[PD] converting decimal to binary

padawan12 padawan12 at obiwannabe.co.uk
Wed Jun 28 06:26:28 CEST 2006


On Tue, 27 Jun 2006 14:16:05 +0100 (BST)
adam armfield <adamairmailed at yahoo.com> wrote:



Hey Adam,

I saw Chucks reply on grouping and realised what
you are experimenting with.

You might find this patch interesting or useful as a base
to modify.

http://www.obiwannabe.co.uk/padawan12/TribalHaus.pd

It doesn't use fibonacci. It uses trigonometric 
(simple harmonic functions) to fill a table, one
for each of 3 instruments, hi-hat, snare and kick.

You will probably have a lot more fun with harmonic
than fibonacci for house beats, but it would a great
starting point for development since you can quickly see
the effects of changing a function parameter in the
table display.


Using binary to store beats is a rather old trick.
See the schematic of a Roland DR55 beat box from
1982 for an example. While it has a certain elegance
I think it may be seducing you down a road that isn't
entirely helpful. I would have another think about
my choice of data-structure/representation if I were you.

The binary notation is merey an efficient way to store
2 valued sequences. You are replacing the digit exponent
of the number base with a linear time relationship. In that
sense the rlationship between the sequence and its integer
representation is a power 2 relationship. Not that useful in
making small scale rythmns but it may have applications
in macrostructure. 


You could experiment with substituting any functions
in TribalHaus. If I remember correctly I used [cos]
and [sin], so just replace those with some new function.

It's not well documented - I expect people to just tweak
it and work it out but a quick summary...

The button rows select the integer harmonic of each sine
contribution, which are alternately, 1, 3, 5, 7 and
2, 4, 6, 8. Each harmonic has a fader to set its level
in the beat. The bottom buttons flip between the absolute
magnitude or the bipolar signal. The top slider rotates the
entire pattern left or right.

That's about it. It's additive synthesis to make beat
patterns. Not surprisingly it works well to create 
extremely subtle shifting beats for house type music.

I would be interested to hear what sonic goodies you get
from playing with other functions like fib though.

Have fun,

Andy


> 
> i want to make a sequencer which generates rhythms
> according to the fibonacci sequence, there's been some
> talk of it on another forum, i've done some cut and
> paste and present the main details here (it looks
> pretty interesting)
> 
> original thread is:
> http://www.dogsonacid.com/showthread.php?s=5ab52100bff93bb30ced93458a7e9529&threadid=409342&perpage=20&pagenumber=2
> 
> all the best
> adam
> -----------------------------------
> i'm not sure if mean - "why do i think fibonacci
> sequences will yield rhythms that sound good?" or "how
> do i do it?". i guess i'll try to answer both...
> 
> harmonics have such an integral role in so many things
> - i just can't believe that they don't come into play
> in rhythm sequences. surely - there is some sort of
> "rule" that determines which patterns "sit" well with
> each other, and which don't. clearly - simply placing
> drum hits in at random sounds like ass, whereas
> certain intervals seem to produce a pleasant interplay
> in the beat. i've always figured this must have
> something to do with the properties of the fibonacci
> sequence, since harmonic relationships are the
> deciding factor in so many appliactions dealing with
> interplay and relationships between things, from which
> atromic orbitals will react with one another - so
> which tones sound good when played together - to the
> proportion of objects in visual arts.
> 
> i'm a bit hesitant to just spill the beans so soon -
> but what the hell, i've always thought that
> information/knowledge should be "open-source". so what
> the hell; basically the method goes like this:
> 
> you always have some fundamental resolution - most of
> us use 1/8th notes or 1/16th notes. so the measure can
> be represented as a string of discrete bits, or a
> binary word, where each bit in the word represents a
> unique position in the measure.
> 
> i'll use the housebeat with 1/8th note rez. for an
> example because it has lots of clean harmonics. note
> that the least significant digit is used to denote the
> first position - so we've got a big/little-endian
> switch going on...
> 
> kick:
> 01010101
> 
> this binary word evaluates to 85
> 
> so if we take 85 to be our "base" (i.e. the first
> element in the series) - and continue in the fibonacci
> sequence, we get 85*(1+1) = 170 which, in binary is:
> 
> 101010
> 
> ^ the open highhat pattern
> 
> continuing on the next element is 21*(2+1) = 255
> 
> 11111111
> 
> ^ commonly used for closed highhats
> 
> 
> basically - for breakbeats - i take 1 or 2 elements
> which i want to draw by hand. in the midi file above i
> used:
> 
> 00100001 (kick)
> and
> 01000100 (snare)
> 
> and added them together. then i took each row, and
> recursively added the current word to the previous
> word to produce the next word.
> 
> the method is still a work in progress - i'm still
> experimenting with "clipping" - in this case meaning
> continuing the sums, and clipping off any bits higher
> than the "all 1s" word. (in this case > 255).
> alternatively, you could just increase the res i
> suppose to get some really complicated breaks with
> 16,32,or even 64 bit resolution.
> 
> this doesn't have to be used just for durms - you
> could use it to generate the rhythm sequences for
> anything. the possibilities are quite mind-boggling.
> 
> so there ya go dogs - if there's a number theorist in
> the house who'd like to collab with me in developing
> applications of this method - hit me up.
> 
> ------------
> 
> least significant means "smallest numerical value".
> each digit in a binary word, read from right to left,
> indicates another power of 2.
> 
> e.g: the rightmost position is bit*2^0, ("bit"
> referring to whether that digit either 1 or 0) the
> next is bit*2^1, the next is bit*2^2, and so on.
> 
> so the first (i.e. rightmost) bit coincides with the
> first note/event in the measure. if you were to order
> the bits the other way around, you'd always roll over
> your word's maximum value in every operation. it's a
> minor point, but one that is definitely necessary.
> just think of it like this: the smaller "time values"
> of the events go with the smaller (or less
> significant) digits of the number.
> 
> the fibonacci sequence goes like this, let "e" denote
> event, and i denote which event it is in the sequence.
> so e_i refeers to an arbitrary event; e_i+1 refers to
> the one that comes next, and e_i-1 refers to the one
> that came before it.
> 
> so the fibonacci sequence is:
> 
> e_i+1 = e_i+e_i-1
> 
> in the example i posted earlier, our "base" is 85.
> meaning we multiply each element of the fibonacci
> sequence by 85, so instead of 1,2,3,5,8 - you would
> get 85,170,255,425,680 = 85*(1,2,3,5,8).
> 
> ------------
> 
> if you can find it - you should check out "the
> schillinger method of musical composition" - it uses
> wave analysis to generate melodies and rhythms. i
> actually have a copy of volume 1 i got many years ago
> - which is where i got started thinking this way. it's
> really interesting stuff - but a heavy read.
> 
> to do what i want to do tho' using wave analysis, i'd
> have to break out my old differential equations notes
> & remember how to do a fourier analysis . like that's
> gonna happen
> 
> ----------
> 
> Everyone has their own way (use single hits and
> sampling for me) but using the fibonacci sequence for
> making beats sounds interesting!!! Here's another way
> to describe, even though I don't use this sequence to
> make beats, just happen to know it:
> 
> Bases:Fsub1=1, Fsub2=1
> Recursive rule: FsubN=FsubN-1+FsubN-2, N greater than
> or equal to 3... so F3=F2+F1. And you can move up to
> any number in the sequence using this format.
> 
> 
> 
> </pre>
> 
> 
> 		
> ___________________________________________________________ 
> Does your mail provider give you FREE antivirus protection? 
> Get Yahoo! Mail http://uk.mail.yahoo.com
> 
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list




More information about the Pd-list mailing list