Safe Haskell | Safe-Inferred |
---|
Convert from Score events to a lilypond score.
Synopsis
- type Error = Text
- paper_config :: [Text]
- type Title = Text
- ly_file :: Types.Config -> Title -> [Movement] -> Lazy.Text
- write_empty_staff :: Types.StaffConfig -> [Either Process.Voices Process.Ly] -> Output ()
- str :: Text -> Text
- (<+>) :: Text -> Text -> Text
- ly_set :: Text -> Text -> Text
- write_staff :: Types.StaffConfig -> Maybe Text -> Maybe Text -> Output () -> Output ()
- write_voice_ly :: Either Process.Voices Process.Ly -> Output ()
- write_ly :: Process.Ly -> Output ()
- show_stack :: Maybe Stack.UiFrame -> Text
- write_voice :: (Process.Voice, [Process.Ly]) -> Output Int
- sort_staves :: [(ScoreT.Instrument, Types.StaffConfig)] -> [StaffGroup] -> [(StaffGroup, Types.StaffConfig)]
- type Output a = State.State OutputState a
- run_output :: Output a -> Lazy.Text
- data OutputState = OutputState {}
- outputs :: [Text] -> Output ()
- output :: Text -> Output ()
- set_bar :: Int -> Output ()
- type Movement = (Title, [StaffGroup])
- data StaffGroup = StaffGroup ScoreT.Instrument [[Either Process.Voices Process.Ly]]
- explicit_movements :: Types.Config -> [(Title, [Types.Event])] -> Either Log.Msg [Movement]
- extract_movements :: Types.Config -> [Types.Event] -> Either Log.Msg [Movement]
- convert_staff_groups :: Types.Config -> Types.Time -> [Types.Event] -> [Types.Event] -> Either Log.Msg [StaffGroup]
- split_events :: [Types.Event] -> [(ScoreT.Instrument, [[Types.Event]])]
- staff_group :: Types.Config -> Types.Time -> [Meter.Meter] -> ScoreT.Instrument -> [[Types.Event]] -> Either Log.Msg StaffGroup
- distribute_global :: [Types.Event] -> ScoreT.Instrument -> [Types.Event] -> [Types.Event]
- split_movements :: [(Types.Time, Title)] -> [Types.Event] -> [(Types.Time, Title, [Types.Event])]
- parse_meters :: Types.Time -> Types.Time -> [Types.Event] -> Either Error ([Meter.Meter], [Types.Event])
- warn :: CallStack.Stack => Text -> Either Log.Msg a
- partition_key :: EnvKey.Key -> [Types.Event] -> Either Error ([(Types.Time, Text)], [Types.Event])
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.
write_staff :: Types.StaffConfig -> Maybe Text -> Maybe Text -> Output () -> Output () Source #
write_voice_ly :: Either Process.Voices Process.Ly -> Output () Source #
write_ly :: Process.Ly -> Output () Source #
show_stack :: Maybe Stack.UiFrame -> Text Source #
write_voice :: (Process.Voice, [Process.Ly]) -> Output Int Source #
sort_staves :: [(ScoreT.Instrument, Types.StaffConfig)] -> [StaffGroup] -> [(StaffGroup, Types.StaffConfig)] Source #
type Output a = State.State OutputState a Source #
run_output :: Output a -> Lazy.Text Source #
data OutputState Source #
OutputState | |
|
Instances
Show OutputState Source # | |
Defined in Perform.Lilypond.Lilypond showsPrec :: Int -> OutputState -> ShowS # show :: OutputState -> String # showList :: [OutputState] -> ShowS # |
convert events
type Movement = (Title, [StaffGroup]) Source #
data StaffGroup Source #
If the staff group has >1 staff, it is bracketed as a grand staff.
Instances
Show StaffGroup Source # | |
Defined in Perform.Lilypond.Lilypond showsPrec :: Int -> StaffGroup -> ShowS # show :: StaffGroup -> String # showList :: [StaffGroup] -> ShowS # | |
Pretty.Pretty StaffGroup Source # | |
Defined in Perform.Lilypond.Lilypond pretty :: StaffGroup -> Text Source # format :: StaffGroup -> Doc Source # formatList :: [StaffGroup] -> Doc Source # |
explicit_movements :: Types.Config -> [(Title, [Types.Event])] -> Either Log.Msg [Movement] Source #
extract_movements :: Types.Config -> [Types.Event] -> Either Log.Msg [Movement] Source #
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
partition_key :: EnvKey.Key -> [Types.Event] -> Either Error ([(Types.Time, Text)], [Types.Event]) Source #