| 1 |
//------------------------------------------------------------------------------ |
| 2 |
// name: subnoise_audio.ck |
| 3 |
// desc: demo showcasing the subnoise UGen as a white noise audio signal |
| 4 |
// |
| 5 |
// SubNoise generates a random value between [-1, 1] every `rate` audio ticks. |
| 6 |
// You can get/set the rate in code via the .rate() method. |
| 7 |
// This example doubles the subnoise rate every second, up to a max of |
| 8 |
// 2^12 = 4096 ticks. |
| 9 |
// Notice how as `rate` increases, the audio becomes increasingly distorted |
| 10 |
// and lowpassed, becase we are emulating downsampling the original white noise. |
| 11 |
// |
| 12 |
// author: azaday |
| 13 |
// date: Spring 2023 |
| 14 |
//------------------------------------------------------------------------------ |
| 15 |
SubNoise sn => dac; |
| 16 |
1 => sn.rate; |
| 17 |
|
| 18 |
repeat (12) { |
| 19 |
<<< "subnoise rate: " + sn.rate() >>>; |
| 20 |
sn.rate() * 2 => sn.rate; |
| 21 |
1::second => now; |
| 22 |
} |