summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-06-25 17:09:11 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-06-25 17:09:11 +0200
commit44858d0385a04afb015359371527c83398b92a8f (patch)
tree11395f329a3c06d5300f138c361d93a6b972b163
parent3b6c4cfc13ae5528d8d9e5f550b4a6e6c206512c (diff)
downloaddigitale-debutanten-44858d0385a04afb015359371527c83398b92a8f.tar.gz
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
-rw-r--r--live_sampler.ck49
1 files changed, 49 insertions, 0 deletions
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;
+ }
+}