note busy status bit

    Jul 27 2013 | 2:56 pm
    Hi to everyone,
    I want to create some variables to keep track of which notes are currently generated by a patch.
    Let's say I take note in info up to a poly object (not poly~). Let's say my synth is for a guitar so it has a max polyphony of 6 notes. If I press one key, the corresponding bit of the string played should turn on (to 1) and reset (back to 0) when noteoff message is received.
    In total I want to have six bit registers.
    I tried to have this simple bit working but seems I can't find a way to route the noteoff message properly. I know it will be the same note (of the note on last message) with velocity 0.
    Any ideas on making this working

    • Jul 28 2013 | 10:36 am
    • Jul 28 2013 | 12:28 pm
      it might be easier to do that _outside_ the poly~.
      a very basic version of counting the number of running notes would be to let
      any note-on-event send 1 to accum, and any note-off-event send -1 to accum.
      "60 127, 60 0"
      [zl ecils 1]
      [expr ($i1!=0) - ($i1==0)]
      [t b i]
    • Jul 28 2013 | 1:09 pm
      don't forget [borax]
    • Jul 28 2013 | 7:58 pm
      thank you everyone for examples/suggestions. spectro's solution is just the thing i needed.