Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Functions to generate a click track from a metric structure.
Synopsis
- type Measure = Int
- type Pulse = Int
- type Mdv = [[Rq]]
- type Mrq = [[Rq]]
- mdv_to_mrq :: Mdv -> Mrq
- mp_lookup_err :: [[t]] -> (Measure, Pulse) -> t
- mp_compare :: (Measure, Pulse) -> (Measure, Pulse) -> Ordering
- ct_ext :: Int -> t -> Tseq Measure t -> Tseq Measure t
- ct_ext1 :: Int -> Tseq Measure t -> Tseq Measure t
- ct_dv_seq :: Int -> Tseq Measure Rational_Time_Signature -> [(Measure, [[Rq]])]
- ct_mdv_seq :: Int -> Tseq Measure Rational_Time_Signature -> [[Rq]]
- ct_rq :: Int -> Tseq Measure Rational_Time_Signature -> [[Rq]]
- ct_mp_lookup :: [[Rq]] -> (Measure, Pulse) -> Rq
- ct_m_to_rq :: [[Rq]] -> [(Measure, t)] -> [(Rq, t)]
- ct_mark_seq :: Int -> Tseq Measure Char -> Tseq Measure (Maybe Char)
- ct_pre_mark :: [(Measure, a)] -> [(Measure, Maybe ())]
- ct_pre_mark_seq :: Measure -> Tseq Measure Char -> Tseq Measure (Maybe ())
- ct_tempo_lseq_rq :: [[Rq]] -> Lseq (Measure, Pulse) Rq -> Lseq Rq Rq
- ct_tempo_at :: Lseq Rq Rq -> Rq -> Rational
- data Ct_Node
- ct_leadin :: (Rq, Double, Int) -> Dseq Double Ct_Node
- delay1 :: [a] -> [a]
- ct_measure :: Lseq Rq Rq -> ([Rq], Maybe Char, Maybe (), [[Rq]]) -> [(Rational, Ct_Node)]
- data Ct = Ct {}
- ct_tempo0 :: Ct -> Maybe Rq
- ct_tempo0_err :: Ct -> Rq
- ct_measures :: Ct -> [Dseq Rational Ct_Node]
- ct_dseq' :: Ct -> Dseq Rational Ct_Node
- ct_dseq :: Ct -> Dseq Double Ct_Node
- ct_rq_measure :: [[Rq]] -> Rq -> Maybe Measure
- ct_rq_mp :: [[Rq]] -> Rq -> Maybe (Measure, Pulse)
- ct_rq_mp_err :: [[Rq]] -> Rq -> (Measure, Pulse)
- ct_mp_to_rq :: [[Rq]] -> [((Measure, Pulse), t)] -> [(Rq, t)]
Documentation
Absolute Rq
locations grouped in measures.
mrq abbreviates measure rational quarter-notes.
Locations are zero-indexed.
mdv_to_mrq :: Mdv -> Mrq Source #
Transform Mdv to Mrq.
mdv_to_mrq [[1,2,1],[3,2,1]] == [[0,1,3],[4,7,9]]
mp_lookup_err :: [[t]] -> (Measure, Pulse) -> t Source #
Ct
ct_ext :: Int -> t -> Tseq Measure t -> Tseq Measure t Source #
Latch measures (ie. make measures contiguous, hold previous value). Arguments are the number of measures and the default (intial) value.
unzip (ct_ext 10 'a' [(3,'b'),(8,'c')]) == ([1..10],"aabbbbbccc")
ct_ext1 :: Int -> Tseq Measure t -> Tseq Measure t 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_mdv_seq :: Int -> Tseq Measure Rational_Time_Signature -> [[Rq]] Source #
ct_dv_seq
without measures numbers (which are 1..n)
ct_rq :: Int -> Tseq Measure Rational_Time_Signature -> [[Rq]] Source #
mdv_to_mrq
of ct_mdv_seq
.
ct_mark_seq :: Int -> Tseq Measure Char -> Tseq Measure (Maybe Char) 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 ())]
ct_pre_mark_seq :: Measure -> Tseq Measure Char -> Tseq Measure (Maybe ()) Source #
Contiguous pre-mark sequence.
ct_pre_mark_seq 1 [(1,'A')] == [(1,Nothing)] ct_pre_mark_seq 10 [(3,'A'),(8,'B')]
ct_tempo_at :: Lseq Rq Rq -> Rq -> Rational Source #
Interpolating lookup of tempo sequence (lseq_lookup_err
).
Types of nodes.
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. |
ct_measure :: Lseq Rq Rq -> ([Rq], Maybe Char, Maybe (), [[Rq]]) -> [(Rational, Ct_Node)] Source #
Generate Ct measure. Calculates durations of events considering only the tempo at the start of the event. To be correct it should consider the tempo envelope through the event.
Click track definition.
ct_tempo0_err :: Ct -> Rq Source #
Erroring variant.