[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aleatoric Elements with barlines

From: Ben
Subject: Re: Aleatoric Elements with barlines
Date: Wed, 9 Jan 2019 17:19:22 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 1/9/2019 10:11 AM, Martin Neubauer wrote:
On 09/01/2019 14:06, Ben wrote:
On 1/8/2019 10:43 PM, Martin Neubauer wrote:
On 07/01/2019 17:29, Reggie wrote:
Aaron you are a great teacher thank you. Just a couple few more
please. First how did you know that it had to equal 2 full measures?
I did
not see how you arrived. Second please tell me is there any negative
of moving the barline from score to staff I didn't want to do that on a
global scale because this alignment is just one small section of a
composition, but if it's safe? Then ok. Any caveats with moving to
Thank you. I don't understand the math of 2 full bars.
In situations like these I might use the \scaleToLength function. That
way it's possible to control the horizontal placement of the music in
the different staves by judicious use of spacer rests and still not
having to worry about getting the synchronisation points right between
the staves. Also in that case there would be no need to use
Hi Martin!

How do you use the scaleToLength function? I can't find much about it
when searching the documentation for it. Sounds interesting from how you
describe it. Thanks!
It turns out I've forgotten I took it from this list some time ago
(apparently written by Malte Meyn). It's basically just a wrapper for
\scaleDurations but provides just the right interface for the mentioned
use case. Before I used an own variation (because it's just that
useful), but since it was written quite clumsily compared to Malte's, it
just vanished into the mists of time...

Anyway, here's the function:

scaleToLength =
#(define-music-function (dur mus) (ly:duration? ly:music?)
   (let* ((real-len (ly:music-length mus))
          (mom (ly:duration-length dur))
          (ratio-mom (ly:moment-div mom real-len))
          (ratio (cons (ly:moment-main-numerator ratio-mom)
                   (ly:moment-main-denominator ratio-mom))))
       \scaleDurations #ratio #mus

And using it is simple enough:
\scaleToLength 1 {
  % some music

Try it, it's great!


Thanks for the function! I'm still a little confused about the value(s) that you use with the function. I see it looks like it takes a duration value, right? Like 1, 4, 16? But I can't see how it would work on the music. Maybe I just put the wrong example music code in mine, but can you share an example where you input " % some music " to show how the function works?

Do you always use one number or does the function also allow/need like 1 4 or 1 8, etc.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]