Limit-based AND gates

Jorahzo's icon

Hello,

I'm currently working on a monosynth. I'd like to use a different oscillator depending on the key that the user is playing in. Attached is my example patch... While I play to clean this up VIA patcher, I was curious if anyone had an idea for an easier or more optimal way to do this? Thank you

Sébastien Gay's icon

You may try [split] (I didn't fine-tune the frequency ranges values) :

Source Audio's icon

print midiin output to see all received bytes.
You will soon see that it shoud no be used like that,
not to set frequency of oscillators, and also not
to split input note range.

Sébastien Gay's icon

Correct. I should have tested. [midiparse], right ?

Source Audio's icon

or notein ...

Roman Thilenius's icon

one could immediately post about 15 to 17 different methods here for this, but they all have two things in common:

1. there is no vanilla external which can split and route multiple ranges of numbers onto different outlets

2. you can put all the splitting garbage into a subpatcher to make it look nicer, which is kind of the general solution.

[split] or [if] can indeed replace the > < &´s... but putting the mtof before the split will not correct the OPs wrong use of midiin. :)


the main issue what comes to my mind with the original patch is that you occupy all mtofs instead of only the one you need. if you do that with hundreds of parallel objects, you will hit certain borders some day.

enough of this lecturer-like know-it-all talk, here is the example i originally did not want to post.

for only 4 you can still use a single expr controlling a gate:

(($i1>=$i2) && ($i1<$i3)) + (($i1>=$i3) && ($i1<$i4))*2 + (($i1>=$i4) && ($i1<$i5))*3 + (($i1>=$i5) && ($i1<$i6))*4


and tomorrow we include the mtof into the expr and save another 4 objectboxes.

simply because we can.