Safe Haskell | Safe-Inferred |
---|
Sound.Tidal.Time
- type Time = Rational
- type Arc = (Time, Time)
- type Event a = (Arc, a)
- sam :: Time -> Time
- nextSam :: Time -> Time
- cyclePos :: Time -> Time
- isIn :: Arc -> Time -> Bool
- arcCycles :: Arc -> [Arc]
- subArc :: Arc -> Arc -> Maybe Arc
- mapArc :: (Time -> Time) -> Arc -> Arc
- mirrorArc :: Arc -> Arc
- eventStart :: Event a -> Time
- midPoint :: Arc -> Time
Documentation
Time is represented by a rational number. Each natural number represents both the start of the next rhythmic cycle, and the end of the previous one. Rational numbers are used so that subdivisions of each cycle can be accurately represented.
(s,e) :: Arc
represents a time interval with a start and end value.
{ t : s <= t && t < e }
The starting point of the current cycle. A cycle occurs from each
natural number to the next, so this is equivalent to floor
.
The end point of the current cycle (and starting point of the next cycle)
mapArc :: (Time -> Time) -> Arc -> ArcSource
Map the given function over both the start and end Time
values
of the given Arc
.
eventStart :: Event a -> TimeSource
The start time of the given Event