Event event=new Event();
SawTooth st=new SawTooth();
WhiteNoise pn=new WhiteNoise();
mul noisevol=new mul();
mul sawvol=new mul();
Envelope noiseenv=new Envelope();
Envelope sawenv=new Envelope();
Sine dclfo1=new Sine();
Sine dclfo2=new Sine();
mul lfomul1=new mul(), lfomul2=new mul();
mul lfomul1a=new mul(), lfomul2a=new mul();
plus lfopl1=new plus(), lfopl2=new plus();
Mixer out=new Mixer();
try{
lfomul1.setSource(IN_IMAG.i, ConstStream.c(n.frequency), OUT.i);
lfomul1.setSource(IN.i, ConstStream.c(0.00033), OUT.i);
dclfo1.setSource(FREQUENCY.i, lfomul1, OUT.i);
lfomul1a.setSource(IN_IMAG.i, dclfo1, OUT.i);
lfomul1a.setSource(IN.i, ConstStream.c(0.333), OUT.i);
lfopl1.setSource(IN_IMAG.i, lfomul1a, OUT.i);
lfopl1.setSource(IN.i, ConstStream.c(0.5), OUT.i);
lfomul2.setSource(IN_IMAG.i, ConstStream.c(n.frequency), OUT.i);
lfomul2.setSource(IN.i, ConstStream.c(0.00013), OUT.i);
dclfo2.setSource(FREQUENCY.i, lfomul2, OUT.i);
lfomul2a.setSource(IN_IMAG.i, dclfo2, OUT.i);
lfomul2a.setSource(IN.i, ConstStream.c(0.133), OUT.i);
lfopl2.setSource(IN_IMAG.i, lfomul2a, OUT.i);
lfopl2.setSource(IN.i, lfopl1, OUT.i);
st.setSource(FREQUENCY.i, ConstStream.c(n.frequency), OUT.i);
st.setSource(DUTYCYCLE.i, lfopl2, OUT.i);
out.setSource(-1, sawvol, OUT.i);
out.setSource(-1, ConstStream.c(0.5*effvol), OUT.i);
out.setSource(-2, noisevol, OUT.i);
out.setSource(-2, ConstStream.c(0.4*effvol), OUT.i);
sawvol.setSource(IN_IMAG.i, st, OUT.i);
noisevol.setSource(IN_IMAG.i, pn, OUT.i);
sawvol.setSource(IN.i, sawenv, OUT.i);
noisevol.setSource(IN.i, noiseenv, OUT.i);
noiseenv.setSource(SYNC.i, event, GATE.i);
sawenv.setSource(SYNC.i, event, GATE.i);
noiseenv.setSource(A.i, ConstStream.c(0.02), OUT.i);
noiseenv.setSource(D.i, ConstStream.c(0.23), OUT.i);
noiseenv.setSource(S.i, ConstStream.c(0.05), OUT.i);
sawenv.setSource(A.i, ConstStream.c(0.02), OUT.i);
sawenv.setSource(D.i, ConstStream.c(1), OUT.i);
if(n.legato){
sawenv.setSource(S.i, ConstStream.c(0.3), OUT.i);
sawenv.setSource(R.i, ConstStream.c(1), OUT.i);
noiseenv.setSource(R.i, ConstStream.c(1), OUT.i);
}else{
sawenv.setSource(S.i, ConstStream.c(0.2), OUT.i);
sawenv.setSource(R.i, ConstStream.c(0.01), OUT.i);
noiseenv.setSource(R.i, ConstStream.c(0.01), OUT.i);
}
}catch(UnknownConnectionException e){
e.printStackTrace();
}catch(TypeMismatchException e){