|
Post by John Tennison on Oct 12, 2017 1:36:17 GMT
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?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 12, 2017 10:42:53 GMT
Now, you're really challenging me!
Here's the first option (128 in lookup table):
IF LOAD # K0 - lookup table size ASS K0 = 80 # lookup table in L0 to L7F ASS L00 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L10 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L20 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L30 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L40 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L50 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L60 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 ASS L70 = 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12
# I0 - current lookup index ASS I0 = 0 END
# 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
becomes
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. Regards, Nic.
|
|
|
Post by John Tennison on Oct 12, 2017 12:24:01 GMT
Thanks Nic!
I will give these a try.
|
|
|
Post by John Tennison on Oct 12, 2017 12:45:19 GMT
I'm getting an error on the 5th to last line when I try to install rules, but I'm not sure why:
#ERR I0 = 0
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 12, 2017 12:50:02 GMT
Ooops. Should be 'ASS I0 = 0'
(just corrected code above)
|
|
|
Post by John Tennison on Oct 12, 2017 21:34:18 GMT
Thanks, Nic!
It's working great!
|
|