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

Perform.Lilypond.Lilypond

Description

Convert from Score events to a lilypond score.

Synopsis

Documentation

config

paper_config :: [Text] Source #

Lilypond code inserted inside the toplevel paper block.

output

ly_file :: Types.Config -> Title -> [Movement] -> Lazy.Text Source #

Format a list Movements into a complete lilypond file.

write_empty_staff :: Types.StaffConfig -> [Either Process.Voices Process.Ly] -> Output () Source #

Convert ly code to all hidden rests, and emit an empty staff with a bass clef. This is so xstaff commands can later cause it to appear, only when needed.

(<+>) :: Text -> Text -> Text infixr 6 Source #

data OutputState Source #

Instances

Instances details
Show OutputState Source # 
Instance details

Defined in Perform.Lilypond.Lilypond

convert events

data StaffGroup Source #

If the staff group has >1 staff, it is bracketed as a grand staff.

Instances

Instances details
Show StaffGroup Source # 
Instance details

Defined in Perform.Lilypond.Lilypond

Pretty.Pretty StaffGroup Source # 
Instance details

Defined in Perform.Lilypond.Lilypond

convert_staff_groups :: Types.Config -> Types.Time -> [Types.Event] -> [Types.Event] -> Either Log.Msg [StaffGroup] Source #

Group a stream of events into individual staves based on instrument, and for keyboard instruments, left or right hand. Then convert each staff of Events to Notes, divided up into measures.

split_events :: [Types.Event] -> [(ScoreT.Instrument, [[Types.Event]])] Source #

Split events by instrument, and if they have EnvKey.hand, further split into right and left hand.

staff_group :: Types.Config -> Types.Time -> [Meter.Meter] -> ScoreT.Instrument -> [[Types.Event]] -> Either Log.Msg StaffGroup Source #

Right hand goes at the top, left hand goes at the bottom. Any other hands go below that. Events that are don't have a hand are assumed to be in the right hand.

distribute_global :: [Types.Event] -> ScoreT.Instrument -> [Types.Event] -> [Types.Event] Source #

Global FreeCode events get distributed to all staves.

movements

split_movements :: [(Types.Time, Title)] -> [Types.Event] -> [(Types.Time, Title, [Types.Event])] Source #

Use the movement break points to group the events by movement. The events are not shifted in time, so each movement has to start at the proper offset. The reason is that certain calls, like tuplet, bake in lilypond code, and it will be wrong if the events change position.

meter

parse_meters :: Types.Time -> Types.Time -> [Types.Event] -> Either Error ([Meter.Meter], [Types.Event]) Source #

Extract Meters from the Events, and emit one per measure.

util