[sdiy] CS class project

Ryan Williams destrukto at gmx.net
Wed Apr 14 04:45:20 CEST 2004


David Cornutt wrote:
> Here's an idea: Build a binary tree where each node contains the number of
> a harmonic.  Distribute the numbers, so the number 1 (fundamental)
> is at the root (top) of the tree; the second layer is 2 & 3, the third 
> layer is 4-5-5-4, the
> fourth layer is 6-7-8-9-9-8-7-6, and so on. Do the tree maybe 10 layers 
> deep.
> 
> To generate a waveform, do a random depth-first walk down the tree
> from the root node, randomly choosing left or right at each layer, and
> recording the number of each node you visit.  When you get to the bottom,
> make an additive waveform containing the harmonics determined by the
> set of numbers you came up with.

that is an interesting idea.

> The hard part 
> might be
> actually generating the waveform, but you could do it fairly easily with 
> something
> like Csound.
> 

if you are using C/C++ and you want to actually play back the sound try 
portAudio. I've used it to generate sawtooth, and square waves with any 
fundamental frequency by adding sine waves together. If you need some 
example source code, I can send it.



More information about the Synth-diy mailing list