summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-06-25 17:08:07 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-06-25 17:08:07 +0200
commit3b6c4cfc13ae5528d8d9e5f550b4a6e6c206512c (patch)
tree34997b876a399ccf8fa7d9ef41144ce1c0613e64
parentd18ff8ed2bb1def654e04b5826ed3d7b3f67c734 (diff)
downloaddigitale-debutanten-3b6c4cfc13ae5528d8d9e5f550b4a6e6c206512c.tar.gz
add LiSaX class: extension of LiSa that allows loading of audio files
-rw-r--r--lib.ck1
-rw-r--r--lib/LiSaX.ck16
2 files changed, 17 insertions, 0 deletions
diff --git a/lib.ck b/lib.ck
index 8da23c9..e3c19c8 100644
--- a/lib.ck
+++ b/lib.ck
@@ -1,4 +1,5 @@
/* Includes */
+Machine.add("lib/LiSaX.ck");
Machine.add("lib/SampOsc.ck");
Machine.add("lib/Clipper.ck");
Machine.add("lib/Element.ck");
diff --git a/lib/LiSaX.ck b/lib/LiSaX.ck
new file mode 100644
index 0000000..7881c78
--- /dev/null
+++ b/lib/LiSaX.ck
@@ -0,0 +1,16 @@
+/*
+ * Version of LiSa that supports reading in files (like a SndBuf)
+ */
+public class LiSaX extends LiSa {
+ fun void
+ read(string file)
+ {
+ SndBuf buf;
+
+ file => buf.read;
+ buf.samples()::samp => duration;
+
+ for (0 => int i; i < buf.samples(); i++)
+ valueAt(i => buf.valueAt, i::samp);
+ }
+}