| Copyright | (c) 2012--2014, Utrecht University |
|---|---|
| License | LGPL-3 |
| Maintainer | W. Bas de Haas <w.b.dehaas@uu.nl> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell98 |
ZMidi.Score.Utilities
Description
Summary: some utilities for manipulating and extracting information from
MidiFiles.
- type TickMap = IntMap Time
- buildTickMap :: [Voice] -> TickMap
- gcIOId :: TickMap -> Time
- isTempoChange :: Timed ScoreEvent -> Bool
- isTimeSig :: Timed ScoreEvent -> Bool
- isKeyChange :: Timed ScoreEvent -> Bool
- isNoteEvent :: Timed ScoreEvent -> Bool
- nrOfNotes :: MidiScore -> Int
- toIOIs :: Voice -> [Time]
- toOnsets :: Voice -> [Time]
- toMidiNr :: Pitch -> Word8
- toPitch :: Word8 -> Pitch
- getPitch :: Timed ScoreEvent -> Pitch
- getInterval :: Pitch -> Pitch -> Interval
- changePitch :: Pitch -> Interval -> Pitch
- pitchClass :: Pitch -> PitchClass
- hasTimeSigs :: MidiScore -> Bool
- updateTimeSig :: MidiScore -> Timed TimeSig -> Timed TimeSig -> Either String MidiScore
- removeLabels :: MidiFile -> MidiFile
- hasNotes :: MidiTrack -> Bool
Minimum length calculation
type TickMap = IntMap Time Source
A TickMap is basically a histogram of IOI counts of a piece (of all
voices)
buildTickMap :: [Voice] -> TickMap Source
builds a TickMap.
gcIOId :: TickMap -> Time Source
The Inter Onset Interval that is the greatest common divider. It can be used to estimate whether a track is quantised or not.
Utilities
isTempoChange :: Timed ScoreEvent -> Bool Source
Returns True if the ScoreEvent is a key change
isTimeSig :: Timed ScoreEvent -> Bool Source
Returns True if the ScoreEvent is a time signature change
isKeyChange :: Timed ScoreEvent -> Bool Source
Returns True if the ScoreEvent is a key change
isNoteEvent :: Timed ScoreEvent -> Bool Source
Returns True if the ScoreEvent is a NoteEvent
toOnsets :: Voice -> [Time] Source
Ignores all pitch information and returns a list of onsets. N.B. in case of a polyphonic track duplicate onsets are deleted.
toPitch :: Word8 -> Pitch Source
Converts a MIDI note number into an octave and a pitch class, a.k.a Pitch
getPitch :: Timed ScoreEvent -> Pitch Source
Returns the Pitch of a Timed ScoreEvent. In case of a non-NoteEvent
an error will be thrown
getInterval :: Pitch -> Pitch -> Interval Source
pitchClass :: Pitch -> PitchClass Source
Returns the PitchClass of a particular Pitch.
hasTimeSigs :: MidiScore -> Bool Source
updateTimeSig :: MidiScore -> Timed TimeSig -> Timed TimeSig -> Either String MidiScore Source
Updates a time signature, or returns a warning if the update fails
MidiFile Utitlites
removeLabels :: MidiFile -> MidiFile Source
Removes the track labels from a MidiFile