lilypond-user
[Top][All Lists]
Advanced

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

Re: Suggestion to make sharps and flats persistent


From: David Kastrup
Subject: Re: Suggestion to make sharps and flats persistent
Date: Wed, 20 May 2020 16:22:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Fr. Samuel Springuel" <address@hidden> writes:

>> On 20 May, 2020, at 9:43 AM, Paul McKay <address@hidden> wrote:
>> 
>> Todays thoughts are: when you specify \language, then part of what
>> you are doing is setting up the parser to understand which character
>> sequence should indicate an f-sharp. I would like to be able to
>> temporarily reconfigure this so that as well as mapping ‘fs’ to
>> f-sharp you can ask it to map ‘F’ to f-sharp. I imagine that the
>> parser is a finite state machine and that at the appropriate point
>> it looks up a list. Normally this would say that ‘fs’ means f-sharp
>> (or ‘fes’ means f-sharp if you were in another language). I guess it
>> looks up a list of pitch names to check whether the current token is
>> a pitch as expected and, if so, which one. If that list might have
>> ‘F’ added at the beginning of the search order, then the parser
>> would recognize the letter ‘F’ as meaning the pitch f-sharp. Later
>> on, you could ask to remove the ‘F’ entry from that list. Removing
>> it would automatically revert to the default behaviour because the
>> list would still contain the entry to say that ‘fs’ means
>> f-sharp. To avoid confusion, the request to add an item to the list
>> would have the form (newName, pitchNameInOriginalLanguage).
>
> I’ve done something like this for transcribing solfege music (while retaining 
> English note names for other purposes):
>
> myNames = #(append (assoc-get 'english language-pitch-names)
>   `(
>     (do . ,(ly:make-pitch -1 0 NATURAL))
>     (re . ,(ly:make-pitch -1 1 NATURAL))
>     (mi . ,(ly:make-pitch -1 2 NATURAL))
>     (fa . ,(ly:make-pitch -1 3 NATURAL))
>     (sol . ,(ly:make-pitch -1 4 NATURAL))
>     (la . ,(ly:make-pitch -1 5 NATURAL))
>     (ta . ,(ly:make-pitch -1 6 FLAT))
>     (ti . ,(ly:make-pitch -1 6 NATURAL))
>   ))
>
> solfegenglish = \myNames
> #(ly:parser-set-note-names solfegenglish)

You can write this as

myNames = \language-pitch-names.english
myNames.do = c
myNames.re = d
myNames.mi = e
myNames.fa = f
myNames.sol = g
myNames.la = a
myNames.ta = bes
myNames.ti = b
language-pitch-names.solfegenglish = \myNames
\language "solfegenglish"

{ c' d' ta' ti' }

> You should be able to adapt this for any particular set of note names you 
> want.

One problem is that programs like Frescobaldi will stop knowing what
you are talking about.

-- 
David Kastrup



reply via email to

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