##synth
##include helper

num Tick()
{
	return SinOsc(frequency, SinOsc(frequency*param['f'])*Adsr(0.2, 0.3, 0.5, 0.2)*4)*Adsr(0.01, 0.2, 0.2, 0.1, true);
}

//a second synth, @I1 chooses this one(counts start at 0)
##synth
##include helper

MoogFilter fil = new MoogFilter();
num Tick()
{
	fil.cutoff = param['f'];
	return fil.Tick(SqrOsc(frequency)*Adsr(0.001, 0.5, 0.0, 0.1, true))*0.3;
}

##tune

//multiple channels, A and B use the first synth, C the second synth
A @I0 @O3 @V0.2 @f1
B @I0 @O4 @V0.3 @f0.5
C @I1 @O2 @V0.5 @f0.2


//the notes between [ and ] are a chord, optionally like at notes the length afterwars
//instruments can be changed after the first time(like every command can)
//the @f0.5 stays at 0.5, even though the synth is a different one
//so instead of being multiplied with frequency it now is the cutoff value
//the | characters are ignored in this context, they are just for organization
A | [c e g]2 | [c f a] | [d g bb] | [e g >c]    | c2
B | c4 e     | f a @I1 | g d      | e c         |
C | c4. c8   | f4. f8  | g4. g8   | c4. c8    c | c2
