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

Perform.Lilypond.Types

Description

Basic types used by both Perform.Lilypond.Lilypond and module that use it. Defined here to avoid circular imports.

Synopsis

Documentation

class ToLily a where Source #

Convert a value to its lilypond representation.

Methods

to_lily :: a -> Text Source #

Instances

Instances details
ToLily Meter Source # 
Instance details

Defined in Perform.Lilypond.Meter

Methods

to_lily :: Meter -> Text Source #

ToLily Ly Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Ly -> Text Source #

ToLily Note Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Note -> Text Source #

ToLily Voice Source # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Voice -> Text Source #

ToLily Accidental Source # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

ToLily NoteDuration Source # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Pitch Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

to_lily :: Pitch -> Text Source #

ToLily PitchClass Source # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Text Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

to_lily :: Text -> Text Source #

data Config Source #

Configure how the lilypond score is generated.

Constructors

Config 

Fields

Instances

Instances details
Read Config Source # 
Instance details

Defined in Perform.Lilypond.Types

Show Config Source # 
Instance details

Defined in Perform.Lilypond.Types

Eq Config Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

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

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

Pretty.Pretty Config Source # 
Instance details

Defined in Perform.Lilypond.Types

Serialize Config Source # 
Instance details

Defined in Cmd.Serialize

data StaffConfig Source #

Constructors

StaffConfig 

Fields

  • staff_long :: !Instrument

    Set Staff.instrumentName or PianoStaff.instrumentName. If an instrument doesn't have a StaffConfig, the long name defaults to the instrument name.

  • staff_short :: !Instrument

    Set Staff.shortInstrumentName or PianoStaff.shortInstrumentName.

  • staff_code :: ![Text]

    Additional code to include verbatim, after the \new Staff line.

  • staff_display :: !Bool

    If false, this staff is omitted from the score.

  • staff_add_bass_staff :: !Bool

    If true, add an additional staff named "down". The new staff has a bass clef and all of the notes replaced with hidden rests, but the key and meter changes remain. It is configured so it will be removed from the score for systems during which it has no notes.

    The idea is that you then use xstaff to put notes on this staff. This is for instruments like 揚琴 that have a wide range, but aren't divided into two hands, like the piano.

global_staff_code :: [Text] Source #

This is emitted for every staff, regardless of its staff_code.

Duration

data Duration Source #

This time duration measured as the fraction of a whole note.

Constructors

D1 
D2 
D4 
D8 
D16 
D32 
D64 
D128 

Instances

Instances details
Bounded Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Enum Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Read Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Show Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Eq Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Ord Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Pretty.Pretty Duration Source # 
Instance details

Defined in Perform.Lilypond.Types

Serialize Duration Source # 
Instance details

Defined in Cmd.Serialize

time_to_dur :: Time -> Duration Source #

Get the longest dur that will fit within the Time, so this rounds down.

NoteDuration

data NoteDuration Source #

A Duration plus a possible dot.

Constructors

NoteDuration !Duration !Bool 

time_to_note_dur :: Time -> NoteDuration Source #

Get the longest NoteDuration that will fit in the Time. 0 becomes D128 since there's no 0 duration. This puts a bottom bound on the duration of a note, which is good since 0 duration notes aren't notateable, but can happen after quantization.

is_note_dur :: Time -> Maybe NoteDuration Source #

Only Just if the Time fits into a single NoteDuration.

Time

newtype Time Source #

Time in score units. The maximum resolution is a 128th note, so one unit is 128th of a whole note.

Constructors

Time Int 

Instances

Instances details
Enum Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

succ :: Time -> Time #

pred :: Time -> Time #

toEnum :: Int -> Time #

fromEnum :: Time -> Int #

enumFrom :: Time -> [Time] #

enumFromThen :: Time -> Time -> [Time] #

enumFromTo :: Time -> Time -> [Time] #

enumFromThenTo :: Time -> Time -> Time -> [Time] #

Num Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

(+) :: Time -> Time -> Time #

(-) :: Time -> Time -> Time #

(*) :: Time -> Time -> Time #

negate :: Time -> Time #

abs :: Time -> Time #

signum :: Time -> Time #

fromInteger :: Integer -> Time #

Integral Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

quot :: Time -> Time -> Time #

rem :: Time -> Time -> Time #

div :: Time -> Time -> Time #

mod :: Time -> Time -> Time #

quotRem :: Time -> Time -> (Time, Time) #

divMod :: Time -> Time -> (Time, Time) #

toInteger :: Time -> Integer #

Real Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

toRational :: Time -> Rational #

Show Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

showsPrec :: Int -> Time -> ShowS #

show :: Time -> String #

showList :: [Time] -> ShowS #

Eq Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

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

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

Ord Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

compare :: Time -> Time -> Ordering #

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

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

(>) :: Time -> Time -> Bool #

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

max :: Time -> Time -> Time #

min :: Time -> Time -> Time #

Pretty.Pretty Time Source # 
Instance details

Defined in Perform.Lilypond.Types

Event

data Event Source #

Constructors

Event 

Fields

Instances

Instances details
Show Event Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Pretty.Pretty Event Source # 
Instance details

Defined in Perform.Lilypond.Types

strip_environ :: DeriveT.Environ -> DeriveT.Environ Source #

Strip out non-ly environ keys so error messages are less cluttered.

pitch

data Pitch Source #

Constructors

Pitch !Int !PitchClass !Accidental 

Instances

Instances details
Show Pitch Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

showsPrec :: Int -> Pitch -> ShowS #

show :: Pitch -> String #

showList :: [Pitch] -> ShowS #

Eq Pitch Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

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

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

Ord Pitch Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

compare :: Pitch -> Pitch -> Ordering #

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

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

(>) :: Pitch -> Pitch -> Bool #

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

max :: Pitch -> Pitch -> Pitch #

min :: Pitch -> Pitch -> Pitch #

ToLily Pitch Source # 
Instance details

Defined in Perform.Lilypond.Types

Methods

to_lily :: Pitch -> Text Source #

Pretty.Pretty Pitch Source # 
Instance details

Defined in Perform.Lilypond.Types