Janek Warchoł <janek.lilyp...@gmail.com> writes: > On Tue, Feb 28, 2012 at 2:36 AM, <d...@gnu.org> wrote: >>> \score { >>> \new Staff { b b } >>> \layout { \override NoteHead #'color = #red } >>> } >> >> Totally elusive bug that also afflicted \settingsFrom. Fixed > > i confirm that it works for me. Thanks! > >>> I even hoped that something like this will be possible: >>> \score { << >>> \new Voice { b b } >>> \new Voice = "aa" { b b } >>> >> >>> \layout { \override aa.NoteHead #'color = #red } >>> } >> >> It is nonsense since aa is not the type but the id of a context and >> can't be meddled with in a layout definition. > > ok... > Out of curiosity, would this be possible to add in a reasonable way or > is it totally wrong?
Totally wrong. > From a users' perspective, it would be great to have such overrides in > \layout, because then i'd have 3 separate and independent areas of my > file: - music in variables or \include files - style decisions in > \layout block. - score structure that doesn't contain any of the > above and can be freely changed. You can use context modifications for that. >> Try \new Voice = "aa" \with { \settingsFrom \override NoteHead #'color >> #red } { ... >> instead. > > It doesn't work: > > \score { > \new Voice \with { \settingsFrom \override NoteHead #'color = #red } { b > b } > } > > produces > > ../bah.ly:2:37: error: syntax error, unexpected \override > \new Voice \with { \settingsFrom > \override NoteHead #'color = #red } { b > b } Ah yes. Because \settingsFrom has an optional argument, and so the music argument must be some delimited form if the optional argument is left out. At one point of time, this aggravation will go, but I will need to boil down the grammar a bit more before I can manage that. > If i add a pair of curly braces, i.e. > \score { > \new Voice \with { \settingsFrom { \override NoteHead #'color = #red > } } { b b } > } > > then it compiles, but the override isn't applied. Well, I _did_ write "Totally elusive bug that also afflicted \settingsFrom. Fixed." So it is to be expected that you need to update to the very latest git commit first. Contextmodifications can be placed in variables, so you can write aasettings = \with { ... } and later use \new Voice = aa \aasettings { ... } or \new Voice = aa \with \aasettings { ... } -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel