I made [a thing](https://soundcloud.com/fcahoon/wild-drone). I had this idea for...

@forrcaho@hachyderm.io

I made [a thing](soundcloud.com/fcahoon/wild-dr).

I had this idea for an additive drone where the amplitude and pan of each of the harmonics is controlled by a system of LFOs. I started in [Faust](faust.grame.fr/), but I hit a complexity limit, so tried again by writing a C program that wrote a WAV file using [libsndfile](libsndfile.github.io/libsndfil). A version of that code is [here](gist.github.com/forrcaho/a3783), but of course I couldn't stop playing with it once I had uploaded to SoundCloud, so it won't generate exactly the same thing. (I also added the fadein and fadeout later in Audacity.)

The amplitude of the nth harmonic is 1/n to a power which varies, controlled by a sinusoidal LFO. The power goes from 1 to 3 for the first 16 harmonics, then the offset increases linearly until at the max 32nd harmonic it goes from 1.5 to 3.5. (I find the higher harmonics like spices; you need to have a little, but too much is overpowering.)

I originally had the rate of this LFO based on the harmonic number raised to a low power (looks like I used e/10 in the code) so the higher harmonics would modulate faster. Then I realized that it would be more interesting if the relationship between the modulation rate and harmonic frequency wasn't so direct. So, I took another offset sinusoidal LFO, whose values ranged from 1 to my max harmonic, and assigned each harmonic a phase shift equally spaced between -pi/2 and pi/2 (so from min to max of a sin wave) at the start, and this was the number raised to the 0.271... power for the nth harmonic. This then shifted very slowly, with a period of 50 or 60 seconds. The effect was that first, the lower harmonics would modulate the slowest and the higher harmonics the fastest. Then, ever so slowly, the highest harmonics would slow down and the middle ones would become the fastest ... and so on.

Working on this has given me the idea of how to write a more generalizable program to produce these sorts of drones, and I that will be a good project to learn Rust with.