[PD] Manipulating Gem objects color with notein

Frank Barknecht fbar at footils.org
Tue Feb 3 09:34:53 CET 2009


Hallo Simone,
simone-www.io-lab.org hat gesagt: // simone-www.io-lab.org wrote:

> After a few months without PD it seems like i forgot the basics and
> got stuck with something rather simple:
> I am using the NOTEIN object to track 16 coming from a sequencer, what
> i want to achieve is to toogle 2 different colors on 16 GEM objects
> ie:
> Note On - Note 60 = object 60 turns blue
> Note Off - Note 60 = object 60 turns white
> 
> Note On - Note 61 = object 61 turns blue
> Note Off - Note 61 = object 61 turns white

Try something like this: 

 [notein 16] <- assuming you read from channel 16
 |       |
 [pack 0 0] <-- pack note number and note velocity into a list
 |
 [route 60 61 62 ...] <-- route according to note number
 |
 [> 0]
 |
 [select 1 0] <-- check if noteon or noteoff was sent. 
 |       | 
 [blue(  [white( 


If you use an abstraction for your Gem objects, I would put the
route-logic into that abstraction like: 

        [r NOTE] <-- "pack"ed note/velocity pairs
        |
        [route $1] <-- create abstraction with arguments like 60, 61 ...
        |
        [> 0]
        |
        [select 1 0]
        |        |
        [0 1 0(  [1 1 1(
        |________/
  [color]
  |
  [square]

Ciao
-- 
Frank




More information about the Pd-list mailing list