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

Copyright(c) Hans Hoglund 2012-2014
Portabilitynon-portable (TF,GNTD)
Safe HaskellNone






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.


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) 
Wrapped (Note a) 
IsDynamics a => IsDynamics (Note a) 
IsPitch a => IsPitch (Note a) 
IsInterval a => IsInterval (Note a) 
Transformable (Note a) 
HasDuration (Note a) 
HasSlide a => HasSlide (Note a) 
HasText a => HasText (Note a) 
Rewrapped (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 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 Pitch (Note a) = Pitch a 
type Dynamic (Note a) = Dynamic a 
type Articulation (Note a) = Articulation a 


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
>>> set notee 6 $ (2,1::Duration)^.note

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

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

>>> 2^.durationNote