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.BarBeatPos

Description

Summary: Functions for representing MIDI time musically.

Synopsis

Documentation

getBeatInBar :: TimeSig -> TPB -> Time -> (Bar, Beat, BeatRat) Source

Within a MidiScore we can musically describe every (quantised) position in time in Bar, Beat, and BarRat. Therefore, we need the TimeSignature, the length of a beat (TPB, in ticks), and the actual Time stamp.

getBarRat :: TimeSig -> TPB -> Time -> (Bar, BarRat) Source

Similar to getBeatInBar we can also describe the musical position as the combination of a Bar and a BarRat. The latter denotes the ratio within a bar, e.g. BarRat (3 % 4) denotes the 4th Beat in the bar.

toRatInBeat :: TimeSig -> BarRat -> (Beat, BeatRat) Source

toRatInBeat allows us to convert a BarRat into a (Beat,BeatRat)

toBarRat :: QBins -> TimeSig -> (Beat, BeatRat) -> BarRat Source

Musically it is sometimes more intuitive to have a BarRat, i.e. the onset is defined as the ratio within the bar. For example 1%4 denotes them the position of the second quarter note within a 4/4 meter