Re: NoteHeads vs duration

2016-08-20 Thread Pierre Perol-Schneider
Hi Malte.
Actually the markups there were just to put something, not real issues.

Thanks anyway!
Cheers,
Pierre

2016-08-20 12:41 GMT+02:00 Malte Meyn :

>
>
> Am 20.08.2016 um 12:25 schrieb Pierre Perol-Schneider:
>
>> (case duration
   ((0) (grob-interpret-markup grob (markup "0")))
   ((1) (grob-interpret-markup grob (markup "1")))
   ((2) (grob-interpret-markup grob (markup "2")))
   ((3) (grob-interpret-markup grob (markup "3")))
   ((4) (grob-interpret-markup grob (markup "4")))
   ((5) (grob-interpret-markup grob (markup "5")))
   ((6) (grob-interpret-markup grob (markup "6")))
   ((7) (grob-interpret-markup grob (markup "7")))
   (else (ly:note-head::print grob)

>>>
> Why not simply use number->string here? Do you really want to print actual
> note heads for breve (and longer) and 256th (and shorter) notes?
>
> \override NoteHead.stencil =
> #(lambda (grob)
>(grob-interpret-markup grob
>  (markup
>   (number->string
>(ly:duration-log
> (ly:event-property (event-cause grob) 'duration))
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: NoteHeads vs duration

2016-08-20 Thread Malte Meyn



Am 20.08.2016 um 12:25 schrieb Pierre Perol-Schneider:

(case duration
  ((0) (grob-interpret-markup grob (markup "0")))
  ((1) (grob-interpret-markup grob (markup "1")))
  ((2) (grob-interpret-markup grob (markup "2")))
  ((3) (grob-interpret-markup grob (markup "3")))
  ((4) (grob-interpret-markup grob (markup "4")))
  ((5) (grob-interpret-markup grob (markup "5")))
  ((6) (grob-interpret-markup grob (markup "6")))
  ((7) (grob-interpret-markup grob (markup "7")))
  (else (ly:note-head::print grob)


Why not simply use number->string here? Do you really want to print 
actual note heads for breve (and longer) and 256th (and shorter) notes?


\override NoteHead.stencil =
#(lambda (grob)
   (grob-interpret-markup grob
 (markup
  (number->string
   (ly:duration-log
(ly:event-property (event-cause grob) 'duration))

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


Re: NoteHeads vs duration

2016-08-20 Thread Pierre Perol-Schneider
Thank you very much David.

2016-08-20 12:20 GMT+02:00 David Kastrup :

> Pierre Perol-Schneider  writes:
>
> > Typo, sorry : so, again, how can I get access to the note head when
> > duration is shorter than a fourth note ?
> >
> > \version "2.19.46"
> >
> > \score {
> >   \new Staff \relative c'' { c1 2 4 8 16 32 64 128 }
> >   \layout {
> > \context {
> >   \Staff
> >   \omit Stem
> >   \omit Flag
> >   \override NoteHead.stencil =
> > #(lambda (grob)
> >   (let ((duration (ly:grob-property grob 'duration-log)))
> > (case duration
> >   ((0) (grob-interpret-markup grob (markup "0")))
> >   ((1) (grob-interpret-markup grob (markup "1")))
> >   ((2) (grob-interpret-markup grob (markup "2")))
> >   ((3) (grob-interpret-markup grob (markup "3")))
> >   ((4) (grob-interpret-markup grob (markup "4")))
> >   ((5) (grob-interpret-markup grob (markup "5")))
> >   ((6) (grob-interpret-markup grob (markup "6")))
> >   ((7) (grob-interpret-markup grob (markup "7")))
> >   (else (ly:note-head::print grob)
> > }
> >   }
> > }
>
> You don't want to "get access to the note head" since the note heads,
> indeed, are all the same for durations shorter than a fourth note.
> Instead, go at the actual _note_ instead, namely the stream event.
>
>
>
>
> --
> David Kastrup
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: NoteHeads vs duration

2016-08-20 Thread David Kastrup
Pierre Perol-Schneider  writes:

> Typo, sorry : so, again, how can I get access to the note head when
> duration is shorter than a fourth note ?
>
> \version "2.19.46"
>
> \score {
>   \new Staff \relative c'' { c1 2 4 8 16 32 64 128 }
>   \layout {
> \context {
>   \Staff
>   \omit Stem
>   \omit Flag
>   \override NoteHead.stencil =
> #(lambda (grob)
>   (let ((duration (ly:grob-property grob 'duration-log)))
> (case duration
>   ((0) (grob-interpret-markup grob (markup "0")))
>   ((1) (grob-interpret-markup grob (markup "1")))
>   ((2) (grob-interpret-markup grob (markup "2")))
>   ((3) (grob-interpret-markup grob (markup "3")))
>   ((4) (grob-interpret-markup grob (markup "4")))
>   ((5) (grob-interpret-markup grob (markup "5")))
>   ((6) (grob-interpret-markup grob (markup "6")))
>   ((7) (grob-interpret-markup grob (markup "7")))
>   (else (ly:note-head::print grob)
> }
>   }
> }

You don't want to "get access to the note head" since the note heads,
indeed, are all the same for durations shorter than a fourth note.
Instead, go at the actual _note_ instead, namely the stream event.

\version "2.19.46"

\score {
  \new Staff \relative c'' { c1 2 4 8 16 32 64 128 }
  \layout {
\context {
  \Staff
  \omit Stem
  \omit Flag
  \override NoteHead.stencil =
#(lambda (grob)
  (let ((duration (ly:duration-log
			   (ly:event-property (event-cause grob) 'duration
(case duration
  ((0) (grob-interpret-markup grob (markup "0")))
  ((1) (grob-interpret-markup grob (markup "1")))
  ((2) (grob-interpret-markup grob (markup "2")))
  ((3) (grob-interpret-markup grob (markup "3")))
  ((4) (grob-interpret-markup grob (markup "4")))
  ((5) (grob-interpret-markup grob (markup "5")))
  ((6) (grob-interpret-markup grob (markup "6")))
  ((7) (grob-interpret-markup grob (markup "7")))
  (else (ly:note-head::print grob)
}
  }
}


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


Re: NoteHeads vs duration

2016-08-20 Thread Pierre Perol-Schneider
Typo, sorry : so, again, how can I get access to the note head when
duration is shorter than a fourth note ?

\version "2.19.46"

\score {
  \new Staff \relative c'' { c1 2 4 8 16 32 64 128 }
  \layout {
\context {
  \Staff
  \omit Stem
  \omit Flag
  \override NoteHead.stencil =
#(lambda (grob)
  (let ((duration (ly:grob-property grob 'duration-log)))
(case duration
  ((0) (grob-interpret-markup grob (markup "0")))
  ((1) (grob-interpret-markup grob (markup "1")))
  ((2) (grob-interpret-markup grob (markup "2")))
  ((3) (grob-interpret-markup grob (markup "3")))
  ((4) (grob-interpret-markup grob (markup "4")))
  ((5) (grob-interpret-markup grob (markup "5")))
  ((6) (grob-interpret-markup grob (markup "6")))
  ((7) (grob-interpret-markup grob (markup "7")))
  (else (ly:note-head::print grob)
}
  }
}

Cheers,
Pierre


2016-08-20 10:37 GMT+02:00 Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com>:

> Hi,
>
> Please consider the following:
>
> \version "2.19.46"
>
> \score {
>   \new Staff \relative c'' { c1 2 4 8 16 32 64 128 256 }
>   \layout {
> \context {
>   \Staff
>   \omit Stem
>   \omit Flag
>   \override NoteHead.stencil =
> #(lambda (grob)
>   (let ((duration (ly:grob-property grob 'duration-log)))
> (case duration
>   ((0) (grob-interpret-markup grob (markup "0")))
>   ((1) (grob-interpret-markup grob (markup "1")))
>   ((2) (grob-interpret-markup grob (markup "2")))
>   ((3) (grob-interpret-markup grob (markup "3")))
>   ((4) (grob-interpret-markup grob (markup "4")))
>   ((5) (grob-interpret-markup grob (markup "5")))
>   ((6) (grob-interpret-markup grob (markup "6")))
>   ((7) (grob-interpret-markup grob (markup "7")))
>   ((8) (grob-interpret-markup grob (markup "8")))
>   (else (ly:note-head::print grob)
> }
>   }
> }
>
> How can I get access to the note head when duration is shorter that a
> fourth note ?
> TIA.
>
> Cheers,
> Pierre
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user