lynx
Seeker
Posts: 2
|
Post by lynx on Apr 6, 2020 7:00:39 GMT
It might just be my lack of experience coding but I cant seem to approach a workaround on FC-50’s hardware config. Basically, 1st-5th triggers send a fixed PC message. And the 6th trigger shifts the patches to another 5 triggers (default: PC 00-04, PC 05-09). The catch is that the 6th trigger sends a dynamic midi message that corresponds to the currently selected patch. Ex. 1. Press 1st Log: “C0 00” 2. Press A/B (6th trigger) Log: C0 00 C0 05 3. Press 2nd Log: C0 06 4. Press A/B Log: C0 06 C0 01 I dont want to give up and utilize all 10 triggers cause I really like the feel of the fc-50. I wonder if there is a way to block midi messages from the A/B trigger. Thank you in advance!
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 6, 2020 16:22:53 GMT
Hi lynx , So when the A/B trigger is pressed, it repeats the program change for the most recently sent program change and then sends the new program change? Does the thing receiving the program changes do something unwanted if it receives the same program change a second time? I think the easiest thing to do is to block sequential identical program changes. Something like: # strip FC-50 dupes if load assign L0 = 80 end if M0 == C0 if M1 < A if M1 == L0 block end assign L0 = M1 end endRegards, Nic.
|
|
lynx
Seeker
Posts: 2
|
Post by lynx on Apr 6, 2020 20:54:40 GMT
Thank you for the fast response, Nic!
The way i’m utilizing the controller is I modify the incoming PC to a more generic controller that doesnt change patches by default. Some triggers are toggle for play, tap tempo, playing samples etc. so sequential triggers are oftentimes inevitable.
I first thought of using the incoming midi message’s length since the fixed triggers only send one PC message while the A/B one sends the current plus the new one. Staring at the stream byte manual, I still have no idea how to approach such algo xD.
Edit: I’m starting to admire people who code for a living. This sh aint easy lol.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 7, 2020 12:39:30 GMT
Hi lynx , OK, well if you do press some of these multiple times we have to look at something different. The A/B message isn't a separate message so we can't use it's length to distinguish it. What we can try is to use timing to detect it. If two program change messages are very close together (say within 10ms) then we discard both of them. Here is some code. I cannot test this at the moment, so hopefully it will work (it may not even compile!) # setup if load alias Q0 threshold assign threshold = $10
# internal alias L0 queued assign queued = 0 end
# handle FC-50 program changes if M0 == C0 if M1 < A if queued == 1 # pc already queued, ignore this # and flag to cancel queued assign queued = 0 else # no pc queued, queue it assign queued = 1 send F0 7E M1 F7 +I +Dthreshold end block end end # handle queued program change if M0 == F0 7E if queued == 1 # send message if still ok send C0 M2 # flag as nothing in queue assign queued = 0 end block end
Note, this does add 10ms latency to the button pushes. You can try reducing that 10ms to something lower and see if that works. Regards, Nic.
|
|