Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone




Convert from Score events to a lilypond score.




paper_config :: [Text] Source #

Lilypond code inserted inside the toplevel paper block.


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 #

convert events

data StaffGroup Source #

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

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] -> [(Score.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] -> Score.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] -> Score.Instrument -> [Types.Event] -> [Types.Event] Source #

Global FreeCode events get distributed to all staves.


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.


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.