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

Derive.TScore.T

Contents

Description

Shared types for TScore.

Synopsis

Documentation

newtype Time Source #

This is the default "beat".

Constructors

Time Rational 

Instances

Instances details
Enum Time # 
Instance details

Defined in Derive.TScore.T

Methods

succ :: Time -> Time #

pred :: Time -> Time #

toEnum :: Int -> Time #

fromEnum :: Time -> Int #

enumFrom :: Time -> [Time] #

enumFromThen :: Time -> Time -> [Time] #

enumFromTo :: Time -> Time -> [Time] #

enumFromThenTo :: Time -> Time -> Time -> [Time] #

Eq Time # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Fractional Time # 
Instance details

Defined in Derive.TScore.T

Methods

(/) :: Time -> Time -> Time #

recip :: Time -> Time #

fromRational :: Rational -> Time #

Num Time # 
Instance details

Defined in Derive.TScore.T

Methods

(+) :: Time -> Time -> Time #

(-) :: Time -> Time -> Time #

(*) :: Time -> Time -> Time #

negate :: Time -> Time #

abs :: Time -> Time #

signum :: Time -> Time #

fromInteger :: Integer -> Time #

Ord Time # 
Instance details

Defined in Derive.TScore.T

Methods

compare :: Time -> Time -> Ordering #

(<) :: Time -> Time -> Bool #

(<=) :: Time -> Time -> Bool #

(>) :: Time -> Time -> Bool #

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

max :: Time -> Time -> Time #

min :: Time -> Time -> Time #

Real Time # 
Instance details

Defined in Derive.TScore.T

Methods

toRational :: Time -> Rational #

RealFrac Time # 
Instance details

Defined in Derive.TScore.T

Methods

properFraction :: Integral b => Time -> (b, Time) #

truncate :: Integral b => Time -> b #

round :: Integral b => Time -> b #

ceiling :: Integral b => Time -> b #

floor :: Integral b => Time -> b #

Show Time # 
Instance details

Defined in Derive.TScore.T

Pretty Time # 
Instance details

Defined in Derive.TScore.T

Pretty (Note CallText (Maybe Text) Time) #

This is the output from Check.check.

Instance details

Defined in Derive.TScore.Parse

Score

newtype Score Source #

Constructors

Score [(Pos, Toplevel)] 

Instances

Instances details
Eq Score # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Score # 
Instance details

Defined in Derive.TScore.T

Element Score # 
Instance details

Defined in Derive.TScore.Parse

data Toplevel Source #

Instances

Instances details
Eq Toplevel # 
Instance details

Defined in Derive.TScore.T

Show Toplevel # 
Instance details

Defined in Derive.TScore.T

Element Toplevel # 
Instance details

Defined in Derive.TScore.Parse

data Block tracks Source #

call is a parameter, because SubBlock will later be resolved to CallText.

Constructors

Block 

Instances

Instances details
Eq tracks => Eq (Block tracks) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: Block tracks -> Block tracks -> Bool #

(/=) :: Block tracks -> Block tracks -> Bool #

Show tracks => Show (Block tracks) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Block tracks -> ShowS #

show :: Block tracks -> String.String #

showList :: [Block tracks] -> ShowS #

Element (Block WrappedTracks) # 
Instance details

Defined in Derive.TScore.Parse

newtype Tracks call Source #

Constructors

Tracks [Track call] 

Instances

Instances details
Eq call => Eq (Tracks call) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: Tracks call -> Tracks call -> Bool #

(/=) :: Tracks call -> Tracks call -> Bool #

Show call => Show (Tracks call) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Tracks call -> ShowS #

show :: Tracks call -> String.String #

showList :: [Tracks call] -> ShowS #

Element (Tracks Call) # 
Instance details

Defined in Derive.TScore.Parse

untracks :: Tracks call -> [Track call] Source #

data Track call Source #

Constructors

Track 

Fields

  • track_key :: !Text

    Some arbitrary symbols. This has no meaning except to make the track with its title unique on this block. This is so that tracks have an identity, and I can detect track moves, adds, and deletes.

  • track_title :: !Text

    The track title will include a > if the original syntax did, or be "" if the track has no title at all, which is only possible for the first one, e.g. [a] or [a > b]. This way unparse can emit the same abbreviated syntax.

  • track_directives :: ![Directive]
     
  • track_tokens :: ![Token call (NPitch Pitch) NDuration Duration]
     
  • track_pos :: !Pos
     

Instances

Instances details
Eq call => Eq (Track call) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: Track call -> Track call -> Bool #

(/=) :: Track call -> Track call -> Bool #

Show call => Show (Track call) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Track call -> ShowS #

show :: Track call -> String.String #

showList :: [Track call] -> ShowS #

Element (Track Call) # 
Instance details

Defined in Derive.TScore.Parse

data Directive Source #

Constructors

Directive !Pos !Text !(Maybe Text) 

Instances

Instances details
Eq Directive # 
Instance details

Defined in Derive.TScore.T

Show Directive # 
Instance details

Defined in Derive.TScore.T

Element Directive # 
Instance details

Defined in Derive.TScore.Parse

data Token call pitch ndur rdur Source #

Constructors

TBarline !Pos !Barline

Higher count for larger divisions, e.g. anga vs. avartanam.

TNote !Pos !(Note call pitch ndur) 
TRest !Pos !(Rest rdur) 

Instances

Instances details
Pretty Token # 
Instance details

Defined in Derive.TScore.Parse

Element Token # 
Instance details

Defined in Derive.TScore.Parse

(Eq call, Eq pitch, Eq ndur, Eq rdur) => Eq (Token call pitch ndur rdur) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: Token call pitch ndur rdur -> Token call pitch ndur rdur -> Bool #

(/=) :: Token call pitch ndur rdur -> Token call pitch ndur rdur -> Bool #

(Show call, Show pitch, Show ndur, Show rdur) => Show (Token call pitch ndur rdur) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Token call pitch ndur rdur -> ShowS #

show :: Token call pitch ndur rdur -> String.String #

showList :: [Token call pitch ndur rdur] -> ShowS #

Pretty (Token CallText Pitch NDuration Duration) # 
Instance details

Defined in Derive.TScore.Parse

token_pos :: Token call pitch ndur rdur -> Pos Source #

token_name :: Token call pitch ndur rdur -> Text Source #

map_call :: (call1 -> call2) -> Token call1 pitch ndur rdur -> Token call2 pitch ndur rdur Source #

map_pitch :: Applicative m => (pitch1 -> m pitch2) -> Token call pitch1 ndur rdur -> m (Token call pitch2 ndur rdur) Source #

map_note_duration :: Applicative m => (dur1 -> m dur2) -> Token call pitch dur1 rdur -> m (Token call pitch dur2 rdur) Source #

map_note :: Applicative m => (Note call1 pitch1 ndur -> m (Note call2 pitch2 ndur)) -> Token call1 pitch1 ndur rdur -> m (Token call2 pitch2 ndur rdur) Source #

type Rank = Int Source #

Opposite from Ruler.Rank, higher numbers mean larger divisions.

data Barline Source #

Instances

Instances details
Eq Barline # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Barline # 
Instance details

Defined in Derive.TScore.T

Pretty Barline # 
Instance details

Defined in Derive.TScore.Parse

Element Barline # 
Instance details

Defined in Derive.TScore.Parse

data Note call pitch dur Source #

Constructors

Note 

Fields

Instances

Instances details
(Eq call, Eq pitch, Eq dur) => Eq (Note call pitch dur) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: Note call pitch dur -> Note call pitch dur -> Bool #

(/=) :: Note call pitch dur -> Note call pitch dur -> Bool #

(Show call, Show pitch, Show dur) => Show (Note call pitch dur) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Note call pitch dur -> ShowS #

show :: Note call pitch dur -> String.String #

showList :: [Note call pitch dur] -> ShowS #

Pretty (Note CallText (Maybe Text) Time) #

This is the output from Check.check.

Instance details

Defined in Derive.TScore.Parse

Pretty (Note CallText Pitch NDuration) # 
Instance details

Defined in Derive.TScore.Parse

Element (Note Call (NPitch Pitch) 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

data Call Source #

Constructors

Call !CallText 
SubBlock !CallText ![Tracks Call]

A call can take multiple Tracks arguments, each one of which is a sub-block.

Instances

Instances details
Eq Call # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Call # 
Instance details

Defined in Derive.TScore.T

String.IsString Call # 
Instance details

Defined in Derive.TScore.T

Pretty Call # 
Instance details

Defined in Derive.TScore.Parse

Pretty Token # 
Instance details

Defined in Derive.TScore.Parse

Element 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 Token # 
Instance details

Defined in Derive.TScore.Parse

Element (Track Call) # 
Instance details

Defined in Derive.TScore.Parse

Element (Tracks Call) # 
Instance details

Defined in Derive.TScore.Parse

Element (Note Call (NPitch Pitch) 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

type CallText = Text Source #

Tracklang expression. This goes into the event text.

newtype Rest dur Source #

Constructors

Rest dur 

Instances

Instances details
Eq dur => Eq (Rest dur) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: Rest dur -> Rest dur -> Bool #

(/=) :: Rest dur -> Rest dur -> Bool #

Show dur => Show (Rest dur) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Rest dur -> ShowS #

show :: Rest dur -> String.String #

showList :: [Rest dur] -> ShowS #

Pretty (Rest Duration) # 
Instance details

Defined in Derive.TScore.Parse

Element (Rest Duration) # 
Instance details

Defined in Derive.TScore.Parse

data NPitch pitch Source #

Constructors

CopyFrom 
NPitch !pitch 

Instances

Instances details
Pretty Token # 
Instance details

Defined in Derive.TScore.Parse

Element Token # 
Instance details

Defined in Derive.TScore.Parse

Eq pitch => Eq (NPitch pitch) # 
Instance details

Defined in Derive.TScore.T

Methods

(==) :: NPitch pitch -> NPitch pitch -> Bool #

(/=) :: NPitch pitch -> NPitch pitch -> Bool #

Show pitch => Show (NPitch pitch) # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> NPitch pitch -> ShowS #

show :: NPitch pitch -> String.String #

showList :: [NPitch pitch] -> ShowS #

Pretty pitch => Pretty (NPitch pitch) # 
Instance details

Defined in Derive.TScore.T

Methods

pretty :: NPitch pitch -> Text Source #

format :: NPitch pitch -> Doc Source #

formatList :: [NPitch pitch] -> Doc Source #

Element (NPitch Pitch) # 
Instance details

Defined in Derive.TScore.Parse

Element (Note Call (NPitch Pitch) 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

data Pitch Source #

Constructors

Pitch 

Instances

Instances details
Eq Pitch # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Pitch # 
Instance details

Defined in Derive.TScore.T

Pretty Pitch # 
Instance details

Defined in Derive.TScore.Parse

Pretty Token # 
Instance details

Defined in Derive.TScore.Parse

Element Pitch # 
Instance details

Defined in Derive.TScore.Parse

Element Token # 
Instance details

Defined in Derive.TScore.Parse

Element (NPitch Pitch) # 
Instance details

Defined in Derive.TScore.Parse

Pretty (Note CallText Pitch NDuration) # 
Instance details

Defined in Derive.TScore.Parse

Element (Note Call (NPitch Pitch) 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

Pretty (Token CallText Pitch NDuration Duration) # 
Instance details

Defined in Derive.TScore.Parse

data Octave Source #

Constructors

Absolute !Int 
Relative !Int 

Instances

Instances details
Eq Octave # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Octave # 
Instance details

Defined in Derive.TScore.T

Pretty Octave # 
Instance details

Defined in Derive.TScore.Parse

Element Octave # 
Instance details

Defined in Derive.TScore.Parse

data NDuration Source #

Instances

Instances details
Eq NDuration # 
Instance details

Defined in Derive.TScore.T

Show NDuration # 
Instance details

Defined in Derive.TScore.T

Pretty Token # 
Instance details

Defined in Derive.TScore.Parse

Element NDuration # 
Instance details

Defined in Derive.TScore.Parse

Element Token # 
Instance details

Defined in Derive.TScore.Parse

Pretty (Note CallText Pitch NDuration) # 
Instance details

Defined in Derive.TScore.Parse

Element (Note Call (NPitch Pitch) 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

Pretty (Token CallText Pitch NDuration Duration) # 
Instance details

Defined in Derive.TScore.Parse

data Duration Source #

Constructors

Duration 

Fields

Instances

Instances details
Eq Duration # 
Instance details

Defined in Derive.TScore.T

Show Duration # 
Instance details

Defined in Derive.TScore.T

Pretty Token # 
Instance details

Defined in Derive.TScore.Parse

Element Duration # 
Instance details

Defined in Derive.TScore.Parse

Element Token # 
Instance details

Defined in Derive.TScore.Parse

Pretty (Rest Duration) # 
Instance details

Defined in Derive.TScore.Parse

Element (Rest Duration) # 
Instance details

Defined in Derive.TScore.Parse

Pretty (Token CallText Pitch NDuration Duration) # 
Instance details

Defined in Derive.TScore.Parse

error

newtype Pos Source #

Character position in the input.

Constructors

Pos Int 

Instances

Instances details
Eq Pos # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Pos # 
Instance details

Defined in Derive.TScore.T

Methods

showsPrec :: Int -> Pos -> ShowS #

show :: Pos -> String.String #

showList :: [Pos] -> ShowS #

Pretty Pos # 
Instance details

Defined in Derive.TScore.T

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

Defined in Derive.TScore.Parse

Methods

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

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

data Error Source #

Constructors

Error !Pos !Text 

Instances

Instances details
Eq Error # 
Instance details

Defined in Derive.TScore.T

Methods

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

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

Show Error # 
Instance details

Defined in Derive.TScore.T

Pretty Error # 
Instance details

Defined in Derive.TScore.T

find_pos :: Text -> Pos -> Maybe (Int, Int, Text) Source #

Find the line and position on that line.