Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Derive.ScoreT

Description

Low-dependency basic types for derivation.

Synopsis

Documentation

newtype Instrument Source #

An Instrument is identified by a plain string. This will be looked up in the instrument db to get the backend specific Instrument type as well as the backend itself, but things at the Derive layer and above don't care about all that.

This should be a valid symbol as defined by valid_symbol. This way it can be parsed without quotes.

Constructors

Instrument Text 

Instances

Instances details
String.IsString Instrument Source # 
Instance details

Defined in Derive.ScoreT

Read Instrument Source # 
Instance details

Defined in Derive.ScoreT

Show Instrument Source # 
Instance details

Defined in Derive.ScoreT

DeepSeq.NFData Instrument Source # 
Instance details

Defined in Derive.ScoreT

Methods

rnf :: Instrument -> () #

Eq Instrument Source # 
Instance details

Defined in Derive.ScoreT

Ord Instrument Source # 
Instance details

Defined in Derive.ScoreT

Hashable Instrument Source # 
Instance details

Defined in Derive.ScoreT

ToVal Instrument Source # 
Instance details

Defined in Derive.REnv

ShowVal.ShowVal Instrument Source # 
Instance details

Defined in Derive.ScoreT

ToVal Instrument Source # 
Instance details

Defined in Derive.Typecheck

Typecheck Instrument Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty Instrument Source # 
Instance details

Defined in Derive.ScoreT

Serialize.Serialize Instrument Source # 
Instance details

Defined in Derive.ScoreT

Control

newtype Control Source #

A control is an abstract parameter that influences derivation. Some of them affect performance and will be rendered as MIDI controls or note parameters or whatever, while others may affect derivation (e.g. tempo) and won't be seen by the backend at all.

A Control should be a valid identifier as defined by valid_symbol.

Constructors

Control Text 

Instances

Instances details
String.IsString Control Source # 
Instance details

Defined in Derive.ScoreT

Read Control Source # 
Instance details

Defined in Derive.ScoreT

Show Control Source # 
Instance details

Defined in Derive.ScoreT

DeepSeq.NFData Control Source # 
Instance details

Defined in Derive.ScoreT

Methods

rnf :: Control -> () #

Eq Control Source # 
Instance details

Defined in Derive.ScoreT

Methods

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

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

Ord Control Source # 
Instance details

Defined in Derive.ScoreT

ToVal ControlRef Source # 
Instance details

Defined in Derive.REnv

ShowVal.ShowVal ControlRef Source #

This can only represent constant signals, since there's no literal for an arbitrary signal. Non-constant signals will turn into a constant of whatever was at 0.

Instance details

Defined in Derive.DeriveT

ShowVal.ShowVal Control Source # 
Instance details

Defined in Derive.ScoreT

ToVal ControlRef Source # 
Instance details

Defined in Derive.Typecheck

ToVal Control Source # 
Instance details

Defined in Derive.Typecheck

Methods

to_val :: Control -> Val Source #

Typecheck ControlRef Source #

Use a TypedFunction or Function instead of this.

Instance details

Defined in Derive.Typecheck

Typecheck Control Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty ControlRef Source # 
Instance details

Defined in Derive.DeriveT

Pretty.Pretty Control Source # 
Instance details

Defined in Derive.ScoreT

Serialize.Serialize Control Source # 
Instance details

Defined in Derive.ScoreT

ShowVal.ShowVal (Typed Control) Source # 
Instance details

Defined in Derive.ScoreT

control :: Text -> Either Text Control Source #

Use this constructor when making a Control from user input. Literals can use the IsString instance.

PControl

newtype PControl Source #

The pitch control version of Control. Unlike Control, this is allowed to be null, which is the name of the default pitch signal.

A PControl should be a valid identifier as defined by valid_symbol, except that its literal tracklang form starts with a #, to differentiate from a Control.

Constructors

PControl Text 

Instances

Instances details
String.IsString PControl Source # 
Instance details

Defined in Derive.ScoreT

Read PControl Source # 
Instance details

Defined in Derive.ScoreT

Show PControl Source # 
Instance details

Defined in Derive.ScoreT

DeepSeq.NFData PControl Source # 
Instance details

Defined in Derive.ScoreT

Methods

rnf :: PControl -> () #

Eq PControl Source # 
Instance details

Defined in Derive.ScoreT

Ord PControl Source # 
Instance details

Defined in Derive.ScoreT

ShowVal.ShowVal PControlRef Source #

There's no way to convert a pitch back into the expression that produced it, so this is the best I can do.

Similar to ShowVal ControlRef, there's no signal literal so I use the value at 0. A pitch can be turned into an expression, but not necessarily accurately since it doesn't take things like pitch interpolation into account.

Instance details

Defined in Derive.DeriveT

ShowVal.ShowVal PControl Source # 
Instance details

Defined in Derive.ScoreT

ToVal PControlRef Source # 
Instance details

Defined in Derive.Typecheck

ToVal PControl Source # 
Instance details

Defined in Derive.Typecheck

Methods

to_val :: PControl -> Val Source #

Typecheck PControlRef Source # 
Instance details

Defined in Derive.Typecheck

Typecheck PControl Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty PControlRef Source # 
Instance details

Defined in Derive.DeriveT

Pretty.Pretty PControl Source # 
Instance details

Defined in Derive.ScoreT

Serialize.Serialize PControl Source # 
Instance details

Defined in Derive.ScoreT

pcontrol :: Text -> Either Text PControl Source #

Use this constructor when making a PControl from user input. Literals can use the IsString instance.

parse_generic_control :: Text -> Either Text (Either Control PControl) Source #

Parse either a Control or PControl.

Type

data Type Source #

Tag for the type of the values in a control signal.

Constructors

Untyped 
Chromatic 
Diatonic 
Nn 
Score 
Real 

Instances

Instances details
Monoid Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

mempty :: Type #

mappend :: Type -> Type -> Type #

mconcat :: [Type] -> Type #

Semigroup Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

(<>) :: Type -> Type -> Type #

sconcat :: NonEmpty Type -> Type #

stimes :: Integral b => b -> Type -> Type #

Enum Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

succ :: Type -> Type #

pred :: Type -> Type #

toEnum :: Int -> Type #

fromEnum :: Type -> Int #

enumFrom :: Type -> [Type] #

enumFromThen :: Type -> Type -> [Type] #

enumFromTo :: Type -> Type -> [Type] #

enumFromThenTo :: Type -> Type -> Type -> [Type] #

Read Type Source # 
Instance details

Defined in Derive.ScoreT

Show Type Source # 
Instance details

Defined in Derive.ScoreT

Eq Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

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

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

Ord Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

compare :: Type -> Type -> Ordering #

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

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

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

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

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Pretty.Pretty Type Source # 
Instance details

Defined in Derive.ScoreT

Serialize.Serialize Type Source # 
Instance details

Defined in Derive.ScoreT

data Typed a Source #

Constructors

Typed 

Fields

Instances

Instances details
Functor Typed Source # 
Instance details

Defined in Derive.ScoreT

Methods

fmap :: (a -> b) -> Typed a -> Typed b #

(<$) :: a -> Typed b -> Typed a #

ToVal ControlRef Source # 
Instance details

Defined in Derive.REnv

ShowVal.ShowVal ControlRef Source #

This can only represent constant signals, since there's no literal for an arbitrary signal. Non-constant signals will turn into a constant of whatever was at 0.

Instance details

Defined in Derive.DeriveT

ToVal ControlRef Source # 
Instance details

Defined in Derive.Typecheck

Typecheck ControlRef Source #

Use a TypedFunction or Function instead of this.

Instance details

Defined in Derive.Typecheck

Typecheck TypedFunction Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty ControlRef Source # 
Instance details

Defined in Derive.DeriveT

(Semigroup a, Monoid a) => Monoid (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Methods

mempty :: Typed a #

mappend :: Typed a -> Typed a -> Typed a #

mconcat :: [Typed a] -> Typed a #

Semigroup a => Semigroup (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Methods

(<>) :: Typed a -> Typed a -> Typed a #

sconcat :: NonEmpty (Typed a) -> Typed a #

stimes :: Integral b => b -> Typed a -> Typed a #

Read a => Read (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Show a => Show (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Methods

showsPrec :: Int -> Typed a -> ShowS #

show :: Typed a -> String.String #

showList :: [Typed a] -> ShowS #

DeepSeq.NFData a => DeepSeq.NFData (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Methods

rnf :: Typed a -> () #

Eq a => Eq (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Methods

(==) :: Typed a -> Typed a -> Bool #

(/=) :: Typed a -> Typed a -> Bool #

Ord a => Ord (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Methods

compare :: Typed a -> Typed a -> Ordering #

(<) :: Typed a -> Typed a -> Bool #

(<=) :: Typed a -> Typed a -> Bool #

(>) :: Typed a -> Typed a -> Bool #

(>=) :: Typed a -> Typed a -> Bool #

max :: Typed a -> Typed a -> Typed a #

min :: Typed a -> Typed a -> Typed a #

ShowVal.ShowVal (Typed Control) Source # 
Instance details

Defined in Derive.ScoreT

ShowVal.ShowVal (Typed Signal.Y) Source # 
Instance details

Defined in Derive.ScoreT

ToVal (Typed Signal.Y) Source # 
Instance details

Defined in Derive.Typecheck

Typecheck (Typed Signal.Y) Source # 
Instance details

Defined in Derive.Typecheck

TypecheckNum (Typed Signal.Y) Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty a => Pretty.Pretty (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

Serialize.Serialize a => Serialize.Serialize (Typed a) Source # 
Instance details

Defined in Derive.ScoreT

merge_typed :: (a -> a -> a) -> Typed a -> Typed a -> Typed a Source #

untyped :: a -> Typed a Source #

ControlMap

type ControlValMap = Map Control Signal.Y Source #

This is a snapshot of the control signals at a certain point in time. It's meant for PitchConfig, so the values are expected to be transpositions, and hence untyped.