ct.put(0.25, 1);
ct.put(1.0, 0);
ct.put(1.25, -1);
ct.put(2.0, 0);
// ct.finish();
ProcessElement si=new Sine();
Mixer fmix=new Mixer();
mul fmul=new mul();
mul fmul2=new mul();
Mixer fmix2=new Mixer();
Envelope fmenv=new Envelope();
CustomWaveform ts=new CustomWaveform();
ts.setTable(ct);
ProcessElement cw=new CustomWave();
advancerRegistry.registerAdvancer(cw);
advancerRegistry.registerAdvancer(si);
advancerRegistry.registerAdvancer(mix);
advancerRegistry.registerAdvancer(fmix);
advancerRegistry.registerAdvancer(fmix2);
advancerRegistry.registerAdvancer(fmul2);
advancerRegistry.registerAdvancer(fmenv);
advancerRegistry.registerAdvancer(fmul);
advancerRegistry.registerAdvancer(env1);
try{
mix.setSource(-1, cw, StandardParameters.OUT.i);
mix.setSource(-1, env1, StandardParameters.OUT.i);
gate.setSource(StandardParameters.FREQUENCY.i, beats, StandardParameters.OUT.i);
gate.setSource(StandardParameters.DUTYCYCLE.i, ConstStream.c(0.5), StandardParameters.OUT.i);
cw.setSource(StandardParameters.FREQUENCY.i, fmix2, StandardParameters.OUT.i);
cw.setSource(StandardParameters.TABLE.i, ts, StandardParameters.TABLE.i);
env1.setSource(StandardParameters.A.i, A, StandardParameters.OUT.i);
env1.setSource(StandardParameters.D.i, D, StandardParameters.OUT.i);
env1.setSource(StandardParameters.S.i, S, StandardParameters.OUT.i);
env1.setSource(StandardParameters.R.i, R, StandardParameters.OUT.i);
env1.setSource(StandardParameters.SYNC.i, gate, StandardParameters.OUT.i);
fmenv.setSource(StandardParameters.A.i, A2, StandardParameters.OUT.i);
fmenv.setSource(StandardParameters.D.i, D2, StandardParameters.OUT.i);
fmenv.setSource(StandardParameters.S.i, S2, StandardParameters.OUT.i);
fmenv.setSource(StandardParameters.R.i, R2, StandardParameters.OUT.i);
fmenv.setSource(StandardParameters.SYNC.i, gate, StandardParameters.OUT.i);
si.setSource(StandardParameters.FREQUENCY.i, fmix, StandardParameters.OUT.i);
fmix.setSource(-1, fmenv, StandardParameters.OUT.i);
fmix.setSource(-1, new ConstStream(-10), StandardParameters.OUT.i);
fmix.setSource(-2, new ConstStream(10), StandardParameters.OUT.i);
fmix2.setSource(-1, si, StandardParameters.OUT.i);
fmix2.setSource(-1, fmenv, StandardParameters.OUT.i);