zmidi-score-0.3.0.0: Representing MIDI a simple score.

Copyright(c) 2012--2014, Utrecht University
LicenseLGPL-3
MaintainerW. Bas de Haas <w.b.dehaas@uu.nl>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

ZMidi.Score.Utilities

Contents

Description

Summary: some utilities for manipulating and extracting information from MidiFiles.

Synopsis

Minimum length calculation

type TickMap = IntMap Time Source

A TickMap is basically a histogram of IOI counts of a piece (of all voices)

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

nrOfNotes :: MidiScore -> Int Source

Returns the number of ScoreEvents in a MidiScore

toIOIs :: Voice -> [Time] Source

Transforms a Voice into a list of Inter Onset Intervals (IOIs)

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.

toMidiNr :: Pitch -> Word8 Source

Converts a Pitch into a MIDI note number

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

Returns the posibly negative Interval between two Pitches

changePitch :: Pitch -> Interval -> Pitch Source

Changes a Pitch with a particular Interval

pitchClass :: Pitch -> PitchClass Source

Returns the PitchClass of a particular Pitch.

hasTimeSigs :: MidiScore -> Bool Source

Returns True if the MidiScore has time signatures other than NoTimeSig

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

hasNotes :: MidiTrack -> Bool Source

Returns True if the MidiTrack is non-empty