Safe Haskell | Safe-Inferred |
---|
Tie together generic Solkattu and specific instruments into a single
Korvai
.
Synopsis
- type Sequence = SequenceT Solkattu.Sollu
- type SequenceT sollu = SequenceG Solkattu.Group sollu
- type SequenceG g sollu = S.Sequence g (Solkattu.Note sollu)
- type Error = Text
- mapSollu :: (a -> b) -> S.Sequence g (Solkattu.Note a) -> S.Sequence g (Solkattu.Note b)
- data Score
- data Part k
- tani :: [Part Korvai] -> Score
- mapScore :: (Korvai -> Korvai) -> Score -> Score
- scoreKorvais :: Score -> [Korvai]
- realizeScore :: (Korvai -> IO ()) -> Score -> IO ()
- data Korvai = Korvai {}
- korvai :: Tala.Tala -> StrokeMaps -> [Section (SequenceT Solkattu.Sollu)] -> Korvai
- korvaiInstruments :: Korvai -> [GInstrument]
- mridangamKorvai :: Tala.Tala -> Realize.PatternMap Mridangam.Stroke -> [Section (SequenceT (Realize.Stroke Mridangam.Stroke))] -> Korvai
- kendangTunggalKorvai :: Tala.Tala -> Realize.PatternMap KendangTunggal.Stroke -> [Section (SequenceT (Realize.Stroke KendangTunggal.Stroke))] -> Korvai
- instrumentKorvai :: Instrument stroke -> Tala.Tala -> Realize.PatternMap stroke -> [Section (SequenceT (Realize.Stroke stroke))] -> Korvai
- tablaKorvai :: Talas.Tal -> [Section (SequenceT (Realize.Stroke Bol.Bol))] -> Korvai
- index :: Int -> Korvai -> Korvai
- slice :: Int -> Int -> Korvai -> Korvai
- data KorvaiSections = forall stroke. KorvaiSections (Instrument stroke) (Sections stroke)
- type Sections stroke = [Section (SequenceT (Realize.Stroke stroke))]
- getSections :: Instrument stroke -> KorvaiSections -> Maybe.Maybe (Sections stroke)
- data GInstrument = forall stroke.(Solkattu.Notation stroke, Ord stroke, Expr.ToExpr (Realize.Stroke stroke)) => GInstrument (Instrument stroke)
- instruments :: [GInstrument]
- ginstrumentName :: GInstrument -> Text
- data Section a = Section {}
- scoreSections :: Score -> [Section ()]
- genericSections :: Korvai -> [Section ()]
- modifySections :: (Tags.Tags -> Tags.Tags) -> Korvai -> Korvai
- addSectionTags :: Tags.Tags -> Section a -> Section a
- modifySectionTags :: (Tags.Tags -> Tags.Tags) -> Section a -> Section a
- section :: a -> Section a
- inferSections :: [SequenceT sollu] -> [Section (SequenceT sollu)]
- data Instrument stroke where
- IKonnakol :: Instrument Solkattu.Sollu
- IMridangam :: Instrument Mridangam.Stroke
- IKendangTunggal :: Instrument KendangTunggal.Stroke
- IKendangPasang :: Instrument KendangPasang.Stroke
- IReyong :: Instrument Reyong.Stroke
- ISargam :: Instrument Sargam.Stroke
- IBol :: Instrument Bol.Bol
- ITabla :: Instrument Tabla.Stroke
- instrumentName :: Instrument stroke -> Text
- getStrokeMap :: Instrument stroke -> StrokeMaps -> StrokeMap Solkattu.Sollu stroke
- setStrokeMap :: Instrument stroke -> StrokeMap Solkattu.Sollu stroke -> StrokeMaps
- instPostprocess :: Instrument stroke -> [Flat stroke] -> [Flat stroke]
- instToScore :: Expr.ToExpr (Realize.Stroke stroke) => Instrument stroke -> ToScore.ToScore stroke
- type Flat stroke = S.Flat (Realize.Group (Realize.Stroke stroke)) (Realize.Note stroke)
- type Realized stroke = ([Flat stroke], [Realize.Warning])
- realize :: forall stroke. (Solkattu.Notation stroke, Ord stroke) => Instrument stroke -> Korvai -> [Either.Either Error (Realized stroke)]
- realizeSection :: (Ord sollu, Pretty.Pretty sollu, Solkattu.Notation stroke) => Talas.Tala -> Realize.ToStrokes sollu stroke -> Realize.StrokeMap Solkattu.Sollu stroke -> ([Flat stroke] -> [Flat stroke]) -> Section (SequenceT sollu) -> Either.Either Error (Realized stroke)
- allMatchedSollus :: Instrument stroke -> Korvai -> Set (Realize.SolluMapKey Solkattu.Sollu)
- matchedSollus :: (Pretty.Pretty sollu, Ord sollu) => Realize.ToStrokes sollu stroke -> Tala.Akshara -> Section (SequenceT sollu) -> Set (Realize.SolluMapKey sollu)
- inferNadai :: [Flat stroke] -> S.Nadai
- flatten :: SequenceG g sollu -> [S.Flat g (Solkattu.Note sollu)]
- spaces :: S.Nadai -> S.Duration -> Either.Either Error [S.Flat g (Realize.Note sollu)]
- mapStrokeRest :: (Realize.Stroke a -> Maybe.Maybe (Realize.Stroke b)) -> [S.Flat g (Realize.Note a)] -> [S.Flat g (Realize.Note b)]
- lint :: Pretty.Pretty stroke => Instrument stroke -> [Sequence] -> Korvai -> Text
- data Metadata = Metadata {}
- type Location = (Text, Int, Text)
- withKorvaiMetadata :: Metadata -> Korvai -> Korvai
- modifyMetadata :: (Metadata -> Metadata) -> Score -> Score
- scoreMetadata :: Score -> Metadata
- setLocation :: Location -> Score -> Score
- inferMetadataS :: Score -> Score
- inferMetadata :: Korvai -> Korvai
- inferKorvaiMetadata :: Korvai -> Korvai
- inferKorvaiTags :: Korvai -> Tags.Tags
- inferSectionTags :: Talas.Tala -> Section (SequenceT sollu) -> Tags.Tags
- sectionAvartanams :: Talas.Tala -> Section (SequenceT sollu) -> Int
- type StrokeMap sollu stroke = Either.Either Error (Realize.StrokeMap sollu stroke)
- data StrokeMaps = StrokeMaps {}
Documentation
type Sequence = SequenceT Solkattu.Sollu Source #
type SequenceT sollu = SequenceG Solkattu.Group sollu Source #
type SequenceG g sollu = S.Sequence g (Solkattu.Note sollu) Source #
mapSollu :: (a -> b) -> S.Sequence g (Solkattu.Note a) -> S.Sequence g (Solkattu.Note b) Source #
Score
scoreKorvais :: Score -> [Korvai] Source #
korvai
Instances
korvai :: Tala.Tala -> StrokeMaps -> [Section (SequenceT Solkattu.Sollu)] -> Korvai Source #
korvaiInstruments :: Korvai -> [GInstrument] Source #
mridangamKorvai :: Tala.Tala -> Realize.PatternMap Mridangam.Stroke -> [Section (SequenceT (Realize.Stroke Mridangam.Stroke))] -> Korvai Source #
kendangTunggalKorvai :: Tala.Tala -> Realize.PatternMap KendangTunggal.Stroke -> [Section (SequenceT (Realize.Stroke KendangTunggal.Stroke))] -> Korvai Source #
instrumentKorvai :: Instrument stroke -> Tala.Tala -> Realize.PatternMap stroke -> [Section (SequenceT (Realize.Stroke stroke))] -> Korvai Source #
tablaKorvai :: Talas.Tal -> [Section (SequenceT (Realize.Stroke Bol.Bol))] -> Korvai Source #
Instrument
data KorvaiSections Source #
forall stroke. KorvaiSections (Instrument stroke) (Sections stroke) |
Instances
Show KorvaiSections Source # | |
Defined in Solkattu.Korvai showsPrec :: Int -> KorvaiSections -> ShowS # show :: KorvaiSections -> String # showList :: [KorvaiSections] -> ShowS # | |
Pretty.Pretty KorvaiSections Source # | |
Defined in Solkattu.Korvai pretty :: KorvaiSections -> Text Source # format :: KorvaiSections -> Doc Source # formatList :: [KorvaiSections] -> Doc Source # |
getSections :: Instrument stroke -> KorvaiSections -> Maybe.Maybe (Sections stroke) Source #
data GInstrument Source #
forall stroke.(Solkattu.Notation stroke, Ord stroke, Expr.ToExpr (Realize.Stroke stroke)) => GInstrument (Instrument stroke) |
instruments :: [GInstrument] Source #
ginstrumentName :: GInstrument -> Text Source #
Section
Section | |
|
Instances
scoreSections :: Score -> [Section ()] Source #
genericSections :: Korvai -> [Section ()] Source #
Instrument
data Instrument stroke where Source #
Each instrument is matched up with a stroke type.
instrumentName :: Instrument stroke -> Text Source #
getStrokeMap :: Instrument stroke -> StrokeMaps -> StrokeMap Solkattu.Sollu stroke Source #
setStrokeMap :: Instrument stroke -> StrokeMap Solkattu.Sollu stroke -> StrokeMaps Source #
instPostprocess :: Instrument stroke -> [Flat stroke] -> [Flat stroke] Source #
instToScore :: Expr.ToExpr (Realize.Stroke stroke) => Instrument stroke -> ToScore.ToScore stroke Source #
realize
type Flat stroke = S.Flat (Realize.Group (Realize.Stroke stroke)) (Realize.Note stroke) Source #
Fully realized notes.
type Realized stroke = ([Flat stroke], [Realize.Warning]) Source #
realize :: forall stroke. (Solkattu.Notation stroke, Ord stroke) => Instrument stroke -> Korvai -> [Either.Either Error (Realized stroke)] Source #
Realize a Korvai on a particular instrument.
realizeSection :: (Ord sollu, Pretty.Pretty sollu, Solkattu.Notation stroke) => Talas.Tala -> Realize.ToStrokes sollu stroke -> Realize.StrokeMap Solkattu.Sollu stroke -> ([Flat stroke] -> [Flat stroke]) -> Section (SequenceT sollu) -> Either.Either Error (Realized stroke) Source #
allMatchedSollus :: Instrument stroke -> Korvai -> Set (Realize.SolluMapKey Solkattu.Sollu) Source #
matchedSollus :: (Pretty.Pretty sollu, Ord sollu) => Realize.ToStrokes sollu stroke -> Tala.Akshara -> Section (SequenceT sollu) -> Set (Realize.SolluMapKey sollu) Source #
inferNadai :: [Flat stroke] -> S.Nadai Source #
spaces :: S.Nadai -> S.Duration -> Either.Either Error [S.Flat g (Realize.Note sollu)] Source #
Generate enough Solkattu.Offset
spaces to align the score to the given
start Duration.
transform
mapStrokeRest :: (Realize.Stroke a -> Maybe.Maybe (Realize.Stroke b)) -> [S.Flat g (Realize.Note a)] -> [S.Flat g (Realize.Note b)] Source #
lint
lint :: Pretty.Pretty stroke => Instrument stroke -> [Sequence] -> Korvai -> Text Source #
Show the shadowed strokes, except an ok set. It's ok to shadow the builtins.
Metadata
Attach some metadata to a Korvai.
Instances
scoreMetadata :: Score -> Metadata Source #
infer
inferMetadataS :: Score -> Score Source #
inferMetadata :: Korvai -> Korvai Source #
This is called in Solkattu.All, thanks to Solkattu.ExtractKorvais.
It used to be called in the korvai
and mridangamKorvai
constructors, but
it was confusing how it wouldn't see modifications done after construction.
inferKorvaiMetadata :: Korvai -> Korvai Source #
inferKorvaiTags :: Korvai -> Tags.Tags Source #
inferSectionTags :: Talas.Tala -> Section (SequenceT sollu) -> Tags.Tags Source #
sectionAvartanams :: Talas.Tala -> Section (SequenceT sollu) -> Int Source #
types
type StrokeMap sollu stroke = Either.Either Error (Realize.StrokeMap sollu stroke) Source #
This can be a Left because it comes from one of the instrument-specific
StrokeMaps
fields, which can be Left if Realize.strokeMap
verification
failed.
data StrokeMaps Source #