[PD] Indexed array selection

Justin Glenn Smith noisesmith at gmail.com
Sun Oct 11 01:13:31 CEST 2009


Justin Glenn Smith wrote:
> Fred Smith wrote:
>> Hello Folks -
>>
>> I know there must be an easy way to do this, but I'm having terrible trouble
>> figuring it out.
>>
>> Is there an easy way to use a integer input to send a message out of an
>> array of messages?
>>
>> Ideally, it would look like this:
>>
>> [bang]
>> |
>> [2]
>> |
>> [newcommand apple beats carrots cheeseburger]
>> |
>> [print]
>>
>> and the output would be "carrots" (given 0 based indexing). Does this
>> command already exist?
>>
> 
> [bang]
> |
> [t b f]
>  |   |
>  |  [clear, adddollar $1<
>  |            |
> [blah blah<   |
>  |           /
>  |          /
> [empty messagebox <
>  |
> 
> 
> ********** or ****************
> 
> [bang]
>   |
> [t b            f]
>  |              |
> [blah blah<    [- 1]
>  |              /
> [list      split]
>         |
>       [$1<
>         |
> 
> in case it is not clear, both the clear,adddollar on the top and the
> [blah blah< connect to the same object, and the $1 on the bottom is
> coming out of the middle inlet of the list split
> 

I missed the float in both examples, imagine the [2] or whatever number
is where the [bang] is now in each one.




More information about the Pd-list mailing list