Sending RMS audio meter data to midi

A handy superdirt snippet, sends rms (audio meter) data for the first 8 orbits to MIDI cc numbers 1 .. 8, useful for visualising channels on external gear:

(
f = { |msg, time, addr|
    if(msg[0] == '/rms') {
		var o = msg[2];
		var vol = (msg[4] + msg[6]);
		if (o < 8) {
			~midiOut.control(0,o+1,(vol*255).min(127));
		}
    }
};
thisProcess.addOSCRecvFunc(f);
);
4 Likes