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

Contents

Description

 

Synopsis

Note type

data Note a Source

A value Note value, representing a suspended stretch of some Transformable value. We can access the value in bothits original and note form using note and notee, respectively.

Placing a value inside Note makes it invariant under delay, however the inner value can still be delayed using fmap delay.

Instances

Monad Note 
Functor Note 
Applicative Note 
Foldable Note 
Traversable Note 
Eq a => Eq (Note a) 
Floating a => Floating (Note a) 
Fractional a => Fractional (Note a) 
Num a => Num (Note a) 
Ord a => Ord (Note a) 
Real a => Real (Note a) 
RealFrac a => RealFrac (Note a) 
(Show a, Transformable a) => Show (Note a) 
IsString a => IsString (Note a) 
ToJSON a => ToJSON (Note a) 
Wrapped (Note a) 
IsDynamics a => IsDynamics (Note a) 
IsPitch a => IsPitch (Note a) 
IsInterval a => IsInterval (Note a) 
Transformable (Note a) 
HasDuration (Note a) 
(Splittable a, Transformable a) => Splittable (Note a) 
HasSlide a => HasSlide (Note a) 
HasText a => HasText (Note a) 
HasColor a => HasColor (Note a) 
Rewrapped (Note a) (Note b) 
HasParts a b => HasParts (Note a) (Note b) 
HasPart a b => HasPart (Note a) (Note b) 
HasPitches a b => HasPitches (Note a) (Note b) 
HasPitch a b => HasPitch (Note a) (Note b) 
HasDynamics a b => HasDynamics (Note a) (Note b) 
HasDynamic a b => HasDynamic (Note a) (Note b) 
HasArticulations a b => HasArticulations (Note a) (Note b) 
HasArticulation a b => HasArticulation (Note a) (Note b) 
Cons (Voice a) (Voice b) (Note a) (Note b) 
Snoc (Voice a) (Voice b) (Note a) (Note b) 
Typeable (* -> *) Note 
type SetPart g (Note a) = Note (SetPart g a) 
type SetPitch b (Note a) = Note (SetPitch b a) 
type SetDynamic b (Note a) = Note (SetDynamic b a) 
type SetArticulation g (Note a) = Note (SetArticulation g a) 
type Unwrapped (Note a) = (Duration, a) 
type Part (Note a) = Part a 
type Pitch (Note a) = Pitch a 
type Dynamic (Note a) = Dynamic a 
type Articulation (Note a) = Articulation a 

Construction

note :: Iso (Duration, a) (Duration, b) (Note a) (Note b) Source

View a note value as a pair of the original value and a stretch factor.

notee :: (Transformable a, Transformable b) => Lens (Note a) (Note b) a b Source

Access the note value. Taking a value out carries out the stretch (using the Transformable instance), while putting a value in carries out the reverse transformation.

>>> view notee $ (2,3::Duration)^.note
6
>>> set notee 6 $ (2,1::Duration)^.note
(2,3)^.note

durationNote :: Iso' Duration (Note ()) Source

A note value as a duration carrying an associated value. Whitness by picking a trivial value.

>>> 2^.durationNote
(2,())^.note