Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Solkattu.Korvai

Description

Tie together generic Solkattu and specific instruments into a single Korvai.

Synopsis

Documentation

type SequenceG g sollu = S.Sequence g (Solkattu.Note sollu) Source #

Score

data Score Source #

Constructors

Single !Korvai 
Tani !Metadata ![Part Korvai] 

Instances

Instances details
Show Score Source # 
Instance details

Defined in Solkattu.Korvai

Methods

showsPrec :: Int -> Score -> ShowS #

show :: Score -> String #

showList :: [Score] -> ShowS #

data Part k Source #

Constructors

K !k 
Comment !Text 

Instances

Instances details
Functor Part Source # 
Instance details

Defined in Solkattu.Korvai

Methods

fmap :: (a -> b) -> Part a -> Part b #

(<$) :: a -> Part b -> Part a #

Show k => Show (Part k) Source # 
Instance details

Defined in Solkattu.Korvai

Methods

showsPrec :: Int -> Part k -> ShowS #

show :: Part k -> String #

showList :: [Part k] -> ShowS #

tani :: [Part Korvai] -> Score Source #

Make a Tani Score, which is just a sequence of Korvais.

realizeScore :: (Korvai -> IO ()) -> Score -> IO () Source #

korvai

data Korvai Source #

Instances

Instances details
Generics.Generic Korvai Source # 
Instance details

Defined in Solkattu.Korvai

Associated Types

type Generics.Rep Korvai :: Type -> Type #

Show Korvai Source # 
Instance details

Defined in Solkattu.Korvai

Pretty.Pretty Korvai Source # 
Instance details

Defined in Solkattu.Korvai

type Generics.Rep Korvai Source # 
Instance details

Defined in Solkattu.Korvai

index :: Int -> Korvai -> Korvai Source #

Modify the korvai to extract a single Section.

Instrument

data KorvaiSections Source #

Constructors

forall stroke. KorvaiSections (Instrument stroke) (Sections stroke) 

type Sections stroke = [Section (SequenceT (Realize.Stroke stroke))] Source #

data GInstrument Source #

Constructors

forall stroke.(Solkattu.Notation stroke, Ord stroke, Expr.ToExpr (Realize.Stroke stroke)) => GInstrument (Instrument stroke) 

Section

data Section a Source #

Constructors

Section 

Fields

Instances

Instances details
Functor Section Source # 
Instance details

Defined in Solkattu.Korvai

Methods

fmap :: (a -> b) -> Section a -> Section b #

(<$) :: a -> Section b -> Section a #

Generics.Generic (Section a) Source # 
Instance details

Defined in Solkattu.Korvai

Associated Types

type Generics.Rep (Section a) :: Type -> Type #

Methods

from :: Section a -> Generics.Rep (Section a) x #

to :: Generics.Rep (Section a) x -> Section a #

Show a => Show (Section a) Source # 
Instance details

Defined in Solkattu.Korvai

Methods

showsPrec :: Int -> Section a -> ShowS #

show :: Section a -> String #

showList :: [Section a] -> ShowS #

Eq a => Eq (Section a) Source # 
Instance details

Defined in Solkattu.Korvai

Methods

(==) :: Section a -> Section a -> Bool #

(/=) :: Section a -> Section a -> Bool #

Pretty.Pretty a => Pretty.Pretty (Section a) Source # 
Instance details

Defined in Solkattu.Korvai

type Generics.Rep (Section a) Source # 
Instance details

Defined in Solkattu.Korvai

Instrument

instPostprocess :: Instrument stroke -> [Flat stroke] -> [Flat 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 #

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 #

flatten :: SequenceG g sollu -> [S.Flat g (Solkattu.Note sollu)] 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

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

data Metadata Source #

Attach some metadata to a Korvai.

Constructors

Metadata 

Instances

Instances details
Monoid Metadata Source # 
Instance details

Defined in Solkattu.Korvai

Semigroup Metadata Source # 
Instance details

Defined in Solkattu.Korvai

Generics.Generic Metadata Source # 
Instance details

Defined in Solkattu.Korvai

Associated Types

type Generics.Rep Metadata :: Type -> Type #

Show Metadata Source # 
Instance details

Defined in Solkattu.Korvai

Eq Metadata Source # 
Instance details

Defined in Solkattu.Korvai

Pretty.Pretty Metadata Source # 
Instance details

Defined in Solkattu.Korvai

type Generics.Rep Metadata Source # 
Instance details

Defined in Solkattu.Korvai

type Location = (Text, Int, Text) Source #

(module, lineNumber, variableName)

infer

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.

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 #

Instances

Instances details
Monoid StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai

Semigroup StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai

Generics.Generic StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai

Associated Types

type Generics.Rep StrokeMaps :: Type -> Type #

Show StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai

Eq StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai

Pretty.Pretty StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai

type Generics.Rep StrokeMaps Source # 
Instance details

Defined in Solkattu.Korvai