#amk 2

#spc
{
    #title   "The Second Sanctuary"
    #game    "DELTARUNE"
    #author  "Toby Fox"
    #comment "Ported by Kevin"
}

#path "second sanctuary"

#samples
{
    #second-sanctuary
    "Illusion of Gaia Harp (84.85%).brr" 
    "Illusion of Gaia Strings.brr"
    "Illusion of Gaia Choir Aah 2.brr"
    "Illusion of Gaia Square.brr"
    "Chrono Trigger Piano.brr"
    "Alcahest Strings.brr"
    "Sine Wave.brr"
    "SGM Kick (32k).brr"
    "SGM Snare (32k).brr"
    "SGM Closed Hi-Hat (32k).brr"
    "SGM Open Hi-Hat (32k).brr"
    "SGM Crash (32k).brr"
}

#instruments
{
    "Illusion of Gaia Harp (84.85%).brr" $ff $f0 $bc $05 $81 ; @30
    "Illusion of Gaia Harp (84.85%).brr" $fe $f0 $bc $05 $84 ; @31
    "Illusion of Gaia Strings.brr"       $00 $00 $7f $09 $23 ; @32
    "Illusion of Gaia Choir Aah 2.brr"   $00 $00 $7f $06 $0c ; @33
    "Illusion of Gaia Square.brr"        $00 $00 $7f $03 $80 ; @34
    "Chrono Trigger Piano.brr"           $ff $ed $b8 $03 $01 ; @35
    "Alcahest Strings.brr"               $fc $e0 $b9 $03 $09 ; @36
    "Sine Wave.brr"                      $af $a0 $b9 $04 $01 ; @37
    "SGM Kick (32k).brr"                 $00 $00 $7f $07 $a8 ; @38
    "SGM Snare (32k).brr"                $00 $00 $7f $07 $a8 ; @39
    "SGM Closed Hi-Hat (32k).brr"        $00 $00 $7f $07 $a8 ; @40
    "SGM Open Hi-Hat (32k).brr"          $00 $00 $7f $07 $a8 ; @41
    "SGM Crash (32k).brr"                $ff $ef $b5 $07 $a8 ; @42
}

"$delay = $05"
"#fir   = $f5$61$12$ff$ff$ff$00$00$00"
"#echo1 = $ef$ff$1a$1a $f1$delay$68$01 #fir"
"#echo2 = $f2$0c$00$00"
"#echo3 = $ef$fe$32$32 $f1$delay$60$01 #fir"
"#echo4 = $ef$fe$32$32 $f1$delay$60$01 #fir"

"@guitar     = @30 h-11 v175 y10"
"@guitarecho = @31 h-11 v105 y10"
"@strings1   = @32 h-35 v195 y10"
"@choir      = @33 h-11 v205 y10"
"@square     = @34 h1 v150 y10"
"@piano      = @35 h1 v180 y10"
"@strings2   = @36 h-11 v202 y10"
"@sine       = @37 h1 v200 y10 $de$0c$10$60 $ea$20"
"@kick       = @38 h1 o4 v255"
"@snare      = @39 h1 o4 v255"
"@chat       = @40 h1 o4 v165"
"@ohat       = @41 h1 o4 v165"
"@crash      = @42 h-7 o4 v200"

"#global_vol = w180"
"#detune     = $ee$98"
"#echofade   = $e8$d8$20"
"#pt_        = $dd$00$08"

"#guitar_rel   = $ed$80$bc"
"#strings1_rel = $ed$80$b6"
"#choir_rel    = $ed$80$b6"
"#square_rel   = $ed$80$bd"
"#piano_rel    = $ed$80$b8"
"#strings2_rel = $ed$80$bb"
"#sine_rel     = $ed$80$b9"
"#crash_rel    = $ed$7f$f0"

"_32 =  =5|^=1"
"_16 = =11|^=1"
"_8  = =23|^=1"
"_4  = =47|^=1"
"_2  = =95|^=1"

#global_vol t69

$f4$02

(!900)[$f4$01 $f4$01]
(!901)[$f4$09]
(!902)[#square_rel]

#0 #detune /
#echo1

[[r1^2 $e1$0c$00 #echo2 r16 $ef$ef$00$00 r2^=10 #global_vol #echo1 r=26]]4

@strings1 o6 q75
d1^1^_4 e1^1^_4 f1^1^_4 > c1^1^_4

#echo3

@square y10 o3
(00)[#echo3
  l4 q7d (!901,-1) (!902,1,$24)
  [[d a > f < d a > e <]]2
  < a+ > a > f << a+ > a > e
  < c a > f < c a > e <
]5
(01)[#echo4
  $f4$09 (!0,0) l8 q7f $f4$01 (!900,-1)
  [[d a > f e < a > d c < d g a]]2
  < a+ > a > f e << a+ >> d c << a+ > g a
  c a > f e < c > d c < c g a16 (!0,0) $f4$01 ^16
]3
(00)5
(01)5

#1 #detune /
[[
  @guitar (10)[o6 l8 q7f
  a+ $dd$00$0c>c< g f g q2f > c < q7f a+ $dd$00$0c>c< g f g]

  @guitarecho
  #echofade r [f r16]5 f16
]]8

(11)[
  @guitar o6 l8 q7f
  [[r a+ $dd$00$0c>c< g f g q2f > c < q7f a+ $dd$00$0c>c< g f g q78 f g q7f]]2
  r a+ $dd$00$0c>c< g f g q2f > c < q7f a+ $dd$00$0c>c< g q7d f g q78 f g q7f
  r a+ $dd$00$0c>c< g f g q2f > c < q7f a+ $dd$00$0c>c< g f > e q78 d q79 e < q7f
]5

(12)[
  @guitar o6 l8 q5f
  [[d $dd$00$06f e f g f $dd$00$06a d+ $dd$00$06f e f g a]]3
  d $dd$00$06f e f g g $dd$00$06a d+ $dd$00$06g f > c < a+ f
]3

(11)5
(12)5

#2 #detune /
[[
  @guitar o6 l8 q7b
  (20)[f c d c q2b f q7b f c < a g >]

  @guitarecho
  #echofade r < [a r16]5 a16 >
  
  @guitar
  (20)

  @guitarecho
  #echofade r < [a r16]5 a16 >
  
  @guitar
  (21)[f c d c q2b f q7b f c < g a >]

  @guitarecho
  #echofade r < [g r16]5 g16 >
  
  @guitar
  (22)[f c d c q2b f q7b f c < g > c]

  @guitarecho
  #echofade r < [g r16]5 g16 >
]]2

(23)[
  @guitar o6 l8 q7b
  [[r f c d c q2b f q7b f c < a g q78 a g > q7b]]2
  r f c d c q2b f q7b f c < q7d g a q78 g a > q7b
  r f c d c q2b f q7b f c < g > c < q78 g > c q7b
]5

(24)[
  @guitar o5 l8 q5b
  [[a g a > c g < a g a > c g <]]2
  g f a > c g < a g a > c g <
  a g a > c f c < a > f d c <
]3

(23)5
(24)5

#3 #detune /
[[
  @guitar o5 l8 q7f
  (30)[d a f g q2f d q7f d a > d c <]

  @guitarecho
  #echofade r > [d r16]5 d16 <
  
  @guitar
  (30)

  @guitarecho
  #echofade r > [d r16]5 d16 <
  
  @guitar
  (31)[< a+ > f > c < g < q2f a+ q7f a+ > f > c e <]

  @guitarecho
  #echofade r > [c r16]5 c16 <
  
  @guitar
  (32)[< b > g > c < g < q2f a+ q7f > c g > c e <]

  @guitarecho
  #echofade r > [c r16]5 c16 <
]]2

[[
(33)[
  @guitar o5 l8 q7f
  r d a f g q2f d q7f d a > d c q78 d c < q7f
]2
(34)[
  r < a+ > f > c < g q2f < a+ q7f a+ > f > q7d c e q78 c e < q7f
  r < b > g > c < g q2f < a+ q7f > c g > c e q78 c e < q7f
]
]]3

(36)[
  l8
  @kick  q7f c_8 @guitar o5 q7f d a
  @snare q7f c_8 @guitar o5 q7f g q2f d
  @kick  q7f c_8 @guitar o5 q7f a > d
  @snare q7f c_8 @guitar o6 q78 d c < q7f
]2
(37)[
  l8
  @kick  q7f c_8 @guitar o5 q7f < a+ > f
  @snare q7f c_8 @guitar o5 q7f g q2f < a+
  @kick  q7f c_8 @guitar o4 q7f > f > q7d c
  @snare q7f c_8 @guitar o6 q78 c e <
  @kick  q7f c_8 @guitar o5 q7f < b > g
  @snare q7f c_8 @guitar o5 q7f g q2f < a+
  @kick  q7f c_8 @guitar o5 q7f g > c
  @snare q7f c_8 @guitar o6 q78 c e <
]

(33)2 (34)

(35)[
  @guitar o5 l8 q5f
  [[d c d e f d c d e f]]2
  < a+ f a+ > c d < a+ f a+ > c d
  c < g > c d e c < g > g f e
]

(38)[
  l8
  [[
  @kick  q7f c_8           @guitar o5 q5f c
  @snare q7f c_8           @guitar o5 q5f e
  @kick  q7f c_8           @guitar o5 q5f d c
  @snare q7f c_8 @kick c_8 @guitar o5 q5f f
  ]]2
  @kick  q7f c_8           @guitar o4 q5f f
  @snare q7f c_8           @guitar o4 q5f > c
  @kick  q7f c_8           @guitar o5 q5f < a+ f
  @snare q7f c_8 @kick c_8 @guitar o5 q5f d
  @kick  q7f c_8           @guitar o5 q5f < g >
  @snare q7f c_8           @guitar o5 q5f d
  @kick  q7f c_8           @guitar o5 q5f c < g >
  @snare q7f c_8 @kick c_8 @guitar o5 q5f e
]2

(33)2 (34)
(33) (36) (37)
[[ (36)2 (37) ]]2
(36) (33) (34)

(35)3
(38)2

#4 #detune /
@guitarecho v0
[[
  o6 l8 q7b
  r16 c

  @guitarecho
  (20) #echofade [r16 < g >]6

  @guitarecho
  (20) #echofade *6

  @guitarecho
  (21) #echofade [r16 < a >]6

  @guitarecho
  (22) #echofade [r16 c]5
]]2
$e8$00$00

(46)[
  y10 q7f
  @kick c4. @snare c4.
]8

(41)[
  @strings1 o5 l4
  ; green
  q7c r f e f g a a4 $ed$80$ad ^1^4 $f4$09
  r f e f g a a2. g2.
]
(42)[
  q7c > c4 $ed$80$aa ^2^2.^2.^2. < $f4$09
  q78 a2.^2. g2.^2.
]
(41)
(43)[
  ; red
  q79 > c2.^2.^2.^2. c2.^2.^2.^2. <
]

(44)[
  q7f y10
  @kick c4 @snare c4 @kick c4. @snare c_8 @kick c4
]4

@strings2 o5 l4
(40)[
  q7b d f a > $eb$00$18$04 c+ $eb$00$00$00 e8. #strings2_rel ^16 $f4$09 $eb$00$0c$fe d $eb$00$00$00 < g $eb$00$18$04 f2^8. r16 $eb$00$00$00
  a8. #strings2_rel ^16 $f4$09 a+ > c < a+ a g > c < e2 > q7c $eb$0c$24$fb e $eb$00$00$00
  c. $eb$0c$24$fb e $eb$00$00$00 c2 e8 c. $eb$0c$24$fb e $eb$00$00$00 c e8 c16 #strings2_rel ^16 $f4$09 e16 #strings2_rel ^16 $f4$09
  l8
  f < a > e < g > c < a g f g a g f g a > c < g > g f e c <
]

@crash y14 l4
$eb$00$90$06 [$f4$09 q7f c. #crash_rel ^. $f4$09 q7c c. #crash_rel ^. $f4$09 q7a c. #crash_rel ^. $f4$09 q79 c. #crash_rel ^.]
$eb$00$90$f8 *
$eb$00$00$00

(41) (42) (41) (43)

(44)12

@strings1 o5 l4 q79
a > f e8 < a > f e8 c < g a #strings1_rel ^8 $f4$09 > f e8
c < g a #strings1_rel ^8 $f4$09 > f e8 < a > f e8 g f g8
> c2 #strings1_rel ^ $f4$09 c < g f > c < g8 f > d e8
c2. #strings1_rel ^ $f4$09 l8 < a a+ > c < c a+ a g a g c f e

#5 #detune /
@guitarecho v0
[[
  o6 l8 q7f
  r16 g
  
  @guitarecho
  (10)
  #echofade [r16 g]5
]]8
$e8$00$00

(70)[
  y8 l8 q7f
  @ohat c @chat c c c @ohat c @chat c
]17

(50)[
  @strings1 o5 l4 q7f
  ;azure
  c $dd$00$18f e < g $dd$00$18>c< a g f f. g. f1 c2 a. a+. g. a.
]
(51)[
  q7c a1. q7b > c1. q7a < a1. q79 g1^_2
]
#strings1_rel ^2. $f4$09
(52)[
  q7e a. g. q7d > c2. q7e < a. g. q7d a2. q7e a. g. > q7d g2. g q7e ^ q7f ^4
]

(71)[
  y8 l8 q7f
  @ohat c4 @chat c4 @ohat c c @chat c @ohat c @chat c c
]4

@strings2
$fa$02$f4 (40) $fa$02$00

@crash l4 y6
$eb$00$90$06 r4. [$f4$09 q7e c. #crash_rel ^. $f4$09 q7b c. #crash_rel ^. $f4$09 q7f c. #crash_rel ^. $f4$09 q78 c. #crash_rel ^.]
$eb$00$90$f8 *
$eb$00$00$00

r4.^2.

@piano o4 l4
q77 r d < a > a g f d

@strings1 o5 l4
q78 d c d e f f2. e2.

@piano o4 l4
q79 f2 ^4

@strings1 o5 l4
(50) < 
q7c a q79 d c d e f f1.
#strings1_rel ^ $f4$09 d c d e f f2. e2.

@piano o3
q79 f2.

@strings1 o5 l4
(52)

(71)4

@choir o3 l4 q7f
  a [a #pt_>f f8 #pt_e e #pt_<a a #pt_>f f8 #pt_e e #pt_c c #pt_<g g #pt_a #choir_rel ^8 $f4$09 a #pt_>f f8 #pt_e
  e #pt_c c #pt_<g g #pt_a #choir_rel ^8 $f4$09 a #pt_>f f8 #pt_e e #pt_<a a #pt_>f f8 #pt_e e #pt_g g #pt_f f8 #pt_g
  g2 #pt_>c #choir_rel ^ $f4$09 c c #pt_<g g #pt_f f #pt_>c c8 #pt_<g g #pt_f f #pt_>d d8 #pt_e
  e2 #pt_c c #choir_rel ^ $f4$09 l8 c #pt_<a a #pt_a+ a+ #pt_>c c #pt_<c c #pt_a+ a+ #pt_a a #pt_g g #pt_a a #pt_g g #pt_c c #pt_f f #pt_e
]
o4 e4 #pt_<a * 

#6 #detune /
@guitarecho v0
[[
  o6 l8 q7f
  r16 e

  @guitarecho
  (30) #echofade [r16 c]6
  
  @guitarecho
  (30) #echofade *6
  
  @guitarecho
  (31) #echofade [r16 e]6

  @guitarecho
  (32) #echofade *5
]]2
$e8$00$00

(99)[r4]24

(46)16

@strings1 o5 l4 q79
; red
r d c d e f f1.
#strings1_rel ^ $f4$09 d c d e f f2. e2.

(46)8

(99)20

@sine
(40) $df

(46)10

@piano o4 l4
q7a r f q7b c > c < a+ a16. a+16. a16. f4 ^2.^4...
q7a c16 a ^..
q79 c32 g8.. e c
^32 > c2 ^8..
q77 d32 q7a f8.. e c
q79 < f32 a8.. g f
c32 f ^8 q78 d32 q79 g32 q7a > c^32
q77 < f32 a ^... ^^32
q7a c... a. a+. g.^32 f^16. e. ^2.^2^8
q7a f e f g a f ^2^2.
a f d g e c < a2.

^2.
(46)6

(99)20

@piano o5 l4 q77
  d f a > c+ $dd$00$18f e8. #piano_rel ^16 $f4$09 d $dd$00$0cc < g f2 $dd$00$18a ^8. #piano_rel ^16 $f4$09
  a8 #piano_rel ^8 $f4$09 a+ > c < a+ a g > c < e2 > e
  c2^8 #piano_rel ^8 $f4$09 c < g f > f g $fa$02$01 g+ $fa$02$00 g
  f2 #piano_rel ^2 $f4$09 l8 < g a g f g a > c < g > g f e c

@strings1 o6 l8 q7a
c1^_4 < a1^_4 f1^_4 g1^_4 a1^_4 > d1^_4
a2. #strings1_rel ^4 $f4$09 f g a < a > g f e f e < a g a

#7 #detune /
(99)123
(70)23
(99)20
(71)8
(70)40
(99)20
(71)16
