\include "articulate.ly"

\version "2.22.1"
\language "english"

#(set-global-staff-size 18)

\header {
  title = "Rogue Fable III - Main Dungeon"
  composer = "music by Nooskewl Games (https://nooskewl.com)"
  tagline = ""
  arranger = "transcribed by Tommy Montgomery (https://tmont.com)"
}

\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
  \key e \minor
  \tempo 4 = 94
}

elecPiano = \relative c'' {
  \global

  \repeat unfold 2 {
    e16( fs e d e8) b e b c b |
    a'16( b a g a8) e r2 |
  }

  \repeat unfold 2 {
    e16( fs e d e8) b r b c b |
    a'16( b a g a8) e r2 |
  }

  e16( fs e d e8) b r b c b | R1 |
  e,16( fs g b e8)-. b-. g-. fs-. g( b)-. |
  c16( d c b a8)-. g-. a-. b-. c-. b-. |
  e,16( fs g b e8)-. fs-. g-. fs-. e-. b'-. |
  c16( b a g fs8)-. a-. g-. a16( g fs8)-. d-. |
  e8 r8 r4 r2 | R1 |

  \bar "|."
}

bass = \relative c, {
  \global
  \clef bass

  \repeat unfold 8 {
    e2. g4 | a2 c4 b |
  }
}

drumkit = \drummode {
  \global

  \stemDown

  \repeat unfold 2 {
    bd4 sn bd sn |
    bd sn bd sn8 sn |
  }

  \repeat unfold 5 {
    <<
      {
        \override NoteHead.font-size = #-3 tommh16 16 16 16 8 8 \revert NoteHead.font-size hh8 hh r4 |
        \override NoteHead.font-size = #-3 tomh16 16 16 16 8 8 \revert NoteHead.font-size hh8 hh r4 |
      } \\
      { bd4 sn bd sn | bd sn bd sn8 sn | }
    >>
  }

  <<
    {
      \override NoteHead.font-size = #-3 tommh16 16 16 16 8 8 \revert NoteHead.font-size hh8 hh r4 |
      \override NoteHead.font-size = #-3 tomh16 16 16 16 8 8 \revert NoteHead.font-size r2|
    } \\
    {
      bd4 sn bd sn |
      bd4 sn bd16 bd bd8 r4 |
    }
  >>
}

lead = \relative c'' {
  \global

  e2 r4 g | a2 r2 | e2 r4 b'4 | a4 r8 e ~ e4 r |
  \repeat unfold 2 {
    b'16 a g fs e4 r8 fs g4 |
    c16 b c8 a4 r2 |
  }

  e2 r2 | R1 | R1*6 |

}

leadStaff = \new Staff \with {
  instrumentName = "Lead"
  midiInstrument = #"pad 1 (new age)"
  midiMinimumVolume = #.5
  midiMaximumVolume = #.5
} {
  \lead
}

elecPianoStaff = \new Staff \with {
  instrumentName = "E. Piano"
  midiInstrument = #"electric piano 1"
  midiMinimumVolume = #0.5
  midiMaximumVolume = #0.5
} {
  \elecPiano
}

bassStaff = \new Staff \with {
  instrumentName = "Bass"
  midiInstrument = #"electric bass (finger)"
  midiMinimumVolume = #0.9
  midiMaximumVolume = #0.9
} {
  \bass
}

drumStaff = \new DrumStaff \with {
  instrumentName = "Drums"
  %midiInstrument = #"tr-808 kit"
  midiMinimumVolume = #0.8
  midiMaximumVolume = #0.8
} {
  \drumkit
}

\score {
  <<
    \leadStaff
    \elecPianoStaff
    \bassStaff
    %\percussionStaff
    \drumStaff
  >>
  \layout {
    \context {
      \Score \omit BarNumber
    }
    \context {
      % \Staff \RemoveEmptyStaves
      \override Glissando.minimum-length = #4
      \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
      \override Glissando.thickness = #2
      \override VerticalAxisGroup.remove-first = ##t
    }
  }
}

\score {
  \articulate \unfoldRepeats {
    <<
      \leadStaff
      \elecPianoStaff
      \transpose c c, \bassStaff
      \drumStaff
  >>
  }
  \midi {}
}