I'm writing a synth module for a Yamaha WX7 wind controller. The synth should play legato or staccato notes depending on how quickly the performer breathes.
The only method I can conceive to do this is to extract the rate of change for the breath data. Starting from when I a MIDI note-on is received, I store the incoming breath data in a tiny buffer. When it's full, a bang is sent to calculate the first derivative (rate of change).
I'm using legato clarinet samples, I begin playback my playback a few milliseconds into the sample. Therefore, I can map the breath rate derivative (integer) to the amplitude ramp time to play the sample.
I (think I) am an intermediate MAX/MSP programmer, but I'm at a loss as how to do this. My intuition tells me that a prebuilt object is necessary, in order to be fast enough. I looked through the forums and MAX object database, but can't find anything.
Thank you for your consideration,
Centre for Music Technology
University of Glasgow