Safe Haskell | Safe-Inferred |
---|
Basic types used by both Perform.Lilypond.Lilypond and module that use it. Defined here to avoid circular imports.
Synopsis
- class ToLily a where
- data Config = Config {}
- quarter_duration :: Config :-> RealTime.RealTime
- quantize :: Config :-> Duration
- dotted_rests :: Config :-> Bool
- staves :: Config :-> [(ScoreT.Instrument, StaffConfig)]
- data StaffConfig = StaffConfig {
- staff_long :: !Instrument
- staff_short :: !Instrument
- staff_code :: ![Text]
- staff_display :: !Bool
- staff_add_bass_staff :: !Bool
- long :: StaffConfig :-> Instrument
- short :: StaffConfig :-> Instrument
- code :: StaffConfig :-> [Text]
- display :: StaffConfig :-> Bool
- add_bass_staff :: StaffConfig :-> Bool
- type Instrument = Text
- default_config :: Config
- empty_staff_config :: StaffConfig
- default_staff_config :: ScoreT.Instrument -> StaffConfig
- global_staff_code :: [Text]
- data Duration
- dur_char :: Duration -> Char
- int_dur :: Int -> Maybe Duration
- dur_to_time :: Duration -> Time
- time_to_dur :: Time -> Duration
- time_to_durs :: Time -> [Duration]
- data NoteDuration = NoteDuration !Duration !Bool
- note_dur_char :: NoteDuration -> Text
- note_dur_to_time :: NoteDuration -> Time
- time_to_note_dur :: Time -> NoteDuration
- dur_to_note_dur :: Duration -> NoteDuration
- is_note_dur :: Time -> Maybe NoteDuration
- time_to_note_durs :: Time -> [NoteDuration]
- newtype Time = Time Int
- to_whole :: Time -> Rational
- time_per_whole :: Time
- real_to_time :: RealTime.RealTime -> RealTime.RealTime -> Time
- multiply :: Rational -> Time -> Maybe Time
- multiply_int :: Int -> Time -> Time
- data Event = Event {}
- event_end :: Event -> Time
- event_overlaps :: Event -> Event -> Bool
- event_attributes :: Event -> Attrs.Attributes
- strip_environ :: DeriveT.Environ -> DeriveT.Environ
- data Pitch = Pitch !Int !PitchClass !Accidental
- data PitchClass
- data Accidental
- = FlatFlat
- | Flat
- | Natural
- | Sharp
- | SharpSharp
- parse_pitch :: Pitch.Pitch -> Either Text Pitch
- parse_degree :: Pitch.Degree -> Either Text (PitchClass, Accidental)
- to_pitch :: Pitch -> Pitch.Pitch
Documentation
Convert a value to its lilypond representation.
Instances
ToLily Meter Source # | |
ToLily Ly Source # | |
ToLily Note Source # | |
ToLily Voice Source # | |
ToLily Accidental Source # | |
Defined in Perform.Lilypond.Types to_lily :: Accidental -> Text Source # | |
ToLily Duration Source # | |
ToLily NoteDuration Source # | |
Defined in Perform.Lilypond.Types to_lily :: NoteDuration -> Text Source # | |
ToLily Pitch Source # | |
ToLily PitchClass Source # | |
Defined in Perform.Lilypond.Types to_lily :: PitchClass -> Text Source # | |
ToLily Text Source # | |
Configure how the lilypond score is generated.
Config | |
|
staves :: Config :-> [(ScoreT.Instrument, StaffConfig)] Source #
data StaffConfig Source #
StaffConfig | |
|
Instances
Read StaffConfig Source # | |
Defined in Perform.Lilypond.Types readsPrec :: Int -> ReadS StaffConfig # readList :: ReadS [StaffConfig] # readPrec :: ReadPrec StaffConfig # readListPrec :: ReadPrec [StaffConfig] # | |
Show StaffConfig Source # | |
Defined in Perform.Lilypond.Types showsPrec :: Int -> StaffConfig -> ShowS # show :: StaffConfig -> String # showList :: [StaffConfig] -> ShowS # | |
Eq StaffConfig Source # | |
Defined in Perform.Lilypond.Types (==) :: StaffConfig -> StaffConfig -> Bool # (/=) :: StaffConfig -> StaffConfig -> Bool # | |
Pretty.Pretty StaffConfig Source # | |
Defined in Perform.Lilypond.Types pretty :: StaffConfig -> Text Source # format :: StaffConfig -> Doc Source # formatList :: [StaffConfig] -> Doc Source # | |
Serialize StaffConfig Source # | |
Defined in Cmd.Serialize put :: Putter StaffConfig Source # get :: Get StaffConfig Source # |
type Instrument = Text Source #
global_staff_code :: [Text] Source #
This is emitted for every staff, regardless of its staff_code
.
Duration
This time duration measured as the fraction of a whole note.
Instances
dur_to_time :: Duration -> Time Source #
time_to_dur :: Time -> Duration Source #
Get the longest dur that will fit within the Time, so this rounds down.
time_to_durs :: Time -> [Duration] Source #
NoteDuration
data NoteDuration Source #
A Duration plus a possible dot.
Instances
Show NoteDuration Source # | |
Defined in Perform.Lilypond.Types showsPrec :: Int -> NoteDuration -> ShowS # show :: NoteDuration -> String # showList :: [NoteDuration] -> ShowS # | |
Eq NoteDuration Source # | |
Defined in Perform.Lilypond.Types (==) :: NoteDuration -> NoteDuration -> Bool # (/=) :: NoteDuration -> NoteDuration -> Bool # | |
ToLily NoteDuration Source # | |
Defined in Perform.Lilypond.Types to_lily :: NoteDuration -> Text Source # | |
Pretty.Pretty NoteDuration Source # | |
Defined in Perform.Lilypond.Types pretty :: NoteDuration -> Text Source # format :: NoteDuration -> Doc Source # formatList :: [NoteDuration] -> Doc Source # |
note_dur_char :: NoteDuration -> Text Source #
note_dur_to_time :: NoteDuration -> Time Source #
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_to_note_durs :: Time -> [NoteDuration] Source #
Time
Time in score units. The maximum resolution is a 128th note, so one unit is 128th of a whole note.
Event
Event | |
|
strip_environ :: DeriveT.Environ -> DeriveT.Environ Source #
Strip out non-ly environ keys so error messages are less cluttered.
pitch
data PitchClass Source #
Instances
data Accidental Source #
Instances
Show Accidental Source # | |
Defined in Perform.Lilypond.Types showsPrec :: Int -> Accidental -> ShowS # show :: Accidental -> String # showList :: [Accidental] -> ShowS # | |
Eq Accidental Source # | |
Defined in Perform.Lilypond.Types (==) :: Accidental -> Accidental -> Bool # (/=) :: Accidental -> Accidental -> Bool # | |
Ord Accidental Source # | |
Defined in Perform.Lilypond.Types compare :: Accidental -> Accidental -> Ordering # (<) :: Accidental -> Accidental -> Bool # (<=) :: Accidental -> Accidental -> Bool # (>) :: Accidental -> Accidental -> Bool # (>=) :: Accidental -> Accidental -> Bool # max :: Accidental -> Accidental -> Accidental # min :: Accidental -> Accidental -> Accidental # | |
ToLily Accidental Source # | |
Defined in Perform.Lilypond.Types to_lily :: Accidental -> Text Source # |
parse_pitch :: Pitch.Pitch -> Either Text Pitch Source #
parse_degree :: Pitch.Degree -> Either Text (PitchClass, Accidental) Source #
to_pitch :: Pitch -> Pitch.Pitch Source #