| 1 |
// gen10 sinusoidal lookup table |
| 2 |
// ported to ChucK from rtcmix by dan trueman |
| 3 |
// see luke's page: http://www.music.columbia.edu/cmix/makegens.html#05 |
| 4 |
|
| 5 |
Phasor drive => Gen10 g10 => dac; |
| 6 |
|
| 7 |
// can also lookup table values directly: |
| 8 |
// g10.lookup(index); |
| 9 |
// with index:[0,1] |
| 10 |
|
| 11 |
// load up the coeffs; amplitudes for successive partials |
| 12 |
g10.coefs( [1., 0.5, 0.3, 0.2] ); |
| 13 |
|
| 14 |
// set frequency for reading through table |
| 15 |
drive.freq(440.); |
| 16 |
|
| 17 |
// infinite time loop |
| 18 |
while (true) |
| 19 |
{ |
| 20 |
// advance time |
| 21 |
500::ms => now; |
| 22 |
// nothing needed to do, so lets look |
| 23 |
// up some random parts of the table! |
| 24 |
<<< g10.lookup( Math.random2f(0,1) ) >>>; |
| 25 |
} |