| 1 |
//-------------------------------------------------------------------- |
| 2 |
// name: LiSa-track3.ck |
| 3 |
// desc: Live sampling utilities for ChucK |
| 4 |
// demonstrate using track == 1 mode with LiSa |
| 5 |
// |
| 6 |
// author: Dan Trueman, 2007 |
| 7 |
// |
| 8 |
// when track == 1, the input is used to control playback position |
| 9 |
// input [0,1] will control playback position within loop marks |
| 10 |
// input values less than zero are multiplied by -1, so it is |
| 11 |
// possible to use audio signals [-1, 1] to control playback position, |
| 12 |
// as in waveshaping |
| 13 |
//-------------------------------------------------------------------- |
| 14 |
|
| 15 |
// signal chain; record a sine wave, play it back |
| 16 |
SinOsc s => LiSa loopme => dac; |
| 17 |
// frequency |
| 18 |
440 => s.freq; |
| 19 |
|
| 20 |
// alloc LiSa memory |
| 21 |
6::second => loopme.duration; |
| 22 |
1000::ms => loopme.loopEndRec; |
| 23 |
1000::ms => loopme.loopEnd; |
| 24 |
|
| 25 |
// set recording ramp time |
| 26 |
loopme.recRamp( 50::ms ); |
| 27 |
// retain some while loop recording |
| 28 |
loopme.feedback( 0.99 ); |
| 29 |
|
| 30 |
// start recording input |
| 31 |
loopme.record( 1 ); |
| 32 |
// 1 sec later, this time DON'T stop recording.... |
| 33 |
1000::ms => now; |
| 34 |
|
| 35 |
// set track mode to 1, where the input chooses playback position |
| 36 |
1 => loopme.track; |
| 37 |
// this time don't change the freq; scan through zippy quick |
| 38 |
loopme.play( 1 ); |
| 39 |
loopme.gain( 0.02 ); |
| 40 |
|
| 41 |
// advance time for 5 seconds |
| 42 |
5000::ms => now; |
| 43 |
// ramp down |
| 44 |
loopme.rampDown( 250::ms ); |
| 45 |
// wait |
| 46 |
500::ms => now; |
| 47 |
|
| 48 |
// pretty farking scary |
| 49 |
// bye bye |