\version "2.20.0"
\include "articulate.ly"

\header {
  % Standaard LilyPond-tagline verwijderen
  tagline = ##f
}

global = {
  \key c \major
  \time 4/4
}

diatonicScale = \relative { c' d e f g a b }

%three = \relative c' { c8 d e }
%three = \relative c' { c16 d8 e16 e r }
three = \relative c' { c16 e8 d16 e e16 }

%three = \relative c' { c16 e4.\mordent }
%three = \relative c' { c16 d8 e4\mordent }

%three = \relative c' { c8 \tuplet 3/2 { d8 e4 } }

subject_a = \relative c'' {
  c4
  \modalTranspose c b \diatonicScale \three 
  \modalTranspose c f \diatonicScale \retrograde \three 
  \modalTranspose c c \diatonicScale \retrograde \three 
  \modalTranspose c g \diatonicScale \three 
  \modalTranspose c d \diatonicScale \retrograde \three 
  \modalTranspose c a \diatonicScale \three 
  \modalTranspose c e \diatonicScale \three 
  \modalTranspose c b \diatonicScale \retrograde \three 
  c4
}

right = \relative c'' {
  \global
    r2. r8
  \modalTranspose c b \diatonicScale \subject_a 
  \modalTranspose c f \diatonicScale \retrograde \subject_a 
  \modalTranspose c c \diatonicScale \retrograde \subject_a 
  \modalTranspose c g \diatonicScale \subject_a 
  \modalTranspose c d \diatonicScale \retrograde \subject_a 
  \modalTranspose c a \diatonicScale \subject_a 
  \modalTranspose c e \diatonicScale \subject_a 
  \modalTranspose c b \diatonicScale \retrograde \subject_a 
  <g f' b d>8~ q4 <c, c' g' c e>2. <f, f' c' a' c f>1
}

left = \relative c' {
  \global
  \retrograde {
  \modalTranspose c c, \diatonicScale \retrograde \subject_a 
  \modalTranspose c g, \diatonicScale \subject_a 
  \modalTranspose c d, \diatonicScale \retrograde \subject_a 
  \modalTranspose c a, \diatonicScale \subject_a 
  \modalTranspose c e, \diatonicScale \subject_a 
  \modalTranspose c b, \diatonicScale \retrograde \subject_a 
  \modalTranspose c f, \diatonicScale \retrograde \subject_a 
  \modalTranspose c c, \diatonicScale \subject_a 
  }
}

\score {
  \new PianoStaff \with {
    instrumentName = "Pno."
  } <<
    \new Staff = "right" \with {
      midiInstrument = "acoustic grand"
    } \transpose c ges, \modalTranspose c g, \diatonicScale \right
    \new Staff = "left" \with {
      midiInstrument = "acoustic grand"
    } \transpose c ges, \modalTranspose c g, \diatonicScale { \clef bass \left }
  >>
  \layout { }
}

\score {
  \new PianoStaff \with {
    instrumentName = "Pno."
  } \articulate <<
    \new Staff = "right" \with {
      midiInstrument = "acoustic grand"
    } \transpose c ges, \modalTranspose c g, \diatonicScale \right
    \new Staff = "left" \with {
      midiInstrument = "acoustic grand"
    } \transpose c ges, \modalTranspose c g, \diatonicScale { \clef bass \left }
  >>
  \midi {
    \tempo 4=84
  }
}