On Tue, Feb 28, 2012 at 9:27 AM, David Kastrup <d...@gnu.org> wrote: > Janek Warchoł <janek.lilyp...@gmail.com> writes: >>>> 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.
Pity. It would be very useful. >> 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. Hmm? If i try \score { << \new Voice { b b } \new Voice = "aa" { b b } >> \layout { \context { \Voice = "aa" \override NoteHead #'color = #red } } } i get a syntax error. Maybe i misunderstood you. >> \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. ok > 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. Aah, fixed in git. I thought it was fixed in the new patchset. > 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 { ... } sure, i can do this. Nevertheless, writing these in \layout {} would be more elegant and in my opinion easier to maintain: \layout must be placed at the end of \score block, while variables containing context modifications must be defined before they are used, i.e. before \score block. Thus, style decisions are spread over two places. still, your work is great! Janek _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel