Copyright | (c) Hans Hoglund 2012 |
---|---|
License | BSD-style |
Maintainer | hans@hanshoglund.se |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
- data Music
- = Rest (Maybe Duration) [PostEvent]
- | Note Note (Maybe Duration) [PostEvent]
- | Chord [(Note, [ChordPostEvent])] (Maybe Duration) [PostEvent]
- | Sequential [Music]
- | Simultaneous Bool [Music]
- | Repeat Bool Int Music (Maybe (Music, Music))
- | Tremolo Int Music
- | Times Rational Music
- | Transpose Pitch Pitch Music
- | Relative Pitch Music
- | Clef Clef
- | Key Pitch Mode
- | Time Integer Integer
- | Breathe (Maybe BreathingSign)
- | Tempo (Maybe String) (Maybe (Duration, Integer))
- | New String (Maybe String) Music
- | Context String (Maybe String) Music
- | Set String Value
- | Override String Value
- | Revert String
- data Note
- data Clef
- = Treble
- | Alto
- | Tenor
- | Bass
- | French
- | Soprano
- | MezzoSoprano
- | Baritone
- | VarBaritone
- | SubBass
- | Percussion
- | Tab
- data Mode
- data Value
- toValue :: Show a => a -> Value
- toLiteralValue :: String -> Value
- data PostEvent
- data ChordPostEvent = Harmonic
- data Articulation
- = Accent
- | Marcato
- | Staccatissimo
- | Espressivo
- | Staccato
- | Tenuto
- | Portato
- | Upbow
- | Downbow
- | Flageolet
- | Thumb
- | LeftHeel
- | RightHeel
- | LeftToe
- | RightToe
- | Open
- | Stopped
- | Turn
- | ReverseTurn
- | Trill
- | Prall
- | Mordent
- | PrallPrall
- | PrallMordent
- | UpPrall
- | DownPrall
- | UpMordent
- | DownMordent
- | PrallDown
- | PrallUp
- | LinePrall
- | SignumCongruentiae
- | ShortFermata
- | Fermata
- | LongFermata
- | VeryLongFermata
- | Segno
- | Coda
- | VarCoda
- data Markup
- = MarkupText String
- | MarkupList [Markup]
- | Bold Markup
- | Box Markup
- | Caps Markup
- | DynamicsFont Markup
- | FingeringFont Markup
- | Fontsize Double Markup
- | Huge Markup
- | Italic Markup
- | Large Markup
- | Larger Markup
- | Magnify Markup
- | Medium Markup
- | Roman Markup
- | Sans Markup
- | Sub Markup
- | Super Markup
- | TextFont Markup
- | Tiny Markup
- | TypewriterFont Markup
- | Upright Markup
- class HasMarkup a where
- data Direction
- data OctaveCheck = OctaveCheck
- data BreathingSign
- newtype Duration = Duration {}
- newtype Pitch = Pitch {
- getPitch :: (PitchName, Accidental, Octaves)
- data PitchName
- type Accidental = Int
- type Octaves = Int
- rest :: Music
- note :: Note -> Music
- chord :: [Note] -> Music
- chordHarm :: [(Note, Bool)] -> Music
- chordWithPost :: [(Note, [ChordPostEvent])] -> Music
- sequential :: Music -> Music -> Music
- simultaneous :: Music -> Music -> Music
- addPost :: PostEvent -> Music -> Music
- addText :: String -> Music -> Music
- addMarkup :: HasMarkup a => a -> Music -> Music
- addDynamics :: Dynamics -> Music -> Music
- addArticulation :: Articulation -> Music -> Music
- addText' :: Direction -> String -> Music -> Music
- addMarkup' :: HasMarkup a => Direction -> a -> Music -> Music
- addDynamics' :: Direction -> Dynamics -> Music -> Music
- addArticulation' :: Direction -> Articulation -> Music -> Music
- beginTie :: Music -> Music
- beginGlissando :: Music -> Music
- beginBeam :: Music -> Music
- endBeam :: Music -> Music
- beginSlur :: Music -> Music
- endSlur :: Music -> Music
- beginPhraseSlur :: Music -> Music
- endPhraseSlur :: Music -> Music
- beginCresc :: Music -> Music
- endCresc :: Music -> Music
- beginDim :: Music -> Music
- endDim :: Music -> Music
- addAccent :: Music -> Music
- addMarcato :: Music -> Music
- addStaccatissimo :: Music -> Music
- addEspressivo :: Music -> Music
- addStaccato :: Music -> Music
- addTenuto :: Music -> Music
- addPortato :: Music -> Music
- addUpbow :: Music -> Music
- addDownbow :: Music -> Music
- addFlageolet :: Music -> Music
- addThumb :: Music -> Music
- addLeftHeel :: Music -> Music
- addRightHeel :: Music -> Music
- addLeftToe :: Music -> Music
- addRightToe :: Music -> Music
- addOpen :: Music -> Music
- addStopped :: Music -> Music
- addTurn :: Music -> Music
- addReverseTurn :: Music -> Music
- addTrill :: Music -> Music
- addPrall :: Music -> Music
- addMordent :: Music -> Music
- addPrallPrall :: Music -> Music
- addPrallMordent :: Music -> Music
- addUpPrall :: Music -> Music
- addDownPrall :: Music -> Music
- addUpMordent :: Music -> Music
- addDownMordent :: Music -> Music
- addPrallDown :: Music -> Music
- addPrallUp :: Music -> Music
- addLinePrall :: Music -> Music
- addSignumCongruentiae :: Music -> Music
- addShortFermata :: Music -> Music
- addFermata :: Music -> Music
- addLongFermata :: Music -> Music
- addVeryLongFermata :: Music -> Music
- addSegno :: Music -> Music
- addCoda :: Music -> Music
- addVarCoda :: Music -> Music
- foldMusic :: (Music -> Music) -> Music -> Music
- removeSingleChords :: Music -> Music
Representation
Music expressions
A Lilypond music expression.
Use the Pretty
instance to convert into Lilypond syntax.
Rest (Maybe Duration) [PostEvent] | Single rest. |
Note Note (Maybe Duration) [PostEvent] | Single note. |
Chord [(Note, [ChordPostEvent])] (Maybe Duration) [PostEvent] | Single chord. |
Sequential [Music] | Sequential composition. |
Simultaneous Bool [Music] | Parallel composition (split voices?). |
Repeat Bool Int Music (Maybe (Music, Music)) | Repetition (unfold?, times, music, alternative). |
Tremolo Int Music | Tremolo (multiplier). |
Times Rational Music | Stretch music (multiplier). |
Transpose Pitch Pitch Music | Transpose music (from to). |
Relative Pitch Music | Use relative octave (octave). |
Clef Clef | Clef. |
Key Pitch Mode | Key signature. |
Time Integer Integer | Time signature. |
Breathe (Maybe BreathingSign) | Breath mark (caesura) |
Tempo (Maybe String) (Maybe (Duration, Integer)) | Tempo mark. |
New String (Maybe String) Music | New expression. |
Context String (Maybe String) Music | Context expression. |
Set String Value | |
Override String Value | |
Revert String |
Attributes
Value of a \set
command.
These are simply wrappers for showable things.
For example use (with OverloadedStrings
)
Set "Staff.instrumentName" "Violin I" Set "Staff.instrumentName" 2
to generate
\set Staff.instrumentName = "Violin I" \set Staff.instrumentName = 2
toLiteralValue :: String -> Value Source
As toValue
, but not quoting strings. Handy for scheme literals such as #red
.
Articulation and dynamics
Text
data Articulation Source
Articulations. These include ornaments.
Eq Articulation | |
Show Articulation | |
Pretty Articulation |
Miscellaneous types
data BreathingSign Source
Time
Notated time in fractions, in [2^^i | i <- [-10..3]]
.
Pitch
Pitch | |
|
type Accidental = Int Source
For double flat -2, flat -1, natural 0, sharp 1 and double sharp 2.
Constructing Lilypond expresions
Notes and rests
Construct a rest of default duration 1/4
.
Use the VectorSpace
methods to change duration.
Construct a note of default duration 1/4
.
Use the VectorSpace
methods to change duration.
chord :: [Note] -> Music Source
Construct a chord of default duration 1/4
.
Use the VectorSpace
methods to change duration.
chordWithPost :: [(Note, [ChordPostEvent])] -> Music Source
Composition
sequential :: Music -> Music -> Music Source
simultaneous :: Music -> Music -> Music Source
Post events
addDynamics :: Dynamics -> Music -> Music Source
addArticulation :: Articulation -> Music -> Music Source
addArticulation' :: Direction -> Articulation -> Music -> Music Source
Curves and lines
beginGlissando :: Music -> Music Source
beginPhraseSlur :: Music -> Music Source
endPhraseSlur :: Music -> Music Source
beginCresc :: Music -> Music Source
Marks
addMarcato :: Music -> Music Source
addStaccatissimo :: Music -> Music Source
addEspressivo :: Music -> Music Source
addStaccato :: Music -> Music Source
addPortato :: Music -> Music Source
addDownbow :: Music -> Music Source
addFlageolet :: Music -> Music Source
addLeftHeel :: Music -> Music Source
addRightHeel :: Music -> Music Source
addLeftToe :: Music -> Music Source
addRightToe :: Music -> Music Source
addStopped :: Music -> Music Source
addReverseTurn :: Music -> Music Source
addMordent :: Music -> Music Source
addPrallPrall :: Music -> Music Source
addPrallMordent :: Music -> Music Source
addUpPrall :: Music -> Music Source
addDownPrall :: Music -> Music Source
addUpMordent :: Music -> Music Source
addDownMordent :: Music -> Music Source
addPrallDown :: Music -> Music Source
addPrallUp :: Music -> Music Source
addLinePrall :: Music -> Music Source
addShortFermata :: Music -> Music Source
addFermata :: Music -> Music Source
addLongFermata :: Music -> Music Source
addVeryLongFermata :: Music -> Music Source
addVarCoda :: Music -> Music Source
Utility
removeSingleChords :: Music -> Music Source