|
Post by jollydodger on Mar 16, 2019 12:45:45 GMT
Hi mrMidi,
I have been trying to set up my BopPad on ios. Can i have some advice please? Is it possible, what app?
Aim: a cc value modify’s a note.... but... the note on is sent before the cc value when looking at it with a midi sniffer but both have the same time stamp. Then lastly there is the note off.
The problem with other midi filter apps is that the modified note is evaluated on the previous cc value, not the current one. This results in the intended note being the previous sent note because it is using the previous cc value.
Any ideas on a solution please?
Rafał
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Mar 19, 2019 11:27:43 GMT
Hi jollydodger , You can use Stream Byter in MidiFire or StreamByterAU to do this with the following code, which will spit out the most recent note on received when it receives any CC: # init IF LOAD ASS L0 = 0 0 0 END
# handle note on 9X XX 00 = 8X IF MT == 90 ASS L0 = M0 M1 M2 # retain the note event XX = XX +B # block note event END
# handle CC IF MT == B0 IF L0 != 0 # if we have a retained note SND L0 L1 L2 # send retained note (after CC) ASS L0 = 0 0 0 # init END END
Regards, Nic.
|
|
|
Post by jollydodger on Mar 24, 2019 9:32:24 GMT
thanks nic very usefull.. streamByteAU used. i didn’t understand some of your code. but i got this hack below to work.. lol. so yay! & ta+
now stuck.. how do i get?
- clean efficient code? the bop pad generates huge amounts of fast data. will my code scale? - the code is just for one of the four quarters of the boppad. Do i just copy the code four times with different note/channel in’s.? or use four au instances? different note input strikes from different zones will be hit simultaneously.
- what’s the best way to filter the in/out’s to the individual note and cc channels? (as defined in the IL0 array noteChan 10 and cc 14) . So each quarter has its own defined channels.
|
|
|
Post by jollydodger on Mar 24, 2019 9:33:23 GMT
# StreamByter - Audeonic Apps # Aim: BopPad convert 4 input notes to 12. With each quarter of the pad divided into three strike zone using cc strike position . # current script below process one note input to three outs of a single strike zone.
# i0: chanIn, ccIn, noteIn0, noteOut0, noteOut1, noteOut2 ccMin ccMax # L0: current delta, note on, note off # K0: note chan, ctl CC/chan, ctl CC val # init IF LOAD ASS I0 = 0B 0E 30 30 2F 2B 30 70 END
# handle note on IF MT == 90 ASS L0 = M0 M1 M2 # retain the note event XX = XX +B # block note event END # handle Cc IF MT == B0
IF L1 == I2 # noteIn ASS K0 = M0 M1 M2 ASS L1 = I1 IF K2 < I6 # less than ccMin. zoneOne ASS L1 = I3 SND I3 SND L0 L1 L2 # send noteOut0 END IF K2 > I7 # more than ccMax. zoneThree ASS L1 = I5 SND I5 SND L0 L1 L2 # send noteOut1 END IF K2 > I6 # inbetween ccMin & ccMax. ZoneTwo
IF K2 < I7 ASS L1 = I4 SND L0 L1 L2 # send noteOut2 END END ASS L0 = 0 0 0 # init END END
# filtering rules XX-F = XX +B # only pass channel chan NX = XX +B # block all note events BX = XX +B # block all controller events
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Mar 25, 2019 12:14:26 GMT
Hi jollydodger , We can rework your code so it handles all four quadrants (pads in my code) with 3 zones each: # BopPad 12 strikes IF LOAD ASS K80 = 2 # number of zones-1 ASS K81 = 0B 0E # strike cc ASS K83 = 30 70 # strike cc limits
# pad notes cfg (in, out 0-2) ASS K0 = 30 30 2F 2B # pad 0 ASS K4 = 32 32 20 21 # pad 1 *** (fix these!) ASS K8 = 34 34 22 23 # pad 2 *** (fix these!) ASS KC = 36 36 24 25 # pad 3 *** (fix these!) END
# handle note on # (retain for when strike CC arrives) 9X XX 00 = 8X IF MT == 90 ASS L0 = M0 M1 M2 END
# handle strike CC IF M0 == K81 K82 # determine which pad into I2 ASS I0 = 0 0 0 IF I0 < K80 +L # loop each pad MAT I1 = I0 * 4 # get pad input note into I1
# do we have a match? IF L1 == KI1 MAT I2 = I1 + 1 # retain pad, out 0 index MAT I0 = K80 + 1 # break loop END MAT I0 = I0 + 1 END
# we matched a base note IF I2 != 0 # determine which zone (default 0) # and adjust I2 to point to # correct out note IF M2 >= K83 MAT I2 = I2 + 1 # zone 1 or 2 IF M2 > K84 MAT I2 = I2 + 1 # zone 2 END END
# send note on SND L0 KI2 L2
# send note off with delay MAT L0 = L0 - 10 SND L0 KI2 00 +D300 END END
# block everything XX = XX +BThis code auto sends a note off 300ms later with each strike. Some sound generators may not like not receiving note offs. In terms of code scalability, both your code and mine should have no problems with event volumes; Stream Byter is very efficient. Now, I don't have a BopPad so although I have verified the syntax is correct, I cannot vouch for the logic as it is very hard to test. In any case, it's the concept that counts! Regards, Nic.
|
|
|
Post by jollydodger on Mar 25, 2019 16:10:00 GMT
that’s awesome.. the logic is better!
sorry i wasn’t clear. each quarter pad needs to be able to be on a separate note channel. I can’t see how that works. maybe i’m being shortsighted.. Anyway will test on the bus home tonight and feedback.
thankyou very much for your input..
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Mar 25, 2019 16:14:37 GMT
Hi jollydodger , I think I made the code channel agnostic, except for the strike CC. The outgoing note channel will be whatever the incoming trigger note channel is. Regards, Nic.
|
|
|
Post by jollydodger on Mar 26, 2019 9:55:49 GMT
morning nic,
tried the code yesterday.. but this part did not work for me.
IF M0 == K81 K82
the midi cc for initial strike position to be used is cc14 (using midi noteChan 11)
if i replace it with IF MT == B0 the first returned notes are correct, but then it tiggers all other cc and notes in a long list..:
rafs
|
|
|
Post by jollydodger on Mar 28, 2019 13:12:05 GMT
# StreamByter - Audeonic Apps # BopPad 12 strikes IF LOAD ASS K80 = 4 # number of zones ASS K81 = 0E # strike cc ASS K83 = 30 70 # strike cc limits # pad notes cfg (in, out 0-2) # Global Midi drums ASS K0 = 24 24 24 24 #kick ASS K4 = 30 32 2F 2B #x3 toms ASS K8 = 26 26 28 25 #x2 snares, x1 stick ASS KC = 2A 30 22 2A #closedHH, pedelHH, openHH END
# handle note on # (retain for when strike CC arrives) 9X XX 00 = 8X IF MT == 90 ASS L0 = M0 M1 M2 END
# handle strike CC IF MT == B0 # *** could not work this out it should be cc14? # determine which pad into I2 ASS I0 = 0 0 0 IF I0 < K80 +L # loop each pad MAT I1 = I0 * 4 # get pad input note into I1
# do we have a match? IF L1 == KI1 MAT I2 = I1 + 1 # retain pad, out 0 index MAT I0 = K80 + 1 # break loop END MAT I0 = I0 + 1 END
# we matched a base note IF I2 != 0 # determine which zone (default 0) # and adjust I2 to point to # correct out note IF M2 >= K83 MAT I2 = I2 + 1 # zone 1 or 2 IF M2 > K84 MAT I2 = I2 + 1 # zone 2 END END
# send note on SND L0 KI2 L2
# send note off with delay MAT L0 = L0 - 10 SND L0 KI2 00 +D300 END END
# block everything XX = XX +B
# filtering rules #XX-F = XX +B # only pass channel chan #NX = XX +B # block all note events #BX = XX +B # block all controller events
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Mar 29, 2019 12:49:02 GMT
Hi jollydodger , > tried the code yesterday.. but this part did not work for me. > IF M0 == K81 K82 > the midi cc for initial strike position to be used is cc14 (using midi noteChan 11) Yeah, there's a bug in my script! At the top where it says: ASS K81 = 0B 0E # strike ccThis should be: ASS K81 = BA 0E # strike ccfor channel 11 The original 0B was meant to be B0 meaning CC on channel 1, so it would never match anything since 0B is not a valid message type. Sorry about that. Regards, Nic.
|
|
|
Post by jollydodger on Mar 31, 2019 13:48:02 GMT
awesome thats working!!
out of intrest.. what does this line do please?
9X XX 00 = 8X
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 1, 2019 9:12:00 GMT
Hi jollydodger , > out of intrest.. what does this line do please?
> 9X XX 00 = 8XThat's a good question! Normally, a MIDI device will send a note off message like 80 12 00 but the MIDI spec also permits a note on with a velocity value of 0 to be interpreted as a note off. Some MIDI equipment sends note offs like this instead - 90 12 00 - both messages are note offs. In a Stream Byter script we usually want to process note ons and note offs differently, so that rule converts the note on + velocity zero to a note off event. This makes it easier to write logic: # rewrite note on + velocity 0 # to note off 9X XX 00 = 8X
# note on IF MT == 90 # note on code here ... END
# note off IF MT == 80 # note off code here ... ENDIf we didn't do this rewriting, our logic for handling note on vs note off would need to be more complex in order to create the logic for the two cases. Here would be one way of doing that: # determine if note on or off ASS I0 = 0 # on/off flag, default to 0 (off) IF MT == 90 IF M2 > 0 ASS I0 = 1 # mark as note on END END
# note on vs off logic IF MT < A0 IF I0 == 1 # note on code here ... END IF I0 == 0 # note off code here ... END ENDRegards, Nic.
|
|
|
Post by jollydodger on Apr 6, 2019 17:39:43 GMT
thanks for the explanation!
|
|
|
Post by jollydodger on Apr 6, 2019 18:29:17 GMT
nearly finished... i’ve rearranged the arrays into separate in/outs (so making versions for different apps is easier). Two question if i may please: a) my code bellow remapping input cc to output cc’s is error’ing (marked NOT WORKINK). I’m still learning, and clearly not yet grasped how it works.. one step at a time. b) at the moment the notes are channel agnostic. is it possible to do the same for the cc? If not I could have the channel for both defined.
Here’s my hack..
# Streambyter - Audeonic Apps # BopPad 4 to 12 notes & cc remap IF LOAD
## IN CONFIG ASS K70 = 24 30 26 2A # note inputs ASS K80 = 4 # number of notes ASS K81 = BA 0E # strike cc (channel, cc) ASS K83 = 30 70 # strike cc position ASS K85 = 0F 10 11 # other cc to pass/remap
## OUT CONFIG # pad notes (out 0-2) # DrumJam: David Langguth kit ASS K0 = 24 35 31 #kick , cymbal(x2) ASS K3 = 30 2F 2B #x3 toms ASS K6 = 26 27 25 #x2 snares, x1 stick ASS K9 = 2A 2E 33 #closedHH, openHH, cymbal # extra cc (not inc. initial strike) ASS K30 = 3 # number of cc to remap ASS K20 = 20 21 22 # cc
END
# handle note on # (retain for when strike CC arrives) 9X XX 00 = 8X # rewrite note on + velocity to note off IF MT == 90 ASS L0 = M0 M1 M2 END
# handle strike CC IF M0 == K81 K82 # determine which pad into I2 ASS I0 = 0 0 0 IF I0 < K80 +L # loop each pad MAT I1 = 70 + I0 # get pad input note into I1
# do we have a match? IF L1 == KI1 MAT I2 = I1 + 0# RETAIN PAD, OUT 0 INDEX MAT I0 = K80 + 1 # break loop END MAT I0 = I0 + 1 END
# we matched a base note IF I2 != 0 # determine which position(default 0) # and adjust I2 to point to # correct out note MAT I2 = I2 - 70 # get pad MAT I2 = I2 * 3 # get note index IF M2 >= K83 MAT I2 = I2 + 1 # zone 1 or 2 IF M2 > K84 MAT I2 = I2 + 1 # zone 2 END END
# send note on SND L0 KI2 L2 # send note off with delay MAT L0 = L0 - 10 SND L0 KI3 00 +D300
## cc remap ASS I3 = 0 0 0 IF I3 < K30 +L # loop MAT I4 = K85 + I3 # in cc MAT I5 = K20 + I3 # out cc MAT I3 = I3 + 1 # loop step BX I5 = XX I4 # remap cc NOT WORKING SND M0 I5 M2 END
END END
# block everything XX = XX +B
########## thanks for your support nic!
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 10, 2019 7:43:44 GMT
Hi jollydodger , a) my code bellow remapping input cc to output cc’s is error’ing (marked NOT WORKINK). I’m still learning, and clearly not yet grasped how it works.. one step at a time.Yes, you can't use SBII variables in SB1 pattern match rules. Looking at your code, might it just be easier to forego the looping/variable stuff and just do your remappings in a more simpler way: BX 0F = XX 20 BX 10 = XX 21 BX 11 = XX 22b) at the moment the notes are channel agnostic. is it possible to do the same for the cc? If not I could have the channel for both defined. Yes, change this: IF M0 == K81 K82 ... END
to: IF MT == B0 IF M1 == K82 ... END # add this END ENDRegards, Nic.
|
|