|
Post by lukesleepwalker on Nov 12, 2018 19:25:23 GMT
OK, would like to work out the code for the note constraints.
Unfortunately, do not get a CC of 0 when I release my finger, but would channel pressure work? I just turned it on and while it doesn't go to zero when I release my finger from the pad, but it goes always go consistently between 001-005 when I remove my finger.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 12, 2018 19:58:53 GMT
Hi lukesleepwalker , Right, so we could take a different approach for this I think. First we scale the CC to a limited range of notes. When a new note is selected it will turn off the current note and sound the new one. If channel pressure falls below a (configurable) limit we then also turn off the current note. That should solve the sensitivity problem and terminate the sounds when the finger is lifted. Let me see what I can come up with. Regards, Nic.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 12, 2018 20:25:05 GMT
OK, give this a whirl:
IF LOAD # range lo-hi, pressure limit ASS K0 = 24 30 0A ASS K3 = C8 # retrigger interval
# currently sounding note (none) ASS L0 = 80 SET LB0 S--
# retain range width MAT L1 = K1 - K0 MAT L1 = L1 - 2
# reset timer ASS L2 = T0 END
IF MT == B0 # update elapsed time MAT L2 = L2 + T0
# if retrigger time has elapsed IF L2 > K3 # map cc value into note range MAT I0 = M2 / L1 MAT I0 = K0 + I0
# new note? IF I0 != L0 # stop currently sounding note IF L0 != 80 MAT I1 = 80 + MC SND I1 L0 00 END
# start new note ASS L0 = I0 MAT I1 = 90 + MC SND I1 L0 50 SET LB0 L0 +N END END END
# channel pressure IF MT == D0 IF M1 < K2 # stop currently sounding note IF L0 != 80 MAT I1 = 80 + MC SND I1 L0 00 ASS L0 = 80 SET LB0 S-- END
END END XX = XX +B
Regards, Nic.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 12, 2018 20:26:39 GMT
The above is a new thing, so don't use it in conjunction with the other stuff we played with earlier! (ie. replace the other code with this)
|
|
|
Post by lukesleepwalker on Nov 12, 2018 22:48:53 GMT
Well, hot diggety dog! We are very, very close to success here, Nic. First, the smaller note range is working perfectly. The sustain when I hold my finger down works well, and the release mostly does--sometimes I'm getting a different note on release but I assume it's because my finger is at a "seam" between two notes; if I move my finger it works as expected. The only odd thing I see now is that with percussive sounds, I often get two notes at once. When I look at the event monitor I can see that even if I lightly tap the pad to get a plucked percussive sound, I can see 2-3 note ons/offs for each "tap" of the pad. If I use a synth with a soft attack and longer release, I don't hear the same effect--and only get an occasional "wobble" between two notes.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 13, 2018 8:50:55 GMT
Hi lukesleepwalker, OK, we seem to be making some progress with this. - Yes, if you are on a 'seam', as you release, it could well trigger the adjacent note as you move your finger. - I think the double notes could be the same thing; if you are on a boundary there would well be a flurry of CC's with enough of a range of values to trigger multiple notes. We could try and add in code to mitigate this, but I'd be concerned that we suppress the wrong note. Let me ponder on this and see if I can think of something. My initial thoughts are that we could also suppress very short notes but this would need to introduce some latency to detect them. Maybe we can find an optimal value for this. Regards, Nic.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 13, 2018 16:03:20 GMT
Actually, I have just had a thought. Could this unit be sending more than one CC when you touch it? eg. One for positiion and another for touch velocity? The code we have reacts on any CC. Maybe we need to cater for this?
Regards, Nic.
|
|
|
Post by lukesleepwalker on Nov 14, 2018 3:33:31 GMT
Nope, there is exactly one CC being sent and the channel pressure. The nice thing about the BopPad is the editor allows very precise control over the messages being transmitted. You can see for yourself if you Google the web editor.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 15, 2018 13:47:14 GMT
Hi lukesleepwalker , No, I haven't forgotten about this. I was busy the last few days authoring a video (linked below if interested!) Oh, it's a KMI BopPad - I thought it was an X-Y controller. Right, so there is just the one CC - that is fine. It would be useful to see exactly what gets sent from the pad when you do a percussive hit. Maybe analysing the data will help find a workaround. Could you hook up an Event Monitor directly to it in MidiFire and give it a whack. Open up the Event Monitor detail and screenshot it and email to me or upload. Regards, Nic.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 15, 2018 14:39:26 GMT
Hi lukesleepwalker , Actually, maybe we can just re-introduce our retrigger timer from before to prevent multiple notes. If you tap on a 'seam' then it could be hit and miss since we only react to the first CC we get, but it should stop multiple notes. I modified the last script so it does that. Let me know if this works better. Another thing is to reduce our note range so there are less 'seams'. To change the range you modify this line at the top: ASS K0 = 24 30 0AWith hex values according to this table and replace the '24' with the low note of the range and '30' with the upper note. Regards, Nic.
|
|
|
Post by lukesleepwalker on Nov 16, 2018 13:22:23 GMT
Hi again, Nic. Sorry for the delay; been traveling for work. First, that video is fantastic--thanks for sharing. I don't play a lot of electric guitar anymore but I may break out my electric this weekend to play around a bit with the possibilities. Very creative ideas and execution there...
I've also got good news to report: the last version you provided works very well! Thanks a bunch for sticking with it and troubleshooting. There are a few folks from the Audiobus forum who are also watching this thread so know that you're helping several people out with this project. I'll make sure my reviews are updated in the App Store as thanks for the unparalleled customer support.
|
|
|
Post by supadom on Nov 22, 2018 10:00:17 GMT
Hi nic I’ve been following this thread for a while thanks to Luke who put this link on Audiobus forum. I’m also a BopPad user and thought of another, possibly simpler way of doing this. Don’t worry if it’s total BS though. The BopPad has the ability to limit outgoing CC range. If range was limited, to say 1- 3 per quadrant and this translated into 3 notes, would that work? Also would that automagically spread the notes evenly along the radius? I’m suggesting just 2 or 3 notes because I feel that the size of the controller might be a bit too small for precise playing if there’s too many notes.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 22, 2018 10:51:31 GMT
Hi supadom , The last revision of the code above sort of does this in that it scales the incoming CC value to the configured note range. It also whacks in a little no-retrigger timeout to prevent dupes. If you reduced the range in the existing solution as per the following, this should in theory have less seams and perform better. At the top of the script, change: ASS K0 = 24 30 0Ato ASS K0 = 24 28 0AHaving said that, I think if we were able to reduce the number of CC values at the source this could improve things as it would be up to the BopPad to determine how to handle the seam. We would have to modify the script to adjust the way it does the scaling though which I'd have to give some thought to. My recommendation would be to try out the above script with a smaller note range and see how you go first; it might just be good enough. If it isn't then I'm happy to try and create a new revision that can be configured with an input CC range (we would default it to 0-127, but would need to match whatever the BopPad is set to) as well as the note output range as it has already. Regards, Nic.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Nov 23, 2018 10:57:58 GMT
Hi supadom & lukesleepwalker , So I gave this a little bit of thought and have reworked a new revision of the script for you to try out. This version does not try to scale, but uses a lookup table for all 128 CC values to determine which note should be sent. This will be more flexible in that you may not wish to use a continual range of notes, but a selection of different notes. In the code below, I have assumed that the pad is configured to send CC 7 (is that right?) with just values of 1, 2, 3 and 4. Those values translate to GM midi notes for Kick, Snare, Closed Hat and Open Hat respectively. I just used these since it is a percussion pad after all and that can be changed by adjusting the lookup table. You will need to configure the BopPad to only send the CC with a range of 1 to 4! The lookup table is near the top and consists of a matrix of 8 x 16 CC value to note mappings. A 'special' note number of '80' means that the CC value should not be mapped at all. The note numbers are hex values as per this table - you can see that all the values are '80' except in the top row for positions 1, 2, 3 and 4 - those are the 4 GM drum notes as described above. I have also made the retrigger prevention timeout configurable (set to 0 to disable entirely if you like) and the fixed velocity of each note is also configurable. All the constants are at the very top and are commented, but ping me if you need help changing these. # BopPad by audeonic
IF LOAD # constants - change these to suit
# K80 and 81 = incoming CC ASS K80 = B0 07
# K82 - retrigger timeout in ms # (set to 0 for no retrigger suppression) ASS K82 = 50
# K83 - channel pressure threshold # (turn current note off if pressure # falls below this value) ASS K83 = 0A
# K84 - fixed note velocity ASS K84 = 50
# lookup table for CC value - all 128 of them # specify 80 for no note on that CC value ASS K00 = 80 23 26 2A 2E 80 80 80 80 80 80 80 80 80 80 80 ASS K10 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ASS K20 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ASS K30 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ASS K40 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ASS K50 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ASS K60 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ASS K70 = 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
# variables - change at your own risk # L0 currently sounding note (none) and L1 timer ASS L0 = 80 T0 SET LB0 S-- END
# handle incoming CC IF M0 == K80 K81 # assume OK to trigger note ASS I0 = 1
IF K82 > 0 # update elapsed time MAT L1 = L1 + T0
# check timer, disable send if # not yet elapsed IF L1 < K82 ASS I0 = 0 END END
# check this CC value maps to a note IF KM2 == 80 ASS I0 = 0 END
# OK to send new note? IF I0 == 1
# is this a new note? IF KM2 != L0
# stop any currently sounding note IF L0 != 80 MAT I1 = K80 - 30 SND I1 L0 00 END
# send new note ASS L0 = KM2 MAT I1 = K80 - 20 SND I1 L0 K84 SET LB0 L0 +N END
END END
# handle channel pressure # (if sounding note) IF L0 != 80 IF MT == D0 IF M1 < K83 # stop currently sounding note MAT I1 = K80 - 30 SND I1 L0 00 ASS L0 = 80 SET LB0 S-- END END END
# block all incoming events XX = XX +B
Let me know how you get on. Regards, Nic.
|
|
|
Post by supadom on Nov 24, 2018 17:36:04 GMT
Cheers Nic, that was quick! I’ve tried the code you”ve dropped but I’m not getting anywhere. Let me explain.
Assigned the quadrants on the BopPad to notes 1,2,3,4 respectively. Then I’ve set radius on each slice to CC7 and restricted the radius to 1-4 range. I’ve connected it all up in Audiobus and Aum but what I’m not seeing is the note names in live value boxes at the bottom of streambyter. Does it show notes in your case?
|
|