music-score-1.9.0: Musical score and part representation.

Copyright(c) Hans Hoglund 2012-2014
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilitynon-portable (TF,GNTD)
Safe HaskellNone
LanguageHaskell2010

Music.Time.Internal.Transform

Contents

Description

 

Synopsis

Documentation

The Transformable class

class Transformable a where Source

Class of values that can be transformed (i.e. scaled and moved) in time.

Methods

transform :: Span -> a -> a Source

Instances

Transformable Bool 
Transformable Char 
Transformable Double 
Transformable Float 
Transformable Int 
Transformable Integer 
Transformable Ordering 
Transformable () 
Transformable Span 
Transformable Time 
Transformable Duration 
Transformable Meta 
Transformable Attribute 
Transformable ArticulationNotation 
Transformable DynamicNotation 
Transformable a => Transformable [a] 
Transformable a => Transformable (Ratio a) 
Transformable a => Transformable (Sum a) 
Transformable a => Transformable (Product a) 
Transformable a => Transformable (Maybe a) 
(Ord a, Transformable a) => Transformable (Set a) 
Transformable a => Transformable (Seq a) 
Transformable a => Transformable (Option a) 
Transformable a => Transformable (Last a) 
Transformable a => Transformable (Ctxt a) 
Transformable (NoReverse a) 
Transformable (Note a) 
Transformable (Voice a) 
Transformable a => Transformable (Placed a) 
Transformable a => Transformable (Track a) 
Transformable a => Transformable (AddMeta a) 
Transformable (Event a) 
Transformable (Score a) 
Transformable v => Transformable (Aligned v) 
Transformable (Behavior a) 
Transformable (Reactive a) 
Transformable a => Transformable (Average a) 
Transformable a => Transformable (TieT a) 
Transformable (Rhythm a) 
Transformable a => Transformable (SlideT a) 
Transformable a => Transformable (TextT a) 
Transformable a => Transformable (HarmonicT a) 
Transformable a => Transformable (TremoloT a) 
Transformable a => Transformable (ColorT a) 
(Transformable a, Transformable b) => Transformable (a -> b) 
Transformable a => Transformable (b, a) 
(Ord k, Transformable a) => Transformable (Map k a) 
(Monoid b, Transformable a) => Transformable (Couple b a) 
Transformable a => Transformable (PartT n a) 
Transformable a => Transformable (DynamicT n a) 
Transformable a => Transformable (ArticulationT n a) 

transformed :: (Transformable a, Transformable b) => Span -> Iso a b a b Source

View the given value in the context of the given transformation.

Apply under a transformation

whilst :: (Transformable a, Transformable b) => (a -> b) -> Span -> a -> b Source

Apply a function under transformation.

>>> stretch 2 `whilst` delaying 2 $ (1 <-> 2)
4 <-> 6

whilstL :: (Functor f, Transformable a, Transformable b) => LensLike f s t a b -> LensLike f (Span, s) (Span, t) a b Source

whilstLT :: (Functor f, Transformable a, Transformable b) => LensLike f s t a b -> LensLike f (Time, s) (Time, t) a b Source

whilstLD :: (Functor f, Transformable a, Transformable b) => LensLike f s t a b -> LensLike f (Duration, s) (Duration, t) a b Source

onSpan :: (Transformable s, Transformable t, Functor f) => LensLike f s t a b -> Span -> LensLike f s t a b Source

Transforms a lens of to a Transformable type to act inside a transformation.

Designed to be used infix, as in

l onSpan (2 <-> 3)

Specific transformations

Transformations

delaying :: Duration -> Span Source

A transformation that moves a value forward in time.

undelaying :: Duration -> Span Source

A transformation that moves a value backward in time.

stretching :: Duration -> Span Source

A transformation that stretches (augments) a value by the given factor.

compressing :: Duration -> Span Source

A transformation that compresses (diminishes) a value by the given factor.

Transforming values

delay :: Transformable a => Duration -> a -> a Source

Moves a value forward in time.

undelay :: Transformable a => Duration -> a -> a Source

Moves a value backward in time. Equnitvalent to stretch . negate.

stretch :: Transformable a => Duration -> a -> a Source

Stretches (augments) a value by the given factor.

compress :: Transformable a => Duration -> a -> a Source

Compresses (diminishes) a score. Equnitvalent to stretch . recip.