Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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 #

data Config Source #

Configure how the lilypond score is generated.

Constructors

Config 

Fields

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

time_to_dur :: Time -> (Duration, Time) Source #

This rounds up to the next Duration, so any Time over a half note will wind up as a whole note.

Convert Time to a Duration, along with any Time left over.

NoteDuration

time_to_note_dur :: Time -> NoteDuration Source #

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

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 # 

Methods

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

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

Integral Time # 

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 # 

Methods

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

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

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

negate :: Time -> Time #

abs :: Time -> Time #

signum :: Time -> Time #

fromInteger :: Integer -> Time #

Ord Time # 

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 # 

Methods

toRational :: Time -> Rational #

Show Time # 

Methods

showsPrec :: Int -> Time -> ShowS #

show :: Time -> String #

showList :: [Time] -> ShowS #

Pretty.Pretty Time # 

Event

data Event Source #

Constructors

Event 

Fields

pitch