Skip to content

Instantly share code, notes, and snippets.

@davemacdo
Created June 4, 2016 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davemacdo/0efb6781bc0a5d993bf7c88251ac99a2 to your computer and use it in GitHub Desktop.
Save davemacdo/0efb6781bc0a5d993bf7c88251ac99a2 to your computer and use it in GitHub Desktop.
Calculate frequencies for even octave divisions in ChucK
SinOsc s => dac; // could be any unit generator
440.0 => float baseFreq; // starting frequency
5.0 => float divs; // number of even divisions of the octave
1 => int i; // number of steps above base
// Playtest
// baseFreq => s.freq; // play base freq
// 1::second => now;
i/divs => float exp;
Math.pow (2, exp) => float mult;
baseFreq * mult => s.freq;
// Playtest
// 1::second => now;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment