lilypond-devel
[Top][All Lists]
Advanced

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

Getting beam subdivision working


From: Jason Yip
Subject: Getting beam subdivision working
Date: Fri, 16 Jun 2023 16:13:24 -0700

Hey all,

I'm currently way ahead of schedule with my GSoC project of fixing automatic beam subdivision, including any number of levels of nested tuples. I have implemented the structures necessary to support subdividing nested tuples and the only regression tests that "fail" so far are very few at the moment (attached as "make_check.png").

`beam-subdivide-tuplets.ly` concerns sextuplets, which my implementation treats the same as triplets. To implement a custom beatStructure that the user can specify for tuplets of a specific size, I may need some help (time-signature-settings.scm might be a good reference to provide defaults for tuplets with non-prime denominators).

The other "failing" regression tests concern the purpose of baseMoment. https://gitlab.com/lilypond/lilypond/uploads/9f968b929162a0d70d212ac2e99ec841/beam-subdivisions--notes-for-reimplementation--urs-liska.pdf points out the flaw of the current implementation's dependence on the value of baseMoment to subdivide beams. Currently, my implementation is much less dependent on baseMoment, generating the same subdivisions for the beams of test beam-subdivision.ly that only change the baseMoment value but not the actual note lengths. To allow better control of the intervals of subdivision and maintain backward compatibility, I suggest that there be 2 new options: minSubdivideInterval and maxSubdivideInterval. They are both Rationals. Their numerator and denominator must be a power of 2. For each power of 2 (including negative powers of 2 of course) between those two values, the beam can be subdivided by that interval. minSubdivideInterval can be 0 for no minimum limit, maxSubdivideInterval can be infinity for no maximum limit. For backward compatibility, when the subdivideBeams option is set to true, minSubdivideInterval can be set to baseMoment * 2. I have not implemented this yet so that the current regression tests at least compile under my implementation.

My implementation also successfully got the correct results (attached as "correct_nested_tuplet.pdf") of

```lilypond

\relative c' {
  \time 1/4
  \set subdivideBeams = ##t
  c32 c
  \tuplet 3/2 {
  \repeat unfold 4 c64
  \tuplet 3/2 { \repeat unfold 12 c128 }
  \repeat unfold 4 c64
  }
  c32 c
}
```

Note that the stable version doesn't even subdivide it all.

My implementation is available in a private fork, I'm not sure how I should share it if any other developers want to examine it (manual invite to each one who wants it?) It's a bit messy at the moment and definitely needs more code comments.

Does anyone have thoughts about my suggestions or want access to my implementation?

--
- Jason Yip

Attachment: make_check.png
Description: PNG image

Attachment: correct_nested_tuplet.pdf
Description: Adobe PDF document

Attachment: OpenPGP_0xB69A3DD87D22F506.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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