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 |
This module provides phrase-wise traversal.
- class HasPhrases s t a b | s -> a, t -> b, s b -> t, t a -> s where
- type HasPhrases' s a = HasPhrases s s a a
- phrases :: HasPhrases s t a b => Traversal s t (Phrase a) (Phrase b)
- phrases' :: HasPhrases' s a => Traversal' s (Phrase a)
- type Phrase a = Voice a
- type MVoice a = Voice (Maybe a)
- type PVoice a = [Either Duration (Phrase a)]
- type TVoice a = Track (Phrase a)
- mVoicePVoice :: Lens (MVoice a) (MVoice b) (PVoice a) (PVoice b)
- mVoiceTVoice :: Lens (MVoice a) (MVoice b) (TVoice a) (TVoice b)
- pVoiceTVoice :: Lens (PVoice a) (PVoice b) (TVoice a) (TVoice b)
- unsafeMVoicePVoice :: Iso (MVoice a) (MVoice b) (PVoice a) (PVoice b)
- singleMVoice :: Prism (Score a) (Score b) (MVoice a) (MVoice b)
- mapPhrasesWithPrevAndCurrentOnset :: HasPhrases s t a b => (Maybe Time -> Time -> Phrase a -> Phrase b) -> s -> t
HasPhrases class
class HasPhrases s t a b | s -> a, t -> b, s b -> t, t a -> s where Source
Classes that provide a phrase traversal.
(HasPart' a, Ord (Part a)) => HasPhrases (Score a) (Score b) a b | Traverses all phrases in each voice, using |
HasPhrases (PVoice a) (PVoice b) a b | |
HasPhrases (MVoice a) (MVoice b) a b | Traverses all phrases in a voice. |
type HasPhrases' s a = HasPhrases s s a a Source
phrases :: HasPhrases s t a b => Traversal s t (Phrase a) (Phrase b) Source
A generic phrase-traversal.
phrases' :: HasPhrases' s a => Traversal' s (Phrase a) Source
A simple generic phrase-traversal.
Phrase types etc
type MVoice a = Voice (Maybe a) Source
A sequence of phrases or rests, represented as notes or rests.
Each consecutive sequence of non-rest elements is considered to be a phrase.
For a more explicit representation of the phrase structure, see PVoice
.
type PVoice a = [Either Duration (Phrase a)] Source
A sequence of phrases or rests, represented with explicit phrase structure.
Utility
mapPhrasesWithPrevAndCurrentOnset :: HasPhrases s t a b => (Maybe Time -> Time -> Phrase a -> Phrase b) -> s -> t Source