Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Derive.ScoreT

Description

Low-dependency basic types for derivation.

Synopsis

Instrument

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.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

FromJSON Instrument Source # 
Instance details

Defined in Derive.ScoreT

ToJSON 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 # 
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 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

checked_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 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

checked_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. Untyped goes last because the parser tries them in order.

Constructors

Chromatic 
Diatonic 
Nn 
Score 
Real 
Untyped 

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 #

Bounded Type Source # 
Instance details

Defined in Derive.ScoreT

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] #

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 #

ShowVal.ShowVal Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

show_val :: Type -> Text Source #

ToVal Type Source # 
Instance details

Defined in Derive.Typecheck

Methods

to_val :: Type -> Val Source #

Typecheck Type Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty Type Source # 
Instance details

Defined in Derive.ScoreT

Serialize.Serialize Type Source # 
Instance details

Defined in Derive.ScoreT

data TimeT Source #

Constructors

TReal 
TScore 

Instances

Instances details
Show TimeT Source # 
Instance details

Defined in Derive.ScoreT

Eq TimeT Source # 
Instance details

Defined in Derive.ScoreT

Methods

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

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

Ord TimeT Source # 
Instance details

Defined in Derive.ScoreT

Methods

compare :: TimeT -> TimeT -> Ordering #

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

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

(>) :: TimeT -> TimeT -> Bool #

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

max :: TimeT -> TimeT -> TimeT #

min :: TimeT -> TimeT -> TimeT #

Pretty.Pretty TimeT Source # 
Instance details

Defined in Derive.ScoreT

data Duration Source #

Some calls can operate in either RealTime or ScoreTime.

Instances

Instances details
Show Duration Source # 
Instance details

Defined in Derive.ScoreT

Eq Duration Source # 
Instance details

Defined in Derive.ScoreT

data Typed a Source #

Constructors

Typed !Type !a 

Instances

Instances details
Foldable Typed Source # 
Instance details

Defined in Derive.ScoreT

Methods

fold :: Monoid m => Typed m -> m #

foldMap :: Monoid m => (a -> m) -> Typed a -> m #

foldMap' :: Monoid m => (a -> m) -> Typed a -> m #

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

foldr' :: (a -> b -> b) -> b -> Typed a -> b #

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

foldl' :: (b -> a -> b) -> b -> Typed a -> b #

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

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

toList :: Typed a -> [a] #

null :: Typed a -> Bool #

length :: Typed a -> Int #

elem :: Eq a => a -> Typed a -> Bool #

maximum :: Ord a => Typed a -> a #

minimum :: Ord a => Typed a -> a #

sum :: Num a => Typed a -> a #

product :: Num a => Typed a -> a #

Traversable Typed Source # 
Instance details

Defined in Derive.ScoreT

Methods

traverse :: Applicative f => (a -> f b) -> Typed a -> f (Typed b) #

sequenceA :: Applicative f => Typed (f a) -> f (Typed a) #

mapM :: Monad m => (a -> m b) -> Typed a -> m (Typed b) #

sequence :: Monad m => Typed (m a) -> m (Typed a) #

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

Defined in Derive.DeriveT

ToVal ControlRef Source # 
Instance details

Defined in Derive.Typecheck

ToVal TypedSignal Source #

Signal.Control has ToVal but not Typecheck, because calls should be using Function.

Instance details

Defined in Derive.Typecheck

Typecheck TypedFunction Source # 
Instance details

Defined in Derive.Typecheck

Typecheck TypedSignal Source # 
Instance details

Defined in Derive.Typecheck

Pretty.Pretty ControlRef Source # 
Instance details

Defined in Derive.DeriveT

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 #

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.Control) Source # 
Instance details

Defined in Derive.DeriveT

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

val_of :: Typed a -> a Source #

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

untyped :: a -> Typed a Source #

type aliases

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.