Re: 3/2 unusual writing

2018-10-05 Thread Jacques Menu
Hello Jan-Peter,

Thanks, that allows cross-selection between source code and resulting image.

JM

> Le 4 oct. 2018 à 20:49, Jan-Peter Voigt  a écrit :
> 
> Hello,
> 
> an engraver can set the duration-log property conditionally as a tweak:
> 
> %%
> \version "2.19.82"
> 
> \layout {
>  \context {
>\Voice
>\consists #(make-engraver
>(listeners
> ((note-event engraver event)
>  (let ((durlog (ly:duration-log (ly:event-property
> event 'duration
>(if (> durlog 1) (ly:event-set-property! event
> 'tweaks '(((NoteHead . duration-log) . 1)) ))
>
>  }
> }
> 
> \relative d {
>  \clef bass \key d \major
>  \time 3/2
>  d1. | e1. | fis2 b,8*2[ cis d b] |
>  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>  e2. d8*2 cis2
> }
> 
> 
> HTH
> Jan-Peter
> 
> 
> Am 04.10.2018 um 20:20 schrieb Pierre Perol-Schneider:
>> Hi All,
>> Another option:
>> 
>> \version "2.19.82"
>> 
>> \relative d {
>>\clef bass \key d \major
>>\time 3/2
>>d1. | e1.
>>\override NoteHead.duration-log = #1
>>| fis2 b,8*2[ cis d b] |
>>\once\revert NoteHead.duration-log
>>e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>>e2. d8*2 cis2
>> }
>> 
>> Cheers,
>> Pierre
>> 
>> Le jeu. 4 oct. 2018 à 14:32, Jacques Menu > >> a écrit :
>> 
>>Hello Graham & Aaron,
>> 
>>Thanks, both your solutions work fine. Lily is really great!
>> 
>>Avoiding to use multiplying factors as in b,8*2 has the advantage
>>that Frescobaldi can select the code from the glyphs and vice-versa
>>alright.
>> 
>>A nice day!
>> 
>>JM
>> 
>>>Le 4 oct. 2018 à 13:29, Aaron Hill >> 
>>>>> a 
>>> écrit :
>>> 
>>>On 2018-10-04 2:09 am, Jacques Menu wrote:
Hello folks,
I’ve found this in Charpentier’s Te Deum, as engraved by the
Centre de Musique Baroque de Versailles, which I had never seen
before:
It’s quite readable indeed, maybe more than using the modern
notation with quarters, and I’ve wondered if there a way to obtain
that with Lily.
>>> 
>>>Simplest option is to use a note scaling fraction:
>>> 
>>>d2*1/2
>>> 
>>>This produces a "half note" but it has been scaled in half so it
>>>only lasts as long as a quarter note.  The note head, however,
>>>will still render as a half.
>>> 
>>>The problem is that this does not let you do beaming:
>>> 
>>>d2*1/2[ e f g]
>>> 
>>>You will get an error because half notes do not support beams.
>>> 
>>>One way to get around this is to use something like an eighth note
>>>(which does support beams) and then scale it so it lasts as long
>>>as a quarter (which is what the music in question needs):
>>> 
>>>d8*2[ e f g]
>>> 
>>>But now we are back at the problem where the note heads are
>>>showing as solid.  Graham has provided a way to force the note
>>>head to render however you want.  Allow me to provide an alternative:
>>> 
>>>
>>>\version "2.19.82"
>>> 
>>>\relative d {
>>> \clef bass \key d \major
>>> \time 3/2
>>> \override NoteHead.stencil = #(lambda (grob)
>>>   (let* ((dur (ly:event-property (event-cause grob) 'duration))
>>>  (dur? (and (eqv? (ly:duration-log dur) 3) (eqv?
>>>(ly:duration-scale dur) 2
>>> (if dur? (ly:grob-set-property! grob 'text (markup
>>>#:musicglyph "noteheads.s1")))
>>> (if dur? ly:text-interface::print ly:note-head::print)))
>>> d1. | e1. | fis2 b,8*2[ cis d b] |
>>> e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>>> e2. d8*2 cis2
>>>}
>>>
>>> 
>>>What I am doing here is providing a function that checks to see if
>>>you are using the 8*2 duration specifically and only then
>>>adjusting the way the note head is displayed.
>>> 
>>>-- Aaron Hill
>>> 
> 
> ___
> 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: 3/2 unusual writing

2018-10-04 Thread Jan-Peter Voigt
Hello,

an engraver can set the duration-log property conditionally as a tweak:

%%
\version "2.19.82"

\layout {
  \context {
\Voice
\consists #(make-engraver
(listeners
 ((note-event engraver event)
  (let ((durlog (ly:duration-log (ly:event-property
event 'duration
(if (> durlog 1) (ly:event-set-property! event
'tweaks '(((NoteHead . duration-log) . 1)) ))

  }
}

\relative d {
  \clef bass \key d \major
  \time 3/2
  d1. | e1. | fis2 b,8*2[ cis d b] |
  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
  e2. d8*2 cis2
}


HTH
Jan-Peter


Am 04.10.2018 um 20:20 schrieb Pierre Perol-Schneider:
> Hi All,
> Another option:
> 
> \version "2.19.82"
> 
> \relative d {
>    \clef bass \key d \major
>    \time 3/2
>    d1. | e1.
>    \override NoteHead.duration-log = #1
>    | fis2 b,8*2[ cis d b] |
>    \once\revert NoteHead.duration-log
>    e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>    e2. d8*2 cis2
> }
> 
> Cheers,
> Pierre
> 
> Le jeu. 4 oct. 2018 à 14:32, Jacques Menu  > a écrit :
> 
> Hello Graham & Aaron,
> 
> Thanks, both your solutions work fine. Lily is really great!
> 
> Avoiding to use multiplying factors as in b,8*2 has the advantage
> that Frescobaldi can select the code from the glyphs and vice-versa
> alright.
> 
> A nice day!
> 
> JM
> 
>> Le 4 oct. 2018 à 13:29, Aaron Hill > > a écrit :
>>
>> On 2018-10-04 2:09 am, Jacques Menu wrote:
>>> Hello folks,
>>> I’ve found this in Charpentier’s Te Deum, as engraved by the
>>> Centre de Musique Baroque de Versailles, which I had never seen
>>> before:
>>> It’s quite readable indeed, maybe more than using the modern
>>> notation with quarters, and I’ve wondered if there a way to obtain
>>> that with Lily.
>>
>> Simplest option is to use a note scaling fraction:
>>
>> d2*1/2
>>
>> This produces a "half note" but it has been scaled in half so it
>> only lasts as long as a quarter note.  The note head, however,
>> will still render as a half.
>>
>> The problem is that this does not let you do beaming:
>>
>> d2*1/2[ e f g]
>>
>> You will get an error because half notes do not support beams.
>>
>> One way to get around this is to use something like an eighth note
>> (which does support beams) and then scale it so it lasts as long
>> as a quarter (which is what the music in question needs):
>>
>> d8*2[ e f g]
>>
>> But now we are back at the problem where the note heads are
>> showing as solid.  Graham has provided a way to force the note
>> head to render however you want.  Allow me to provide an alternative:
>>
>> 
>> \version "2.19.82"
>>
>> \relative d {
>>  \clef bass \key d \major
>>  \time 3/2
>>  \override NoteHead.stencil = #(lambda (grob)
>>    (let* ((dur (ly:event-property (event-cause grob) 'duration))
>>   (dur? (and (eqv? (ly:duration-log dur) 3) (eqv?
>> (ly:duration-scale dur) 2
>>  (if dur? (ly:grob-set-property! grob 'text (markup
>> #:musicglyph "noteheads.s1")))
>>  (if dur? ly:text-interface::print ly:note-head::print)))
>>  d1. | e1. | fis2 b,8*2[ cis d b] |
>>  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>>  e2. d8*2 cis2
>> }
>> 
>>
>> What I am doing here is providing a function that checks to see if
>> you are using the 8*2 duration specifically and only then
>> adjusting the way the note head is displayed.
>>
>> -- Aaron Hill
>>

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


Re: 3/2 unusual writing

2018-10-04 Thread Pierre Perol-Schneider
Hi All,
Another option:

\version "2.19.82"

\relative d {
   \clef bass \key d \major
   \time 3/2
   d1. | e1.
   \override NoteHead.duration-log = #1
   | fis2 b,8*2[ cis d b] |
   \once\revert NoteHead.duration-log
   e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
   e2. d8*2 cis2
}

Cheers,
Pierre

Le jeu. 4 oct. 2018 à 14:32, Jacques Menu  a écrit :

> Hello Graham & Aaron,
>
> Thanks, both your solutions work fine. Lily is really great!
>
> Avoiding to use multiplying factors as in b,8*2 has the advantage that
> Frescobaldi can select the code from the glyphs and vice-versa alright.
>
> A nice day!
>
> JM
>
> Le 4 oct. 2018 à 13:29, Aaron Hill  a écrit :
>
> On 2018-10-04 2:09 am, Jacques Menu wrote:
>
> Hello folks,
> I’ve found this in Charpentier’s Te Deum, as engraved by the
> Centre de Musique Baroque de Versailles, which I had never seen
> before:
> It’s quite readable indeed, maybe more than using the modern
> notation with quarters, and I’ve wondered if there a way to obtain
> that with Lily.
>
>
> Simplest option is to use a note scaling fraction:
>
> d2*1/2
>
> This produces a "half note" but it has been scaled in half so it only
> lasts as long as a quarter note.  The note head, however, will still render
> as a half.
>
> The problem is that this does not let you do beaming:
>
> d2*1/2[ e f g]
>
> You will get an error because half notes do not support beams.
>
> One way to get around this is to use something like an eighth note (which
> does support beams) and then scale it so it lasts as long as a quarter
> (which is what the music in question needs):
>
> d8*2[ e f g]
>
> But now we are back at the problem where the note heads are showing as
> solid.  Graham has provided a way to force the note head to render however
> you want.  Allow me to provide an alternative:
>
> 
> \version "2.19.82"
>
> \relative d {
>  \clef bass \key d \major
>  \time 3/2
>  \override NoteHead.stencil = #(lambda (grob)
>(let* ((dur (ly:event-property (event-cause grob) 'duration))
>   (dur? (and (eqv? (ly:duration-log dur) 3) (eqv?
> (ly:duration-scale dur) 2
>  (if dur? (ly:grob-set-property! grob 'text (markup #:musicglyph
> "noteheads.s1")))
>  (if dur? ly:text-interface::print ly:note-head::print)))
>  d1. | e1. | fis2 b,8*2[ cis d b] |
>  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>  e2. d8*2 cis2
> }
> 
>
> What I am doing here is providing a function that checks to see if you are
> using the 8*2 duration specifically and only then adjusting the way the
> note head is displayed.
>
> -- Aaron Hill
>
> ___
> 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
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: 3/2 unusual writing

2018-10-04 Thread Jacques Menu
Hello Graham & Aaron,

Thanks, both your solutions work fine. Lily is really great!

Avoiding to use multiplying factors as in b,8*2 has the advantage that 
Frescobaldi can select the code from the glyphs and vice-versa alright.

A nice day!

JM

> Le 4 oct. 2018 à 13:29, Aaron Hill  a écrit :
> 
> On 2018-10-04 2:09 am, Jacques Menu wrote:
>> Hello folks,
>> I’ve found this in Charpentier’s Te Deum, as engraved by the
>> Centre de Musique Baroque de Versailles, which I had never seen
>> before:
>> It’s quite readable indeed, maybe more than using the modern
>> notation with quarters, and I’ve wondered if there a way to obtain
>> that with Lily.
> 
> Simplest option is to use a note scaling fraction:
> 
> d2*1/2
> 
> This produces a "half note" but it has been scaled in half so it only lasts 
> as long as a quarter note.  The note head, however, will still render as a 
> half.
> 
> The problem is that this does not let you do beaming:
> 
> d2*1/2[ e f g]
> 
> You will get an error because half notes do not support beams.
> 
> One way to get around this is to use something like an eighth note (which 
> does support beams) and then scale it so it lasts as long as a quarter (which 
> is what the music in question needs):
> 
> d8*2[ e f g]
> 
> But now we are back at the problem where the note heads are showing as solid. 
>  Graham has provided a way to force the note head to render however you want. 
>  Allow me to provide an alternative:
> 
> 
> \version "2.19.82"
> 
> \relative d {
>  \clef bass \key d \major
>  \time 3/2
>  \override NoteHead.stencil = #(lambda (grob)
>(let* ((dur (ly:event-property (event-cause grob) 'duration))
>   (dur? (and (eqv? (ly:duration-log dur) 3) (eqv? (ly:duration-scale 
> dur) 2
>  (if dur? (ly:grob-set-property! grob 'text (markup #:musicglyph 
> "noteheads.s1")))
>  (if dur? ly:text-interface::print ly:note-head::print)))
>  d1. | e1. | fis2 b,8*2[ cis d b] |
>  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>  e2. d8*2 cis2
> }
> 
> 
> What I am doing here is providing a function that checks to see if you are 
> using the 8*2 duration specifically and only then adjusting the way the note 
> head is displayed.
> 
> -- Aaron Hill
> 
> ___
> 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: 3/2 unusual writing

2018-10-04 Thread Aaron Hill

On 2018-10-04 2:09 am, Jacques Menu wrote:

Hello folks,

I’ve found this in Charpentier’s Te Deum, as engraved by the
Centre de Musique Baroque de Versailles, which I had never seen
before:

It’s quite readable indeed, maybe more than using the modern
notation with quarters, and I’ve wondered if there a way to obtain
that with Lily.


Simplest option is to use a note scaling fraction:

d2*1/2

This produces a "half note" but it has been scaled in half so it only 
lasts as long as a quarter note.  The note head, however, will still 
render as a half.


The problem is that this does not let you do beaming:

d2*1/2[ e f g]

You will get an error because half notes do not support beams.

One way to get around this is to use something like an eighth note 
(which does support beams) and then scale it so it lasts as long as a 
quarter (which is what the music in question needs):


d8*2[ e f g]

But now we are back at the problem where the note heads are showing as 
solid.  Graham has provided a way to force the note head to render 
however you want.  Allow me to provide an alternative:



\version "2.19.82"

\relative d {
  \clef bass \key d \major
  \time 3/2
  \override NoteHead.stencil = #(lambda (grob)
(let* ((dur (ly:event-property (event-cause grob) 'duration))
   (dur? (and (eqv? (ly:duration-log dur) 3) (eqv? 
(ly:duration-scale dur) 2
  (if dur? (ly:grob-set-property! grob 'text (markup #:musicglyph 
"noteheads.s1")))

  (if dur? ly:text-interface::print ly:note-head::print)))
  d1. | e1. | fis2 b,8*2[ cis d b] |
  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
  e2. d8*2 cis2
}


What I am doing here is providing a function that checks to see if you 
are using the 8*2 duration specifically and only then adjusting the way 
the note head is displayed.


-- Aaron Hill

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


Re: 3/2 unusual writing

2018-10-04 Thread Graham King


On 4 Oct 2018, at 10:09, Jacques Menu wrote:

> Hello folks,
> 
> I’ve found this in Charpentier’s Te Deum, as engraved by the Centre de 
> Musique Baroque de Versailles, which I had never seen before:
> 
> <3-2 unusual writing.png>
> 
> It’s quite readable indeed, maybe more than using the modern notation with 
> quarters, and I’ve wondered if there a way to obtain that with Lily.
> 
> Thanks for your help!
> 
> JM

Jacques, does this help?
The code works for your example, but it would need a bit of work to generalise 
it.

\version "2.19.82"

whiteheads = #(define-music-function (music) (ly:music?)
  #{
\temporary \override NoteHead.stencil = #ly:text-interface::print
\temporary \override NoteHead.text = \markup {
  \musicglyph "noteheads.s1" }
\omit \time 3/4
\shiftDurations #1 #0 { #music }
\omit \time 3/2
\revert NoteHead.stencil
\revert NoteHead.text
  #}
)

{ \clef bass 
  \key b \minor
  \time 3/2
  \relative { 
d1. |
e1. |
\whiteheads {fis2 b,4 cis d b} |
e1. |
\whiteheads {fis2. gis4 ais2 |
b2 b,4 cis d2 |
e2. d4 cis2} |
}}

kind regards
-- Graham


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


3/2 unusual writing

2018-10-04 Thread Jacques Menu
Hello folks,

I’ve found this in Charpentier’s Te Deum, as engraved by the Centre de Musique 
Baroque de Versailles, which I had never seen before:



It’s quite readable indeed, maybe more than using the modern notation with 
quarters, and I’ve wondered if there a way to obtain that with Lily.

Thanks for your help!

JM

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