diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-06-28 21:48:59 +0200 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-06-28 21:48:59 +0200 |
| commit | 899033e19b308b7a76f8c694f178994c5918361d (patch) | |
| tree | fc876af1e2c7bcd3ff73c26b750afcab710adc0b /lib | |
| parent | 44858d0385a04afb015359371527c83398b92a8f (diff) | |
| download | digitale-debutanten-899033e19b308b7a76f8c694f178994c5918361d.tar.gz | |
fixed live-sampler for stereo sound files (well actually it's still broken but I do know about the issue now)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/LiSaX.ck | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/LiSaX.ck b/lib/LiSaX.ck index 7881c78..63627c9 100644 --- a/lib/LiSaX.ck +++ b/lib/LiSaX.ck @@ -8,9 +8,16 @@ public class LiSaX extends LiSa { SndBuf buf; file => buf.read; + /* buf.samples() returns number of frames (or samples in one channel) */ buf.samples()::samp => duration; for (0 => int i; i < buf.samples(); i++) - valueAt(i => buf.valueAt, i::samp); + /* + * Only get the first channel's data. + * Still broken for stereo files probably because a + * ChucK bug prevents buf.valueAt(i) to work for + * i > buf.samples() + */ + valueAt(i * buf.channels() => buf.valueAt, i::samp); } } |
