помощь в добавлении миди в файл lilypond

Я набирал православные литургии, используя григорианский стиль в lilypond. Для «речитативов», где много слогов поются на одну ноту, я фактически разделил их и написал четвертные ноты для каждого. Затем кто-то помог мне с шаблоном (без григорианского стиля), в котором была четвертная нота в начале речитатива и одна в конце, но я не уверен (в моих файлах была строка 1 для всех 4 частей), как добавить сзади миди.

Вот файл, который мне прислали, и мне нужна помощь в добавлении миди:

\version "2.18.0"
\include "english.ly"
\include "gregorian.ly"
\layout {
  \context{
    \Score \override SpacingSpanner.packed-spacing = ##f 
}
\context{
    \Lyrics \override LyricHyphen.minimum-distance = #3.75
    \override LyricSpace.minimum-distance = #2.75
  }
}

\header {
  title = \markup\bold\fontsize #2.0 
    {"Kontakion"}
  subtitle = \markup\bold\fontsize #2.0 
    {"18 August - Martyrs Florus & Laurus"}
  subsubtitle = ""
  poet = \markup\bold\fontsize #1.25 
    {"Tone 8"}
  composer =  \markup\bold\fontsize #1.25 
    {"Abbreviated ''Bulgarian'' Chant"}
   tagline = "Translation - OCA Traditional English"  
}


% #(set-global-staff-size 22)
global = {
  \key f \major
  \override Staff.NoteHead.style = #'altdefault
  \override Staff.TimeSignature.stencil = ##f
  %\override Staff.BarLine.stencil = ##f
  \set Score.defaultBarType = "-"
  \bar "|."
}
move = { \bar "" \break }

soprano = 
\relative c' {
  \global
  % Music follows here.
  f4 g a a a bf bf bf a a a a a g2 f \bar"|"
  f4 g a bf bf bf bf a a a g2. g4 g f2 \bar"|"

  f4 g a a bf a4 a g2. g4 g g f2 \bar"|"
  f4 g a bf bf bf a a a a a a g2 f \bar"||"

  f4 g a a bf bf a a a a g2 f\breve \bar"|."
}

alto = 
\relative c' {
  \global
  % Music follows here.
  c4 e f f f f f f f f f f f e2 c \bar"|"
  c4 e f f f f f f f f e2. e4 e c2 \bar"|"

  c4 e f f f f f e2. e4 e e c2 \bar"|"
  c4 e f f f f f f4 f f f f e2 c \bar"||"

  c4 e f f f f f f f f e2 c\breve \bar"|."
}

tenor = 
\relative c' {
  \global
  % Music follows here.
  a4 bf c c c d d d c c c c c bf2 a \bar"|"
  a4 bf c d d d d c c c bf2. bf4 bf a2 \bar"|"

  a4 bf c c d c c bf2. bf4 bf bf a2 \bar"|"
  a4 bf c d d d c c c c c c bf2 a \bar"||"

  a4 bf c c d d c c c c bf2 a\breve \bar"|."
}


bass = 
\relative c {
  \global
  % Music follows here.
  f4 c f f f bf, d f f f f f f c2 f \bar"|"
  f4 c f bf, bf bf d f f f c2. c4 c f2 \bar"|"

  f4 c f f bf, f' f c2. c4 c c f2 \bar"|"
  f4 c f bf, bf d f f f f f f c2 f \bar"||"

  f4 c f f bf, d f f f f c2 f\breve \bar"|."
}


verse = \lyricmode {
  % Lyrics follow here.
  The whole uni -- verse glo -- ri -- ous -- ly hon -- ors Flor -- us and Lau -- rus 
  As pi -- ous vic -- tims and di -- vine -- ly wise mar -- tyrs for Christ. 
  That we may re -- ceive grace and mer -- cy through their prayers 
  And be de -- liv -- ered from ev -- ery tri -- al and tribu -- la -- tion 
  And from wrath and sor -- row on the Day of Judg -- ment.
}

\score {
  \new ChoirStaff <<
    \new Staff \with {
      midiInstrument = "string ensemble 1"
      instrumentName = \markup \center-column { "Soprano" "Alto"}
    } <<
      \new Voice = "soprano" { \voiceOne \soprano }
      \new Voice = "alto" { \voiceTwo \alto }
    >>
    \new Lyrics \lyricsto "soprano" \verse
    \new Staff \with {
      midiInstrument = "string ensemble 1"
      instrumentName = \markup \center-column { "Tenor" "Bass" }
    } <<
      \clef bass
      \new Voice = "tenor" { \voiceOne \tenor }
      \new Voice = "bass" { \voiceTwo \bass }
    >>
  >>
   \layout {
    ragged-last=##t
    #(layout-set-staff-size 22)
    \context {
      \Lyrics
      \override VerticalAxisGroup.staff-affinity = ##f
      \override VerticalAxisGroup.staff-staff-spacing =
        #'((basic-distance . 0)
       (minimum-distance . 2)
       (padding . 2))
    }
    indent = 1.25\cm
    \context {
      \Staff
      \override VerticalAxisGroup.staff-staff-spacing =
        #'((basic-distance . 0)
       (minimum-distance . 2)
       (padding . 2))
    }
  }
  \midi {
    \context {
      \Score
      tempoWholesPerMinute = #(ly:make-moment 175/4)      
      }
    }
  }

Мне нужна помощь, потому что каждый раз, когда я пытаюсь, я продолжаю получать ошибки.

Спасибо.

Вот правильный файл, с которым мне нужна помощь. Как упоминалось в комментариях, кажется, я непреднамеренно удалил все свои попытки добавить миди в файл ниже.

\version "2.18.2"

\paper {
 left-margin = 15
  top-system-spacing #'basic-distance = #10
  score-system-spacing #'basic-distance = #10
  system-system-spacing #'basic-distance = #10
  last-bottom-spacing #'basic-distance = #10
}

\header {
  title = \markup {\normal-text "Resurrection Kanon - Tone 1"}
subtitle = \markup \center-column { "" \vspace #2 } 
  composer = "arr. by B. Ledkovsky"

}

global = {
  \key f \major
  \omit Staff.TimeSignature
}

#(set-global-staff-size 23)

sopMusic = \relative c'' {
  \set Timing.measureLength = #(ly:make-moment 5/4)
f,4 g4 a2 a4\bar"" 
\set Timing.measureLength = #(ly:make-moment 2/4)
a4 a4 \bar""
\set Timing.measureLength = #(ly:make-moment 5/4)
f4 g4 a4 bes2\bar""
\set Timing.measureLength = #(ly:make-moment 16/4)
a4 bes4 c2 bes4 a4 a4 a4(g4) a4 bes4 a4 g4 f2.\bar""
\set Timing.measureLength = #(ly:make-moment 9/4)
a4 a4 a4 a4 bes4 c2 c4 c4\bar"" 
\set Timing.measureLength = #(ly:make-moment 2/4)
c4 c4 \bar""
\set Timing.measureLength = #(ly:make-moment 9/4)
c4 d4 c8(bes8) a4 bes2 bes2.\bar""
\set Timing.measureLength = #(ly:make-moment 2/4)
a4 a4 \bar""
\set Timing.measureLength = #(ly:make-moment 9/4)
g4 a4(bes4) a4 g4 f1



\bar"|."


}

sopWords = \lyricmode {


}

altoMusic = \relative c' {
 \set Timing.measureLength = #(ly:make-moment 5/4)
c4 c4 f2 f4
\set Timing.measureLength = #(ly:make-moment 2/4)
f4 f4 
\set Timing.measureLength = #(ly:make-moment 5/4)
f4 f4 f4 f2
\set Timing.measureLength = #(ly:make-moment 16/4)
f4 g4 a2  f4 f4 f4 f2 f4 f4 f4 e4 c2.
\set Timing.measureLength = #(ly:make-moment 9/4)
f4 f4 f4 f4 g4 a2 a4 a4  
\set Timing.measureLength = #(ly:make-moment 2/4)
a4 a4\bar""
\set Timing.measureLength = #(ly:make-moment 9/4) 
a4 bes4 a8(g8) f4 f2 f2.
\set Timing.measureLength = #(ly:make-moment 2/4)
f4 f4 
\set Timing.measureLength = #(ly:make-moment 9/4)
f4 f2 f4 e4 c1

}

altoWords = \lyricmode {
Thy tri_ --  um_ --  phant
\once \override LyricText.self-alignment-X = #LEFT 
right_hand,_in_a manner
\once \override LyricText.self-alignment-X = #CENTER
be_ --  fit_ --  ting God,
has been glo -- ri -- fied in strength, O Im -- mor -- tal One; 
For_ since_ it_ is_ all-_ pow_ --  -er_ -- -ful,
\once \override LyricText.self-alignment-X = #LEFT  
it__has__broken_ the
\once \override LyricText.self-alignment-X = #CENTER
en_ --  e_ --  -my_ to__ piec_ --  -es,
\once \override LyricText.self-alignment-X = #LEFT  
and__for__the__Israelites__has__made a 
\once \override LyricText.self-alignment-X = #CENTER
new path through the deep.


}

tenorMusic = \relative c' {
  \set Timing.measureLength = #(ly:make-moment 5/4)
a4 bes4 c2 c4
\set Timing.measureLength = #(ly:make-moment 2/4) 
c4 c4
\set Timing.measureLength = #(ly:make-moment 5/4)
a4 bes4 c4 d2
\set Timing.measureLength = #(ly:make-moment 16/4)
c4 c4 f2 d4  c4 c4 c4(bes4) c4 d4 c4  bes4 a2.
\set Timing.measureLength = #(ly:make-moment 9/4)
c4 c4 c4 c4 c4 f2 f4 f4 
\set Timing.measureLength = #(ly:make-moment 2/4)
f4 f4
\set Timing.measureLength = #(ly:make-moment 9/4)
f4 f4 f4 c4 d2 d2.
\set Timing.measureLength = #(ly:make-moment 2/4) 
c4 c4
\set Timing.measureLength = #(ly:make-moment 9/4)
bes4 c4(d4) c4 bes4 a1

}
tenorWords = \lyricmode {

}

bassMusic = \relative c {
  \set Timing.measureLength = #(ly:make-moment 5/4)
f4 f4 f2 f4
\set Timing.measureLength = #(ly:make-moment 2/4)
f4 f4 
\set Timing.measureLength = #(ly:make-moment 5/4)
f4 f4  f4 bes,2
\set Timing.measureLength = #(ly:make-moment 16/4)
f'4 f4 f2 f4 f4 f4 f2 f4 bes,4 c4 c4 f2.
\set Timing.measureLength = #(ly:make-moment 9/4)
f4 f4 f4 f4 f4 f2 f4 f4
\set Timing.measureLength = #(ly:make-moment 2/4)
f4 f4
\set Timing.measureLength = #(ly:make-moment 9/4)
f4 f4 f4 f4 bes,2 bes2.
\set Timing.measureLength = #(ly:make-moment 2/4)
f'4 f4
\set Timing.measureLength = #(ly:make-moment 9/4)
f4 f4(bes4) c,4 c4 f1


}
bassWords = \lyricmode {


}

\score {
  \new ChoirStaff <<
    \new Lyrics = "sopranos" \with {
      % this is needed for lyrics above a staff
      \override VerticalAxisGroup.staff-affinity = #DOWN

    }
    \new Staff = "women" <<
      \new Voice = "sopranos" {
        \voiceOne
        << \global \sopMusic >>
      }
      \new Voice = "altos" {
        \voiceTwo
        << \global \altoMusic >>
      }
    >>
    \new Lyrics = "altos"
    \new Lyrics = "tenors" \with {
      % this is needed for lyrics above a staff
      \override VerticalAxisGroup.staff-affinity = #DOWN
    }
    \new Staff = "men" <<
      \clef bass
      \new Voice = "tenors" {
        \voiceOne
        << \global \tenorMusic >>
      }
      \new Voice = "basses" {
        \voiceTwo << \global \bassMusic >>

      }
    >>
    \new Lyrics = "basses"
    \context Lyrics = "sopranos" \lyricsto "sopranos" \sopWords
    \context Lyrics = "altos" \lyricsto "altos" \altoWords
    \context Lyrics = "tenors" \lyricsto "tenors" \tenorWords
    \context Lyrics = "basses" \lyricsto "basses" \bassWords
  >>
}

Спасибо!

Какие ошибки вы получаете? Когда я компилирую этот файл, он создает PDF-файл, который выглядит нормально, и MIDI-файл, который воспроизводится нормально. В чем именно у вас проблема?
@ElementsinSpace: Извините. По какой-то причине я сохранил файл выше с именем файла, с которым мне нужна помощь. Тот, который я сейчас отправляю (в отличие от вышеизложенного), имеет «речитатив», сделанный так, что отображаются только первая и последняя ноты, но я до сих пор не смог получить миди. Версия файла a, отправка не имеет моей попытки добавить миди, так как я думаю (при проверке только что), что я, должно быть, удалил свою работу. Спасибо.

Ответы (1)

Чтобы создать файлы PDF и MIDI при компиляции, вам просто нужно добавить следующие строки, прежде чем закрыть последнюю}

\layout { }

\midi { 
    \set Staff.midiInstrument = #"string ensemble 1" 
}
Хорошо спасибо. Только один дополнительный вопрос: как я могу изменить инструмент по умолчанию на струнный ансамбль 1?
Я отредактировал это в своем ответе для вас сейчас. Я поместил его в миди-линию, но вы также можете добавить глобальную линию.