Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Quantization/splitting: Bounded rhythms not properly splitted in notation output #37

Closed
hanshoglund opened this issue May 7, 2013 · 1 comment
Labels

Comments

@hanshoglund
Copy link
Member

`TSee example:

screen shot 2013-05-07 at 20 11 17

Cause

The basic problem is that the rhythm representation (see below) is too weak.

data Rhythm a 
    = Beat       Duration a                    -- d is divisible by 2
    | Group      [Rhythm a]                    -- normal note sequence
    | Dotted     Int (Rhythm a)                -- n > 0.
    | Tuplet     Duration (Rhythm a)           -- d is an emelent of 'tupletMods'.
    | Bound      Duration (Rhythm a)           -- tied from duration

The semantics of Beat, Group, Dotted and Tuplet are clear and compositional. However, Bound is ambigous: it can be notated by adding the duration as an extra beat before or after the sub-rhythm encapsulated by the Bound constructor.

Problem 1

For example in Group [Dotted 1 (Beat (1/4) a), Bound (1/2) (Beat (1/8) b)] the bound constructor should be expanded as 8th to half (bound duration after), while in Group [Bound (1/2) (Beat (1/8) b)], Dotted 1 (Beat (1/4) a) it should be half to eight (bound duration before). However, this can not be determined by looking at the bound constructor, it depends on its place in the group context.

Problem 2

It is also unclear how to use it for representing ties between subdivisions. Consider Group [Tuplet (2/3) $ Group [...], Tuplet (4/5) $ Group [...]], with a tied note between the two groups. If the tied note is represented using Bound, either the first or the second group will have one note less than expected. Even worse, the bound constructor will have a "raw" duration (in this case 1/4 or 1/5) with no clear indication on how it was quantized.

Note: The quantization engine can not parse such rhythms at the moment. The representation should allow them just as well.

Solution 1

  • Problem 1 can be solved by disambiguering Bound, by adding an extra Bool field or making it two separate constructors. However this does not solve problem 2.

Solution 2

  • Remove Bound and add a constructor Tied BeginEnd (Rhythm a) to indicate a tied note. Then we can do Group [Tuplet (2/3) $ Group [... Tied Begin a], Tuplet (4/5) $ Group [Tied End a ...]] or similar.
  • This is problematic as it requires a tie split. Proper tie splitting (w.r.t dynamics etc) requires a Tiable instance. That was one of the reasons we used Bound (which does not split but simply store an extra duration) in the first place.

Solution 3 (best)

  • Remove Bound and fall back on Tiable. We need to add a Tiable constraint to the quantization engine.
hanshoglund added a commit that referenced this issue Jun 6, 2013
hanshoglund added a commit that referenced this issue Jun 6, 2013
This patch removes bound rhythms as per solution 3 in #37. We still have the
problem that we can't distinguish long-short/short-long in the bound parser,
however this does not show up in the representation now; the parser arbitrarily
picks short-long.
@hanshoglund
Copy link
Member Author

Closing, might open for short-long problem (as per 07ab0c6).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant