- type R = Double
- traverse :: (Music -> a) -> Music -> [a]
- collect_entries :: (Music -> Bool) -> Music -> [Music]
- count_entries :: (Music -> Bool) -> Music -> Integer
- count_notes :: Music -> Integer
- count_chords :: Music -> Integer
- count_ts :: Music -> Integer
- has_pitch :: Music -> Bool
- collect_pitches_no_grace :: Music -> [Pitch]
- collect_pitches :: Music -> [Pitch]
- note_seq :: Music -> [Music]
- freq_anal_by :: Ord a => (a -> a -> Ordering) -> [a] -> [(Int, a)]
- freq_anal :: Ord a => [a] -> [(Int, a)]
- type TempoMarking = (Duration, Integer)
- apply_dots :: Rational -> Integer -> Rational
- dur_pulses :: TimeSignature -> Duration -> Rational
- pulse_duration :: TimeSignature -> TempoMarking -> R
- measure_duration :: TimeSignature -> TempoMarking -> R
- type TimeSignature_Map = [(Measure, TimeSignature)]
- type TempoMarking_Map = [(Measure, TempoMarking)]
- type Temporal_Map = (TimeSignature_Map, TempoMarking_Map)
- temporal_map :: [Music] -> Temporal_Map
- mm_durations :: Temporal_Map -> Integer -> [(R, Integer)]
- integrate :: Num a => [a] -> [a]
- mm_start_times :: Temporal_Map -> Integer -> [(R, R, Integer)]
- location_to_rt :: [(R, R, Integer)] -> Location -> R
- locate_rt :: [Music] -> [(R, Music)]
- data Locate_Mode
- type Measure = Integer
- type Pulse = Rational
- type Part_ID = Integer
- data Location = Location {}
- location_nf :: TimeSignature -> Location -> Location
- type Locate_ST = (TimeSignature, Location)
- st_set_part :: Locate_ST -> Part_ID -> Locate_ST
- st_set_mode :: Locate_ST -> Locate_Mode -> Locate_ST
- location_step :: Locate_ST -> Duration -> Locate_ST
- type LM = (Location, Music)
- type LV a = (Location, a)
- locate_st :: Locate_ST -> Music -> (Locate_ST, [LM])
- locate :: Music -> [LM]
- locate' :: [Music] -> [LM]
- lv_located_parts :: [LV a] -> [Part_ID]
- lv_group_parts :: [LV a] -> [[LV a]]
- lv_from_measure :: Integer -> [LV a] -> [LV a]
- lv_group_measures :: [LV a] -> [[LV a]]
- lv_extract_part :: Part_ID -> [LV a] -> [LV a]
- lv_extract_measure :: Measure -> [LV a] -> [LV a]
- lm_pitches :: [LM] -> [Pitch]
- lm_pcset :: [LM] -> [PitchClass]
- lm_pitches_per_measure :: [LM] -> [[Pitch]]
- lm_pcset_per_measure :: [LM] -> [[PitchClass]]
- unlocate_p :: Music -> Bool
- normal_mode_p :: Location -> Bool
- lm_unlocate :: [LM] -> [Music]
- location_time :: Location -> (Measure, Pulse)
- lv_sort :: [LV a] -> [LV a]
- located_pitches :: [[Music]] -> [(Location, [Pitch])]
- ts_rewrite :: Integer -> TimeSignature -> TimeSignature
- ts_sum :: [TimeSignature] -> TimeSignature
- measure_diff :: Location -> Location -> Integer
- lv_last_measure :: [LV a] -> Measure
- time_unpack :: Music -> TimeSignature
- ts_structure :: Music -> [[(TimeSignature, Integer)]]
- ts_structure' :: [Music] -> [[(TimeSignature, Integer)]]
- structure_unfold' :: Integral i => [(a, i)] -> [a]
- structure_unfold :: Integral i => [(a, i)] -> [Maybe a]
- lm_ts_map :: [LM] -> TimeSignature_Map
- ts_map :: [Music] -> TimeSignature_Map
- map_lookup :: Ord i => [(i, a)] -> i -> a
- ts_lookup :: [(Measure, TimeSignature)] -> Measure -> TimeSignature
- lm_tempo_map :: [LM] -> [(Measure, (Duration, Integer))]
- tempo_map :: [Music] -> [(Measure, (Duration, Integer))]
- tempo_lookup :: [(Measure, (Duration, Integer))] -> Measure -> (Duration, Integer)
- kv_group_by :: Ord c => (a -> c) -> [(a, b)] -> [[(a, b)]]
- kv_collate :: Ord k => (a -> k) -> (a -> v) -> [a] -> [(k, [v])]
- kv_collate' :: Ord k => [(k, v)] -> [(k, [v])]
- kv_filter :: (k -> Bool) -> (v -> Bool) -> [(k, v)] -> [(k, v)]
- kv_map :: (k -> k') -> (v -> v') -> [(k, v)] -> [(k', v')]
- measure_collate :: (Music -> Bool) -> Music -> [[(Integer, [Music])]]
- collation_unfold :: [(Integer, a)] -> [Maybe a]
- type ST_r st = (st, Music)
- type ST_f st = st -> Music -> ST_r st
- transform_st :: ST_f st -> st -> Music -> ST_r st
- transform :: (Music -> Music) -> Music -> Music
- write_out_repeats :: Music -> Music
- note_replace_pitch :: Pitch -> Music -> Music
- note_replace_pitch_m :: Music -> Music -> Music
- replace_notes_fn :: (a -> Pitch) -> [a] -> Music -> ([a], Music)
- replace_notes_p :: [Pitch] -> Music -> Music
- replace_notes :: [Music] -> Music -> Music
- insert_after_notes_fn :: [Maybe Music] -> Music -> ([Maybe Music], Music)
- insert_after_notes :: [Maybe Music] -> Music -> Music
- discard_tied_notes_pr :: (a -> Bool) -> (a -> Bool) -> [a] -> [a]
- discard_tied_notes :: [Music] -> [Music]
- lm_discard_tied_notes :: [LM] -> [LM]
- spell_ks :: (Octave, PitchClass) -> Music
- spell_sharp :: (Octave, PitchClass) -> Music
- spell_flat :: (Octave, PitchClass) -> Music
- v_assert :: String -> (Music -> Bool) -> Music -> Maybe String
- v_chord_note_valid :: Music -> Maybe String
- validate :: Music -> [String]
Documentation
Basic traversal
traverse :: (Music -> a) -> Music -> [a]Source
Apply a function to all elements and collect results in a list.
Basic statistical analysis
count_notes :: Music -> IntegerSource
count_chords :: Music -> IntegerSource
Basic pitch analysis
collect_pitches_no_grace :: Music -> [Pitch]Source
Collect pitches from a note or chord or join of such.
collect_pitches :: Music -> [Pitch]Source
Collect pitches from a note, chord, or grace note.
Frequency analysis utilites
freq_anal_by :: Ord a => (a -> a -> Ordering) -> [a] -> [(Int, a)]Source
Durations
type TempoMarking = (Duration, Integer)Source
apply_dots :: Rational -> Integer -> RationalSource
Apply d
dots to the rational pulse count n
.
dur_pulses :: TimeSignature -> Duration -> RationalSource
Convert a duration to a pulse count in relation to the indicated time signature.
pulse_duration :: TimeSignature -> TempoMarking -> RSource
The duration, in seconds, of a pulse at the indicated time signaure and tempo marking.
measure_duration :: TimeSignature -> TempoMarking -> RSource
The duration, in seconds, of a measure at the indicated time signaure and tempo marking.
Temporal map
type TimeSignature_Map = [(Measure, TimeSignature)]Source
type TempoMarking_Map = [(Measure, TempoMarking)]Source
temporal_map :: [Music] -> Temporal_MapSource
mm_durations :: Temporal_Map -> Integer -> [(R, Integer)]Source
Return duration (in seconds) and pulse counts for n measures.
mm_start_times :: Temporal_Map -> Integer -> [(R, R, Integer)]Source
Return start time and duration (in seconds) and pulse counts for i measures.
Temporal annotations
Data type representing the location of a musical element.
location_nf :: TimeSignature -> Location -> LocationSource
Convert a location to normal form under given time signature.
type Locate_ST = (TimeSignature, Location)Source
Type to thread state through location calculations.
st_set_part :: Locate_ST -> Part_ID -> Locate_STSource
Update state part number.
st_set_mode :: Locate_ST -> Locate_Mode -> Locate_STSource
Update state part number.
location_step :: Locate_ST -> Duration -> Locate_STSource
Step location state by duration.
locate_st :: Locate_ST -> Music -> (Locate_ST, [LM])Source
State threading form of location calculations. Currently, nested polyphonic parts generate duplicate IDs (?)
lv_located_parts :: [LV a] -> [Part_ID]Source
Extract list of part identifiers.
lv_group_parts :: [LV a] -> [[LV a]]Source
lv_from_measure :: Integer -> [LV a] -> [LV a]Source
Drop n
measures.
lv_group_measures :: [LV a] -> [[LV a]]Source
lv_extract_part :: Part_ID -> [LV a] -> [LV a]Source
lv_extract_measure :: Measure -> [LV a] -> [LV a]Source
lm_pitches :: [LM] -> [Pitch]Source
lm_pcset :: [LM] -> [PitchClass]Source
lm_pitches_per_measure :: [LM] -> [[Pitch]]Source
lm_pcset_per_measure :: [LM] -> [[PitchClass]]Source
unlocate_p :: Music -> BoolSource
normal_mode_p :: Location -> BoolSource
lm_unlocate :: [LM] -> [Music]Source
location_time :: Location -> (Measure, Pulse)Source
located_pitches :: [[Music]] -> [(Location, [Pitch])]Source
Time-signature structure analysis.
ts_rewrite :: Integer -> TimeSignature -> TimeSignatureSource
Rewrite time signature to indicated denominator.
ts_sum :: [TimeSignature] -> TimeSignatureSource
Sum time signatures (ie. 316 and 12 sum to 11/16).
measure_diff :: Location -> Location -> IntegerSource
lv_last_measure :: [LV a] -> MeasureSource
ts_structure :: Music -> [[(TimeSignature, Integer)]]Source
Time signature structure of music.
ts_structure' :: [Music] -> [[(TimeSignature, Integer)]]Source
structure_unfold' :: Integral i => [(a, i)] -> [a]Source
structure_unfold :: Integral i => [(a, i)] -> [Maybe a]Source
lm_ts_map :: [LM] -> TimeSignature_MapSource
ts_map :: [Music] -> TimeSignature_MapSource
map_lookup :: Ord i => [(i, a)] -> i -> aSource
Keys are in ascending order, the value retrieved is the that with the greatest key less than or equal to the key requested.
ts_lookup :: [(Measure, TimeSignature)] -> Measure -> TimeSignatureSource
Tempo
Key/value utilties
kv_group_by :: Ord c => (a -> c) -> [(a, b)] -> [[(a, b)]]Source
kv_collate :: Ord k => (a -> k) -> (a -> v) -> [a] -> [(k, [v])]Source
kv_collate' :: Ord k => [(k, v)] -> [(k, [v])]Source
kv_filter :: (k -> Bool) -> (v -> Bool) -> [(k, v)] -> [(k, v)]Source
Filter with predicates at key and value.
Measure collation
collation_unfold :: [(Integer, a)] -> [Maybe a]Source
Transformation
transform_st :: ST_f st -> st -> Music -> ST_r stSource
Repeats
Replace
note_replace_pitch :: Pitch -> Music -> MusicSource
Replace the pitch of note element n1 with that of n0.
note_replace_pitch_m :: Music -> Music -> MusicSource
replace_notes_fn :: (a -> Pitch) -> [a] -> Music -> ([a], Music)Source
replace_notes_p :: [Pitch] -> Music -> MusicSource
Replaces notes with indicated pitches, rhythms and annotations are not replaced. Tied notes do not use multiple pitches from the input sequence.
replace_notes :: [Music] -> Music -> MusicSource
Insert
insert_after_notes :: [Maybe Music] -> Music -> MusicSource
Inserts a value after each note as indicated.
Tied notes
discard_tied_notes_pr :: (a -> Bool) -> (a -> Bool) -> [a] -> [a]Source
discard_tied_notes :: [Music] -> [Music]Source
lm_discard_tied_notes :: [LM] -> [LM]Source
Spelling
spell_ks :: (Octave, PitchClass) -> MusicSource
spell_sharp :: (Octave, PitchClass) -> MusicSource
spell_flat :: (Octave, PitchClass) -> MusicSource
Validation
v_chord_note_valid :: Music -> Maybe StringSource
Notes in chords must not have duration.