Hi. My MIDIPLUS AKM322 didn't have a Program Change button. So I wanted to use de Data encoder to change the sample set. I am just a newbie at programming so this is not an automatic solution but it is simple to understand.
First of all search for
def MidiCallback(message, time_stamp):
after this line
velocity = message[2] if len(message) > 2 else None
paste this
print 'message type: ' + str(messagetype)
print 'note: ' + str(note)
print 'velocity: ' + str(velocity)
this way, when you run
python samplerbox.py
you will see the values of these parameters for each key or knob or whatever you touch on your midi device.
In my case, the Data encoder generates a Message type 11 and a note 10. The velocity value went from 0 to 127.
By the way, I tested the other three knobs and all them were message type 11, note 21, 22, 23 respectively.
so, I modified again samplerbox.py, deleted the lines added before and after this line (at the end of the MidiCallback def)
elif (messagetype == 11) and (note == 64) and (velocity >= 64): # sustain pedal on
sustain = True
I added
elif (messagetype == 11) and (note == 10):
print 'Program Change ' + str(velocity)
preset = velocity
LoadSamples()
Hope this will be useful!!!!
I speak Spanish, so excuse my English.
to modify the .py file I used
sudo nano samplerbox.py