Filtering CC messages

    Mar 06 2014 | 11:37 pm
    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
    - 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!

    • Mar 07 2014 | 1:32 am
    • Mar 07 2014 | 1:39 am
      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.)
    • Mar 07 2014 | 5:24 pm
      Brilliant, thanks so much guys!
    • Mar 07 2014 | 9:14 pm
      You could use routepass and you wouldn't have to muck around with prepend.
    • Mar 07 2014 | 11:22 pm
      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
    • Mar 07 2014 | 11:51 pm
      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 :)
    • Mar 08 2014 | 6:56 pm
      one could also do 5*4 and use zl join to prepend it. :)
      right, routepass.
    • Mar 09 2014 | 12:00 pm
      Thanks again, all!