lilypond-user
[Top][All Lists]
Advanced

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

Re: Custom Format


From: Aaron Hill
Subject: Re: Custom Format
Date: Wed, 31 Mar 2021 10:20:48 -0700
User-agent: Roundcube Webmail/1.4.9

(For your reference, do try to remember keeping the mailing list on future emails. This ensures wider visibility and continuity of the discussion for all users. Also, those of us who participate on the list are sometimes busy with other work, so personal contact can often result in delayed or missing responses.)

Could you point me to a place in the docs where I could understand
what your solutions/functions are doing?

While not exhaustive, I would direct you to the Extending manual [1]. It is a good starting point; in particular, it covers how LilyPond intermingles its own music syntax with that of Scheme.

[1]: http://lilypond.org/doc/v2.22/Documentation/extending/index.html


This looks like exactly what I want. Thank you for your efforts.
I will give each of these a shot and let you know how that goes.

Since LilyPond already uses numbers for durations, you might consider writing numeric pitches in alphabetic form, since this most clearly disambiguates pitches from durations. Here is an example of defining custom note names in LilyPond:

%%%%
\version "2.22.0"

#(define (define-custom-note-names language notes)
  (set! language-pitch-names
        (acons language notes language-pitch-names)))

#(define-custom-note-names 'numeric-english
  `((zero . ,(ly:make-pitch -1 0 NATURAL))
    (one . ,(ly:make-pitch -1 0 SHARP))
    (two . ,(ly:make-pitch -1 1 NATURAL))
    (three . ,(ly:make-pitch -1 1 SHARP))
    (four . ,(ly:make-pitch -1 2 NATURAL))
    (five . ,(ly:make-pitch -1 3 NATURAL))
    ; ...
  ))

#(define-custom-note-names 'numeric-roman
  `((z . ,(ly:make-pitch -1 0 NATURAL))
    (i . ,(ly:make-pitch -1 0 SHARP))
    (ii . ,(ly:make-pitch -1 1 NATURAL))
    (iii . ,(ly:make-pitch -1 1 SHARP))
    (iv . ,(ly:make-pitch -1 2 NATURAL))
    (v . ,(ly:make-pitch -1 3 NATURAL))
    ; ...
  ))

\language "numeric-english"
{ zero'4 four'8 five' two'2 }

\language "numeric-roman"
{ z'4 iv'8 v' ii'2 }
%%%%

NOTE: I've abbreviated the definitions above, but you should be able to continue the patterns as needed.


-- Aaron Hill



reply via email to

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