From a6fcf83f27a944ca455425f3cd3a037cf3952dd1 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 5 Sep 2012 04:51:58 +0200 Subject: use array initializers objects must be casted to UGen (perhaps a bug since the array types should be compatible) --- lfo.ck | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lfo.ck b/lfo.ck index 57f29a2..1a64444 100644 --- a/lfo.ck +++ b/lfo.ck @@ -1,11 +1,10 @@ /* * Configurable LFOs */ -/* FIXME: ChucK bug prevents elegant initialization with [new ..., ...] */ -UGen @lfo[3]; -new SinOsc @=> lfo[0]; -new PulseOsc @=> lfo[1]; -new SampOsc @=> lfo[2]; +[new SinOsc $ UGen, + new PulseOsc $ UGen, + new SampOsc $ UGen] @=> UGen @lfo[]; + /* BUG WORKAROUND: setting lfo[2].gain crashes */ 10 => (lfo[2] $ SampOsc).gain; /* preamp, to get value range 0 to 1000 */ @@ -18,9 +17,8 @@ for (0 => int i; i < lfo.cap(); i++) 0 => int cur_lfo; -UGen @osc[2]; -new SawOsc @=> osc[0]; -new PulseOsc @=> osc[1]; +[new SawOsc $ UGen, + new PulseOsc $ UGen] @=> UGen @osc[]; 0 => int cur_osc; -- cgit v1.2.3