Scripter Plugin - Ignore accidental repeated note within specified timeframe
Hi,
I am trying to write a script for Mainstage Scripter plugin that ignores a duplicate note message within the range of say 100 milliseconds. ie., if a C-2 note on event is received, pass it through to the instrument, and then if any more C-2 note on events are received within 100 milliseconds of the first event, do not pass them through. Kind of like a Midi time gate or something...
The problem I'm trying to solve is that I use my sustain pedal to trigger kick drum samples by converting the CC64 to a Note C-2 using Midipipe (I know I can do this directly with Scripter now but its working) and send it to the Mainstage instrument. But because the sustain pedal is just a physical switch, any slight contact of the switch sends a 127/0 value of CC64, which isn't a problem with sustain, but when it's converted to C-2, it triggers a kick drum sample. This means that sometimes I get double or triple notes when hitting the pedal. As long as I hit the pedal cleanly it doesn't usually happen, but in a live scenario it often happens at the worst times haha...
I am great at stealing scripts from other people and messing around with them to get them to solve my problems, but I actually have no idea what I'm doing, so I have hit a wall, and I can't find anyone else who has tried to solve a similar problem.
Hope that makes sense, any help would be appreciated
Cheers
Jeremy
MacBook Pro (13-inch Early 2011)