From 44858d0385a04afb015359371527c83398b92a8f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 25 Jun 2012 17:09:11 +0200 Subject: added live sampler shred based on LiSa (LiSaX) * it reserves several controller buttons as sample banks (some of them may be preinitialized with stock samples) * allows recording into the bank and playback * loop playback and loop recording --- live_sampler.ck | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 live_sampler.ck diff --git a/live_sampler.ck b/live_sampler.ck new file mode 100644 index 0000000..74fda43 --- /dev/null +++ b/live_sampler.ck @@ -0,0 +1,49 @@ +/* + * Live (and stock) sampler based on LiSa + */ +LiSaX lisa[7]; + +for (0 => int i; i < lisa.cap(); i++) { + 10::second => lisa[i].duration; + lisa[i].duration() => lisa[i].loopEndRec; +} +"samples/stier_loop.wav" => lisa[0].read; + +for (0 => int i; i < lisa.cap(); i++) { + Bus.channels[0] => lisa[i] => Bus.out_left; + lisa[i] => Bus.out_right; +} + +lisa[0] @=> LiSaX @currentSample; + +/* + * Sampler configuration + */ +"primary" => NanoEvent.init @=> NanoEvent @nanoev; + +while (nanoev => now) { + if ("recordToggle" => nanoev.isControl) { + if (nanoev.getBool()) { + currentSample.loop() => currentSample.loopRec; + currentSample.loopEnd() => currentSample.loopEndRec; + 0::samp => currentSample.recPos; + } else if (!currentSample.loopRec() || + currentSample.loopEnd() == 0::samp) { + currentSample.recPos() => currentSample.loopEnd; + } + nanoev.getBool() => currentSample.record; + } else if ("playButton" => nanoev.isControl) { + if (nanoev.getBool()) { + 0::samp => currentSample.playPos; + 1 => currentSample.play; + } + } else if ("stopButton" => nanoev.isControl) { + if (nanoev.getBool()) + 0 => currentSample.play; + } else if ("loopToggle" => nanoev.isControl) { + nanoev.getBool() => currentSample.loop; + } else if (nanoev.CCId >= 23 && nanoev.CCId <= 29) { + /* chooseSampleButton#CCId pressed */ + lisa[nanoev.CCId - 23] @=> currentSample; + } +} -- cgit v1.2.3