| Copyright | (c) Hans Hoglund 2012-2014 |
|---|---|
| License | BSD-style |
| Maintainer | hans@hanshoglund.se |
| Stability | experimental |
| Portability | non-portable (TF,GNTD) |
| Safe Haskell | None |
| Language | Haskell2010 |
Music.Time.Aligned
Description
- data Aligned v
- aligned :: Time -> LocalDuration -> v -> Aligned v
- renderAligned :: HasDuration a => (Span -> a -> b) -> Aligned a -> b
- renderAlignedVoice :: Aligned (Voice a) -> Score a
- renderAlignedNote :: Aligned (Note a) -> Event a
- renderAlignedDuration :: Aligned Duration -> Span
Documentation
Aligned places a vector-like object in space, by fixing a local duration interpolating
the vector to a specific point in time. The aligned value must be an instance of
HasDuration, with providing the size of the vector.view duration
This is analogous to alignment in a graphical program. To align something at onset, midpoint or offset, use 0, 0.5 or 1 as the local duration value.
Instances
| Show a => Show (Aligned a) | |
| Transformable v => Transformable (Aligned v) | |
| HasDuration v => HasDuration (Aligned v) | |
| HasDuration v => HasPosition (Aligned v) |
aligned :: Time -> LocalDuration -> v -> Aligned v Source
Align the given value so that its local duration occurs at the given time.
renderAligned :: HasDuration a => (Span -> a -> b) -> Aligned a -> b Source
renderAlignedVoice :: Aligned (Voice a) -> Score a Source
Convert an aligned voice to a score.
renderAlignedNote :: Aligned (Note a) -> Event a Source
Convert an aligned note to an event.
renderAlignedDuration :: Aligned Duration -> Span Source
Convert an aligned duration to a span.