ProgramChange to Switch Instrument?
Started by cforster




4 posts in this topic
hansehv

168 posts 17 threads Joined: Dec 2020
19-06-21, 23:13 -
#2
Hi Chris,
New possibilities at the horizon ..  Idea
There is quite a complex way to translate the note-on / note-off on channel 10 (the drumpad) into control changes and program-up/downs. It's in the docs when reading creatively, but I'm not going to explain now - please read on....

As you state: it sends the right messages. But on the wrong channel.
And I made the drumpad exception for notes only, because I didn't know keyboards existed with this double use of the drumpads, but still having the fixed channel=10 (that's the culprit, I can reprogram the pads on my keyboards to any channel and send any message).
But shortcomings can be repaired....

In the samplerbox.py from line 891 next lines can be changed:
Code:
    elif gv.drumpad:  # using less compact coding in favor of performance...
        if messagechannel==DRUMPAD_CHANNEL:
            if messagetype==8 or messagetype==9:        # We only remap notes
                for i in xrange(len(gv.drumpadmap)):
                    if gv.drumpadmap[i][0]==message[1]:
                        message[1]=gv.drumpadmap[i][1]
                        messagechannel=0
                        break       # found it, stop wasting time
into:
Code:
    elif gv.drumpad:  # using less compact coding in favor of performance...
        if messagechannel==DRUMPAD_CHANNEL and messagetype in [8,9,12]:
            messagechannel=0
            if messagetype in [8,9]:        # Remap notes if necessary
                for i in xrange(len(gv.drumpadmap)):
                    if gv.drumpadmap[i][0]==message[1]:
                        message[1]=gv.drumpadmap[i][1]
                        break       # found it, stop wasting time
I hope I didn't make a silly mistake and you are able to make this change..
No problem if you cannot do this yourself: then please send me a PM, so we work out a way working that's OK for you.
Please feedback result!
I'm even considering to include message==11 (CC), but have to think about the consequences versus chance such keyboards exist...
Hans
This post was last modified: 19-06-21, 23:15 by hansehv.


Messages In This Thread
RE: ProgramChange to Switch Instrument? - by hansehv - 19-06-21, 23:13