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

Safe HaskellNone

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
Show Ly # 
Instance details

Defined in Perform.Lilypond.Process

Methods

showsPrec :: Int -> Ly -> ShowS #

show :: Ly -> String #

showList :: [Ly] -> ShowS #

Pretty.Pretty Ly # 
Instance details

Defined in Perform.Lilypond.Process

Types.ToLily Ly # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Ly -> Text Source #

data Note Source #

Constructors

Note 

Fields

Instances
Show Note # 
Instance details

Defined in Perform.Lilypond.Process

Methods

showsPrec :: Int -> Note -> ShowS #

show :: Note -> String #

showList :: [Note] -> ShowS #

Types.ToLily Note # 
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
Show Voices # 
Instance details

Defined in Perform.Lilypond.Process

Pretty.Pretty Voices # 
Instance details

Defined in Perform.Lilypond.Process

data Voice Source #

Instances
Eq Voice # 
Instance details

Defined in Perform.Lilypond.Process

Methods

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

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

Ord Voice # 
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 #

Show Voice # 
Instance details

Defined in Perform.Lilypond.Process

Methods

showsPrec :: Int -> Voice -> ShowS #

show :: Voice -> String #

showList :: [Voice] -> ShowS #

Pretty.Pretty Voice # 
Instance details

Defined in Perform.Lilypond.Process

Types.ToLily Voice # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Voice -> Text Source #