|
From: | Gianmaria Lari |
Subject: | Re: Numbers as easy note heads with RhythmicStaff |
Date: | Fri, 15 Jun 2018 15:11:23 +0200 |
On 2018-06-15 05:27, Gianmaria Lari wrote:
> \version "2.19.81"
> #(define Ez_numbers_engraver
> (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))
> (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))))))
>
> \layout {
> ragged-right = ##t
> \context {
> \Voice
> \consists \Ez_numbers_engraver
> }
> }
>
> \new RhythmicStaff { a4 b8 a }
>
> and this is the error I get
>
> Interpreting music..document.ly:8:26 <0>: In procedure
> ly:pitch-notename in
> _expression_ (ly:pitch-notename tonic-pitch):
>
> ..document.ly:8:26 <1>: Wrong type argument in position 1 (expecting
> Pitch): ()
>
>
> Any suggestion to fix it?
It appears that RhythmicStaves do not have a tonic property. So there
is no reference from which you can derive the numbering. You can
explicitly specify a tonic:
%%%%
\new RhythmicStaff \with { tonic = #(ly:make-pitch 0 0 0) }
{ \easyHeadsOn a4 b8 a }
%%%%
[Prev in Thread] | Current Thread | [Next in Thread] |