💾 Archived View for thrig.me › music › lilypond captured on 2023-06-14 at 14:40:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-09-08)

-=-=-=-=-=-=-

Lilypond

Lilypond is a music typesetting program, usually available in the ports or package system. It can produce sheet music, or adequate MIDI files.

Template

I like to split the MIDI from the Score, though both use the same music sections. This allows the score and MIDI to vary; perhaps the score uses a volta repeat while the MIDI unfolds the same. Or, I can disable sections in the MIDI block to only playback particular bits. Or, the score can have a RhythmicStaff for reference that is not part of the MIDI.

For example:

    % LilyPond engraving system - https://www.lilypond.org/
    \version "2.22.2"
    \include "articulate.ly"
    \header {
      title = "TODO FIXME"
      tagline = #f
    }

    tempoandetc = {
      \tempo 4=120
      \time 4/4
      \key c \minor
    }

    sopa = \relative c'' {
      c4 c c c
    }

    sopb = \relative c'' {
      d4-. d( d) d-!
    }

    msop = {
      \tempoandetc 
      \set Staff.midiInstrument = #"french horn"
      \articulate {
        % here is where to twiddle what parts to listen to
        %\sopa
        \sopb
      }
    }
    themidi = {
      <<
        \set Score.midiChannelMapping = #'staff
        \new Staff = "soprano" \msop
      >>
    }
    \score {
      \themidi
      \midi { }
    }

    ssop = {
      \tempoandetc
      \set Staff.instrumentName = #"French Horn"
      % TODO
      %\transpose c g {
        \sopa
        \sopb
      %}
      r8 r r r r r
      % TODO
      %\bar "|."
    }
    thescore = {
      <<
        \new Staff << \clef sop \ssop >>
        \new RhythmicStaff {
          c8 c c c c c c c c c c c c c c c
          c8 c c c c c c c c c c c c c c c
        }
      >>
    }
    \score {
      \thescore
      \layout { }
    }