Safe Haskell | Safe-Inferred |
---|
Utilities shared among formatting backends.
Synopsis
- data Abstraction
- isAbstract :: Abstraction -> Solkattu.Meta -> Bool
- abstract :: Solkattu.GroupType -> Abstraction
- named :: Solkattu.GroupType -> Abstraction
- unnamed :: Solkattu.GroupType -> Abstraction
- defaultAbstraction :: Abstraction
- allAbstract :: Abstraction
- data Highlight
- scoreInstruments :: Korvai.Score -> [Korvai.GInstrument]
- type Flat stroke = S.Flat Solkattu.Meta (Realize.Note stroke)
- convertGroups :: [Either Korvai.Error ([Korvai.Flat stroke], warnings)] -> [Either Korvai.Error ([Flat stroke], warnings)]
- mapGroups :: [S.Flat (Realize.Group stroke) a] -> [S.Flat Solkattu.Meta a]
- type NormalizedFlat stroke = S.Flat Solkattu.Meta (S.State, S.Stroke (Realize.Note stroke))
- makeGroupsAbstract :: Abstraction -> [NormalizedFlat stroke] -> [NormalizedFlat stroke]
- makeGroupsAbstractScore :: Abstraction -> [S.Flat (Realize.Group a) (Realize.Note stroke)] -> [S.Flat (Realize.Group a) (Realize.Note stroke)]
- normalizeSpeed :: S.Speed -> Tala.Akshara -> [Flat stroke] -> [NormalizedFlat stroke]
- breakAvartanams :: [(S.State, a)] -> [[(S.State, a)]]
- formatFinalAvartanam :: (note -> Bool) -> (note -> Bool) -> [[[(a, note)]]] -> [[[(a, note)]]]
- onSam :: S.State -> Bool
- onAnga :: Set Tala.Akshara -> S.State -> Bool
- onAkshara :: S.State -> Bool
- angaSet :: Tala.Tala -> Set Tala.Akshara
- type Ruler = [(Text, Int)]
- type PrevRuler = (Maybe Ruler, Int)
- pairWithRuler :: Int -> PrevRuler -> Talas.Tala -> Int -> [[Line sym]] -> (PrevRuler, [[(Maybe Ruler, Line sym)]])
- inferRuler :: Tala.Akshara -> Talas.Tala -> Int -> [S.State] -> Ruler
- showTags :: Tags.Tags -> Text
- mapSnd :: ([a] -> [b]) -> [(x, a)] -> [(x, b)]
Documentation
data Abstraction Source #
Control what is rendered as strokes, and what is rendered as abstract groups with durations.
Instances
Monoid Abstraction Source # | |
Defined in Solkattu.Format.Format mempty :: Abstraction # mappend :: Abstraction -> Abstraction -> Abstraction # mconcat :: [Abstraction] -> Abstraction # | |
Semigroup Abstraction Source # | |
Defined in Solkattu.Format.Format (<>) :: Abstraction -> Abstraction -> Abstraction # sconcat :: NonEmpty Abstraction -> Abstraction # stimes :: Integral b => b -> Abstraction -> Abstraction # | |
Show Abstraction Source # | |
Defined in Solkattu.Format.Format showsPrec :: Int -> Abstraction -> ShowS # show :: Abstraction -> String # showList :: [Abstraction] -> ShowS # | |
Eq Abstraction Source # | |
Defined in Solkattu.Format.Format (==) :: Abstraction -> Abstraction -> Bool # (/=) :: Abstraction -> Abstraction -> Bool # |
isAbstract :: Abstraction -> Solkattu.Meta -> Bool Source #
Instances
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.Group
s to local Group
s.
mapGroups :: [S.Flat (Realize.Group stroke) a] -> [S.Flat Solkattu.Meta a] Source #
normalize speed
type NormalizedFlat stroke = S.Flat Solkattu.Meta (S.State, S.Stroke (Realize.Note stroke)) Source #
Flat
after normalizeSpeed
.
makeGroupsAbstract :: Abstraction -> [NormalizedFlat stroke] -> [NormalizedFlat stroke] Source #
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.
normalizeSpeed :: S.Speed -> Tala.Akshara -> [Flat stroke] -> [NormalizedFlat stroke] Source #
tala
breakAvartanams :: [(S.State, a)] -> [[(S.State, a)]] Source #
Split on sam.
If the final non-rest is at sam, drop trailing rests, and don't wrap it onto the next line.
ruler
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.