The essence of it is this little bit of patch, which bangs out on the left for stomp, and bangs on the right for release, when Channel 16, Note 42, Vel 100 and Vel 0 are received, and then you can do whatever you want with those bangs. When I walked away last night I had just finished this simplication of the patch where I figured things out, but to finish for our pedalboard it’s just a couple more boxes, I will post here later today with the rest.
This will be turned into ten Subpatches with the relevant bits broken out for easy setting. This was the bit that tortured my brain, though mainly because I set out as a complete PD noob to solve a real problem, so I got confused by every one of those boxes at first. Technically I’ve been working on this since I got the board a couple years ago. ADHD sucks, but the rest of the plan will proceed quickly from here.
Oh also, I have previously setup a patch in the FCB1010 where each footswitch sends only a noteOn/noteOff, and the pedals sending their CC data on a couple of channels - I will need to add some stuff to forward that data back out on whatever channel is appropriate for the end use. I plan to capture the Sysex that applies this configuration to a PC of choice, and have a “Initialize FCB1010” button that allows the user to put the PD patch wherever makes sense to them. Obviously this will be a on a public repo somewhere too, the firmware of this thing is an atrocity and someone has to do something for the punters who don’t have a spare 70 euro.
Originally I was wrangling a third Bang for the Channel and there were stacked Spigots to deal with, but I learned eventually that you can put the channel in the midi box as an argument, so that greatly simplified the thing.
I’ll explain the whole patch for anyone who doesn’t know PD and wants to get into this incredible tool. As you can see, it’s nodes with lines connecting them. signal flows in the top and out the bottom any given box.
The “notein” box receives data from the midi port. I have selected channel 16 as an argument, if I removed that, it would output the channel of all notes on a third outlet.
The two “select” boxes receive data and filter for (Note) 42 in one case, and (Velocity) 100 and 0 in the other. It passes only the selected numbers through to the outlet. You’ll notice each has an extra outlet - it sends all non-selected numbers to that box, if you want to do something else with them.
The next row is three Bangs, which are basically just buttons that send a “go” signal out the outlet, either when you push it, or when they receive something in their inlet. They are here for visual representation of signal flow. Bangs are cheap. :>
The “delay” box takes what comes in the left Inlet and sends it back out the bottom 2ms later. You can put whatever amount of time you like there, AND you can pass a number into the right Inlet to set it dynamically. It is necessary here as you will see.
The oddly shaped boxes over on the right of delay are Message boxes - when they get a bang or a signal on the Inlet, they send out whatever message is in them. In this case, I’ve got 1s and 0s. They are wired to the velocity selector via bangs, with each Vel going to a separate binary pair that indicates True or False in a given moment about whether your foot is on the switch.
Lastly, the “spigots” are basically little gates that pass through whatever is coming into their Inlet, but only when the right Inlet is set to “1”. This where Order Of Execution bites you in the ass, as it frequently likes to do with PD, and the reason for the 2ms delay being there - you need to set the logic Inlet before the data arrives on the left, or it gets blocked. The delay ensures that the correct 0 or 1 is there just before the note arrives on the left. 1ms seemed to work just fine, but I figure 2ms is still well in the very best neighbourhod of the Haas zone.
So like I said, ten of these, one for each pedal note, with the bangs feeding into and activating whatever you want to do. For our pianos, it’s just a “ctlout” box that sends CC64 at 127 and 0 at the appropriate moments.
I should have this finished today sometime, it’s been my obsession all week. Oh and for laughs, you can see a gif of the janky, not fully working prototype of this [here](JimmyChezPants 🇨🇦: "Yep, it was Message boxes I needed. #puredata V…" - Growers Social).