hi,
i'm working on a little project in which some notes with random pitches and duration appear at random time intervals. Each note is packed in a "midi" format (pitch and velocity), with a note-off event (pitch and zero velocity) sent after the note duration interval.
it can happen that a new note is generated before the previous one has been stopped.That's not a trouble, since i can handle it with [poly], eventually set to 1 voice and with voice stealing to force a "monophonic" melody.
The problem appears if the new note coming has the same pitch than the previous one. This is impossible for a "real" midi keyboard, in fact a key can be played again only after it has been released. This leads to an undesired behaviour of [poly]: if there are more than 1 voice, i have the sum of different voices playing the same note, with an undesiderd increase of the volume. Even worse, when the voice is only one, the note-off message of the previous note stops the new note before its assigned time duration!
I tried to set up a strategy to avoid this, but with no results. Any idea?
thanks, athos
Try researching "edge detection."
~Kyle
On Sun, Nov 8, 2009 at 9:54 PM, Athos Bacchiocchi athos.bacchiocchi@tin.itwrote:
hi,
i'm working on a little project in which some notes with random pitches and duration appear at random time intervals. Each note is packed in a "midi" format (pitch and velocity), with a note-off event (pitch and zero velocity) sent after the note duration interval.
it can happen that a new note is generated before the previous one has been stopped.That's not a trouble, since i can handle it with [poly], eventually set to 1 voice and with voice stealing to force a "monophonic" melody.
The problem appears if the new note coming has the same pitch than the previous one. This is impossible for a "real" midi keyboard, in fact a key can be played again only after it has been released. This leads to an undesired behaviour of [poly]: if there are more than 1 voice, i have the sum of different voices playing the same note, with an undesiderd increase of the volume. Even worse, when the voice is only one, the note-off message of the previous note stops the new note before its assigned time duration!
I tried to set up a strategy to avoid this, but with no results. Any idea?
thanks, athos
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Sorry, did not read that deep enough the first time.
Wish I could help more, but I can't.
~Kyle
On Sun, Nov 8, 2009 at 10:33 PM, Kyle Klipowicz kyleklip@gmail.com wrote:
Try researching "edge detection."
~Kyle
On Sun, Nov 8, 2009 at 9:54 PM, Athos Bacchiocchi < athos.bacchiocchi@tin.it> wrote:
hi,
i'm working on a little project in which some notes with random pitches and duration appear at random time intervals. Each note is packed in a "midi" format (pitch and velocity), with a note-off event (pitch and zero velocity) sent after the note duration interval.
it can happen that a new note is generated before the previous one has been stopped.That's not a trouble, since i can handle it with [poly], eventually set to 1 voice and with voice stealing to force a "monophonic" melody.
The problem appears if the new note coming has the same pitch than the previous one. This is impossible for a "real" midi keyboard, in fact a key can be played again only after it has been released. This leads to an undesired behaviour of [poly]: if there are more than 1 voice, i have the sum of different voices playing the same note, with an undesiderd increase of the volume. Even worse, when the voice is only one, the note-off message of the previous note stops the new note before its assigned time duration!
I tried to set up a strategy to avoid this, but with no results. Any idea?
thanks, athos
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
--
2009/11/9 Athos Bacchiocchi athos.bacchiocchi@tin.it
hi,
i'm working on a little project in which some notes with random pitches and duration appear at random time intervals. Each note is packed in a "midi" format (pitch and velocity), with a note-off event (pitch and zero velocity) sent after the note duration interval.
it can happen that a new note is generated before the previous one has been stopped.That's not a trouble, since i can handle it with [poly], eventually set to 1 voice and with voice stealing to force a "monophonic" melody.
Hi Athos,
Since you want it to be monophonic, why don't you just force a note-off for the previous note, right before the note-on of the new note ? If you want rests inbetween the notes you could also use [pipe]---[pack f 0], and [flush( the [pipe] when a new note arrives, so that if the previous note had not finished yet, the scheduled note-off for it is sent early, before the new note-on... does that make sense ? (attached is an example)
Tim
The problem appears if the new note coming has the same pitch than the
previous one. This is impossible for a "real" midi keyboard, in fact a key can be played again only after it has been released. This leads to an undesired behaviour of [poly]: if there are more than 1 voice, i have the sum of different voices playing the same note, with an undesiderd increase of the volume. Even worse, when the voice is only one, the note-off message of the previous note stops the new note before its assigned time duration!
I tried to set up a strategy to avoid this, but with no results. Any idea?
thanks, athos
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Athos Bacchiocchi wrote:
The problem appears if the new note coming has the same pitch than the previous one. This is impossible for a "real" midi keyboard, in fact a key can be played again only after it has been released.
Ok. Think about this sequence of events:
Note On 60 Note On 60 Note Off 60 Note Off 60
How should this be interpreted by the voice allocator?
A) Voice 1 Note On 60 Voice 2 Note On 60 Voice 2 Note Off 60 Voice 1 Note Off 60 | ---- | |------------|
B) Voice 1 Note On 60 Voice 2 Note On 60 Voice 1 Note Off 60 Voice 2 Note Off 60 | --------| |-------- |
Think about how you want your voice allocator to behave, and if the behaviour of [poly] does not meet your needs, then you probably have to write your own voice allocator that does.