lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme / Lilypond question


From: Simon Albrecht
Subject: Re: Scheme / Lilypond question
Date: Fri, 6 Jan 2017 22:01:53 +0100

On 06.01.2017 21:26, Jay Vara wrote:
1) Is it possible to define a variable as a piece of music:

jj = g16 \3 ( f e f)

Of course it’s possible – there’s no way engraving reasonably large scores without that! The only thing you need to change from your example is wrap the notes in {} to create sequential music. Else the variable jj will contain only { g16\3 } and the rest of the notes will raise errors from the parser.

The idea is, in the music I am working on the note F is sometimes replaced by the above [and similarly other notes]. Perhaps a scheme function may be needed for this?

You might do this using scheme, but you don’t need to: just use tags like follows:

%%%%%%%%%%%%%%%%%%
\version "2.19.53"

% use this to prevent interference with already used tags
\tagGroup unembellished,embellished

jj = { \tag unembellished f'4 \tag embellished { g'16\3( f' e' f') } }

\score {
  \keepWithTag <<
    \jj
    \addlyrics { foo }
  >>
}

%%%%%%%%%%%%%%%%%%

2) When I am specifying the guitar string the note is to be played on, it turns out I need to specify it for each and every note. Is there a way to specify it easily? Say,

StrThree { g16 (f e f)} would mean all the notes should be played on string three.

Yes, there is a way. Though I’d advise you to spell it out, maybe using the help of an editor. That way you keep your source code more standard-compliant and easier to read for both humans and e.g. syntax highlighting algorithms. For example, I have taken to spelling out staccatos instead of applying the music function from an LSR snippet, which adds staccatos to all the contained notes. Frescobaldi helps me doing that with its ‘Quick insert’ tool. However, I don’t think there is a ‘Quick insert’ for string numbers yet – you might want to submit a feature request at <https://github.com/wbsoft/frescobaldi/issues>.

HTH, Simon



reply via email to

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