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

Solkattu.Format.Format

Description

Utilities shared among formatting backends.

Synopsis

Documentation

data Abstraction Source #

Control what is rendered as strokes, and what is rendered as abstract groups with durations.

data Highlight Source #

Instances

Instances details
Show Highlight Source # 
Instance details

Defined in Solkattu.Format.Format

Eq Highlight Source # 
Instance details

Defined in Solkattu.Format.Format

score

group

type Flat stroke = S.Flat Solkattu.Meta (Realize.Note stroke) Source #

convertGroups :: [Either Korvai.Error ([Korvai.Flat stroke], warnings)] -> [Either Korvai.Error ([Flat stroke], warnings)] Source #

Reduce Realize.Groups to local Groups.

normalize speed

makeGroupsAbstractScore :: Abstraction -> [S.Flat (Realize.Group a) (Realize.Note stroke)] -> [S.Flat (Realize.Group a) (Realize.Note stroke)] Source #

Like makeGroupsAbstract except for non-normalized Realize.realize output. This is used by LSol, not Format, but is defined here since it's doing the same thing.

tala

breakAvartanams :: [(S.State, a)] -> [[(S.State, a)]] Source #

Split on sam.

formatFinalAvartanam Source #

Arguments

:: (note -> Bool) 
-> (note -> Bool) 
-> [[[(a, note)]]]
avartanams
, broken by lines
-> [[[(a, note)]]] 

If the final non-rest is at sam, drop trailing rests, and don't wrap it onto the next line.

ruler

type Ruler = [(Text, Int)] Source #

(mark, width)

type PrevRuler = (Maybe Ruler, Int) Source #

(prevRuler, linesSinceLastRuler)

pairWithRuler :: Int -> PrevRuler -> Talas.Tala -> Int -> [[Line sym]] -> (PrevRuler, [[(Maybe Ruler, Line sym)]]) Source #

inferRuler :: Tala.Akshara -> Talas.Tala -> Int -> [S.State] -> Ruler Source #

Rather than generating the ruler purely from the Tala, I use the States to figure out the mark spacing. Otherwise I wouldn't know where nadai changes occur. But it does mean I can't generate ruler if I run out of strokes, which is a bit annoying for incomplete korvais or ones with eddupu.

metadata

util

mapSnd :: ([a] -> [b]) -> [(x, a)] -> [(x, b)] Source #

This assumes the function doesn't change the length of the list!