Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- 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 Time_Signature_Map = [(Measure, Time_Signature)]
- type Tempo_Marking_Map = [(Measure, Tempo_Marking)]
- type Temporal_Map = (Time_Signature_Map, Tempo_Marking_Map)
- temporal_map :: [Music] -> Temporal_Map
- mm_durations :: Temporal_Map -> Integer -> [(Rational, Integer)]
- integrate :: Num a => [a] -> [a]
- mm_start_times :: Temporal_Map -> Integer -> [(Rational, Rational, Integer)]
- location_to_rt :: [(Rational, Rational, Integer)] -> Location -> Rational
- locate_rt :: [Music] -> [(Rational, Music)]
- data Locate_Mode
- type Measure = Integer
- type Pulse = Rational
- type Part_ID = Integer
- data Location = Location {}
- location_nf :: Time_Signature -> Location -> Location
- type Locate_ST = (Time_Signature, 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])]
- measure_diff :: Location -> Location -> Integer
- lv_last_measure :: [LV a] -> Measure
- time_unpack :: Music -> Time_Signature
- ts_structure :: Music -> [[(Time_Signature, Integer)]]
- ts_structure' :: [Music] -> [[(Time_Signature, Integer)]]
- structure_unfold' :: Integral i => [(a, i)] -> [a]
- structure_unfold :: Integral i => [(a, i)] -> [Maybe a]
- lm_ts_map :: [LM] -> Time_Signature_Map
- ts_map :: [Music] -> Time_Signature_Map
- map_lookup :: Ord i => [(i, a)] -> i -> a
- ts_lookup :: [(Measure, Time_Signature)] -> Measure -> Time_Signature
- lm_tempo_map :: [LM] -> [(Measure, Tempo_Marking)]
- tempo_map :: [Music] -> [(Measure, Tempo_Marking)]
- tempo_lookup :: [(Measure, Tempo_Marking)] -> Measure -> Tempo_Marking
- 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]
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 -> Integer Source
count_chords :: Music -> Integer Source
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
Temporal map
type Time_Signature_Map = [(Measure, Time_Signature)] Source
type Tempo_Marking_Map = [(Measure, Tempo_Marking)] Source
temporal_map :: [Music] -> Temporal_Map Source
mm_durations :: Temporal_Map -> Integer -> [(Rational, Integer)] Source
Return duration (in seconds) and pulse counts for n measures.
mm_start_times :: Temporal_Map -> Integer -> [(Rational, Rational, 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 :: Time_Signature -> Location -> Location Source
Convert a location to normal form under given time signature.
type Locate_ST = (Time_Signature, Location) Source
Type to thread state through location calculations.
st_set_part :: Locate_ST -> Part_ID -> Locate_ST Source
Update state part number.
st_set_mode :: Locate_ST -> Locate_Mode -> Locate_ST Source
Update state part number.
location_step :: Locate_ST -> Duration -> Locate_ST Source
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 -> Bool Source
normal_mode_p :: Location -> Bool Source
lm_unlocate :: [LM] -> [Music] Source
location_time :: Location -> (Measure, Pulse) Source
located_pitches :: [[Music]] -> [(Location, [Pitch])] Source
Time-signature structure analysis.
measure_diff :: Location -> Location -> Integer Source
lv_last_measure :: [LV a] -> Measure Source
time_unpack :: Music -> Time_Signature Source
ts_structure :: Music -> [[(Time_Signature, Integer)]] Source
Time signature structure of music.
ts_structure' :: [Music] -> [[(Time_Signature, Integer)]] Source
structure_unfold' :: Integral i => [(a, i)] -> [a] Source
structure_unfold :: Integral i => [(a, i)] -> [Maybe a] Source
lm_ts_map :: [LM] -> Time_Signature_Map Source
ts_map :: [Music] -> Time_Signature_Map Source
map_lookup :: Ord i => [(i, a)] -> i -> a Source
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, Time_Signature)] -> Measure -> Time_Signature Source
Tempo
lm_tempo_map :: [LM] -> [(Measure, Tempo_Marking)] Source
tempo_map :: [Music] -> [(Measure, Tempo_Marking)] Source
tempo_lookup :: [(Measure, Tempo_Marking)] -> Measure -> Tempo_Marking Source
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.
kv_map :: (k -> k') -> (v -> v') -> [(k, v)] -> [(k', v')] Source
Apply functions to keys and values.
Measure collation
collation_unfold :: [(Integer, a)] -> [Maybe a] Source
Transformation
transform_st :: ST_f st -> st -> Music -> ST_r st Source
Repeats
write_out_repeats :: Music -> Music Source
Replace
note_replace_pitch :: Pitch -> Music -> Music Source
Replace the pitch of note element n1 with that of n0.
note_replace_pitch_m :: Music -> Music -> Music Source
replace_notes_fn :: (a -> Pitch) -> [a] -> Music -> ([a], Music) Source
replace_notes_p :: [Pitch] -> Music -> Music Source
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 -> Music Source
Insert
insert_after_notes :: [Maybe Music] -> Music -> Music Source
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) -> Music Source
spell_sharp :: (Octave, PitchClass) -> Music Source
spell_flat :: (Octave, PitchClass) -> Music Source
Validation
v_chord_note_valid :: Music -> Maybe String Source
Notes in chords must not have duration.