On Thursday 08 April 2004 13:54, Frank Barknecht wrote:
Hallo,
William Fields hat gesagt: // William Fields wrote:
I am using "makenote" and I am running into a problem with duplicate notes. If I tell it to send note 32 with duration 2000ms, then 1000ms later I tell it to send the same note (32 with duration 2000ms), the second note gets cut off after 1000ms by the first note's note-off message. The second note-off message is still sent but is useless because the note is no longer playing.
...
Any ideas?
This depends, on what you want to do with these notes. Makenote's behaviour is correct (at least it does, what it says it would do), so the problem is after it. The note-off of the first note cannot know, that there will be another note-off later.
If you want polyphony, you need to use [poly] afterwards and route notes accordingly. A [poly 1 1] will implicitly create a note-off before the second note comes, whereas a [poly 1] (== [poly 1 0]) will simply ignore the second, overlapping note altogether. ([poly 2 1] will route it to the second voice.)
Ouch, so much for using Poly as is on my current project then. It apparently needs to be enhanced a bit, because what you're saying, it seems that Poly doesn't allow overlapping notes with the same key. Hopefully you're wrong about this - it would definitly be a bit unexpected if poly would not allow more than one note on the same key.
From what I understand, the MIDI 1.0 spec doesn't really address this issue;
at least I never found anything addressing this issue when I last read the spec. I can understand why, I think. When the MIDI spec was written, it was in practice impossible or highly improbable to have the overlapping notes situation, because the MIDI stream was generated by someone playing a keyboard. There was a sustain pedal, true, but that didn't really cause any problems, because then it left the issue up to the synthesizer, instead of the case in PD where the sustain pedal processing is a front end, and "poly" or what ever else, gets the post-processed result which will consist of overlapping note ons and offs.
So the current situation of what to do with overlapping notes, when the note offs can happen at different times, is just a symptom of how the MIDI protocol is severely outdated and just doesn't address the current situation.
Larry
For a monoized synth you might get inspired by doc/3.audio.examples/C10.monophonic.synth.pd
ciao