Well, really nothing very glamourous... Like a network port scan, it was kind of "brute force", except as I'm starting to discover midi, I'm not as sure of what I'm doing, and my understanding of midi is very limited.
In fact, I studied the mapping from the Numark Omnicontrol as a starting point, to get how the mixxx API and stuff are working and saw that the author of this mapping was sending events with 64 as velocity (not sure of the term...) for turning light on and 00 for lights off. Browsing the amidi command man page I saw it could send midi events, it was a command line interface, so I could script it to make a "port scan" tool, perfect.
So I used amidi, with -S arg for sending triplets of the form 90xx64 to try to turn lights on. With xx starting from 00 to ff. With a very small bit of perl I generated an amidi command with all the midi events (amidi -p .... -S "90 00 64 90 01 64 90 02 64..... 90 ff 64" and all the lights illuminated ! Hurra ! Now... Among all these 256 events I sent, which are the goods one ? First I needed to turn them off, I regenerated a command with all the "velocity" to 00, all the lights turned off, the hint in the Omnicontrol was the good one.
And now, the real problem was that I needed to check "visually" for each command, so I could not script it all the way... And I checked, when a light is turned on (or off), no midi event is sent by the controller... So that was looooooong

Let's send 900064... no light ? Let's send 900164... no light ? Let's send... etc.
So it was very stupid, and a bit tedious yes

and... the first working event I sent was 33 (The 51st one !)...
Let's say I was applying a scientific experimental method

(or just plain old good home hacking...sounds good too)
But once it is done, it is done, and I'm quite happy that it is finished and to have all the references in hand now.
The small bit of perl, just in case it is useful for some one, replace the value of the -p argument with the address of your controller.
It's a one liner, it will print (not execute) a command on the standard output. So execute it in bash, and save the output in a file, to execute it as a script for example.
- Code: Select all
perl -e '$cmd = "amidi -p hw:2,0,0 -S "; foreach $i (0..255) { $cmd .= "90 ".sprintf("%02x",$i)." 64 ";} print $cmd."\n";'