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

Safe HaskellNone

Perform.Lilypond.Types

Contents

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.

Minimal complete definition

to_lily

Methods

to_lily :: a -> Text Source #

Instances
ToLily Text # 
Instance details

Defined in Perform.Lilypond.Types

Methods

to_lily :: Text -> Text Source #

ToLily Accidental # 
Instance details

Defined in Perform.Lilypond.Types

ToLily PitchClass # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Pitch # 
Instance details

Defined in Perform.Lilypond.Types

Methods

to_lily :: Pitch -> Text Source #

ToLily NoteDuration # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Duration # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Meter # 
Instance details

Defined in Perform.Lilypond.Meter

Methods

to_lily :: Meter -> Text Source #

ToLily Voice # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Voice -> Text Source #

ToLily Note # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Note -> Text Source #

ToLily Ly # 
Instance details

Defined in Perform.Lilypond.Process

Methods

to_lily :: Ly -> Text Source #

data Config Source #

Configure how the lilypond score is generated.

Constructors

Config 

Fields

Instances
Eq Config # 
Instance details

Defined in Perform.Lilypond.Types

Methods

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

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

Read Config # 
Instance details

Defined in Perform.Lilypond.Types

Show Config # 
Instance details

Defined in Perform.Lilypond.Types

Pretty.Pretty Config # 
Instance details

Defined in Perform.Lilypond.Types

Serialize Config # 
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
Bounded Duration # 
Instance details

Defined in Perform.Lilypond.Types

Enum Duration # 
Instance details

Defined in Perform.Lilypond.Types

Eq Duration # 
Instance details

Defined in Perform.Lilypond.Types

Ord Duration # 
Instance details

Defined in Perform.Lilypond.Types

Read Duration # 
Instance details

Defined in Perform.Lilypond.Types

Show Duration # 
Instance details

Defined in Perform.Lilypond.Types

Pretty.Pretty Duration # 
Instance details

Defined in Perform.Lilypond.Types

Serialize Duration # 
Instance details

Defined in Cmd.Serialize

ToLily Duration # 
Instance details

Defined in Perform.Lilypond.Types

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
Enum Time # 
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] #

Eq Time # 
Instance details

Defined in Perform.Lilypond.Types

Methods

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

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

Integral Time # 
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 #

Num Time # 
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 #

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

Real Time # 
Instance details

Defined in Perform.Lilypond.Types

Methods

toRational :: Time -> Rational #

Show Time # 
Instance details

Defined in Perform.Lilypond.Types

Methods

showsPrec :: Int -> Time -> ShowS #

show :: Time -> String #

showList :: [Time] -> ShowS #

Pretty.Pretty Time # 
Instance details

Defined in Perform.Lilypond.Types

Event

data Event Source #

Constructors

Event 

Fields

Instances
Show Event # 
Instance details

Defined in Perform.Lilypond.Types

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Pretty.Pretty Event # 
Instance details

Defined in Perform.Lilypond.Types

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

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

pitch

data Pitch Source #

Constructors

Pitch !Int !PitchClass !Accidental 
Instances
Eq Pitch # 
Instance details

Defined in Perform.Lilypond.Types

Methods

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

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

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

Show Pitch # 
Instance details

Defined in Perform.Lilypond.Types

Methods

showsPrec :: Int -> Pitch -> ShowS #

show :: Pitch -> String #

showList :: [Pitch] -> ShowS #

Pretty.Pretty Pitch # 
Instance details

Defined in Perform.Lilypond.Types

ToLily Pitch # 
Instance details

Defined in Perform.Lilypond.Types

Methods

to_lily :: Pitch -> Text Source #