Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. // time measures
  2. 0.5::second => dur beat;
  3. 4::beat => dur measure;
  4.  
  5. // audio oscillators
  6. SawOsc fbOsc => dac;
  7. 110 => float OscFrequency => fbOsc.freq; // 110Hz, or "A -1" musical note
  8.  
  9. // audio controls
  10. 0.15 => fbOsc.gain;
  11.  
  12. // variables for looping
  13. now + 16::measure => time stop; // 64 beats
  14. 1 => int stepCounter;
  15. 0 => float freqCounter;
  16.  
  17. // start loop
  18. while ( now < stop ) {
  19.     ( OscFrequency + 1 ) - ( Math.pow ( 1, ( OscFrequency / 12 ) ) ) => float stepExponent;
  20.     <<< "-----" >>>;
  21.     <<< "stepExponent: ", stepExponent >>>;
  22.     <<< "Result: ", stepCounter >>>;
  23.     <<< "OscFrequency: ", OscFrequency >>>;
  24.     OscFrequency + stepExponent => OscFrequency => fbOsc.freq;
  25.     beat +=> now;
  26.     1 +=> stepCounter;
  27. }
  28. <<< "end program" >>>;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement