Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This guy's blog post describes the issue - http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
However, I think his solution is not exactly what I'm looking for. The synths I use in Logic have note priority methods and remember all held down notes (or at least 10).
I wondering if anyone has managed to implement something like this in Pd or might know where I can find out more about it.
ddg.mono from Max ( http://www.cycling74.com/docs/max5/refpages/m4l-ref/ddg.mono.html) looks similar to what I want - but I don't use Max and I don't think I can access the source.
Any ideas?
Thanks, Joe
Hi Joe,
On 21/04/11 12:48, Joe White wrote:
Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This guy's blog post describes the issue - http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
However, I think his solution is not exactly what I'm looking for. The synths I use in Logic have note priority methods and remember all held down notes (or at least 10).
If pitch is the only thing determining which notes should sound, you could use a [table $0-active 128] (one index for each MIDI note) to count how many times each note has been pressed and not released, then process it how you like.
If the order of key presses matters, you could keep an ordered list of pressed notes (example below using Haskell to prototype the algorithm) and sound the most recently pressed note that hasn't been released:
----8<---- $ ghci ...
let soundingNote = listToMaybe let noteOn note vel notes = (note, vel) : notes let noteOff note vel notes = deleteBy ((==)
on
fst) (note, vel) notes let noNotes = [] let test = noteOff 62 60 . noteOn 60 60 . noteOn 62 60 $ noNotes soundingNote test
Just (60,60)
soundingNote (noteOff 60 25 test)
Nothing ----8<----
I wondering if anyone has managed to implement something like this in Pd or might know where I can find out more about it.
Might be something more directly useful in the previous discussions:
http://lists.puredata.info/search/Pd-list?query=monophonic&max=100&r...
I am using a [coll] object to store all notes being played and not yet released. When the current note is released it recalls the last note that was stored from the [coll] list by sending something like [end, bang( to [coll]. You can play as many notes as you want and it will always go back to the last note played. When releasing a note (that may not even sound ATM) it gets erased from [coll] by using [remove $1(. To separate note on / off I use [nroute 0 2]. Note priority in this case is "last" which is all I personally ever need. (I suppose other priorities can be set by using some sorting options within [coll].)
In order to avoid other notes cutting off the current note I find the easiest (monophonic) solution is to add [poly 1 1] right before sound generation. This sends a note off to the last note played before starting the new one and avoids double note offs.
I am using this in a rather complex patch. Ill see if I can extract just this single part of it if you can't get it to work correctly. Although I dont think Ill be able get to it until next week.
Ingo
Von: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] Im Auftrag von Joe White Gesendet: Donnerstag, 21. April 2011 13:48 An: pd-list@iem.at Betreff: [PD] Midi note handling for monophonic synth
Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This guy's blog post describes the issue - http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
However, I think his solution is not exactly what I'm looking for. The synths I use in Logic have note priority methods and remember all held down notes (or at least 10).
I wondering if anyone has managed to implement something like this in Pd or might know where I can find out more about it.
ddg.mono from Max (http://www.cycling74.com/docs/max5/refpages/m4l-ref/ddg.mono.html) looks similar to what I want - but I don't use Max and I don't think I can access the source.
Any ideas?
Thanks, Joe
Hi Ingo,
Thanks for the reply, [coll] and [poly] definitely look useful. However, I forget to mention I'm using Pd Vanilla :(
The information you provided is really helpful though, I'm thinking if I can try and replicate the functionality of [coll], maybe using tables or something similar. I tried a while ago but it ended up getting messy.
If you can extract your method from your patch that'd be much appreciated.
Thanks, Joe
On 21 April 2011 13:36, Ingo ingo@miamiwave.com wrote:
I am using a [coll] object to store all notes being played and not yet released. When the current note is released it recalls the last note that was stored from the [coll] list by sending something like [end, bang( to [coll]. You can play as many notes as you want and it will always go back to the last note played. When releasing a note (that may not even sound ATM) it gets erased from [coll] by using [remove $1(. To separate note on / off I use [nroute 0 2]. Note priority in this case is "last" which is all I personally ever need. (I suppose other priorities can be set by using some sorting options within [coll].)
In order to avoid other notes cutting off the current note I find the easiest (monophonic) solution is to add [poly 1 1] right before sound generation. This sends a note off to the last note played before starting the new one and avoids double note offs.
I am using this in a rather complex patch. I’ll see if I can extract just this single part of it if you can't get it to work correctly. Although I don’t think I’ll be able get to it until next week.
Ingo
Von: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] Im Auftrag von Joe White Gesendet: Donnerstag, 21. April 2011 13:48 An: pd-list@iem.at Betreff: [PD] Midi note handling for monophonic synth
Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This guy's blog post describes the issue
However, I think his solution is not exactly what I'm looking for. The synths I use in Logic have note priority methods and remember all held down notes (or at least 10).
I wondering if anyone has managed to implement something like this in Pd or might know where I can find out more about it.
ddg.mono from Max (http://www.cycling74.com/docs/max5/refpages/m4l-ref/ddg.mono.html) looks similar to what I want - but I don't use Max and I don't think I can access the source.
Any ideas?
Thanks, Joe
Yes, I can extract a small patch with just that functionality. But I'm afraid you'll have to mess with it for a while if you want to use it with Vanilla. I'll get back to you after Easter.
Ingo
Von: Joe White [mailto:white.joe4@gmail.com] Gesendet: Donnerstag, 21. April 2011 14:47 An: Ingo Cc: pd-list@iem.at Betreff: Re: [PD] Midi note handling for monophonic synth
Hi Ingo,
Thanks for the reply, [coll] and [poly] definitely look useful. However, I forget to mention I'm using Pd Vanilla :(
The information you provided is really helpful though, I'm thinking if I can try and replicate the functionality of [coll], maybe using tables or something similar. I tried a while ago but it ended up getting messy.
If you can extract your method from your patch that'd be much appreciated.
Thanks, Joe On 21 April 2011 13:36, Ingo ingo@miamiwave.com wrote: I am using a [coll] object to store all notes being played and not yet released. When the current note is released it recalls the last note that was stored from the [coll] list by sending something like [end, bang( to [coll]. You can play as many notes as you want and it will always go back to the last note played. When releasing a note (that may not even sound ATM) it gets erased from [coll] by using [remove $1(. To separate note on / off I use [nroute 0 2]. Note priority in this case is "last" which is all I personally ever need. (I suppose other priorities can be set by using some sorting options within [coll].)
In order to avoid other notes cutting off the current note I find the easiest (monophonic) solution is to add [poly 1 1] right before sound generation. This sends a note off to the last note played before starting the new one and avoids double note offs.
I am using this in a rather complex patch. Ill see if I can extract just this single part of it if you can't get it to work correctly. Although I dont think Ill be able get to it until next week.
Ingo
Von: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] Im Auftrag von Joe White Gesendet: Donnerstag, 21. April 2011 13:48 An: pd-list@iem.at Betreff: [PD] Midi note handling for monophonic synth
Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This guy's blog post describes the issue - http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
However, I think his solution is not exactly what I'm looking for. The synths I use in Logic have note priority methods and remember all held down notes (or at least 10).
I wondering if anyone has managed to implement something like this in Pd or might know where I can find out more about it.
ddg.mono from Max (http://www.cycling74.com/docs/max5/refpages/m4l-ref/ddg.mono.html) looks similar to what I want - but I don't use Max and I don't think I can access the source.
Any ideas?
Thanks, Joe
On 04/21/2011 01:48 PM, Joe White wrote:
http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
this does not happen here, using the method from the monosynth example in the pd-help. (stripnote), 3. c10. however the sound stops, if the last pressed key is released. if this is not desired, maybe a counter for note on/off msg (and stopping the sound at 0) would help, so that the sound is only stopped when all keys are released.
bis denn! martin
Hi Martin,
I looked at the monosynth tutorial but it seemed like that only remembered the second-last note played, it's not really scaleable.
After spending hours trying in Pd, I ended up making an external to handle it. It basically orders any currently held notes and forgets them as they are released - If anyone wants the code give me a shout.
Thanks for your help Martin, Joe
On 21 April 2011 21:33, martin brinkmann mnb@martin-brinkmann.de wrote:
On 04/21/2011 01:48 PM, Joe White wrote:
http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
this does not happen here, using the method from the monosynth example in the pd-help. (stripnote), 3. c10. however the sound stops, if the last pressed key is released. if this is not desired, maybe a counter for note on/off msg (and stopping the sound at 0) would help, so that the sound is only stopped when all keys are released.
bis denn! martin
Joe White <white.joe4 <at> gmail.com> writes:
Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This guy's
blog post describes the issue - http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/
However, I think his solution is not exactly what I'm looking for. The synths
I use in Logic have note priority methods and remember all held down notes (or at least 10).
I wondering if anyone has managed to implement something like this in Pd or
might know where I can find out more about it.
ddg.mono from Max
(http://www.cycling74.com/docs/max5/refpages/m4l-ref/ddg.mono.html) looks similar to what I want - but I don't use Max and I don't think I can access the source.
Any ideas?
Thanks, Joe
Pd-list <at> iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Joe:
I read you message witha 2 years delay. jeje, I am making a course about how to build a Virtual Analog Sinthesizer with pure data on My Youtube Chanel:
www.youtube.com/user/canalpuredata
I've got a solution to that MONO MIDI problem using Vanilla ( I don't like lybraries) so I hope it will be usefull for you.
Thats My Patch: __________________________________________________________________________
#N canvas 0 22 327 401 10; #X obj 56 42 notein; #X obj 45 100 - 1; #X obj 45 125 pack 0 0 0; #N canvas 0 22 227 376 guardaNotas 0; #X obj 50 83 unpack 0 0 0; #N canvas 0 22 247 267 ++ 0; #X obj 41 40 inlet; #X obj 110 41 inlet; #X obj 41 99 f; #X obj 41 133 + 1; #X msg 110 82 0; #X obj 41 165 outlet; #X msg 41 73 bang; #X connect 0 0 6 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 3 0 2 1; #X connect 3 0 5 0; #X connect 4 0 2 1; #X connect 6 0 2 0; #X restore 50 224 pd ++; #X obj 50 49 inlet; #X obj 50 282 *; #X obj 84 265 > 0; #X msg 50 198 bang; #X text 106 228 evita cuenta eterna; #X obj 104 207 r $0-ordenreset; #X obj 92 127 tabwrite $0-velocity; #X obj 32 166 tabwrite $0-nota; #X obj 50 307 tabwrite $0-orden; #X connect 0 0 5 0; #X connect 0 0 9 0; #X connect 0 1 4 0; #X connect 0 1 8 0; #X connect 0 2 8 1; #X connect 0 2 9 1; #X connect 0 2 10 1; #X connect 1 0 3 0; #X connect 2 0 0 0; #X connect 3 0 10 0; #X connect 4 0 3 1; #X connect 5 0 1 0; #X connect 7 0 1 1; #X restore 72 195 pd guardaNotas; #X msg 45 147 $2 $3 $1; #X obj 45 170 t b l; #N canvas 0 22 309 311 changeNote 0; #X text 91 9 evita redundancia.; #X obj 70 51 inlet; #X obj 109 104 unpack; #X obj 142 171 &&; #X obj 70 76 t l l; #X obj 70 210 spigot; #X obj 109 138 == -1; #X obj 157 138 == -1; #X obj 142 193 == 0; #X obj 179 102 unpack; #X obj 70 243 outlet; #X connect 1 0 4 0; #X connect 2 0 6 0; #X connect 2 1 7 0; #X connect 3 0 8 0; #X connect 4 0 5 0; #X connect 4 1 2 0; #X connect 5 0 9 0; #X connect 5 0 10 0; #X connect 6 0 3 0; #X connect 7 0 3 1; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 9 1 7 1; #X restore 45 248 pd changeNote; #X obj 45 274 unpack; #X obj 89 316 outlet; #X obj 42 317 outlet; #X obj 56 70 poly 10; #N canvas 386 100 412 676 note 0; #X obj 63 66 t b b b; #X text 18 603 mensaje midi; #X obj 63 31 inlet; #X obj 63 619 outlet; #X obj 86 254 moses 0; #X msg 179 237 0; #X floatatom 191 280 5 0 0 0 - - -; #X obj 125 351 f; #X text 198 257 saca numero mayor; #X obj 63 368 f; #X obj 113 181 t f f; #X text 187 349 numero mayor; #X text 110 369 indice; #X floatatom 168 385 5 0 0 0 - - -; #X msg 125 321 bang; #X obj 125 279 t f f; #X obj 63 395 t f f; #X obj 63 582 pack; #X text 43 554 memoria ultima nota; #X obj 53 492 t f f b; #N canvas 733 352 236 271 cuenta11 0; #X obj 56 160 + 1; #X obj 56 112 until; #X obj 56 87 t f b; #X msg 114 120 -1; #X obj 56 137 f; #X obj 56 38 inlet; #X obj 56 184 outlet; #X msg 56 64 11; #X connect 0 0 4 1; #X connect 0 0 6 0; #X connect 1 0 4 0; #X connect 2 0 1 0; #X connect 2 1 3 0; #X connect 3 0 4 1; #X connect 4 0 0 0; #X connect 5 0 7 0; #X connect 7 0 2 0; #X restore 113 128 pd cuenta11; #X msg 147 509 10; #X obj 235 436 sel 10; #X text 171 455 reset orden , evita cuenta eterna; #X text 149 404 si llega a 10 en "0" , note off; #X obj 235 479 s $0-ordenreset; #X obj 113 207 tabread $0-orden; #X obj 84 434 tabread $0-velocity; #X obj 63 462 tabread $0-nota; #X obj 72 534 tabwrite $0-nota; #X connect 0 0 9 0; #X connect 0 1 20 0; #X connect 0 2 5 0; #X connect 2 0 0 0; #X connect 4 1 15 0; #X connect 5 0 4 1; #X connect 6 0 4 1; #X connect 7 0 9 1; #X connect 9 0 13 0; #X connect 9 0 16 0; #X connect 10 0 26 0; #X connect 10 1 7 1; #X connect 14 0 7 0; #X connect 15 0 14 0; #X connect 15 1 6 0; #X connect 16 0 28 0; #X connect 16 1 22 0; #X connect 16 1 27 0; #X connect 17 0 3 0; #X connect 19 0 17 0; #X connect 19 1 21 0; #X connect 19 1 29 0; #X connect 20 0 10 0; #X connect 21 0 29 1; #X connect 22 0 25 0; #X connect 26 0 4 0; #X connect 27 0 17 1; #X connect 28 0 19 0; #X restore 45 218 pd note; #X obj 136 45 table $0-nota 11; #X obj 136 67 table $0-velocity 11; #X obj 136 89 table $0-orden 11; #X connect 0 0 10 0; #X connect 0 1 10 1; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 4 0 5 0; #X connect 5 0 11 0; #X connect 5 1 3 0; #X connect 6 0 7 0; #X connect 7 0 9 0; #X connect 7 1 8 0; #X connect 10 0 1 0; #X connect 10 1 2 1; #X connect 10 2 2 2; #X connect 11 0 6 0;
Un abrazo!
Claudio Nervi.
www.claudionervi.com
Hey Claudio,
Thanks, that's a nice solution! I like vanilla ice cream as well :)
It's shame that there aren't any nice in-built array methods, I've come up against various problems where having a mutable array would be super useful. In the end I preferred to implement a few lines of C rather than deal with some complicated list/table mapping method.
Better than late than never! Nice video too dude!
Cheers, Joe
On 23 February 2013 19:57, claudio nervi claudionervi@gmail.com wrote:
Joe White <white.joe4 <at> gmail.com> writes:
Hi all,
I'm implementing a synth in Pd using midi/notein as an input.
One problem I keep coming up against is handling note off messages. This
guy's blog post describes the issue
However, I think his solution is not exactly what I'm looking for. The
synths I use in Logic have note priority methods and remember all held down notes (or at least 10).
I wondering if anyone has managed to implement something like this in Pd
or might know where I can find out more about it.
ddg.mono from Max
(http://www.cycling74.com/docs/max5/refpages/m4l-ref/ddg.mono.html) looks similar to what I want - but I don't use Max and I don't think I can access the source.
Any ideas?
Thanks, Joe
Pd-list <at> iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Joe:
I read you message witha 2 years delay. jeje, I am making a course about how to build a Virtual Analog Sinthesizer with pure data on My Youtube Chanel:
www.youtube.com/user/canalpuredata
I've got a solution to that MONO MIDI problem using Vanilla ( I don't like lybraries) so I hope it will be usefull for you.
Thats My Patch: __________________________________________________________________________
#N canvas 0 22 327 401 10; #X obj 56 42 notein; #X obj 45 100 - 1; #X obj 45 125 pack 0 0 0; #N canvas 0 22 227 376 guardaNotas 0; #X obj 50 83 unpack 0 0 0; #N canvas 0 22 247 267 ++ 0; #X obj 41 40 inlet; #X obj 110 41 inlet; #X obj 41 99 f; #X obj 41 133 + 1; #X msg 110 82 0; #X obj 41 165 outlet; #X msg 41 73 bang; #X connect 0 0 6 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 3 0 2 1; #X connect 3 0 5 0; #X connect 4 0 2 1; #X connect 6 0 2 0; #X restore 50 224 pd ++; #X obj 50 49 inlet; #X obj 50 282 *; #X obj 84 265 > 0; #X msg 50 198 bang; #X text 106 228 evita cuenta eterna; #X obj 104 207 r $0-ordenreset; #X obj 92 127 tabwrite $0-velocity; #X obj 32 166 tabwrite $0-nota; #X obj 50 307 tabwrite $0-orden; #X connect 0 0 5 0; #X connect 0 0 9 0; #X connect 0 1 4 0; #X connect 0 1 8 0; #X connect 0 2 8 1; #X connect 0 2 9 1; #X connect 0 2 10 1; #X connect 1 0 3 0; #X connect 2 0 0 0; #X connect 3 0 10 0; #X connect 4 0 3 1; #X connect 5 0 1 0; #X connect 7 0 1 1; #X restore 72 195 pd guardaNotas; #X msg 45 147 $2 $3 $1; #X obj 45 170 t b l; #N canvas 0 22 309 311 changeNote 0; #X text 91 9 evita redundancia.; #X obj 70 51 inlet; #X obj 109 104 unpack; #X obj 142 171 &&; #X obj 70 76 t l l; #X obj 70 210 spigot; #X obj 109 138 == -1; #X obj 157 138 == -1; #X obj 142 193 == 0; #X obj 179 102 unpack; #X obj 70 243 outlet; #X connect 1 0 4 0; #X connect 2 0 6 0; #X connect 2 1 7 0; #X connect 3 0 8 0; #X connect 4 0 5 0; #X connect 4 1 2 0; #X connect 5 0 9 0; #X connect 5 0 10 0; #X connect 6 0 3 0; #X connect 7 0 3 1; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 9 1 7 1; #X restore 45 248 pd changeNote; #X obj 45 274 unpack; #X obj 89 316 outlet; #X obj 42 317 outlet; #X obj 56 70 poly 10; #N canvas 386 100 412 676 note 0; #X obj 63 66 t b b b; #X text 18 603 mensaje midi; #X obj 63 31 inlet; #X obj 63 619 outlet; #X obj 86 254 moses 0; #X msg 179 237 0; #X floatatom 191 280 5 0 0 0 - - -; #X obj 125 351 f; #X text 198 257 saca numero mayor; #X obj 63 368 f; #X obj 113 181 t f f; #X text 187 349 numero mayor; #X text 110 369 indice; #X floatatom 168 385 5 0 0 0 - - -; #X msg 125 321 bang; #X obj 125 279 t f f; #X obj 63 395 t f f; #X obj 63 582 pack; #X text 43 554 memoria ultima nota; #X obj 53 492 t f f b; #N canvas 733 352 236 271 cuenta11 0; #X obj 56 160 + 1; #X obj 56 112 until; #X obj 56 87 t f b; #X msg 114 120 -1; #X obj 56 137 f; #X obj 56 38 inlet; #X obj 56 184 outlet; #X msg 56 64 11; #X connect 0 0 4 1; #X connect 0 0 6 0; #X connect 1 0 4 0; #X connect 2 0 1 0; #X connect 2 1 3 0; #X connect 3 0 4 1; #X connect 4 0 0 0; #X connect 5 0 7 0; #X connect 7 0 2 0; #X restore 113 128 pd cuenta11; #X msg 147 509 10; #X obj 235 436 sel 10; #X text 171 455 reset orden , evita cuenta eterna; #X text 149 404 si llega a 10 en "0" , note off; #X obj 235 479 s $0-ordenreset; #X obj 113 207 tabread $0-orden; #X obj 84 434 tabread $0-velocity; #X obj 63 462 tabread $0-nota; #X obj 72 534 tabwrite $0-nota; #X connect 0 0 9 0; #X connect 0 1 20 0; #X connect 0 2 5 0; #X connect 2 0 0 0; #X connect 4 1 15 0; #X connect 5 0 4 1; #X connect 6 0 4 1; #X connect 7 0 9 1; #X connect 9 0 13 0; #X connect 9 0 16 0; #X connect 10 0 26 0; #X connect 10 1 7 1; #X connect 14 0 7 0; #X connect 15 0 14 0; #X connect 15 1 6 0; #X connect 16 0 28 0; #X connect 16 1 22 0; #X connect 16 1 27 0; #X connect 17 0 3 0; #X connect 19 0 17 0; #X connect 19 1 21 0; #X connect 19 1 29 0; #X connect 20 0 10 0; #X connect 21 0 29 1; #X connect 22 0 25 0; #X connect 26 0 4 0; #X connect 27 0 17 1; #X connect 28 0 19 0; #X restore 45 218 pd note; #X obj 136 45 table $0-nota 11; #X obj 136 67 table $0-velocity 11; #X obj 136 89 table $0-orden 11; #X connect 0 0 10 0; #X connect 0 1 10 1; #X connect 1 0 2 0; #X connect 2 0 4 0; #X connect 4 0 5 0; #X connect 5 0 11 0; #X connect 5 1 3 0; #X connect 6 0 7 0; #X connect 7 0 9 0; #X connect 7 1 8 0; #X connect 10 0 1 0; #X connect 10 1 2 1; #X connect 10 2 2 2; #X connect 11 0 6 0;
Un abrazo!
Claudio Nervi.
www.claudionervi.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list