Portability | non-portable (TF,GNTD) |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
Provides partwise traversal, part composition and extraction.
- class HasPart a where
- type HasPart' a = (Ord (Part a), HasPart a)
- newtype PartT n a = PartT {
- getPartT :: (n, a)
- extract :: (HasPart' a, MonadPlus s, Performable s) => s a -> [s a]
- extractParts :: (HasPart' a, MonadPlus s, Performable s) => s a -> [(Part a, s a)]
- mapPart :: (Ord v, v ~ Part a, HasPart a, MonadPlus s, Performable s, Enum b) => b -> (s a -> s a) -> s a -> s a
- mapAllParts :: (HasPart' a, MonadPlus s, Performable s) => ([s a] -> [s b]) -> s a -> s b
- mapParts :: (HasPart' a, MonadPlus s, Performable s) => (s a -> s b) -> s a -> s b
- getParts :: (HasPart' a, Performable s) => s a -> [Part a]
- setParts :: (HasPart a, Functor s) => Part a -> s a -> s a
- modifyParts :: (HasPart a, Functor s) => (Part a -> Part a) -> s a -> s a
- (</>) :: (HasPart' a, Enum (Part a), Functor s, MonadPlus s, Performable s) => s a -> s a -> s a
- moveParts :: (HasPart' a, Enum (Part a), Integral b, Functor s) => b -> s a -> s a
- moveToPart :: (HasPart' a, Enum (Part a), Functor s) => Part a -> s a -> s a
Documentation
Class of types with an associated part.
The part type can be any type that is orddered.
Get the voice of the given note.
setPart :: Part a -> a -> aSource
Set the voice of the given note.
modifyPart :: (Part a -> Part a) -> a -> aSource
Modify the voice of the given note.
HasPart Double | |
HasPart Float | |
HasPart Int | |
HasPart Integer | |
HasPart () | |
Integral a => HasPart (Ratio a) | |
HasPart a => HasPart (Maybe a) | |
HasPart a => HasPart (TieT a) | |
HasPart a => HasPart (DynamicT a) | |
HasPart a => HasPart (ArticulationT a) | |
HasPart a => HasPart (SlideT a) | |
HasPart a => HasPart (HarmonicT a) | |
HasPart a => HasPart (TextT a) | |
HasPart a => HasPart (TremoloT a) | |
HasPart (PartT n a) |
type HasPart' a = (Ord (Part a), HasPart a)Source
Like HasPart
, but enforces the part to be ordered.
This is usually required for part separation and traversal.
Typeable2 PartT | |
Functor (PartT n) | |
(Enum v, Bounded a) => Bounded (PartT v a) | |
(Enum v, Enum a) => Enum (PartT v a) | |
(Eq n, Eq a) => Eq (PartT n a) | |
(Enum v, Ord v, Real a, Enum a, Integral a) => Integral (PartT v a) | |
(Enum v, Eq v, Num a) => Num (PartT v a) | |
(Ord n, Ord a) => Ord (PartT n a) | |
(Enum v, Ord v, Num a, Ord a, Real a) => Real (PartT v a) | |
(Show n, Show a) => Show (PartT n a) | |
(IsDynamics a, Enum n) => IsDynamics (PartT n a) | |
(IsPitch a, Enum n) => IsPitch (PartT n a) | |
HasPitch a => HasPitch (PartT n a) | |
HasPart (PartT n a) | |
Tiable a => Tiable (PartT n a) | |
HasDynamic a => HasDynamic (PartT n a) | |
HasArticulation a => HasArticulation (PartT n a) | |
HasSlide a => HasSlide (PartT n a) | |
HasHarmonic a => HasHarmonic (PartT n a) | |
HasText a => HasText (PartT n a) | |
HasTremolo a => HasTremolo (PartT n a) | |
HasChord a => HasChord (PartT n a) | |
HasMidi a => HasMidi (PartT n a) | |
HasLilypond a => HasLilypond (PartT n a) | |
HasMusicXml a => HasMusicXml (PartT n a) |
extract :: (HasPart' a, MonadPlus s, Performable s) => s a -> [s a]Source
extractParts :: (HasPart' a, MonadPlus s, Performable s) => s a -> [(Part a, s a)]Source
Extract parts from the a score.
The parts are returned in the order defined the associated Ord
instance part type.
Simple type
Score a -> [(Part a, Score a)]
mapPart :: (Ord v, v ~ Part a, HasPart a, MonadPlus s, Performable s, Enum b) => b -> (s a -> s a) -> s a -> s aSource
Map over a single voice in the given score.
Part -> (Score a -> Score a) -> Score a -> Score a
mapAllParts :: (HasPart' a, MonadPlus s, Performable s) => ([s a] -> [s b]) -> s a -> s bSource
Map over all parts in the given score.
([Score a] -> [Score a]) -> Score a -> Score a
mapParts :: (HasPart' a, MonadPlus s, Performable s) => (s a -> s b) -> s a -> s bSource
Map over all parts in the given score.
([Score a] -> [Score a]) -> Score a -> Score a
getParts :: (HasPart' a, Performable s) => s a -> [Part a]Source
Get all parts in the given score. Returns a list of parts.
Score a -> [Part]
setParts :: (HasPart a, Functor s) => Part a -> s a -> s aSource
Set all parts in the given score.
Part -> Score a -> Score a
modifyParts :: (HasPart a, Functor s) => (Part a -> Part a) -> s a -> s aSource
Modify all parts in the given score.
(Part -> Part) -> Score a -> Score a
Part composition
(</>) :: (HasPart' a, Enum (Part a), Functor s, MonadPlus s, Performable s) => s a -> s a -> s aSource
Similar to <>
, but increases parts in the second part to prevent collision.