|
Post by qaratechop on Oct 19, 2018 21:54:21 GMT
Hi there,
I’m struggling a bit with what’s probably a pretty simple StreamByter program, i.e. to get a simple note randomiser going.
Can anyone give me some pointers on what the code would look like to create a randomiser in which if a D2 note were triggered it would randomly play any note within the range of C2 and C#3?
Any help would be much appreciated.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 20, 2018 9:26:19 GMT
Hi qaratechop , The tricky part here is making sure that the subsequent note off that is received is also mapped to the same random note the original note on was. Consider this: # force noteon+vel0 to off 9X XX 00 = 8X
# is it a note event? IF MT < A0
# calculate random note # and store into LM1 if # event is a note on IF MT == 90 MAT LM1 = M1 - 2 # subtract 2 semitones MAT LM1 = LM1 + R0D # add between 0 and 12 random semitones END
# rewrite note on/off to LM1 ASS M1 = LM1 ENDThis will randomise every note by subtracting 2 semitones and then adding a random number of semitones from 0 to 12, which is what you wanted for D2. If you only want this kick in for note D2 (and not all others) then you would need to adjust the code and add in an extra IF/END after IF MT < A0 to check that the note is actually D2 (IF M1 == 32) Regards, Nic.
|
|