Re: Inheritance of MIDI settings into embedded contexts?
Dear all, thanks for the explanations! I understand the pragmatics behind the decision to have the dynamic performer at the voice context, because of the possible usage for parallel and independent instruments. But I am still not convinced: as Maurits has pointed out, nothing in the syntax suggests that parallel voices do _not_ inherit settings from outside. If you look at the pdf output of the example, there is only a fortissimo mark at the beginning of the measure and no other dynamic mark. Any real performer (!) would not stop at the voices and say "oh, now there are parallel voices, I should drop back to default volume". But lilyponds MIDI output does. Nevertheless I shall implement Aaron's suggestion: it works great for my needs, thanks for your effort! Best regards, Thomas
Re: Inheritance of MIDI settings into embedded contexts?
Hi, It might be here that the Lilypond syntax leads you up the proverbial garden path. While voices are contexts within the scope of a staff, they are not nested within each other. So, whenever a new voice is created, it is created equal to the other voices and consequently has only the Staff as a parent context. Musically it makes a lot of sense to have the Dynamic_performer in the Voice context by default: most polyphonic uses of the Voice context are related to having two instruments or voices/vocals on a single staff, where each has their own dynamic signs. Only in keyboard music both voices will be performed by one performer and consequently most of the dynamics should be "inherited". In that case, it is more logical to move the Dynamic performer to the Staff context. cheers Maurits > Op 22 aug. 2020, om 23:46 heeft Dr. Thomas Tensi het > volgende geschreven: > > Hello Aaron, > > > thanks for the quick and detailed answer! > > You wrote: > > The Dynamic_performer is part of the Voice context; and the > > construct << ... \\ ... >> implicitly creates new Voice contexts. > > That is what I had assumed: the voice context _initializes_ its dynamics > to the default value regardless of any outer contexts (that have no > dynamic performer, by the way). > > > [...] > > \consisting the Dynamic_performer to the Staff (and \removing it > > from the Voice) should apply the current logic to the wider scope > > This sounds logical. > > But what I do not get is why the contexts do not nest. A staff should > have a dynamic performer that is _inherited_ by explicit and implicit > voices within that staff. The settings from the outer (staff) context > are taken over unless the inner context (voice) changes some setting. > The scope of this change is, of course, the inner context. > > The same logic applies to variables in scoped programming languages: > inner definitions shadow outer definitions, but if there is no inner > definition, the outer definition is visible. > > Hence: in my opinion the dynamics should be a setting that may be > overridden in embedded contexts; if not, it retains the outer setting. > > > Best regards, > > Thomas >
Re: Inheritance of MIDI settings into embedded contexts?
Hello Aaron, thanks for the quick and detailed answer! You wrote: > The Dynamic_performer is part of the Voice context; and the > construct << ... \\ ... >> implicitly creates new Voice contexts. That is what I had assumed: the voice context _initializes_ its dynamics to the default value regardless of any outer contexts (that have no dynamic performer, by the way). > [...] > \consisting the Dynamic_performer to the Staff (and \removing it > from the Voice) should apply the current logic to the wider scope This sounds logical. But what I do not get is why the contexts do not nest. A staff should have a dynamic performer that is _inherited_ by explicit and implicit voices within that staff. The settings from the outer (staff) context are taken over unless the inner context (voice) changes some setting. The scope of this change is, of course, the inner context. The same logic applies to variables in scoped programming languages: inner definitions shadow outer definitions, but if there is no inner definition, the outer definition is visible. Hence: in my opinion the dynamics should be a setting that may be overridden in embedded contexts; if not, it retains the outer setting. Best regards, Thomas
Re: Inheritance of MIDI settings into embedded contexts?
On 2020-08-22 8:52 am, Dr. Thomas Tensi wrote: I am using lilypond as the frontend for audio production and now I have a problem where I do not understand lilypond's internal logic for transferring MIDI settings into embedded contexts. [ . . . ] This means that the embedded voices are in the MIDI default volume while the surrounding notes are in fortissimo (as specified and expected). My naive assumption is that any setting (also the dynamics for MIDI) is inherited by embedded contexts. But this does not seem to be the case. The Dynamic_performer is part of the Voice context; and the construct << ... \\ ... >> implicitly creates new Voice contexts. As such, dynamics of notes from different Voices would be expected to be distinct, regardless of whether they might occupy the same Staff. Personally I find this very impractical, because this leads to loudness jumps in the MIDI output when I have some multiple-voice context embedded in some macro with the dynamics specified on an outer section level. It is simply not modular. Any ideas on how to cope with that? \consisting the Dynamic_performer to the Staff (and \removing it from the Voice) should apply the current logic to the wider scope: \version "2.19.82" \score { << \new Staff = piano \with { midiInstrument = "acoustic grand" } { { \key c \major \time 4/4 \relative c' { c4\ff << {e f} \\ {c d}>> g } } } >> \layout {} \midi { \context { \Staff \consists "Dynamic_performer" } \context { \Voice \remove "Dynamic_performer" } } } Whether there are any side effects, I do not know. -- Aaron Hill
Inheritance of MIDI settings into embedded contexts?
Dear all, I am using lilypond as the frontend for audio production and now I have a problem where I do not understand lilypond's internal logic for transferring MIDI settings into embedded contexts. The file - \version "2.19.82" \score { << \new Staff = piano \with { midiInstrument = "acoustic grand" } { { \key c \major \time 4/4 \relative c' { c4\ff << {e f} \\ {c d}>> g } } } >> \layout {} \midi {} } - produces a MIDI file with the following track data: - MTrk 0 Meta TrkName "piano:" 0 PrCh ch=1 p=0 0 PrCh ch=1 p=0 0 Meta InstrName "acoustic grand" 0 KeySig 0 major 0 On ch=1 n=60 v=101 384 On ch=1 n=60 v=0 384 On ch=1 n=64 v=89 384 On ch=1 n=60 v=89 768 On ch=1 n=64 v=0 768 On ch=1 n=60 v=0 768 On ch=1 n=65 v=89 768 On ch=1 n=62 v=89 1152 On ch=1 n=65 v=0 1152 On ch=1 n=62 v=0 1152 On ch=1 n=67 v=101 1536 On ch=1 n=67 v=0 1536 Meta TrkEnd TrkEnd - This means that the embedded voices are in the MIDI default volume while the surrounding notes are in fortissimo (as specified and expected). My naive assumption is that any setting (also the dynamics for MIDI) is inherited by embedded contexts. But this does not seem to be the case. Personally I find this very impractical, because this leads to loudness jumps in the MIDI output when I have some multiple-voice context embedded in some macro with the dynamics specified on an outer section level. It is simply not modular. Any ideas on how to cope with that? Best regards, Thomas
Re: MIDI settings
I guess that major problem is that you cannot even specify a \p or \ within \chordmode {...}. Otherwise, it's easy to modify the definition of the ChordNames context to take the dynamics into account in the MIDI output. One possibility is to include your dynamics in a separate identifier: mydynamics = { s1 \p s1*4 \f ...} and make a separate \score for the MIDI output, with \score{ ... \new Voice \mychords \mydynamics ... \midi{...} } corresponding to \score{ ... \new ChordNames \mychords ... \layout{...} } in the print version. /Mats fiëé visuëlle wrote: Hi ho! It's nice that LilyPond plays my chords in MIDI, and I recognized I can set the instrument with \set ChordNames.midiInstrument = flute But how to set the volume? Dynamic marks like \p don't work in chordmode. Further I'd like to get every MIDI file with mid extension instead of midi - MacOSX doesn't recognize .midi, and Windows doesn't either. How can I setup that? Greetlings from Lake Constance --- fiëé visuëlle Henning Hraban Ramm http://www.fiee.net http://angerweit.tikon.ch/lieder/ ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-use r -- = Mats Bengtsson Signal Processing Signals, Sensors and Systems Royal Institute of Technology SE-100 44 STOCKHOLM Sweden Phone: (+46) 8 790 8463 Fax: (+46) 8 790 7260 Email: [EMAIL PROTECTED] WWW: http://www.s3.kth.se/~mabe = ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
MIDI settings
Hi ho! It's nice that LilyPond plays my chords in MIDI, and I recognized I can set the instrument with \set ChordNames.midiInstrument = flute But how to set the volume? Dynamic marks like \p don't work in chordmode. Further I'd like to get every MIDI file with mid extension instead of midi - MacOSX doesn't recognize .midi, and Windows doesn't either. How can I setup that? Greetlings from Lake Constance --- fiëé visuëlle Henning Hraban Ramm http://www.fiee.net http://angerweit.tikon.ch/lieder/ ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user