Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Documentation
Musical tempo is represented as a data structure with three orthogonal components. (Generic instances are derived in order to allow later generation of instances for Aeson classes.)
Instances
Eq Tempo Source # | |
Show Tempo Source # | |
Generic Tempo Source # | |
type Rep Tempo Source # | |
Defined in Data.Tempo type Rep Tempo = D1 (MetaData "Tempo" "Data.Tempo" "tempi-1.0.0.0-Jg3VX53htujJiIoGiEZ7vu" False) (C1 (MetaCons "Tempo" PrefixI True) (S1 (MetaSel (Just "freq") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Rational) :*: (S1 (MetaSel (Just "time") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UTCTime) :*: S1 (MetaSel (Just "count") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Rational)))) |
origin :: Tempo -> UTCTime Source #
The origin
of a Tempo is the time at which the number of elapsed cycles/beats
would have been 0.
timeToCount :: Tempo -> UTCTime -> Rational Source #
Given a Tempo and a clock time (UTCTime), timeToCount tells us how many cycles/beats have elapsed at that time.
countToTime :: Tempo -> Rational -> UTCTime Source #
Given a Tempo and a count of elapsed cycles/beats, countToTime tells us when that "beat" will (or would have) take(n) place.