Binary Maths for Dummies

Image_Engine

2008-06-28 03:42:37

Hi All
I have a range of numbers (0-255) that MT is generating based on my FCB footboard ie Bank01.00=Bank00.00 variable + (Bank01.00 sent note). In other words I select preset 2 on bank 0 (eg preset2 which selects the verse2 in Live) it sets an index of 1). This is then used with the bank 1 preset number to index the slot in Live.
Sounds confusing but there are 32 tracks in Live and 8 possible scenes which generates 256 required control signals to access each slot. In the above example, pressing bank 00.01 creates index 1. Then pressing bank 01.02 would select the second slot in the verse 2 scene(2) (with a corresponding control number of 33 (index * number of tracks + current preset) = 1 * 32 + 1 (zero based remember) .
Considering there are only 128 note nums per channel I need to turn this range of numbers into a formula in MT that will increment the channel when the number fed to it is greater than 127. ie when the variable is 127 mt will create output 9C 7F 40. However when the variable is 128, it will output 9D 00 40. Can this be done in a simplified way with bit and/or etc (I saw one of Florians posts with info on bit combination for replacing midi channels and wondered whether this could be used but Im a bit of a novice on these binary issues :-(
Thanks
Mark

metastatik

2008-07-11 19:17:13

If I understand you correctly, all you’d need is a simple set of rules for that. First, replace “9C” and “9D” with a variable like pp. Then, use rules so that your global variable determines the value of pp. Something like this…

If ga <= 127 then pp = $9C
If ga >= 128 then pp = $9D