hmt-0.3: Haskell Music Theory







duration_compare_meq :: Duration -> Duration -> OrderingSource

Compare durations with equal multipliers.

sort_pair :: (t -> t -> Ordering) -> (t, t) -> (t, t)Source

no_dots :: (Duration, Duration) -> BoolSource

True if neither duration is dotted.

sum_dur_undotted :: (Integer, Integer) -> Maybe DurationSource

Sum undotted divisions, input is required to be sorted.

sum_dur_dotted :: (Integer, Integer, Integer, Integer) -> Maybe DurationSource

Sum dotted divisions, input is required to be sorted.

sum_dur :: Duration -> Duration -> Maybe DurationSource

Sum durations. Not all durations can be summed, and the present algorithm is not exhaustive.

RQ (Rational Quarter Note Count)

rq_to_duration :: Rational -> Maybe DurationSource

Rational number of quarter notes to duration value. It is a mistake to hope this could handle tuplets directly, ie. a 3:2 dotted note will be of the same duration as a plain undotted note.

whole_note_division_to_rq :: Integer -> RationalSource

Convert a whole note division integer to a RQ.

rq_apply_dots :: Rational -> Integer -> RationalSource

Apply d dots to the duration n.

duration_to_rq :: Duration -> RationalSource

Convert duration to RQ value, see rq_to_duration for partial inverse.