
Post by jasonmidas1 on Mar 29, 2015 21:18:44 GMT
Hi i need to create some code to reverse controllers for drawbars what I need is, on channels 25, continuous controllers 311 0127 values to be reversed i.e high =0, low =127
given the sparse documentation for the app I've not been able to figure this out, it should be really simple?
thanks


nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011

Post by nic on Mar 30, 2015 9:33:37 GMT
Hi jasonmidas1, In defence of the 'sparse' documentation, the inbuilt manual for MidiBridge is the definitive specification of the Stream Byter language and as such it is quite concise. There is an Stream Byter guide available which may be of use also. Unfortunately what you want to do isn't exactly straight forward and a little outside the limits of what the (current) Stream Byter was created to do. Nevertheless it can be done. Please copy/paste the following rules into the Stream Byter edit box on the port you wish to manipulate: # jasonmidas1  reverse CCs 31 on CHs 25 A14 030B = XX +B B14 030B 00 = AX XX 7F B14 030B 01 = AX XX 7E B14 030B 02 = AX XX 7D B14 030B 03 = AX XX 7C B14 030B 04 = AX XX 7B B14 030B 05 = AX XX 7A B14 030B 06 = AX XX 79 B14 030B 07 = AX XX 78 B14 030B 08 = AX XX 77 B14 030B 09 = AX XX 76 B14 030B 0A = AX XX 75 B14 030B 0B = AX XX 74 B14 030B 0C = AX XX 73 B14 030B 0D = AX XX 72 B14 030B 0E = AX XX 71 B14 030B 0F = AX XX 70 B14 030B 10 = AX XX 6F B14 030B 11 = AX XX 6E B14 030B 12 = AX XX 6D B14 030B 13 = AX XX 6C B14 030B 14 = AX XX 6B B14 030B 15 = AX XX 6A B14 030B 16 = AX XX 69 B14 030B 17 = AX XX 68 B14 030B 18 = AX XX 67 B14 030B 19 = AX XX 66 B14 030B 1A = AX XX 65 B14 030B 1B = AX XX 64 B14 030B 1C = AX XX 63 B14 030B 1D = AX XX 62 B14 030B 1E = AX XX 61 B14 030B 1F = AX XX 60 B14 030B 20 = AX XX 5F B14 030B 21 = AX XX 5E B14 030B 22 = AX XX 5D B14 030B 23 = AX XX 5C B14 030B 24 = AX XX 5B B14 030B 25 = AX XX 5A B14 030B 26 = AX XX 59 B14 030B 27 = AX XX 58 B14 030B 28 = AX XX 57 B14 030B 29 = AX XX 56 B14 030B 2A = AX XX 55 B14 030B 2B = AX XX 54 B14 030B 2C = AX XX 53 B14 030B 2D = AX XX 52 B14 030B 2E = AX XX 51 B14 030B 2F = AX XX 50 B14 030B 30 = AX XX 4F B14 030B 31 = AX XX 4E B14 030B 32 = AX XX 4D B14 030B 33 = AX XX 4C B14 030B 34 = AX XX 4B B14 030B 35 = AX XX 4A B14 030B 36 = AX XX 49 B14 030B 37 = AX XX 48 B14 030B 38 = AX XX 47 B14 030B 39 = AX XX 46 B14 030B 3A = AX XX 45 B14 030B 3B = AX XX 44 B14 030B 3C = AX XX 43 B14 030B 3D = AX XX 42 B14 030B 3E = AX XX 41 B14 030B 3F = AX XX 40 B14 030B 40 = AX XX 3F B14 030B 41 = AX XX 3E B14 030B 42 = AX XX 3D B14 030B 43 = AX XX 3C B14 030B 44 = AX XX 3B B14 030B 45 = AX XX 3A B14 030B 46 = AX XX 39 B14 030B 47 = AX XX 38 B14 030B 48 = AX XX 37 B14 030B 49 = AX XX 36 B14 030B 4A = AX XX 35 B14 030B 4B = AX XX 34 B14 030B 4C = AX XX 33 B14 030B 4D = AX XX 32 B14 030B 4E = AX XX 31 B14 030B 4F = AX XX 30 B14 030B 50 = AX XX 2F B14 030B 51 = AX XX 2E B14 030B 52 = AX XX 2D B14 030B 53 = AX XX 2C B14 030B 54 = AX XX 2B B14 030B 55 = AX XX 2A B14 030B 56 = AX XX 29 B14 030B 57 = AX XX 28 B14 030B 58 = AX XX 27 B14 030B 59 = AX XX 26 B14 030B 5A = AX XX 25 B14 030B 5B = AX XX 24 B14 030B 5C = AX XX 23 B14 030B 5D = AX XX 22 B14 030B 5E = AX XX 21 B14 030B 5F = AX XX 20 B14 030B 60 = AX XX 1F B14 030B 61 = AX XX 1E B14 030B 62 = AX XX 1D B14 030B 63 = AX XX 1C B14 030B 64 = AX XX 1B B14 030B 65 = AX XX 1A B14 030B 66 = AX XX 19 B14 030B 67 = AX XX 18 B14 030B 68 = AX XX 17 B14 030B 69 = AX XX 16 B14 030B 6A = AX XX 15 B14 030B 6B = AX XX 14 B14 030B 6C = AX XX 13 B14 030B 6D = AX XX 12 B14 030B 6E = AX XX 11 B14 030B 6F = AX XX 10 B14 030B 70 = AX XX 0F B14 030B 71 = AX XX 0E B14 030B 72 = AX XX 0D B14 030B 73 = AX XX 0C B14 030B 74 = AX XX 0B B14 030B 75 = AX XX 0A B14 030B 76 = AX XX 09 B14 030B 77 = AX XX 08 B14 030B 78 = AX XX 07 B14 030B 79 = AX XX 06 B14 030B 7A = AX XX 05 B14 030B 7B = AX XX 04 B14 030B 7C = AX XX 03 B14 030B 7D = AX XX 02 B14 030B 7E = AX XX 01 B14 030B 7F = AX XX 00 A14 030B = BX
Note that this hijacks a portion of the aftertouch space on those channels for notes 3 to 11. Note this can also be done using the Holy Mapper module but would require a lot of button pushing... Regards, Nic.



Post by jasonmidas1 on Mar 30, 2015 17:46:48 GMT
Wow, thanks for the reply nic. It's not that unusual an action: drawbars work in reverse to normal faders. So you literally have to put in a rule for every iteration: that's why I couldn't find anything as Im used to using more 'compact' methods that would involve a simple filter (even something as simple as qmidiroute does it), I've used Bomes in the past too, can't remeber how you'd do it in that but it's either inbuilt or you'd do it algorithmically or in a loop. Thanks again for the help. Control v at the ready


nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011

Post by nic on Mar 30, 2015 18:21:27 GMT
Hi jasonmidas1, Yes, there is currently no 'maths' in Stream Byter rules, so covering every controller value is the only option. Don't worry though, I didn't write all that stuff manually; generated from a script. It might seem like a lot of rules, but the Stream Byter engine will process those in no time at all. Regards, Nic.



Post by jasonmidas1 on Mar 30, 2015 19:28:45 GMT
Thanks again. Out of interest and for future reference, what does the filter A1 do, I can't seem to find it in the guide?
Cheers


nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011

Post by nic on Mar 30, 2015 19:57:39 GMT
Hi jasonmidas1, That's related to the MIDI spec rather than anything Stream Byter specific. A is for Poly Key Pressure (aftertouch). I'm hijacking a small portion of the aftertouch namespace to temporarily remap the controllers to, because if I just did: B14 030B 00 = XX XX 7F ... B14 030B 7F = XX XX 00 Each controller value would be remapped reverse and back, so to prevent any rules further down from matching again after a remap I also change the event type from controller to poly aftertouch. Once the controller value remaps are done, then I have to revert those aftertouch messages back to controller messages. The very first rule is to block that section of aftertouch messages (all aftertouch messages on channels 2 to 5, notes 3 to 11) so that if any aftertouch messages *do* come in they are just thrown away and not converted to controllers. Regards, Nic.

