[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re:feathered beam calculations
From:       Flaming Hakama by Elaine <elaine () flaminghakama ! com>
Date:       2018-12-21 23:44:52
Message-ID: CACX-=8zW+UN4Sc80LAZ0JA0AWio_xDfX4CFQGoJ1UbWDPJV0TA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> ---------- Forwarded message ----------

From: Reggie <reegistoop@gmail.com>
> To: lilypond-user@gnu.org
> Cc:
> Bcc:
> Date: Fri, 21 Dec 2018 12:10:12 -0700 (MST)
> Subject: Re: feathered beam calculations
> Aaron Hill wrote
> > Given the current implementation, it would be necessary to use an
> > approximate rational like 50/63 as the moment in order to get 'f' to be
> > half of 'c'.  Why that number?  Well, it's a close approximation to the
> > irrational cube root of one half.  We determine this exact value by
> > taking the desired ratio (1/2) and raising it to the reciprocal of the
> > number of scaling steps between the first and last notes (three, in this
> > case, which becomes the fraction 1/3).  (1/2)^(1/3) is about 0.7937; and
> > 50/63 is roughly 0.79365.
> >
> > But before we get lost in the murky details of whether the implemented
> > behavior is right or the documentation is right, let us circle back
> > around to a key point that I feel has not been stressed enough.
> >
> > This means your score really should be bar check clean *before* you ever
> > use \featherDurations.
> >
> > I said earlier we would talk about bar checks *within* the feathered
> > sequence of notes.  Consider the following addition to our example:
> >
> >      << { r64 \featherDurations #(ly:make-moment 2/1)
> >               { c32*127/14[ d e f g a | b] } }
> >         { r64 \featherDurations #(ly:make-moment 2/1)
> >               { c32*63/12[ d e f g a] } | b1 }
> >         { r64 { c64 d32 e16 f8 g4 a2 } | b1 } >>
> >
> > You'll see that the 'b' is included within the beamed notes.  Because we
> > now have seven notes covering the period of two measures less one 64th,
> > we had to adjust our scaling fraction to 127/14.  However, what is most
> > important is that \featherDurations fixes the timing of the notes to
> > allow the inside bar check to pass.  Omit it, and you'll see that the
> > bar check fails.  But also try changing the 2/1 moment to anything else,
> > and the bar check will also fail.
> >
> > What we have here is a very fragile element in the score that can be
> > easily avoided by never requiring any note (apart from the first) within
> > a feathered sequence to align to anything else.  The final 'b' above
> > should properly be outside the feathered sequence (or possibly start a
> > new sequence of its own).  In this way, the math to ensure all of the
> > sequences have the right lengths can be done completely independent of
> > \featherDurations.
> >
> > Hopefully some of this will be helpful.
> >
> > -- Aaron Hill
> >
> > _______________________________________________
> > lilypond-user mailing list
>
> > lilypond-user@
>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> Aaron that makes sense but only if you have failed bar checks before
> feathering. Let's say you have a perfect score with no fails. And now you
> want to simply insert feather beamed notes only in one measure but have
> them
> spaced out according to the speed accelerando ritard as standard. How do
> you
> even begin to know what math * * * * you should be doing when there is no
> math to do in the first place??? NO bar check math because everything is
> already fine. Why can't you just spread out the notes according to how
> feathers are supposed to? Prove me please. Here look.
>
>
> \relative c'
> {
>
>   \override Beam.grow-direction = #LEFT
>   \featherDurations #(ly:make-moment 2/1)
>   c32[ d e f g f e f d f g f d e d f] c4~c | c1 |
> }
>
>
> My CODE has no errors. And yet the 2/1 does NOT space out any notes at ALL
> it's just normal beamed notes with fancy feathers. What math do I need how
> does one even know what math to use since there are no bar bad checks? See?
> :))
>


 \version "2.18.2"

%{

If you want the spacing to be proportionate to duration,
then you are responsible for calculating those durations.

It is basically high school level math, so grab a beer
and let's go.


Let's think this through from the beginning.

In terms of the literal feathered beaming, you have specified
eight notes, which scale in duration from a 32nd to an 8th.
What is the actual duration of this sequence?

Assuming a linear scale, on average, these would sum to 1.25

(For example, add first & last and multiply by N/2:  (1/32 + 1/8) * 8 =
1.25)


So, in order for the written durations of the beams (1.25 measures)
to match the intended duration, based on what else is in the measure
(0.5 measures), the entire passage would need to be scaled by a factor
of 1.25/0.5 = 1/2.5

With that in mind, let's proceed towards an approach
of scaling durations.


The way to get a printed note to scale to a different
duration is like c32*2 (the equivalent of a 16th) or
c32*4 (the equivalent of an 8th).


But in addition to scaling the entire sequence, we need to
specify the relative durations of the notes.

How do you do the math?  There is more than one way.
Note that our goal is to find a sequence that in 16 steps
scales to a value that is about 4x the intial value.

Here is one approximation, trying to keep things in fractions
and not reals for the sake of syntax:

%}

sequence = \relative c' {
    c32*10/10 [
    d32*12/10
    e32*14/10
    f32*16/10

    g32*18/10
    f32*20/10
    e32*22/10
    f32*24/10

    d32*28/10
    f32*30/10
    g32*32/10
    f32*34/10

    d32*36/10
    e32*38/10
    d32*40/10
    f32*42/10 ]
}

%{

You can see that the last duration is 42/10, which is larger than 40/10, so
since we have overshot, this sequence sums to 1.3, rather than 1.25.

((1/32)*(10/10) + (1/32)*(12/10) + (1/32)*(14/10) + (1/32)*(16/10) +
(1/32)*(18/10) + (1/32)*(20/10) + (1/32)*(22/10) + (1/32)*(24/10) +
(1/32)*(28/10) + (1/32)*(30/10) + (1/32)*(32/10) + (1/32)*(34/10) +
(1/32)*(36/10) + (1/32)*(38/10) + (1/32)*(40/10) + (1/32)*(42/10)) = 1.3

In any case, we can just use this value as the factor used to
change the denominator to in order to scale from 1.3 measures
(the actual total length) to 0.5 measures (the desired length),
or  1.3/0.5 = 2.6.

So, we change our denominator from 10 to 26:

%}

scaledSequence = \relative c' {
    c32*10/26 [
    d32*12/26
    e32*14/26
    f32*16/26

    g32*18/26
    f32*20/26
    e32*22/26
    f32*24/26

    d32*28/26
    f32*30/26
    g32*32/26
    f32*34/26

    d32*36/26
    e32*38/26
    d32*40/26
    f32*42/26 ]
}

%{

((1/32)*(10/26) + (1/32)*(12/26) + (1/32)*(14/26) + (1/32)*(16/26) +
(1/32)*(18/26) + (1/32)*(20/26) + (1/32)*(22/26) + (1/32)*(24/26) +
(1/32)*(28/26) + (1/32)*(30/26) + (1/32)*(32/26) + (1/32)*(34/26) +
(1/32)*(36/26) + (1/32)*(38/26) + (1/32)*(40/26) + (1/32)*(42/26)) = 0.5

Now that we have done the scaling manually,
we don't need to change the durations in the featherDurations call:

%}

\relative c' {
    \override Beam.grow-direction = #LEFT
    \featherDurations #(ly:make-moment 1/1)
    \scaledSequence
    \override Beam.grow-direction = #'()
    c4 ~ c | c1
}


HTH,

Elaine Alt
415 . 341 .4954                                           "Confusion is
highly underrated"
elaine@flaminghakama.com
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---------- Forwarded \
message ----------</blockquote><blockquote class="gmail_quote" style="margin:0px 0px \
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From:  Reggie \
&lt;<a href="mailto:reegistoop@gmail.com" \
target="_blank">reegistoop@gmail.com</a>&gt;<br>To:  <a \
href="mailto:lilypond-user@gnu.org" target="_blank">lilypond-user@gnu.org</a><br>Cc:  \
<br>Bcc:  <br>Date:  Fri, 21 Dec 2018 12:10:12 -0700 (MST)<br>Subject:  Re: feathered \
beam calculations<br>Aaron Hill wrote<br> &gt; Given the current implementation, it \
would be necessary to use an <br> &gt; approximate rational like 50/63 as the moment \
in order to get &#39;f&#39; to be <br> &gt; half of &#39;c&#39;.   Why that number?   \
Well, it&#39;s a close approximation to the <br> &gt; irrational cube root of one \
half.   We determine this exact value by <br> &gt; taking the desired ratio (1/2) and \
raising it to the reciprocal of the <br> &gt; number of scaling steps between the \
first and last notes (three, in this <br> &gt; case, which becomes the fraction 1/3). \
(1/2)^(1/3) is about 0.7937; and <br> &gt; 50/63 is roughly 0.79365.<br>
&gt; <br>
&gt; But before we get lost in the murky details of whether the implemented <br>
&gt; behavior is right or the documentation is right, let us circle back <br>
&gt; around to a key point that I feel has not been stressed enough.<br>
&gt; <br>
&gt; This means your score really should be bar check clean *before* you ever <br>
&gt; use \featherDurations.   <br>
&gt; <br>
&gt; I said earlier we would talk about bar checks *within* the feathered <br>
&gt; sequence of notes.   Consider the following addition to our example:<br>
&gt; <br>
&gt;         &lt;&lt; { r64 \featherDurations #(ly:make-moment 2/1)<br>
&gt;                       { c32*127/14[ d e f g a | b] } }<br>
&gt;              { r64 \featherDurations #(ly:make-moment 2/1)<br>
&gt;                       { c32*63/12[ d e f g a] } | b1 }<br>
&gt;              { r64 { c64 d32 e16 f8 g4 a2 } | b1 } &gt;&gt;<br>
&gt; <br>
&gt; You&#39;ll see that the &#39;b&#39; is included within the beamed notes.   \
Because we <br> &gt; now have seven notes covering the period of two measures less \
one 64th, <br> &gt; we had to adjust our scaling fraction to 127/14.   However, what \
is most <br> &gt; important is that \featherDurations fixes the timing of the notes \
to <br> &gt; allow the inside bar check to pass.   Omit it, and you&#39;ll see that \
the <br> &gt; bar check fails.   But also try changing the 2/1 moment to anything \
else, <br> &gt; and the bar check will also fail.<br>
&gt; <br>
&gt; What we have here is a very fragile element in the score that can be <br>
&gt; easily avoided by never requiring any note (apart from the first) within <br>
&gt; a feathered sequence to align to anything else.   The final &#39;b&#39; above \
<br> &gt; should properly be outside the feathered sequence (or possibly start a <br>
&gt; new sequence of its own).   In this way, the math to ensure all of the <br>
&gt; sequences have the right lengths can be done completely independent of <br>
&gt; \featherDurations.<br>
&gt; <br>
&gt; Hopefully some of this will be helpful.<br>
&gt; <br>
&gt; -- Aaron Hill<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; lilypond-user mailing list<br>
<br>
&gt; lilypond-user@<br>
<br>
&gt; <a href="https://lists.gnu.org/mailman/listinfo/lilypond-user" rel="noreferrer" \
target="_blank">https://lists.gnu.org/mailman/listinfo/lilypond-user</a><br> <br>
Aaron that makes sense but only if you have failed bar checks before<br>
feathering. Let&#39;s say you have a perfect score with no fails. And now you<br>
want to simply insert feather beamed notes only in one measure but have them<br>
spaced out according to the speed accelerando ritard as standard. How do you<br>
even begin to know what math * * * * you should be doing when there is no<br>
math to do in the first place??? NO bar check math because everything is<br>
already fine. Why can&#39;t you just spread out the notes according to how<br>
feathers are supposed to? Prove me please. Here look.<br>
<br>
<br>
\relative c&#39;<br>
{<br>
<br>
   \override Beam.grow-direction = #LEFT<br>
   \featherDurations #(ly:make-moment 2/1)<br>
   c32[ d e f g f e f d f g f d e d f] c4~c | c1 |<br>
}<br>
<br>
<br>
My CODE has no errors. And yet the 2/1 does NOT space out any notes at ALL<br>
it&#39;s just normal beamed notes with fancy feathers. What math do I need how<br>
does one even know what math to use since there are no bar bad checks? See?<br>
> ))<br></blockquote><div><br></div><div><br></div><div>  \version \
> &quot;2.18.2&quot;<br><br>%{ <br><br>If you want the spacing to be proportionate to \
> duration, <br>then you are responsible for calculating those durations.<br><br>It \
> is basically high school level math, so grab a beer<br>and let&#39;s \
> go.<br><br><br>Let&#39;s think this through from the beginning.<br><br>In terms of \
> the literal feathered beaming, you have specified <br>eight notes, which scale in \
> duration from a 32nd to an 8th.   <br>What is the actual duration of this \
> sequence?<br><br>Assuming a linear scale, on average, these would sum to \
> 1.25<br><br>(For example, add first &amp; last and multiply by N/2:   (1/32 + 1/8) \
> * 8 = 1.25)<br><br><br>So, in order for the written durations of the beams (1.25 \
> measures)<br>to match the intended duration, based on what else is in the measure \
> <br>(0.5 measures), the entire passage would need to be scaled by a factor<br>of \
> 1.25/0.5 = 1/2.5 <br><br>With that in mind, let&#39;s proceed towards an \
> approach<br>of scaling durations.<br><br><br>The way to get a printed note to scale \
> to a different <br>duration is like c32*2 (the equivalent of a 16th) or <br>c32*4 \
> (the equivalent of an 8th).<br><br><br>But in addition to scaling the entire \
> sequence, we need to <br>specify the relative durations of the notes. <br><br>How \
> do you do the math?   There is more than one way.<br>Note that our goal is to find \
> a sequence that in 16 steps <br>scales to a value that is about 4x the intial \
> value.<br><br>Here is one approximation, trying to keep things in fractions \
> <br></div><div>and not reals for the sake of syntax:<br><br>%}<br><br>sequence = \
> \relative c&#39; { <br>       c32*10/10 [<br>       d32*12/10<br>       \
> e32*14/10<br>       f32*16/10<br><br>       g32*18/10<br>       f32*20/10<br>       \
> e32*22/10<br>       f32*24/10<br><br>       d32*28/10<br>       f32*30/10<br>       \
> g32*32/10<br>       f32*34/10<br><br>       d32*36/10<br>       e32*38/10<br>       \
> d32*40/10<br>       f32*42/10 ]<br>}<br><br>%{<br><br>You can see that the last \
> duration is 42/10, which is larger than 40/10, so<br>since we have overshot, this \
> sequence sums to 1.3, rather than 1.25.<br><br>((1/32)*(10/10) + (1/32)*(12/10) + \
> (1/32)*(14/10) + (1/32)*(16/10) + (1/32)*(18/10) + (1/32)*(20/10) + (1/32)*(22/10) \
> + (1/32)*(24/10) + (1/32)*(28/10) + (1/32)*(30/10) + (1/32)*(32/10) + \
> (1/32)*(34/10) + (1/32)*(36/10) + (1/32)*(38/10) + (1/32)*(40/10) + (1/32)*(42/10)) \
> = 1.3<br><br>In any case, we can just use this value as the factor used to \
> <br>change the denominator to in order to scale from 1.3 measures <br>(the actual \
> total length) to 0.5 measures (the desired length), <br>or   1.3/0.5 = 2.6.   \
> <br><br>So, we change our denominator from 10 to \
> 26:<br><br>%}<br><br>scaledSequence = \relative c&#39; { <br>       c32*10/26 [<br> \
> d32*12/26<br>       e32*14/26<br>       f32*16/26<br><br>       g32*18/26<br>       \
> f32*20/26<br>       e32*22/26<br>       f32*24/26<br><br>       d32*28/26<br>       \
> f32*30/26<br>       g32*32/26<br>       f32*34/26<br><br>       d32*36/26<br>       \
> e32*38/26<br>       d32*40/26<br>       f32*42/26 \
> ]<br>}<br><br>%{<br><br>((1/32)*(10/26) + (1/32)*(12/26) + (1/32)*(14/26) + \
> (1/32)*(16/26) + (1/32)*(18/26) + (1/32)*(20/26) + (1/32)*(22/26) + (1/32)*(24/26) \
> + (1/32)*(28/26) + (1/32)*(30/26) + (1/32)*(32/26) + (1/32)*(34/26) + \
> (1/32)*(36/26) + (1/32)*(38/26) + (1/32)*(40/26) + (1/32)*(42/26)) = 0.5<br><br>Now \
> that we have done the scaling manually, <br>we don&#39;t need to change the \
> durations in the featherDurations call:<br><br>%}<br><br>\relative c&#39; {<br>     \
> \override Beam.grow-direction = #LEFT<br>       \featherDurations #(ly:make-moment \
> 1/1)<br>       \scaledSequence <br>       \override Beam.grow-direction = \
> #&#39;()<br>       c4 ~ c | c1<br>}<br><br><br>HTH,<br><br>Elaine Alt<br>415 . 341 \
> .4954                                                                               \
> &quot;Confusion is highly underrated&quot;<br><a \
> href="mailto:elaine@flaminghakama.com">elaine@flaminghakama.com</a><br>Producer ~ \
> Composer ~ Instrumentalist<br>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-</div></div></div></div>
> 



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic