Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone




Utilities to deal with block and track titles.

This module is used by both Cmd and Derive since Cmd also wants to know track types for track specific cmds.

Note track titles are just tracklang expressions, so no extra code is needed. Control tracks titles are just a hardcoded list of special cases, though they are parsed as tracklang Vals.



parse_block :: Text -> Either Text BaseTypes.Expr Source #

A block title is a normal expression, applied as a transform.


data Type Source #


Eq Type # 


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

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

Show Type # 


showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Pretty Type # 

note track

control track

parse_control_type :: Text -> Either Text ControlType Source #

Parse the first part of the control track title. This is special syntax, and is not the usual call plus list of argument values.

data ControlType Source #


Tempo (Maybe Expr.Symbol)

Tempo track with an optional modifying symbol.

Pitch Pitch.ScaleId (Either TrackCall PControl) (Maybe Merge)

Pitch track that sets a ScaleId (unless it's Pitch.empty_scale), and sets the given pitch signal.

Control (Either TrackCall (Typed Control)) (Maybe Merge)

Control track with an optional combining operator.

p_pitch :: A.Parser ControlType Source #

  • twelve (#name | !track-call) merge

p_control :: A.Parser ControlType Source #

(!track-call | % | control:typ) merge


control_to_title :: Typed Control -> Text Source #

This is different from ShowVal (Typed Control) because the control doesn't need a % in the control track title.

parse util

p_scale_id :: A.Parser Pitch.ScaleId Source #

This is special syntax that's only allowed in control track titles.


title_to_control :: Text -> Maybe Control Source #

Convert a track title to its control.

is_control_track :: Text -> Bool Source #

A pitch track is also considered a control track.

is_signal_track :: Text -> Bool Source #

This is like is_control_track but doesn't include pitch tracks.


parse_note :: Text -> Either Text BaseTypes.Expr Source #

Parse a note track like >inst as note-track inst. Other than this, note track titles are normal expressions.

title_to_instrument :: Text -> Maybe Instrument Source #

Convert a track title into its instrument.

instrument_to_title :: Instrument -> Text Source #

Convert from an instrument to the title of its instrument track.