lilypond-1.9.0: Bindings to Lilypond

Copyright(c) Hans Hoglund 2012
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Data.Music.Lilypond

Contents

Description

 

Synopsis

Representation

Music expressions

data Music Source

A Lilypond music expression.

Use the Pretty instance to convert into Lilypond syntax.

Constructors

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 

Instances

Eq Music 
Show Music 
Pretty Music 
IsPitch Music 
VectorSpace Music 
AdditiveGroup Music 
type Scalar Music = Duration 

data Note Source

Instances

Eq Note 
Show Note 
Pretty Note 
IsPitch Note 

data Mode Source

Mode (for key signatures).

Constructors

Major 
Minor 

Instances

Eq Mode 
Show Mode 
Pretty Mode 

Attributes

data Value Source

  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

toValue :: Show a => a -> Value Source

toLiteralValue :: String -> Value Source

As toValue, but not quoting strings. Handy for scheme literals such as #red.

Articulation and dynamics

Text

class HasMarkup a where Source

Methods

markup :: a -> Markup Source

Instances

Miscellaneous types

data Direction Source

Constructors

Above 
Default 
Below 

Instances

Time

newtype Duration Source

Notated time in fractions, in [2^^i | i <- [-10..3]].

Constructors

Duration 

Pitch

newtype Pitch Source

Constructors

Pitch 

Instances

Eq Pitch 
Ord Pitch 
Show Pitch 
Pretty Pitch 
IsPitch Pitch 

data PitchName Source

Constructors

C 
D 
E 
F 
G 
A 
B 

type Accidental = Int Source

For double flat -2, flat -1, natural 0, sharp 1 and double sharp 2.

type Octaves = Int Source

Number of octaves raised (positive) or flattened (negative).

Constructing Lilypond expresions

Notes and rests

rest :: Music Source

Construct a rest of default duration 1/4.

Use the VectorSpace methods to change duration.

note :: Note -> Music Source

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.

Composition

Post events

Curves and lines

Marks

Utility