tidal-0.9.9: Pattern language for improvised music

Safe HaskellSafe
LanguageHaskell2010

Sound.Tidal.Time

Description

 

Synopsis

Documentation

type Time = Rational #

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) #

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

type Event a = (Arc, Arc, a) #

An Event is a value that occurs during the period given by the first Arc. The second one indicates the event's "domain of influence". These will often be the same, but many temporal transformations, such as rotation and scaling time, may result in arcs being split or truncated. In such cases, the first arc is preserved, but the second arc reflects the portion of the event which is relevant.

sam :: Time -> Time #

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 -> Time #

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

cyclePos :: Time -> Time #

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

isIn :: Arc -> Time -> Bool #

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

arcCycles :: Arc -> [Arc] #

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

arcCycles' :: Arc -> [Arc] #

Splits the given Arc into a list of Arcs, at cycle boundaries, but wrapping the arcs within the same cycle.

subArc :: Arc -> Arc -> Maybe Arc #

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

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

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

mapCycle :: (Time -> Time) -> Arc -> Arc #

Similar to mapArc but time is relative to the cycle (i.e. the sam of the start of the arc)

mirrorArc :: Time -> Arc -> Arc #

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

eventStart :: Event a -> Time #

The start time of the given Event

eventOnset :: Event a -> Time #

The original onset of the given Event

eventOffset :: Event a -> Time #

The original offset of the given Event

eventArc :: Event a -> Arc #

The arc of the given Event

midPoint :: Arc -> Time #

The midpoint of an Arc

hasOnset :: Event a -> Bool #

True if an Event's first and second Arc's start times match

hasOffset :: Event a -> Bool #

True if an Event's first and second Arc's end times match

onsetIn :: Arc -> Event a -> Bool #

True if an Event's starts is within given Arc

offsetIn :: Arc -> Event a -> Bool #

True if an Event's ends is within given Arc