Portability | portable |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
A Haskell representation and parser for ABC notation. Based on the 2.1 standard.
For more information see http://abcnotation.com.
- data AbcFile = AbcFile (Maybe String) (Maybe FileHeader) [Element]
- data FileHeader = FileHeader [Information] [Directive]
- data Element
- data AbcTune = AbcTune TuneHeader TuneBody
- data TuneHeader = TuneHeader [Information]
- type TuneBody = [Music]
- data Music = Music [Note :|: (MultiRest :|: (Barline :|: ()))]
- type Note = DecorationT (SlurT (BeamT (GraceT (TupletT (DurationT (RestT Pitch))))))
- type DecorationT a = ([Decoration], a)
- type SlurT a = (Bool, a, Bool)
- type BeamT a = (Bool, a, Bool)
- type GraceT a = (Bool, a)
- type TupletT a = (Duration, a)
- type DurationT a = (a, Duration)
- type RestT a = Maybe (Maybe a)
- type :|: a b = Either a b
- newtype Duration = Duration {}
- data PitchClass
- data Accidental
- = DoubleFlat
- | Flat
- | Natural
- | Sharp
- | DoubleSharp
- newtype Octave = Octave {}
- newtype Pitch = Pitch {
- getPitch :: (PitchClass, Accidental, Octave)
- data Decoration
- = Trill
- | TrillBegin
- | TrillEnd
- | Lowermordent
- | Uppermordent
- | Roll
- | Turn
- | Turnx
- | Invertedturn
- | Invertedturnx
- | Arpeggio
- | Accent
- | Fermata Bool
- | Tenuto
- | Fingering Int
- | Plus
- | Snap
- | Slide
- | Wedge
- | Upbow
- | Downbow
- | Open
- | Thumb
- | Breath
- | Crescendo
- | EndCrescendo
- | Diminuendo
- | EndDiminuendo
- | Segno
- | Coda
- | DaSegno
- | DaCapo
- | Dacoda
- | Fine
- | Shortphrase
- | Mediumphrase
- | Longphrase
- data Barline
- newtype MultiRest = MultiRest {
- getMultiRest :: Int
- data Information
- = Area String
- | Book String
- | Composer String
- | Discography String
- | FileUrl String URI
- | Group String
- | History String
- | Instruction Directive
- | Key Key
- | UnitNoteLength Duration
- | Meter Meter
- | Notes String
- | Origin String
- | Parts
- | Tempo Tempo
- | Rhythm String
- | Source String
- | SymbolLine Symbol
- | TuneTitle String
- | Voice VoiceProps
- | Words String
- | ReferenceNumber Integer
- | Transcription String
- type Directive = (String, String)
- readAbc :: String -> AbcFile
- showAbc :: AbcFile -> String
Abc format
Files
File header
data FileHeader Source
File header (2.2.2).
Either a tune, free text or typeset text (2.2.3).
Tunes
Music
Note stack
type DecorationT a = ([Decoration], a)Source
Basic types
Time
Pitch
data PitchClass Source
data Accidental Source
Pitch | |
|
Decorations (articulation, dynamics etc)
data Decoration Source
Structure
Barline, including special barlines and repeats.
Information etc
data Information Source
Area String | |
Book String | |
Composer String | |
Discography String | |
FileUrl String URI | |
Group String | |
History String | |
Instruction Directive | |
Key Key | |
UnitNoteLength Duration | |
Meter Meter | |
Notes String | |
Origin String | |
Parts | |
Tempo Tempo | |
Rhythm String | |
Source String | |
SymbolLine Symbol | |
TuneTitle String | |
Voice VoiceProps | |
Words String | |
ReferenceNumber Integer | |
Transcription String |