«MIDI displayer/debugger» by peterk

on 26 Dec'19 13:58 in midi

Get started using midi controllers with this script to easily output note on/off and continuous controller messages.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// A simple script to help you get started with midi controllers 
// It will dump midi note on, off, and continuous control messages 

// initialize the midi client
MIDIClient.init;

// connect all the possible inputs
MIDIIn.connectAll;

// if we receive a midi on message, display some data about it including velocity, note number, channel, and source
MIDIdef.noteOn(\noteOnFunc, {
	arg vel, nn, chan, src;
	[vel, nn, chan, src].postln;
});

// same for note off
MIDIdef.noteOff(\noteOffFunc, {
	arg vel, nn, chan, src;
	[nn, chan, src].postln;
});


// handle continuous control messages
MIDIdef.cc(\ccFunc, {
	arg ccNum, chan;
	
	//print the num & chan
	[ccNum, chan].postln;
});
descendants
«Re: MIDI displayer/debugger» by anonymous (private)
full graph
raw 711 chars (focus & ctrl+a+c to copy)
reception
comments