Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/live_sampling.ck
Created November 21, 2013 02:54
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 zeffii/7575366 to your computer and use it in GitHub Desktop.
Save zeffii/7575366 to your computer and use it in GitHub Desktop.
lisa
fun SndBuf load_sample(string wavname){
// usage
// load_sample("kick_02") @=> SndBuf kick => dac;
// turn incoming wavname into path/wavename.wav
// return a reference to a new buffer object.
SndBuf temp_buff;
me.dir() + "/audio/" + wavname + ".wav" => temp_buff.read;
// set to end, and set gain, then return the object
temp_buff.samples() => temp_buff.pos;
0.8 => temp_buff.gain;
return temp_buff;
}
load_sample("hihat_04") @=> SndBuf perc_sample => Gain master_sample => dac;
master_sample => Pan2 sample_pan => dac;
LiSa liveSampl1 => NRev rname => Gain big => dac;
rname.mix(0.2);
(10*240*22)::samp => dur bigtime => liveSampl1.duration;
master_sample => liveSampl1;
big.gain(4);
1 => liveSampl1.record;
for(2 => int j; j<10; j++){
((((j%2)*2)-1)*.9) => sample_pan.pan;
for(0 => int i; i<240; i++){
0.01 => master_sample.gain;
0 + (i*j*142)=> perc_sample.pos;
22::samp => now;
}
}
0 => liveSampl1.record;
for(0 => int i; i<4; i++){
0 => liveSampl1.playPos;
-.3 => liveSampl1.rate;
1 => liveSampl1.play;
bigtime => now;
0 => liveSampl1.play;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment