Midi/midi.ily

Zur Navigation springen Zur Suche springen

Lilypond-Code

%% ein Score wird anhand einer Liste in verschiedenen Tempi abgespielt
%% das Prefix kann angegeben werden
make-midi-list =
#(define-void-function (name score tempolist)
   ((string? #f) ly:score? list?)
   (for-each
    (lambda (tempo)
      (ly:book-process
       (apply
        ly:make-book
        $defaultpaper
        $defaultheader
        (list score))
       $defaultpaper
       #{
         \midi {
           \tempo 4 = $tempo
           \context {
             \Staff
             \name ConcertinaStaff
             \alias Staff
             midiInstrument = #"concertina"
             %midiMaximumVolume = #0.99
           }
           \context {
             \Staff
             \name FluteStaff
             \alias Staff
             midiInstrument = #"pan flute"
             %midiMaximumVolume = #0.7
           }
           \context {
             \Staff
             \name BassStaff
             \alias Staff
             midiInstrument = #"acoustic bass"
             %midiMaximumVolume = #0.7
           }
           \context {
             \Staff
             \name VibraStaff
             \alias Staff
             midiInstrument = #"vibraphone"
           }
           \context {
             \Staff
             \name HarmonicaStaff
             \alias Staff
             midiInstrument = #"harmonica"
           }
           \context {
             \Staff
             \name AccordionStaff
             \alias Staff
             midiInstrument = #"accordion"
           }
           \context {
             \Staff
             \name FiddleStaff
             \alias Staff
             midiInstrument = #"fiddle"
           }
           \context {
             \Score
             \accepts ConcertinaStaff
             \accepts FluteStaff
             \accepts BassStaff
             \accepts VibraStaff
             \accepts FiddleStaff
             \accepts HarmonicaStaff
             \accepts AccordionStaff
           }
         }
       #}
       (format #f "~a_~a"
         (or name "midi")
         tempo)))
    tempolist))

\layout {
  \context {
    \Staff
    \name ConcertinaStaff
    \alias Staff
  }
  \context {
    \Staff
    \name FluteStaff
    \alias Staff
  }
  \context {
    \Staff
    \name BassStaff
    \alias Staff
  }
  \context {
    \Staff
    \name VibraStaff
    \alias Staff
  }
  \context {
    \Staff
    \name FiddleStaff
    \alias Staff
  }
  \context {
    \Staff
    \name HarmonicaStaff
    \alias Staff
  }
  \context {
    \Staff
    \name AccordionStaff
    \alias Staff
  }
  \context {
    \Score
    \accepts ConcertinaStaff
    \accepts FluteStaff
    \accepts BassStaff
    \accepts VibraStaff
    \accepts FiddleStaff
    \accepts HarmonicaStaff
    \accepts AccordionStaff
  }
}