The fact that it's working from MIDI items but not live input is a little weird. I looked through the code, and it makes a couple of assumptions that might trip up in edge-cases, but it's only a theory.
I can't test on your setup, so this might take a bit of trial-and-error, but could you try the attached version and see if it behaves any differently?
Geraint
|