bell notificationshomepageloginNewPostedit profiledmBox

Hoots : Two MIDI files generated by Lilypond output the same audio 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 - freshhoot.com

10% popularity   0 Reactions

Two MIDI files generated by Lilypond output the same audio
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
}
}


Load Full (2)

Login to follow hoots

2 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

Their documentation at 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.


10% popularity   0 Reactions

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).


Back to top Use Dark theme