Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- type Time = Rational
- type Arc = (Time, Time)
- type Event a = (Arc, Arc, a)
- sam :: Time -> Time
- nextSam :: Time -> Time
- cyclePos :: Time -> Time
- isIn :: Arc -> Time -> Bool
- arcCycles :: Arc -> [Arc]
- arcCycles' :: Arc -> [Arc]
- subArc :: Arc -> Arc -> Maybe Arc
- mapArc :: (Time -> Time) -> Arc -> Arc
- mapCycle :: (Time -> Time) -> Arc -> Arc
- mirrorArc :: Time -> Arc -> Arc
- eventStart :: Event a -> Time
- eventOnset :: Event a -> Time
- eventOffset :: Event a -> Time
- eventArc :: Event a -> Arc
- midPoint :: Arc -> Time
- hasOnset :: Event a -> Bool
- hasOffset :: Event a -> Bool
- onsetIn :: Arc -> Event a -> Bool
- offsetIn :: Arc -> Event a -> Bool

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

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, Arc, a) Source #

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.

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

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

arcCycles' :: Arc -> [Arc] Source #

Splits the given `Arc`

into a list of `Arc`

s, at cycle boundaries, but wrapping the arcs within the same cycle.

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

`subArc i j`

is the arc that is the intersection of `i`

and `j`

.

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

Map the given function over both the start and end `Time`

values
of the given `Arc`

.

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

Similar to `mapArc`

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

mirrorArc :: Time -> Arc -> Arc Source #

Returns the `mirror image' of an `Arc`

around the given point intime, used by `Sound.Tidal.Pattern.rev`

.

eventStart :: Event a -> Time Source #

The start time of the given `Event`

eventOnset :: Event a -> Time Source #

The original onset of the given `Event`

eventOffset :: Event a -> Time Source #

The original offset of the given `Event`