2

When generating the MIDI files for the two Lilypond files below, and then generating the WAV audio files with Timidity (timidity --output-24bit -A120 f.midi -Ow -o f.wav), I can hear no differences between the two outputs, even if the two scores were in different keys.

Is it a MIDI problem (but MIDI does support key signature) or a synthesis one? Cause the generated scores (PDF files) look different.

File 1:

\score {
  \new Staff <<
    \new Voice {
      \set midiInstrument = #"acoustic grand"
      \voiceOne
      \key c \minor
      \time 4/4

      c'' d'' e'' f'' g'' a'' b'' c'''
    }
  >>
  \layout { }
  \midi {
    \context {
      \Staff
      \remove "Staff_performer"
    }
    \context {
      \Voice
      \consists "Staff_performer"
    }
    \tempo 2 = 72
  }
}

File 2:

\score {
  \new Staff <<
    \new Voice {
      \set midiInstrument = #"acoustic grand"
      \voiceOne
      \key g \major
      \time 4/4

      c'' d'' e'' f'' g'' a'' b'' c'''
    }
  >>
  \layout { }
  \midi {
    \context {
      \Staff
      \remove "Staff_performer"
    }
    \context {
      \Voice
      \consists "Staff_performer"
    }
    \tempo 2 = 72
  }
}
2
  • No, MIDI does not support key signatures, nor can it distinguish between c-sharp and d-flat.
    – guidot
    Dec 11, 2015 at 21:38
  • 2
    It does as a meta message (the two bytes 0xFF 0x59 indicate "key signature"). But it is either not written by Lilypond, or not read by Timidity.
    – nightcod3r
    Dec 11, 2015 at 21:54

2 Answers 2

5

Their documentation at http://www.lilypond.org/doc/v2.18/Documentation/learning/accidentals-and-key-signatures (in the section Warning: key signatures and pitches) states

key signature only affects the printed accidentals, not the note’s pitch!

It seems that Lilypond equates a note name with a particular pitch - you have to add the relevant suffix ('es' or 'is') to lower or raise the pitch, regardless of key signature.

So the two files above would be expected to generate midi files with the same midi note numbers.

0

Those are the same notes. LilyPond names its notes "absolutely"; changing the key does not change the meaning of the note names.

In the printed version, you'll see that f'' now gets a natural sign in order to keep it at the same pitch.

However, if you play the Midi on an arranger with a key display or load it into a sequencer with note display, the display will change to indicate G major (more exactly, a key signature of one sharp as Midi does not distinguish G major from E minor in its key messages).

4
  • Problem is that when the 'is' is added (fis''), then the note in the score does not show the sign anymore. Looks like there's no way to conciliate the printed and midi representations, you can either have it well written, or well played, but not both.
    – nightcod3r
    Dec 12, 2015 at 9:15
  • @nightcod3r in which key does fis not show the sign? Dec 12, 2015 at 9:46
  • G major. There's a natural sign for f'' and there's no sign for fis''.
    – nightcod3r
    Dec 12, 2015 at 11:16
  • 1
    @nightcod3r I think that's what I'd expect. In G major, the F# is in the key signature, so there's no need for an accidental if you are actually playing F# (fis). On the other hand, F natural (f) is not the F normally found in G major, so it would have the natural sign accidental. Dec 12, 2015 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.