lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIDI dynamics


From: Hilary Snaden
Subject: Re: MIDI dynamics
Date: Sun, 4 Feb 2018 09:22:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 04/02/18 05:19, Abraham Lee wrote:
Hi, Hilary!

On Sat, Feb 3, 2018 at 9:42 PM Hilary Snaden <address@hidden> wrote:

I have been trying to get LilyPond to generate MIDI versions of some
piano music. The music script renders nicely, and there are no errors or
warnings, but the MIDI file plays with no dynamics at all. What am I
doing wrong? (LilyPond 2.18.2.)

\score {
    \unfoldRepeats
    \new Staff
    <<
      { \tempo 4=86 }
      \new Voice = "v1" {
        \set Staff.midiInstrument = "Acoustic grand"
        \set Staff.midiMinimumVolume = #0.2
        \set Staff.midiMaximumVolume = #0.8
        \upper
      }
      \new Voice = "v2" {
        \set Staff.midiInstrument = "Acoustic grand"
        \set Staff.midiMinimumVolume = #0.2
        \set Staff.midiMaximumVolume = #0.8
        \lower
      }
      \new Dynamics \pianodynamics
    >>
    \midi { }
}


In order for dynamics to affect the notes, they need to be directly
attached to them. Since this score is solely for playback, instead of
creating a separate dynamics context (which is really more helpful for the
engraving part), make \pianodynamics simultaneous with the variables \upper
and \lower *within the Voice contexts*. So, something like this:

\new Voice { ... } <<
   \upper
   \pianodynamics


and remove the Dynamics context completely since it doesn’t have a direct
affect on playback.

Hope that helps,
Abraham


It does help, thanks. I found that I also had to move the midi volume adjustments into the staff context, so the midi block now looks like this:

\score {
  \unfoldRepeats
  \new Staff {
    \set Staff.midiInstrument = "Acoustic grand"
    \set Staff.midiMinimumVolume = #0.05
    \set Staff.midiMaximumVolume = #0.85
    <<
      { \upper }
      { \lower }
      { \pianodynamics }
      { \tempi }
    >>
  }
  \midi { }
}

For best results I'll need to add explicit levels at the end of every cresc and dim in the variable containing the dynamics, but this is still a significant improvement over no dynamics at all. Cheers!

--
Hilary




reply via email to

[Prev in Thread] Current Thread [Next in Thread]