<meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Hi Claude,</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Thanks for the info, how are you searching the list btw?</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><meta charset="utf-8"><div>
Found this in the search you linked: </div><div><br></div><div>"<span class="Apple-style-span" style="font-family: monospace; white-space: pre; border-collapse: separate; font-size: medium; ">i coded two simple externals that do the job (and tell you the gate </span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; border-collapse: separate; font-size: medium; ">status also, eg. if there are notes pressed or not). you can find on my </span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; border-collapse: separate; font-size: medium; ">(under construction) website <a href="http://xaero.ath.cx/cms/software">http://xaero.ath.cx/cms/software</a>'</span></div>
<span class="Apple-style-span" style="border-collapse: separate; font-family: Times; font-size: medium; "><pre><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; white-space: normal; ">It's sod's law that the link is broken :(</span></pre>
</span></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">> If the order of key presses matters, you could keep an ordered list of<br>
</span>> pressed notes (example below using Haskell to prototype the algorithm)<br>
> and sound the most recently pressed note that hasn't been released:</div><div><br></div><div>This exactly what I want, although I don't know Haskell at all, sorry. I can keep an ordered list with just one item, however, using item pairs (pitch, velocity) gets more difficult with how Pd handles commas (i'm assuming comma is the best way to keep a separated list). </div>
<div><br></div><div>Thanks for the help,</div><div>Joe</div><div><br></div><meta charset="utf-8">Message: 3<br>Date: Thu, 21 Apr 2011 13:27:26 +0100<br>From: Claude Heiland-Allen <<a href="mailto:claude@goto10.org" style="color: rgb(51, 51, 204); ">claude@goto10.org</a>><br>
Subject: Re: [PD] Midi note handling for monophonic synth<br>To: <a href="mailto:pd-list@iem.at" style="color: rgb(51, 51, 204); ">pd-list@iem.at</a><br>Message-ID: <<a href="mailto:4DB022AE.9010208@goto10.org" style="color: rgb(51, 51, 204); ">4DB022AE.9010208@goto10.org</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Hi Joe,<br><br>On 21/04/11 12:48, Joe White wrote:<br>> Hi all,<br>><br>> I'm implementing a synth in Pd using midi/notein as an input.<br>><br>
> One problem I keep coming up against is handling note off messages. This<br>> guy's blog post describes the issue -<br>> <a href="http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/" target="_blank" style="color: rgb(51, 51, 204); ">http://kemptonmooney.com/2010/09/pure-data-midi-note-off-solution/</a><br>
><br>> However, I think his solution is not exactly what I'm looking for. The<br>> synths I use in Logic have note priority methods and remember all held down<br>> notes (or at least 10).<br><br>If pitch is the only thing determining which notes should sound, you<br>
could use a [table $0-active 128] (one index for each MIDI note) to<br>count how many times each note has been pressed and not released, then<br>process it how you like.<br><br>If the order of key presses matters, you could keep an ordered list of<br>
pressed notes (example below using Haskell to prototype the algorithm)<br>and sound the most recently pressed note that hasn't been released:<br><br>----8<----<br>$ ghci<br>...<br> > let soundingNote = listToMaybe<br>
> let noteOn note vel notes = (note, vel) : notes<br> > let noteOff note vel notes = deleteBy ((==)`on`fst) (note, vel) notes<br> > let noNotes = []<br> > let test = noteOff 62 60 . noteOn 60 60 . noteOn 62 60 $ noNotes<br>
> soundingNote test<br>Just (60,60)<br> > soundingNote (noteOff 60 25 test)<br>Nothing<br>----8<----<br><br>> I wondering if anyone has managed to implement something like this in Pd or<br>> might know where I can find out more about it.<br>
<br>Might be something more directly useful in the previous discussions:<br><br><a href="http://lists.puredata.info/search/Pd-list?query=monophonic&max=100&result=normal&sort=score" target="_blank" style="color: rgb(51, 51, 204); ">http://lists.puredata.info/search/Pd-list?query=monophonic&max=100&result=normal&sort=score</a><br>
<br><br>Claude<br>--<br><a href="http://claudiusmaximus.goto10.org/" target="_blank" style="color: rgb(51, 51, 204); ">http://claudiusmaximus.goto10.org</a></span>