Borax equivalent in RNBO?

joelsquare's icon

Hi all,

Is there an equivalent of Borax within RNBO?

More specifically, I'm looking for the simplest way to know if any notes are being held down. Any easy ways to do this within RNBO?

Cheers,
Joel

joelsquare's icon

Update - while I'm quite sure there's a more elegant way to solve this problem (which I hope someone will share!), for the sake of anyone trying to accomplish the task of knowing whether or not a note is being pressed, I used route and (a very long) expr to output the sum of the velocities being held. As long as it's greater than zero, it means a note is being held.

Hopefully someone wiser than I will chime in and say "Why didn't you just use the _____ object?"

joelsquare's icon

('route' receives incoming midi notes in the range I want to monitor and 'expr' keeps a running tally of the sum of their velocities). When it's ZERO, nothing is being pressed.

Alex Norman's icon

Here are 2 different approaches

Max Patch
Copy patch and select New From Clipboard in Max.

joelsquare's icon

Thank you so much! These are much more elegant solutions. I'm especially fond of your CodeBox version - I wish I had the programming chops to understand... but I do know that it's doing exactly what I'd want it to do.

Huge appreciation!

-j

Alex Norman's icon

Happy to hear that this is working for you!

Basically, the codebox version creates an array of 128 entries (much like the [data] in the patched version) and stores the down state in that array, using the note number to decide where in that array to store the state. Before it does that though, it looks up the previous state for that note, removes it from the accumulated "runningsum" and adds the new input to that "runningsome" and outputs the result. The state is simply represented as a 1 for note on and 0 for note off, which makes the summing easy.