Re: Ambitus per voice and Ez_numbers_engraver

2019-01-15 Thread Gloops
Thank you Harm!
It's perfect ...
Still sorry for my poor English, luckily the pictures spoke for me.
Regards, Gilles



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-13 Thread Thomas Morley
Well, I'm still confused what you're after...

Am So., 13. Jan. 2019 um 13:43 Uhr schrieb Gloops :

> Hello Harm!
> Sorry, I did not express myself well!
> I want to go through "Ez_numbers_engraver_harm"
> to convert NoteHead to a number and display AmbitusNoteHead directly.
> I do not want (if possible) to go through "brew-ez-stencil" ...
> Gilles
>
> 
>
> 

>From the images, something like below?

#(define-public (note-head::brew-ez-no-head-stencil grob)
  (let* ((pitch (ly:event-property (event-cause grob) 'pitch))
 (pitch-index (ly:pitch-notename pitch))
 (note-names (ly:grob-property grob 'note-names))
 (pitch-string (if (and (vector? note-names)
(> (vector-length note-names) pitch-index))
   (vector-ref note-names pitch-index)
   (string
(integer->char
 (+ (modulo (+ pitch-index 2) 7)
(char->integer #\A))
 (staff-space (ly:staff-symbol-staff-space grob))
 (line-thickness (ly:staff-symbol-line-thickness grob))
 (font-size (ly:grob-property grob 'font-size 0))
 (radius (* (magstep font-size) (/ (+ staff-space line-thickness) 2)))
 (letter
   (make-fontsize-markup
 font-size
 (make-center-align-markup (make-vcenter-markup pitch-string)

(ly:stencil-translate-axis
 (grob-interpret-markup grob letter)
 radius
 X)))


#(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
 (stencil-proc
   (assoc-get
 'stencil-proc
 details
 ;; fall-back:
 note-head::brew-ez-stencil)))
(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
  (if (procedure? stencil-proc)
  (stencil-proc grob)
  point-stencil)))

(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

easyAmbitusHeadsOn = \override AmbitusNoteHead.details.ez-numbers = ##t

\score {
  \new Staff <<
\new Voice \with {

} \relative c'' {
\key f \major
  \override Ambitus.X-offset = #2.0
  \voiceOne
  \easyHeadsOn
  c4 a d e
  f2
}
\new Voice \with {

} \relative c' {
  \voiceTwo
  \easyHeadsOn
  es4 f g  as
  b1
}
  >>
  \layout {
ragged-right = ##t
\context {
  \Voice
  \consists \Ez_numbers_engraver_harm
  \consists "Ambitus_engraver"
%% Choose the font-size
  \override AmbitusNoteHead.font-size = -3
%% Choose the procedure to create the "ez-stencil"
%% Possible is currently:
%% note-head::brew-ez-no-head-stencil
%% or
%% note-head::brew-ez-stencil
%% Which is the fall-back as well (if details.stencil-proc is unset/commented)
%% An unsuitable setting here will result in point-stencil
  \override AmbitusNoteHead.details.stencil-proc =
#note-head::brew-ez-no-head-stencil
  \easyAmbitusHeadsOn
}
  }
}

HTH,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-13 Thread Gloops
Bonjour Valentin !
Je connais la liste française mais je n'ai rien trouvé concernant ce sujet,
c'est pourquoi j'ai posté ici...
En tout cas merci de l'avoir suggérer!
Peut être à bientôt sur la liste française...
Gilles



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-13 Thread Gloops
Thomas Morley-2 wrote
> Am Fr., 11. Jan. 2019 um 10:04 Uhr schrieb Gloops <

> yagloops@

> >:
>>
>> Hello Harm
>> Thank you for this correction ...
>> Is there any way to engrave the ambitus directly without going through
>> "note-head :: brew-ez-stencil" in order to avoid the head of the note?
>> Gilles
> 
> Not sure what you mean.
> Probably, set details.ez-numbers #f or easier comment \easyAmbitusHeadsOn
> Then Ambitus_engraver is not affected by Ez_numbers_engraver_harm
> 
> Cheers,
>   Harm
> 
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user


Hello Harm!
Sorry, I did not express myself well!
I want to go through "Ez_numbers_engraver_harm"
to convert NoteHead to a number and display AmbitusNoteHead directly.
I do not want (if possible) to go through "brew-ez-stencil" ...
Gilles

 

 



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-12 Thread Valentin Villenave
On 1/12/19, Thomas Morley  wrote:
> Then Ambitus_engraver is not affected

On an unrelated note: Gilles, if you happen to speak French, you may
also be interested in joining the LilyPond French-speaking community:
http://lists.gnu.org/mailman/listinfo/lilypond-user-fr
(just in case you didn’t already know about it.)

Cheers,
V.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-12 Thread Thomas Morley
Am Fr., 11. Jan. 2019 um 10:04 Uhr schrieb Gloops :
>
> Hello Harm
> Thank you for this correction ...
> Is there any way to engrave the ambitus directly without going through
> "note-head :: brew-ez-stencil" in order to avoid the head of the note?
> Gilles

Not sure what you mean.
Probably, set details.ez-numbers #f or easier comment \easyAmbitusHeadsOn
Then Ambitus_engraver is not affected by Ez_numbers_engraver_harm

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-11 Thread Gloops
Hello Harm
Thank you for this correction ...
Is there any way to engrave the ambitus directly without going through
"note-head :: brew-ez-stencil" in order to avoid the head of the note?
Gilles



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-10 Thread Thomas Morley
Am Mi., 9. Jan. 2019 um 23:38 Uhr schrieb Gloops :
>
> 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

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-09 Thread Gloops
Thank you very much Harm, it works very well now!!!
Musically
Gilles



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Ambitus per voice and Ez_numbers_engraver

2019-01-08 Thread Thomas Morley
Am Di., 8. Jan. 2019 um 14:51 Uhr schrieb Gloops :
>
> Hello!
> Ambitus by voice and Ez_numbers_engraver can not work together?

The problem: Ez_numbers_engraver works on every grob with a
note-head-interface. NoteHeads and AmbitusNoteHead both have this.
Though, at the time this engraver works the pitch of AmbitusNoteHead
is not yet known, thus an error occurs if one tries to rely on this
pitch.

Suggestion:
Do settings for AmbitusNoteHead after-line-breaking, switched on by
the (new introduced) details.ez-numbers-property and let the other
code do as before.

There's wide room for improvements, ofcourse. Nevertheless here the code:

\version "2.19.82"

#(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 'stencil
  (note-head::brew-ez-stencil grob))
(ly:grob-set-property! grob 'font-family 'sans)
(ly:grob-set-property! grob 'font-series 'bold))

(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

easyAmbitusHeadsOn = \override AmbitusNoteHead.details.ez-numbers = ##t


\layout {
  ragged-right = ##t
  \context {
\Voice
\consists \Ez_numbers_engraver_harm
\consists "Ambitus_engraver"
\easyAmbitusHeadsOn
  }
}

\new Staff <<
  \new Voice \with {

  } \relative c'' {
  \key f \major
\override Ambitus.X-offset = #2.0
\voiceOne
\easyHeadsOn
c4 a d e
f2
  }
  \new Voice \with {

  } \relative c' {
\voiceTwo
\easyHeadsOn
es4 f g  as
b1
  }
>>

HTH,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Ambitus per voice and Ez_numbers_engraver

2019-01-08 Thread Gloops
Hello!
Ambitus by voice and Ez_numbers_engraver can not work together?
Gilles

#(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
\consists "Ambitus_engraver"

  }
}



\new Staff <<
  \new Voice \with {

  } \relative c'' {
\override Ambitus.X-offset = #2.0
\voiceOne
\easyHeadsOn
c4 a d e
f1
  }
  \new Voice \with {

  } \relative c' {
\voiceTwo
\easyHeadsOn
es4 f g  as
b1
  }
>>



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user