[PD] Midi note handling for monophonic synth

Joe White white.joe4 at gmail.com
Thu Apr 21 16:41:15 CEST 2011


Hi Claude,

Thanks for the info, how are you searching the list btw?

Found this in the search you linked:

"i coded two simple externals that do the job (and tell you the gate status
also, eg. if there are notes pressed or not). you can find on my (under
construction) website http://xaero.ath.cx/cms/software'

It's sod's law that the link is broken :(

> 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:

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).

Thanks for the help,
Joe

Message: 3
Date: Thu, 21 Apr 2011 13:27:26 +0100
From: Claude Heiland-Allen <claude at goto10.org>
Subject: Re: [PD] Midi note handling for monophonic synth
To: pd-list at iem.at
Message-ID: <4DB022AE.9010208 at goto10.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

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&result=normal&sort=score


Claude
--
http://claudiusmaximus.goto10.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20110421/beaa1f16/attachment-0001.htm>


More information about the Pd-list mailing list