[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tweaking the string number: no circle, and to the right?
From: |
Jean Abou Samra |
Subject: |
Re: Tweaking the string number: no circle, and to the right? |
Date: |
Thu, 5 Jan 2023 10:32:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 |
Le 04/01/2023 à 01:43, Alasdair McAndrew a écrit :
Many thanks indeed for that heads-up! But I have another problem, in
that I'm typesetting my chords as per the practice of the time, which
was to have the stem of the upper note up, and the stem of the lower
note(s) down. I have done this using voices, and a simple function to
save typing:
chord =
#(define-music-function
(topnote bottomnote)
(ly:music? ly:music?)
#{
<< { $topnote } \\ { $bottomnote } >>
#})
(Thanks to people here - including you! - who helped me with this.) I
do have another function:
stRight = \set stringNumberOrientations = #'(right)
which I can place before any string number. I suppose I could also
set a stencil property here too (when I learn how to include two
variable assignments in one function). But it's a pain to have to
include this function for every string number.
Of course I could get round a lot of this if I could tweak the chord
function so that any chord is typeset as I want.
This should get you started:
\version "2.24.0"
chord =
#(define-music-function
(topnote bottomnote)
(ly:music? ly:music?)
#{
<< { < $topnote > } \\ { < $bottomnote > } >>
#})
{
\set Staff.stringNumberOrientations = #'(right)
\override Staff.StringNumber.stencil = #ly:text-interface::print
\chord c''\3 c'\4
}
Note that
- The function needs to include chord brackets < ... >, as David pointed
out.
- You need to set stringNumberOrientations on Staff level, otherwise the
setting applies to the current Voice, while the << \\ >> construct
creates new Voices.
- The default StringNumber stencil is computed by
print-circled-text-callback (see
https://lilypond.org/doc/v2.24/Documentation/internals/stringnumber),
which prints the text property of the StringNumber in a circle, but you
can use ly:text-interface::print, which only prints the text property.
Best,
Jean
OpenPGP_signature
Description: OpenPGP digital signature