Re: Feathered Beam Timing

2024-05-12 Thread Timothy Lanfear

On 12/05/2024 09:46, Timothy Lanfear wrote:

On 11/05/2024 18:42, Steph Phillips wrote:




Pretty happy with how that looks, but now I'm having trouble 
converting it to a function. The following is what I've put together, 
but I can't seem to shake the compiler error.



The parameters feather-ratio, tuplet-ratio are not moments, but 
ratios. Also, the parser and location arguments have not been required 
for several releases of LilyPond. Here is a working version of your 
function.


Looking again at the documentation, feather-ratio can be expressed as a 
moment -- the predicate to match this type is ly:moment? (not moment?). 
Tuplet-ratio must be a rational number, expressed as a pair.



--
Timothy Lanfear, Bristol, UK.


Re: Feathered Beam Timing

2024-05-12 Thread Timothy Lanfear

On 11/05/2024 18:42, Steph Phillips wrote:




Pretty happy with how that looks, but now I'm having trouble 
converting it to a function. The following is what I've put together, 
but I can't seem to shake the compiler error.



The parameters feather-ratio, tuplet-ratio are not moments, but ratios. 
Also, the parser and location arguments have not been required for 
several releases of LilyPond. Here is a working version of your function.


\version "2.24.2"

customTuplet = #(define-music-function
  (displayed-note y-off beam-left tuplet-up feather-ratio tuplet-ratio 
notes)

  (number? number? boolean? boolean? rational? pair? ly:music?)
   #{
 \once \override TupletNumber.text = \markup { \note-by-number 
#displayed-note #0 #UP }

 \once \override TupletBracket.bracket-visibility = ##t
 \once \override TupletBracket.visible-over-note-heads = ##t
 \once \override TupletBracket.Y-offset = #y-off
 \once \override Beam.grow-direction = #(if beam-left LEFT RIGHT)
 #(if tuplet-up
    #{ \tupletUp \tuplet #tuplet-ratio {
 \featherDurations #feather-ratio { $notes }
   } #}
    #{ \tupletDown \tuplet #tuplet-ratio {
 \featherDurations #feather-ratio { $notes }
   } #}
 )
   #})

\score {
  \relative c'' {
    \time 4/4

    \customTuplet #1 #-1.5 ##t ##t #2/1 #'(6 . 8) {
  d16[-. d-. d-. d-. d-. d]-.
    }

    \customTuplet #2 #-1.5 ##f ##f #2/1 #'(5 . 8) {
  e16[-. e-. e-. e-. e-. e]-.
    }
  }
}

--
Timothy Lanfear, Bristol, UK.


Re: Feathered Beam Timing

2024-05-11 Thread David Wright
On Sat 11 May 2024 at 16:06:00 (+0200), N. Andrew Walsh wrote:
> (the stickler in me would complain that tuplets should always indicate a
> shortening of length, and this is technically putting six sixteenths in the
> space of eight, but I guess the feathering overrules that)

I tickles me that I still remember my first encounter with
two in the time of three (Vaughan Williams, Te Deum in G,
Govern them …) even though it was over 60 years ago.

Cheers,
David.



Re: Feathered Beam Timing

2024-05-11 Thread Archer Endrich

Hello,

I have frequently encountered the situation where I want to have 
feathered durations within a specified duration -- e.g., a crotchet, or 
a minim, or a breve.  This is the code I've come up with:


\once \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 1/2)
  \tuplet 6/8 {a'16^\markup{\small{( \note {2} #UP )}}\p\<[( g' a' b' 
c'' d'')]}

  \once \override Beam.grow-direction = #'()
  |

The use of the tuplet helps to indicate the number of notes in the 
figure.  In this case, 6 semiquaver notes are to be played with the time 
of 8 semiquavers (and feathered) to fill out a minim duration.  This 
minim is shown above the figure in parentheses using markup, to confirm 
to the player the duration to be filled.


Here is another example in which 8 notes are played in the time of 8 
semiquavers, but feathered.


 \once \override Beam.grow-direction = #RIGHT
    \featherDurations #(ly:make-moment 1/2)
    \tuplet 8/8 {a'16^\markup{\small{( \note {2} #UP )}}\p[( b' c'' b' 
c'' d'' c'' b')]}

  \once \override Beam.grow-direction = #'() |

And another, in which 8 notes are feathered within a breve (whole note) :

 \once \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 1/2)
  \tuplet 8/16 {e''!16^\markup{\small{( \note {1} #UP )}}\p\<[( e'' 
e'' e''\!) e''\>( e'' e'' e''\!)]}

  \once \override Beam.grow-direction = #'()

The tuplet is 8/16 because it takes 16 normal semiquavers to fill four 
beats and there are only 8 notes.


This score was done with version 2.22.0 and compiles OK.  I hope this 
helps, but if anything is incorrect or could be improved, I trust the 
list to comment.


Archer


On 11/05/2024 15:06, N. Andrew Walsh wrote:

Hi Steph,

I'm not an expert with the \featherDurations interface, but this:

On Sat, May 11, 2024 at 3:53 PM Steph Phillips 
 wrote:



\once \override Beam.grow-direction = #LEFT
\featherDurations 6/4 { d16[-. d-. d-. d-. d-. d]-. } |

seems to disagree with how the tutorial describes it: 
https://lilypond.org/doc/v2.25/Documentation/notation/feathered-beams


There, that ratio (*unlike* with tuplets) describes the ratio in 
duration between the first and last value of the feathered 
group, *not* their relationship to unmodified durations. So if you 
wanted the first note to be a sixteenth and the last to be an eighth, 
you'd use "2/1". I don't know how you'd get six sixteenths to fit 
within the duration of a half note, though, as the feathered interface 
doesn't seem to account for tuplet-like durations. Or, at least, it 
doesn't seem to be documented. Maybe you'd have to nest one inside the 
other? Something like

--
\tuplet 6/8 {
\once \override Beam.grow-direction = #LEFT
\featherDurations 2/1 { d16[-. d-. d-. d-. d-. d]-. }
}
--
(the stickler in me would complain that tuplets should always indicate 
a shortening of length, and this is technically putting six sixteenths 
in the space of eight, but I guess the feathering overrules that)


Anyway, maybe that helps?

Cheers,

A




Re: Feathered Beam Timing

2024-05-11 Thread N. Andrew Walsh
Hi Steph,

I'm not an expert with the \featherDurations interface, but this:

On Sat, May 11, 2024 at 3:53 PM Steph Phillips 
wrote:

>
> \once \override Beam.grow-direction = #LEFT
> \featherDurations 6/4 { d16[-. d-. d-. d-. d-. d]-. } |
>
seems to disagree with how the tutorial describes it:
https://lilypond.org/doc/v2.25/Documentation/notation/feathered-beams

There, that ratio (*unlike* with tuplets) describes the ratio in duration
between the first and last value of the feathered group, *not* their
relationship to unmodified durations. So if you wanted the first note to be
a sixteenth and the last to be an eighth, you'd use "2/1". I don't know how
you'd get six sixteenths to fit within the duration of a half note, though,
as the feathered interface doesn't seem to account for tuplet-like
durations. Or, at least, it doesn't seem to be documented. Maybe you'd have
to nest one inside the other? Something like
--
\tuplet 6/8 {
\once \override Beam.grow-direction = #LEFT
\featherDurations 2/1 { d16[-. d-. d-. d-. d-. d]-. }
}
--
(the stickler in me would complain that tuplets should always indicate a
shortening of length, and this is technically putting six sixteenths in the
space of eight, but I guess the feathering overrules that)

Anyway, maybe that helps?

Cheers,

A