[PD] Binary - integer conversion

Martin Peach martin.peach at sympatico.ca
Sat Mar 17 18:00:24 CET 2007


IOhannes m zmoelnig wrote:
> David Powers wrote:
>   
>> My idea, is to represent simple drum machine style rhythms as binary
>> numbers. [101010001011]. Ok, so if this were a float, it would be
>> trivial to do a common task and shift the rhythm left or right. I
>> think, that other rhythmic variations would also be quite fast to
>> implement using this system, you can do binary math instead of list
>> operations which should be much faster, I assume.
>>
>>     
> just to chime in:
> pd internally uses 32bit floats, which will make your idea troublesome
> to implement as soon as you want patterns longer than (...cannot rembmer
> right now).
>
> you could always use zexy's [symbol2list] to convert a symbol
> [+-+-+---+-++] into a list of symbols + - + - + - - - + - + +
> which can then easily be passed with a kind of [drip] (or [list/drip]
> into a [select] in order to trigger stuff.
>
>   
Also if my string patch is applied to pd, you can use [str drip 1 0 1 0 
1 0 0 0 1 0 1 1] to output that sequence one at a time. Since the floats 
are always 1 or 0 there won't be any problems with long strings.

Martin





More information about the Pd-list mailing list