I need a Stream Byter module that will trigger a CC6 command for each and every note-on received. I need the CC6 command to be sent out on the same MIDI channel as the received note-on. As far as the specific CC commands sent out, I need to have a lookup table that Stream Byter will cycle through and then restart reading from the beginning of the lookup table when the last CC6 value has been sent. I need the note-ons and note offs to pass through unchanged, although no CC commands need to be triggered by the note offs. As far as the number of values in the lookup table, I would like that to be flexible, so that could have anywhere from 1 to any number, but for starters, having a lookup table with 12 values that can be specified would be helpful.
As a variant of this module, it would also be helpful if I could specify a particular set of lookup values and be able to assign a probability that anyone of them would end up being the CC6 value that was triggered by the note-on event. Is this possible with Stream Byter?
# catch note on events # on any channel IF M0 >= 90 IF M0 <= 9F IF M2 > 0
# get CC on same channel into J0 MAT J0 = M0 + 20
# send out CC6, value from table SND J0 06 LI0
# increment/cycle index MAT I0 = I0 + 1 IF I0 >= K0 ASS I0 = 0 END
END END END
All typed 'as-is' - might be syntax/semantics errors, but it's the method that counts.
Now, the second option (probabilities), we don't have probabilities, per se, but you could fill up the lookup table with values in the required probability ratio and then use a random variable to select one. You would the change the above in two places:
near the top:
ASS I0 = 0
ASS I0 = R7F
and replace the 'increment/cycle' bit of code further down, also with
ASS I0 = R7F
What will happen is that I0 will be set to an index in the table randomly and you adjust the probability of a particular value being selected by how many times is appears in the table compared to others. In my example above, it will send CC6 value 16 (hex 10) 50% of the time and value 18 (hex 12) 50% of the time.