diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-06-25 17:08:07 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-06-25 17:08:07 +0200 |
commit | 3b6c4cfc13ae5528d8d9e5f550b4a6e6c206512c (patch) | |
tree | 34997b876a399ccf8fa7d9ef41144ce1c0613e64 | |
parent | d18ff8ed2bb1def654e04b5826ed3d7b3f67c734 (diff) | |
download | digitale-debutanten-3b6c4cfc13ae5528d8d9e5f550b4a6e6c206512c.tar.gz |
add LiSaX class: extension of LiSa that allows loading of audio files
-rw-r--r-- | lib.ck | 1 | ||||
-rw-r--r-- | lib/LiSaX.ck | 16 |
2 files changed, 17 insertions, 0 deletions
@@ -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); + } +} |