Music.Theory.Duration.CT

Contents

Description

Functions to generate a click track from a metric structure.

Synopsis

# Documentation

type Measure = Int Source #

1-indexed.

type Pulse = Int Source #

1-indexed.

mdv_to_mrq :: [[RQ]] -> [[RQ]] Source #

Transform measures given as RQ divisions to absolute RQ locations. mdv abbreviates measure divisions.

mdv_to_mrq [[1,2,1],[3,2,1]] == [[0,1,3],[4,7,9]]

mp_lookup_err :: [[a]] -> (Measure, Pulse) -> a Source #

Lookup function for (Measure,Pulse) indexed structure.

mp_compare :: (Measure, Pulse) -> (Measure, Pulse) -> Ordering Source #

Comparison for (Measure,Pulse) indices.

# CT

ct_ext :: Int -> a -> [(Measure, a)] -> [(Measure, a)] Source #

Latch measures (ie. make measures contiguous, hold previous value).

unzip (ct_ext 10 'a' [(3,'b'),(8,'c')]) == ([1..10],"aabbbbbccc")

ct_ext1 :: Int -> [(Measure, a)] -> [(Measure, a)] Source #

Variant that requires a value at measure one (first measure).

ct_dv_seq :: Int -> Tseq Measure Rational_Time_Signature -> [(Measure, [[RQ]])] Source #

rts_divisions of ct_ext1.

ct_dv_seq without measures numbers.

mdv_to_mrq of ct_mdv_seq.

ct_m_to_rq :: [[RQ]] -> [(Measure, t)] -> [(RQ, t)] Source #

Latch rehearsal mark sequence, only indicating marks. Initial mark is ..

ct_mark_seq 2 [] == [(1,Just '.'),(2,Nothing)]
let r = [(1,Just '.'),(3,Just 'A'),(8,Just 'B')]
in filter (isJust . snd) (ct_mark_seq 10 [(3,'A'),(8,'B')]) == r

ct_pre_mark :: [(Measure, a)] -> [(Measure, Maybe ())] Source #

Indicate measures prior to marks.

ct_pre_mark [] == []
ct_pre_mark [(1,'A')] == []
ct_pre_mark [(3,'A'),(8,'B')] == [(2,Just ()),(7,Just ())]

Contiguous pre-mark sequence.

ct_pre_mark_seq 1 [(1,'A')] == [(1,Nothing)]
ct_pre_mark_seq 10 [(3,'A'),(8,'B')]

Interpolating lookup of tempo sequence (lseq_lookup_err).

data CT_Node Source #

Types of nodes.

Constructors

 CT_Mark RQ The start of a measure with a rehearsal mark. CT_Start RQ The start of a regular measure. CT_Normal RQ A regular pulse. CT_Edge RQ The start of a pulse group within a measure. CT_Pre RQ A regular pulse in a measure prior to a rehearsal mark. CT_End The end of the track.

Instances

 Source # Methods(==) :: CT_Node -> CT_Node -> Bool #(/=) :: CT_Node -> CT_Node -> Bool # Source # MethodsshowList :: [CT_Node] -> ShowS #

Lead-in of (pulse,tempo,count).

delay1 :: [a] -> [a] Source #

Prepend initial element to start of list.

delay1 "abc" == "aabc"

ct_measure :: Lseq RQ RQ -> ([RQ], Maybe Char, Maybe (), [[RQ]]) -> [(Rational, CT_Node)] Source #

data CT Source #

Click track definition.

Constructors

 CT Fieldsct_len :: Int ct_ts :: [(Measure, Rational_Time_Signature)] ct_mark :: [(Measure, Char)] ct_tempo :: Lseq (Measure, Pulse) RQ ct_count :: (RQ, Int)

Instances

 Source # MethodsshowsPrec :: Int -> CT -> ShowS #show :: CT -> String #showList :: [CT] -> ShowS #

Initial tempo, if given.

Erroring variant.

# Indirect

ct_mp_to_rq :: [[RQ]] -> [((Measure, Pulse), t)] -> [(RQ, t)] Source #