Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

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
Eq Highlight # 
Instance details

Defined in Solkattu.Format.Format

Show Highlight # 
Instance details

Defined in Solkattu.Format.Format

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) 
-> [[[(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 -> Tala.Tala -> Int -> [[Line sym]] -> (PrevRuler, [[(Maybe Ruler, Line sym)]]) Source #

inferRuler :: Tala.Akshara -> Tala.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!