Filtering CC messages

jomtones's icon

I'm sure this is a pretty trivial problem but I can't figure out how to filter for certain CC messages. So MIDI comes in and midiparse gives me just the CC's like:

Controller value
15 36
15 37
15 38
20 101
20 102
15 39

etc.

- now I need to make a filter to allow e.g. only CC 20 through - and then give me the value for CC 20.

I'll bet this is dead simple but I'm just going in circles with 'sel' and 'gate' right now! Any tips appreciated!

brooke's icon

route

Roman Thilenius's icon

with [select] you are on the right path. but you can also use [route].

[route 20] will filter lists according to their indexes correctly but it cuts the first value in incoming lists off, so that you had to regenerate it.

you basically only need to do

[route 20]
|
[prepend 20]

and you have a working filter.

note that both, [route] and [prepend] can be "set" dynamically when they only have 1 argument.

if you want the same for general purpose you have to make sure that "20" can also pass when it comes as single number and not as list. this can be done like in the picture. (which here only takes arguments and is not dynamic.)

route.jpg
jpg
jomtones's icon

Brilliant, thanks so much guys!

Evan's icon

@Roman,

You could use routepass and you wouldn't have to muck around with prepend.

-E

jomtones's icon

Thanks Evan - I think in this case Route suits the purpose best as once I've filtered for controller, all I need is the value :D

Evan's icon

Oh for sure, I was just pointing out the alternate routing object, I just found that one recently and it helped eliminate a ton of extraneous prepending :)

Roman Thilenius's icon

one could also do 5*4 and use zl join to prepend it. :)

right, routepass.

jomtones's icon

Thanks again, all!