\version "2.22.1"
\language "english"

#(set-global-staff-size 18)

\header {
  title = "Main Theme"
  subtitle = "from the game \"Die in the Dungeon\""
  composer = "Adrián González"
  arranger = "transcribed by Tommy Montgomery (https://tmont.com)"
  tagline = ""
}

\paper {
  % system-system-spacing = #'((basic-distance . 0.1) (padding . 4))
}

global = {
  \set Staff.printKeyCancellation = ##f
  \numericTimeSignature
  \compressEmptyMeasures
  \override TupletBracket #'bracket-visibility = #'if-no-beam
  \override MultiMeasureRest.expand-limit = #3
  \override Score.ChordName.font-name = #"Noto Serif"
  \override Score.ChordName.font-size = #0
  \override Score.LyricText.font-name = #"Noto Serif"
  \override Score.LyricText.font-size = #0
  \tempo 4 = 130
  \key c \major
}

main = \relative c' {
  \time 4/4
  \global

  b16^"harpsichord" d f4. g,16 b e4. |
  b16 d f4. c16 a f4. |

  e''8.^"guitar" fs16 ds8. e16 f8. e16 d8 e16 d |
  e8. fs16 ds8. e16 f8. e16 d8 c16 d |

  e8.^"sine wave" fs16 ds8. e16 fs8 gs as bs |

  b,,!16^"harpsichord" d! f!4. g,!16 b! e4. |
  b16 d f4. c16 a f4. |

  gs'8.^"marimba" fs16 ~ fs8 e8 ~ e es16 fs es8 fs16 es |
  <<
    { gs8. fs16 ~ fs8 e!8 ~ e fs?16 gs g8. g16 | } \\
    { b,16_"harpsichord" d f!4. c16 a f!4. | }
  >>

  gs'8. fs16 ~ fs8 e8 ~ e fs16 g a8 b |

  e,16^"xylophone" g8 b16 ~ b4 \tuplet 3/2 { f!16 d b } g4. |
  b16^"harpsichord" d f4. g,16 b e4. |

  <<
    { e'8.^"sine wave" fs16 ds8. e16 f8. e16 d8 c16 d | } \\
    { b,16 d f?4. c16 a f4. | }
  >>

  <<
    { \xNotesOn e''8.^"noise" fs16 ds8. e16 fs8 gs as bs \xNotesOff | } \\
    { b,,16 d f?4. g,16 b e4. | }
  >>
  b!16 d! f!4. c16 a! f!4. |

  e'16^"xylophone" g8 b16 ~ b4 \tuplet 3/2 { f16 d b } g4. |

  bs'8^"harpsichord" as gs fs ds8. cs16 b!4 |
  e8 fs gs fs ef8. f16 g4 |

  \xNotesOn e'!8.^"noise" fs16 ds8. e16 fs8 gs as bs \xNotesOff |

  b,,!16^"harpsichord" d! f!4. g,!16 b e4. |
  e16^"xylophone" g8 b16 ~ b4 \tuplet 3/2 { f16 d b } g4. | \bar "|."

}

drumBeatA = \drummode {
  <bd sn>4 sn <bd sn> sn |
}

drumBeatB = \drummode {
  <bd sn>4 sn <bd sn> sn8 bd |
}

drumkit = \drummode {
  \global
  \repeat unfold 3 {
    \drumBeatA \drumBeatB
  }
  R1 |

  \drumBeatB | \drumBeatA

  \drumBeatB | \drumBeatB
  \drumBeatA
  R1 |

  sn8. sn16 sn8. sn16 sn8 sn sn sn |

  \drumBeatA

  <bd sn>4 sn <bd sn>4 q |
  \drumBeatB | \drumBeatA |

  sn8. sn16 sn8. sn16 sn8 sn sn sn |
  \drumBeatA | R1 |

}


mainStaff = \new Staff \with { instrumentName = "Melody" } \main
drumStaff = \new DrumStaff \with { instrumentName = "Drums" } \drumkit

\score {
  <<
    \mainStaff
    \drumStaff
  >>
  \layout {
    % indent = #0
    \context {
      % \Staff \RemoveEmptyStaves
      % \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
      % \override VerticalAxisGroup.remove-first = ##t
    }
  }
}