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

Perform.Lilypond.Process

Description

Convert Lilypond Events to lilypond code.

It's a terrible name, but what else am I supposed to call it? Render? Realize? Perform?

Synopsis

Documentation

process Source #

Arguments

:: Types.Config 
-> Types.Time 
-> [Meter.Meter]

one for each measure

-> [Types.Event] 
-> Either Log.Msg [Either Voices Ly] 

This is the top level function which converts a stream of Events on one staff into lilypond code.

. First pass finds voice boundaries. . Then insert rests. . Convert [Event]->[Ly]: keys, meter splitting, tuplet and tremolo. . Merge 0 dur events FreeCode in [Ly] since they have been split according to the meter.

convert_to_rests :: [Either Voices Ly] -> [Ly] Source #

Convert a staff to all rests, keeping the key, clef, and meter changes. have predicates that recognize those, and keep those Codes

parse_key :: Text -> Either Error Key Source #

data Ly Source #

Ultimately, the contants of Ly is just a bit of lilypond code. They are all converted to text via Types.to_lily and concatenated to form the full score. But I encode a fair amount of structure into the data type, which is convenient for debugging. It could also could theoretically be further modified, though I don't think I ever do that. However, ly_duration at least is used to merge FreeCode into a Ly stream.

Constructors

LyNote !Note 
LyRest !Rest 
LyNested Nested 
LyBarline !(Maybe.Maybe Meter.Meter) 
LyCode !Code 

Instances

Instances details
Show Ly Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

showsPrec :: Int -> Ly -> ShowS #

show :: Ly -> String #

showList :: [Ly] -> ShowS #

Types.ToLily Ly Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Ly -> Text Source #

Pretty.Pretty Ly Source # 
Instance details

Defined in Perform.Lilypond.Process

data Note Source #

Constructors

Note 

Fields

Instances

Instances details
Show Note Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

showsPrec :: Int -> Note -> ShowS #

show :: Note -> String #

showList :: [Note] -> ShowS #

Types.ToLily Note Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Note -> Text Source #

newtype Voices Source #

Each Ly list should be the same duration and have the same number of barlines.

Constructors

Voices (VoiceMap Ly) 

Instances

Instances details
Show Voices Source # 
Instance details

Defined in Perform.Lilypond.Process

Pretty.Pretty Voices Source # 
Instance details

Defined in Perform.Lilypond.Process

data Voice Source #

Instances

Instances details
Show Voice Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

showsPrec :: Int -> Voice -> ShowS #

show :: Voice -> String #

showList :: [Voice] -> ShowS #

Eq Voice Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

(==) :: Voice -> Voice -> Bool #

(/=) :: Voice -> Voice -> Bool #

Ord Voice Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

compare :: Voice -> Voice -> Ordering #

(<) :: Voice -> Voice -> Bool #

(<=) :: Voice -> Voice -> Bool #

(>) :: Voice -> Voice -> Bool #

(>=) :: Voice -> Voice -> Bool #

max :: Voice -> Voice -> Voice #

min :: Voice -> Voice -> Voice #

Types.ToLily Voice Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Voice -> Text Source #

Pretty.Pretty Voice Source # 
Instance details

Defined in Perform.Lilypond.Process