lilypond-user
[Top][All Lists]
Advanced

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

Variable names? (was: Re: Adding 3-column section to score)


From: Wim van Dommelen
Subject: Variable names? (was: Re: Adding 3-column section to score)
Date: Sun, 18 Nov 2012 11:30:04 +0100

Hi Harm, and others,

I wondered in this discussion what you were exactly trying to achieve, so I copied your code and compiled it. Very nice!

And after the copy I saw a weird thing (nothing to do with this specific example!): You use "non-standard" characters and numbers as names of the variables. I gasped, I didn't know this was possible at all. I always use rather generic names and with multiple instruments or pieces I always use things like: trumpetApieceB or similar. Now I see, it can also be something like:

H₂O→trumpet¹pieceª = { ... }

(I just tried it and this works). But the learning manual states (v.2.16.0, p. 37, the only reference I could find on this): "The name of a variable must have alphabetic characters only, no numbers, underscores, or 
dashes." which I always interpreted as: A-Z, a-z and 0-9 from the regular ASCII set. Now I see also other characters used.

My question: Is this use of different (utf8) characters supported "by accident", or on purpose? I would welcome this change but not when it can be broken in the future. And if "yes" can someone update the documentation to provide some guideline as what to do and what not to do.... With some examples?

Regards,
Wim.



On 18 Nov 2012, at 02:34 , Thomas Morley wrote:

2012/11/17 Olivier Biot <address@hidden>:
Is there a more elegant and less verbose way than the following approach to
add a 3-column section for documenting editorial changes to scores?

%% BEGIN
\version "2.16.0"

% LSR snippet: http://lsr.dsi.unimi.it/LSR/Snippet?id=464
#(define-markup-command (columns layout props args) (markup-list?)
[...]

Hi Olivier,

I do like this \columns-command and from my point of view it
_is_elegant and _not_ verbose.
I'd recommend to store more stuff in variables.

If you prefer a version without \columns you may want to use this:

\version "2.16.0"

txt¹ = \markup {
  \override #'(line-width . 32) {
     \column {
        \huge \bold \fill-line { Bemerkungen }
        \wordwrap { % Deutsch
           \bold { N° 30. } Crantz Ausgabe T. 11: cis \bold { e } gis:
        }
     }
  }
}

txt² = \markup {
  \override #'(line-width . 36) {
     \column {
        \huge \bold \fill-line \italic { Remarques }
        \wordwrap \italic { % Français
           \bold {N° 30.} Édition Crantz, mesure 11: do dièse  \bold
{ mi } sol dièse:
        }
     }
  }
}

txt³ = \markup {
  \override #'(line-width . 36) {
     \column {
        \huge \bold \fill-line { Notes }
        \wordwrap { % English
           \bold {N° 30.} Crantz Edition, mesure 11: C sharp \bold {
E natural } G sharp:
        }
     }
  }
}

mus = \markup {
   % Music annotation
   \score {
     \new Staff \with {
       \override Fingering #'add-stem-support = ##t
       \override Fingering #'avoid-slur = #'outside
       \override TupletBracket #'bracket-visibility = ##t
       fontSize = #-3
       \override StaffSymbol #'staff-space = #(magstep -3)
       \override StaffSymbol #'thickness = #(magstep -3)
       \remove "Time_signature_engraver"
     } {
       \key fis \minor
       \time 4/4
       \clef bass
       \bar ""
       \set Score.currentBarNumber = #11
       cis2 ~ cis8 cis-. e?-. gis-.
     }
     \layout { ragged-right = ##t }
   }
}

\markup
  \override #'(box-padding . 1)
  \rounded-box \center-column {
       \fill-line { \txt¹ \txt² \txt³ }
       \vspace #0.1
       \mus
}


HTH,
 Harm

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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