tidal-0.2.13: Pattern language for improvised music

Safe HaskellSafe-Inferred

Sound.Tidal.Time

Synopsis

Documentation

type Time = RationalSource

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.

type Arc = (Time, Time)Source

(s,e) :: Arc represents a time interval with a start and end value. { t : s <= t && t < e }

type Event a = (Arc, a)Source

An Event is a value that occurs during the given Arc

sam :: Time -> TimeSource

The starting point of the current cycle. A cycle occurs from each natural number to the next, so this is equivalent to floor.

nextSam :: Time -> TimeSource

The end point of the current cycle (and starting point of the next cycle)

cyclePos :: Time -> TimeSource

The position of a time value relative to the start of its cycle.

isIn :: Arc -> Time -> BoolSource

isIn a t is True iff t is inside the arc represented by a.

arcCycles :: Arc -> [Arc]Source

Splits the given Arc into a list of Arcs, at cycle boundaries.

subArc :: Arc -> Arc -> Maybe ArcSource

subArc i j is the arc that is the intersection of i and j.

mapArc :: (Time -> Time) -> Arc -> ArcSource

Map the given function over both the start and end Time values of the given Arc.

mirrorArc :: Arc -> ArcSource

Returns the `mirror image' of an Arc, used by Sound.Tidal.Pattern.rev.

eventStart :: Event a -> TimeSource

The start time of the given Event

midPoint :: Arc -> TimeSource

The midpoint of an Arc