[PD] How to add/remove MIDI notes from a list using MIDI in and note on/off?

patrice colet colet.patrice at free.fr
Wed Nov 12 04:50:54 CET 2014


Nice one!

Le 12/11/2014 04:17, Alex a écrit :
> I couldn't resist creating my own approach.
>
> I used a table with 2048 entries and just store the velocity for each 
> note, I add 128 * channel number to each note number to achieve 
> multiple channels.
>
> In order to find which notes are down you just see which entries in 
> the table are greater than 0.
>
> -Alex
>
> On Tue, Nov 11, 2014 at 6:40 PM, JC Pedroza <nemesis4go10 at hotmail.com 
> <mailto:nemesis4go10 at hotmail.com>> wrote:
>
>     I finally solved this.
>
>     Used a combination of [list-extend], [list-find], [list-delete]
>     for the list dynamics and [notein] for MIDI input. The patch first
>     separates the MIDI note messages by velocity (0 velocity is
>     note-off). If note-on then it adds the note to the list, if
>     note-off it removes the note from the list.
>
>     When the patch receives a bang, it outputs the list with all the
>     keys (MIDI notes) that are being pressed.
>
>     I'm including the patch as attachment. You can also get it at:
>     http://raw.githubusercontent.com/JCPedroza/puredata/master/tools/MIDI_io/list-MIDInoteon.pd
>
>     There are two important subpatches. [pd on_off_route] routes the
>     MIDI-note-on notes to one side, and MIDI-note-off notes to the
>     other. [pd list-deletevalue] deletes a value from a given list,
>     outputs the list unchanged if the value was not found.
>
>     It surely can be improved. Let me know if you find something.
>
>     Thanks everyone for your time and help, I really appreciate it.
>
>     ----------------------------------------
>     > From: ingo at miamiwave.com <mailto:ingo at miamiwave.com>
>     > To: nemesis4go10 at hotmail.com <mailto:nemesis4go10 at hotmail.com>;
>     pd-list at lists.iem.at <mailto:pd-list at lists.iem.at>
>     > Subject: AW: [PD] How to add/remove MIDI notes from a list using
>     MIDI in and note on/off?
>     > Date: Tue, 11 Nov 2014 14:43:33 +0100
>     >
>     > If you are on Pd-extended I would suggest using [cyclone/coll].
>     > That's what I am using. Much easier than working with regular lists.
>     >
>     > Ingo
>     >
>     >
>     >> -----Ursprüngliche Nachricht-----
>     >> Von: Pd-list [mailto:pd-list-bounces at lists.iem.at
>     <mailto:pd-list-bounces at lists.iem.at>] Im Auftrag von JC
>     >> Pedroza
>     >> Gesendet: Dienstag, 11. November 2014 13:54
>     >> An: pd-list at lists.iem.at <mailto:pd-list at lists.iem.at>
>     >> Betreff: [PD] How to add/remove MIDI notes from a list using
>     MIDI in and
>     >> note on/off?
>     >>
>     >> I need to populate a list with the MIDI notes that are being
>     pressed, and
>     >> remove the note from the list when the key is released.
>     >>
>     >> One idea is to use [notein], and if the velocity is> 0 then add
>     the note
>     >> to the list, and if the velocity == 0 then remove the note from
>     the list.
>     >> But I have no idea of how to implement this.
>     >>
>     >> I think I need [list-extend], [list-find], and [list-delete],
>     but I just
>     >> can't figure out an implementation.
>     >>
>     >> How can I do this?
>     >> _______________________________________________
>     >> Pd-list at lists.iem.at <mailto:Pd-list at lists.iem.at> mailing list
>     >> UNSUBSCRIBE and account-management ->
>     >> http://lists.puredata.info/listinfo/pd-list
>     >
>
>     _______________________________________________
>     Pd-list at lists.iem.at <mailto:Pd-list at lists.iem.at> mailing list
>     UNSUBSCRIBE and account-management ->
>     http://lists.puredata.info/listinfo/pd-list
>
>
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141112/cc080ae4/attachment.html>


More information about the Pd-list mailing list