[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ambitus per voice and Ez_numbers_engraver
From: |
Thomas Morley |
Subject: |
Re: Ambitus per voice and Ez_numbers_engraver |
Date: |
Fri, 11 Jan 2019 00:02:27 +0100 |
Am Mi., 9. Jan. 2019 um 23:38 Uhr schrieb Gloops <address@hidden>:
>
> Thank you very much Harm, it works very well now!!!
> Musically
> Gilles
Hi Gilles,
glad you like it.
Though, here one improvement: Settings for 'font-series and
'font-family need to be done _before_ 'stencil. I.e.:
#(define Ez_numbers_engraver_harm
(make-engraver
(acknowledgers
((note-head-interface engraver grob source-engraver)
(let* ((context (ly:translator-context engraver))
(tonic-pitch (ly:context-property context 'tonic))
(tonic-name (ly:pitch-notename tonic-pitch)))
(if (grob::has-interface grob 'ambitus-interface)
(let* ((details (ly:grob-property grob 'details))
(ez-numbers (assoc-get 'ez-numbers details #f)))
(if ez-numbers
(ly:grob-set-property! grob 'after-line-breaking
(lambda (grob)
(let* ((grob-pitch
(ly:event-property (event-cause grob) 'pitch))
(grob-name (ly:pitch-notename grob-pitch))
(delta (modulo (- grob-name tonic-name) 7))
(note-names
(make-vector 7 (number->string (1+ delta)))))
(ly:grob-set-property! grob 'note-names note-names)
(ly:grob-set-property! grob 'font-family 'sans)
(ly:grob-set-property! grob 'font-series 'bold)
(ly:grob-set-property! grob 'stencil
(note-head::brew-ez-stencil grob)))))))
(let* ((grob-pitch
(ly:event-property (event-cause grob) 'pitch))
(grob-name (ly:pitch-notename grob-pitch))
(delta (modulo (- grob-name tonic-name) 7))
(note-names
(make-vector 7 (number->string (1+ delta)))))
(ly:grob-set-property! grob 'note-names note-names))))))))
Cheers,
Harm