Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Derive.TScore.Parse

Description

Parse the tscore language.

Synopsis

Documentation

data Config Source #

Parsing config. Parsed T.Directives can affect further parsing, which is not very nice, but convenient for concise notation.

Constructors

Config 

Fields

Instances

Instances details
Eq Config # 
Instance details

Defined in Derive.TScore.Parse

Methods

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

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

Show Config # 
Instance details

Defined in Derive.TScore.Parse

parse

class Element a where Source #

Methods

parse :: Config -> Parser a Source #

unparse :: Config -> a -> Text Source #

Instances

Instances details
Element Id.BlockId # 
Instance details

Defined in Derive.TScore.Parse

Element T.Duration # 
Instance details

Defined in Derive.TScore.Parse

Element T.NDuration # 
Instance details

Defined in Derive.TScore.Parse

Element T.Octave # 
Instance details

Defined in Derive.TScore.Parse

Element T.Pitch # 
Instance details

Defined in Derive.TScore.Parse

Element T.Call #
plain-word
"ns/block"
"word with spaces"
"with embedded "() quote"
[sub // block]
plain-word[sub // block]
"spaces word"[sub]
Instance details

Defined in Derive.TScore.Parse

Element T.Barline # 
Instance details

Defined in Derive.TScore.Parse

Element T.Directive # 
Instance details

Defined in Derive.TScore.Parse

Element T.WrappedTracks # 
Instance details

Defined in Derive.TScore.Parse

Element T.Toplevel # 
Instance details

Defined in Derive.TScore.Parse

Element T.Score # 
Instance details

Defined in Derive.TScore.Parse

Element Token # 
Instance details

Defined in Derive.TScore.Parse

Element (T.NPitch T.Pitch) # 
Instance details

Defined in Derive.TScore.Parse

Element (T.Rest T.Duration) # 
Instance details

Defined in Derive.TScore.Parse

Element (T.Track T.Call) # 
Instance details

Defined in Derive.TScore.Parse

Element (T.Tracks T.Call) # 
Instance details

Defined in Derive.TScore.Parse

Element (T.Block T.WrappedTracks) # 
Instance details

Defined in Derive.TScore.Parse

Element a => Element (T.Pos, a) # 
Instance details

Defined in Derive.TScore.Parse

Methods

parse :: Config -> Parser (T.Pos, a) Source #

unparse :: Config -> (T.Pos, a) -> Text Source #

Element (T.Note T.Call (T.NPitch T.Pitch) T.NDuration) #

Parse a note with a letter pitch.

<call><oct><pitch><zero-dur><dur><dots><tie>
call/  4    s      *         4    .     ~
       ,    s                :1

oct is optional, but oct without pitch is not so useful, so pitch >=1 char.

a a2 call/a2
a2.
a~ a2~
"call with spaces"/
Instance details

Defined in Derive.TScore.Parse

barline

Note

dot_note :: T.Note T.CallText (T.NPitch T.Pitch) T.NDuration Source #

This note is treated specially by the Check layer, to repeat of the previous note.

tie_note :: T.Note T.CallText (T.NPitch T.Pitch) T.NDuration Source #

This note is treated specially by the Check layer, to repeat of the previous note, plus put a tie on the previous note.

Pitch

Duration

util

lexeme_b :: Parser a -> Parser a Source #

Use a backslash to allow whitespace. If I had a separate tokenizer, maybe I could implement this as a general-purpose glue together tokens thing, but at least for the moment I only want to do this in a specific spot.

Orphan instances

Pretty T.Octave # 
Instance details

Pretty T.Pitch # 
Instance details

Pretty T.Call # 
Instance details

Pretty T.Barline # 
Instance details

Pretty Token # 
Instance details

Pretty (T.Rest T.Duration) # 
Instance details

Pretty (T.Note T.CallText (Maybe Text) T.Time) #

This is the output from Check.check.

Instance details

Pretty (T.Note T.CallText T.Pitch T.NDuration) # 
Instance details

Pretty (T.Token T.CallText T.Pitch T.NDuration T.Duration) # 
Instance details