0 EPIANO      = 0
0 BRASS       = 1
0 ORCHESTRA   = 2
0 ORGAN       = 3
0 STRINGS     = 4
0 HARP        = 5
0 TUBULARBELL = 6
0 CYMBAL      = 7

0 MAINPART11  = EPIANO
0 MAINPART12  = TUBULARBELL
0 MAINPART13  = BRASS
0 MAINPART2   = STRINGS
0 CODEPART    = ORCHESTRA

0 ACLEAR()

# epiano

0 AUNITSET(EPIANO)

0 O1 = AUNIT(  , 512, A_ENVFIXED)
0 O2 = AUNIT(O1,    , A_ENVFIXED)
0 O3 = AUNIT(  , 512, A_ENVFIXED)
0 O4 = AUNIT(O3,    , A_ENVFIXED)

0 AOSC(O1)
0 AOSC(O2)
0 AOSC(O3)
0 AOSC(O4,, 1024*14)

0 AENVPOINT(O1,,   0,1000)
0 AENVPOINT(O1,,1000,   0)

0 AENVPOINT(O2,,   0,1000)
0 AENVPOINT(O2,, 500,   0)

0 AENVPOINT(O3,,   0,1000)
0 AENVPOINT(O3,, 250,   0)

0 AENVPOINT(O4,,   0,1000)
0 AENVPOINT(O4,, 250,   0)

# brass

0 AUNITSET(BRASS)

0 O1 = AUNIT(A_OUTPUT, 256)
0 O2 = AUNIT(A_OUTPUT, 256)
0 O3 = AUNIT(A_OUTPUT, 256)
0 O4 = AUNIT(A_OUTPUT, 256)

0 AOSC(O1,  800, 1024/2,, A_SIN)
0 AOSC(O2,  700, 1024  ,, A_SIN)
0 AOSC(O3, 1000, 1024  ,, A_SIN)
0 AOSC(O4,  600, 1024*2,, A_SIN)

0 AADDOUT(O1, O1, 500)
0 AADDOUT(O2, O2, 600)
0 AADDOUT(O3, O3, 400)
0 AADDOUT(O4, O4, 300)

0 AENVPOINT(O1,,   0,   0)
0 AENVPOINT(O1,, 100,1000)
0 AENVPOINT(O1,, 700,1000)
0 AENVPOINT(O1,,1000,   0)

0 AENVPOINT(O2,,   0,   0)
0 AENVPOINT(O2,, 200,1000)
0 AENVPOINT(O2,, 600,1000)
0 AENVPOINT(O2,,1000,   0)

0 AENVPOINT(O3,,   0,   0)
0 AENVPOINT(O3,, 300,1000)
0 AENVPOINT(O3,, 500,1000)
0 AENVPOINT(O3,,1000,   0)

0 AENVPOINT(O4,,   0,   0)
0 AENVPOINT(O4,, 350,1000)
0 AENVPOINT(O4,, 450,1000)
0 AENVPOINT(O4,,1000,   0)

# orchestra

0 AUNITSET(ORCHESTRA)

0 O1 = AUNIT(A_OUTPUT, 256)
0 O2 = AUNIT(A_OUTPUT, 256)
0 O3 = AUNIT(A_OUTPUT, 256)
0 O4 = AUNIT(A_OUTPUT, 256)

0 AOSC(O1,  800, 1024/2   ,, A_SAWTOOTH)
0 AOSC(O2,  700, 1024  -10,, A_SAWTOOTH)
0 AOSC(O3, 1000, 1024     ,, A_SAWTOOTH)
0 AOSC(O4,  600, 1024*2+10,, A_SAWTOOTH)

0 AADDOUT(O1, O1, 500)
0 AADDOUT(O2, O2, 600)
0 AADDOUT(O3, O3, 400)
0 AADDOUT(O4, O4, 300)

0 AENVPOINT(O1,,   0,   0)
0 AENVPOINT(O1,, 100,1000)
0 AENVPOINT(O1,, 700,1000)
0 AENVPOINT(O1,,1000,   0)

0 AENVPOINT(O2,,   0,   0)
0 AENVPOINT(O2,, 200,1000)
0 AENVPOINT(O2,, 600,1000)
0 AENVPOINT(O2,,1000,   0)

0 AENVPOINT(O3,,   0,   0)
0 AENVPOINT(O3,, 300,1000)
0 AENVPOINT(O3,, 500,1000)
0 AENVPOINT(O3,,1000,   0)

0 AENVPOINT(O4,,   0,   0)
0 AENVPOINT(O4,, 350,1000)
0 AENVPOINT(O4,, 450,1000)
0 AENVPOINT(O4,,1000,   0)

# organ

0 AUNITSET(ORGAN)

0 O1 = AUNIT(A_OUTPUT, 256)
0 O2 = AUNIT(A_OUTPUT, 256)
0 O3 = AUNIT(A_OUTPUT, 256)
0 O4 = AUNIT(A_OUTPUT, 256)

0 AOSC(O1, 1000, 1024  ,, A_SIN)
0 AOSC(O2,  700, 1024*2,, A_SIN)
0 AOSC(O3,  700, 1024*4,, A_SIN)
0 AOSC(O4,  700, 1024*8,, A_SIN)

0 AADDOUT(O1, O1, 200)
0 AADDOUT(O2, O2, 200)
0 AADDOUT(O3, O3, 200)
0 AADDOUT(O4, O4, 200)

# strings

0 AUNITSET(STRINGS)

0 O1 = AUNIT(A_OUTPUT, 256)
0 O2 = AUNIT(A_OUTPUT, 256)
0 O3 = AUNIT(A_OUTPUT, 256)
0 O4 = AUNIT(A_OUTPUT, 256)

0 AOSC(O1,  800, 1024  ,, A_SQUARE)
0 AOSC(O2,  700, 1024+3,, A_SQUARE)
0 AOSC(O3, 1000, 1024*2,, A_SQUARE)
0 AOSC(O4,  600, 1024*3,, A_SQUARE)

0 AADDOUT(O1, O1, 500)
0 AADDOUT(O2, O2, 600)
0 AADDOUT(O3, O3, 400)
0 AADDOUT(O4, O4, 300)

0 AENVPOINT(O1,,   0,   0)
0 AENVPOINT(O1,, 200,1000)
0 AENVPOINT(O1,, 700,1000)
0 AENVPOINT(O1,,1000,   0)

0 AENVPOINT(O2,,   0,   0)
0 AENVPOINT(O2,, 250,1000)
0 AENVPOINT(O2,, 600,1000)
0 AENVPOINT(O2,,1000,   0)

0 AENVPOINT(O3,,   0,   0)
0 AENVPOINT(O3,, 300,1000)
0 AENVPOINT(O3,, 500,1000)
0 AENVPOINT(O3,,1000,   0)

0 AENVPOINT(O4,,   0,   0)
0 AENVPOINT(O4,, 350,1000)
0 AENVPOINT(O4,, 450,1000)
0 AENVPOINT(O4,,1000,   0)

# harp

0 AUNITSET(HARP)

0 O1 = AUNIT(A_OUTPUT, 512, A_ENVFIXED)
0 O2 = AUNIT(A_OUTPUT, 512, A_ENVFIXED)

0 AOSC(O1, 1000, 1024  ,, A_SIN)
0 AOSC(O2,  500, 1024*2,, A_SIN)

0 AADDOUT(O1, O1, 100)
0 AADDOUT(O2, O2, 100)

0 AENVPOINT(O1,,   0,1000)
0 AENVPOINT(O1,, 100, 500)
0 AENVPOINT(O1,,4000,   0)

0 AENVPOINT(O2,,   0,1000)
0 AENVPOINT(O2,, 100, 500)
0 AENVPOINT(O2,, 800,   0)

# tubular bell

0 AUNITSET(TUBULARBELL)

0 O1 = AUNIT(  ,    , A_ENVFIXED)
0 O2 = AUNIT(O1,1000, A_ENVFIXED)

0 AOSC(O1)
0 AOSC(O2,,1024*35/10)

0 AENVPOINT(O1,,   0,1000)
0 AENVPOINT(O1,, 100, 900)
0 AENVPOINT(O1,,4000,   0)

0 AENVPOINT(O2,,   0,1000)
0 AENVPOINT(O2,,2000,   0)

# cymbal

0 AUNITSET(CYMBAL)

0 O1 = AUNIT(  , 700, A_ENVFIXED)
0 O2 = AUNIT(O1,1000)

0 AOSC(O1,, 256)
0 AOSC(O2,, 256)

0 AADDOUT(O2,O2,8000)

0 AENVPOINT(O1,,   0,1000)
0 AENVPOINT(O1,, 100, 500)
0 AENVPOINT(O1,, 500, 200)
0 AENVPOINT(O1,,2000, 100)
0 AENVPOINT(O1,,4000,   0)



# tempo

0 APLAY("T240", A_SAVE)

# main part

0 AUNITSET(MAINPART11)

0 APLAY("V120L4", A_SAVE|A_NEW)
0 APLAY("C4.C8 C4.D8 E4.E8 E4.E8", A_SAVE)
0 APLAY("D4.C8 D4.E8 C2   <G2>", A_SAVE)
0 APLAY("E4.E8 E4.F8 G4.G8 G4.G8", A_SAVE)
0 APLAY("F4.E8 F4.G8 E4.R8 R4.G8", A_SAVE)
0 APLAY("E4.R8 R4.G8 E4.R8 R4.G8", A_SAVE)
0 APLAY("E4.G8 E4.G8 E2", A_SAVE)

0 AUNITSET(MAINPART12)

0 APLAY("V80L4", A_SAVE|A_NEW)
0 APLAY("R4.R8 R4.R8 R4.R8 R4.R8", A_SAVE)
0 APLAY("R4.R8 R4.R8 R4.R8 R4.R8", A_SAVE)
0 APLAY("C4.C8 C4.D8 E4.E8 E4.E8", A_SAVE)
0 APLAY("D4.C8 D4.E8 C2   <G2>", A_SAVE)
0 APLAY("E4.E8 E4.F8 G4.G8 G4.G8", A_SAVE)
0 APLAY("F4.E8 F4.G8 E4.R8 R4.R8", A_SAVE)

0 AUNITSET(MAINPART13)

0 APLAY("V180L4", A_SAVE|A_NEW)
0 APLAY("R4.R8 R4.R8 R4.R8 R4.R8", A_SAVE)
0 APLAY("R4.R8 R4.R8 R4.R8 R4.R8", A_SAVE)
0 APLAY("R4.R8 R4.R8 R4.R8 R4.R8", A_SAVE)
0 APLAY("R4.R8 R4.R8 R4.R8 R4.R8", A_SAVE)
0 APLAY("C4.C8 C4.D8 E4.E8 E4.E8", A_SAVE)
0 APLAY("D4.C8 D4.E8 C2    R2", A_SAVE)

# main part 2

0 AUNITSET(MAINPART2)

0 APLAY("V180L4", A_SAVE|A_NEW)
0 APLAY("C4.C8 C4.D8 E4.E8 E4.E8", A_SAVE)
0 APLAY("D4.C8 D4.E8 C2   <G2>", A_SAVE)
0 APLAY("E4.E8 E4.F8 G4.G8 G4.G8", A_SAVE)
0 APLAY("F4.E8 F4.G8 E4.R8 R4.G8", A_SAVE)
0 APLAY("E4.R8 R4.G8 E4.R8 R4.G8", A_SAVE)
0 APLAY("E4.G8 E4.G8 E2", A_SAVE)

# code part

0 AUNITSET(CODEPART)

0 APLAY("V160L1", A_SAVE|A_NEW)
0 APLAY("(CEG)(CEG)(<B>DF)(CEG)", A_SAVE)
0 APLAY("(CEG)(CEG)(<B>DF)(CEG)", A_SAVE)
0 APLAY("(CEG)(CEG)(<B>DF)(CEG)", A_SAVE)

# play

#0 APLAY("",,,"silent-lakeside.wav")
0 APLAY("")
