lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reorganizing the contents of the \paper block


From: Trevor Bača
Subject: Re: Reorganizing the contents of the \paper block
Date: Thu, 8 Feb 2007 11:53:25 -0600

On 2/8/07, Trevor Bača <address@hidden> wrote:
On 2/8/07, Han-Wen Nienhuys <address@hidden> wrote:
> Trevor Bača escreveu:
>
> > Note that this is not a zero-code proposal, however: the idea of
> > collapsing \paper and \layout is a pretty serious structural change,
> > even though I think it makes extremely good sense.
>
> It's actually not. Inside the code it's already implemented like that.
> The difference between paper and layout is that paper has a
>
>   is-paper = ##t
>
> setting.

OK. So this means that if we build consensus for the "collapse \paper
and \layout into \settings" proposal (which we haven't done yet) then
at least the implementation will be straightforward. That's good.



> What you're really losing is the ability to set a default for the \layout
> block.

Oh I hope not.

If we do away with \paper and \layout and wind up instead with
\score-settings, \book-settings and \global-settings, then we should
be able to set a value in \book-settings which will then act as the
default for any values in \score-settings. This should preserve the
ability to set defaults, I believe. Ex:

%%% BEGIN %%%

\global-settings { }

\book {

  \book-settings { special-layout-setting = foo }

   \score {
       \new Staff { c'4 }
    }

   \score {
      \new Staff { c'4 }
      \score-settings { special-layout-setting = bar }
   }

}

%%% END %%%

In this example, we have two scores both living inside the same book.
Score 1 will inherit special-layout-setting as foo from
\book-settings. Score 2 likewise inherits special-layout-settings as
foo from \book-settings but then overrides the value of
special-layout-setting to bar in the \score-settings block.

So \book-settings gives us the ability to set defaults for all of our
different scores within a single book, which we are then free to
override with a \score-settings block inserted directly into any
particular score.

So we actually do preserve the ability to set (and overide) defaults, yes?



> > Perhaps if we wind up wanting to collapse \layout and \paper, then we
> > can simply rip \context blocks out and leave them as free-standing
> > elements within a \score. But this is a sidenote until we consider
> > whether collapsing \paper and \layout even makes sense.]
>
> No, I think that in this case, the \context  definitions have to  go into
> \settings as well, ie. in the \book wide settings.

OK.

OK, I'm going to float one last proposal that I know will be much
harder to implement, though I do think it's worth mentioning if for
nothing other than to add to the discourse.

NOTE: this is a second and different proposal from the "compress
\paper and \layout into \settings" proposal. More radical and we might
call this the "ubiquitous \with" proposal.

What about a file structure like this:

%%% BEGIN UBIQUITOUS WITH %%%

\new File \with { % ALL possible top-level settings live here } {

  \new Book \with { % ALL possible book-level settings live here} {

     \new  Score \with { % ALL possible score-level settings live here } {

          \new Staff \with { % ALREADY all possible staff settings
can live here } { c'4 }

     }

  }

}

%%% END %%%

That's it: NO special input blocks of *any* sort -- no \layout, no
\paper, no \midi, no \settings, no nothing. Nada. Not even any
top-level Scheme commands. This would in many ways be a *super* clean
way of organizing both music content and settigs of all sorts. Every
setting that exists would go into the \with-block of an actual piece
of real input -- File, Book, Score, Staff, Voice, right on down the
hierarchy.

Benefits:

* Semantic input blocks only

* All settings attach to one input block

* Clear nesting; all elements of hierarchy named uniquely

* Kills off \paper, \layout, \midi (or \settings) reducing the need to
ever document or refer to these again

* Extends existing and effective \with pattern to (all) other input objects

* Provides absolutely unambiguous written language to describe where a
setting is made ("in the File \with-block, in the Book \with-block, in
the Score \with-block, in the Staff \with-block, etc".)

* Unifies currently disjunct parts of the input language because book
(and the newly proposed File) starts to look like the Score, Staff,
Voice, etc.

* Kinda looks like XML

* Provides absolutely unambiguous definition for what an input file
actually *is*: "A Lily input file comprises exactly one File block,
which comprises one to many Book blocks, each of which comprise one to
many Score blocks, each of which comprises exactly one music
expression. Settings for all blocks live in the special \with
construct." Period.

Wow. I really like this. Anyone else?

OK, so I'm also sure this blows up tons of stuff ... Han-Wen? As a
longer term design goal, say for 3.0?



--
Trevor Bača
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]