[PD] Binary - integer conversion

IOhannes m zmoelnig zmoelnig at iem.at
Sat Mar 17 08:49:15 CET 2007


David Powers wrote:
> Hello,
> 
> Is it possible to somehow convert back and forth between integer and
> binary in PD?
> 
> 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.


mfg.asdr
IOhannes




More information about the Pd-list mailing list