Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Derive.ScoreTypes

Contents

Description

These are types that belong in Derive.Score, but are here to avoid circular imports.

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

Defined in Derive.ScoreTypes

Ord Instrument # 
Instance details

Defined in Derive.ScoreTypes

Read Instrument # 
Instance details

Defined in Derive.ScoreTypes

Show Instrument # 
Instance details

Defined in Derive.ScoreTypes

String.IsString Instrument # 
Instance details

Defined in Derive.ScoreTypes

DeepSeq.NFData Instrument # 
Instance details

Defined in Derive.ScoreTypes

Methods

rnf :: Instrument -> () #

Pretty.Pretty Instrument # 
Instance details

Defined in Derive.ScoreTypes

Serialize.Serialize Instrument # 
Instance details

Defined in Derive.ScoreTypes

ShowVal.ShowVal Instrument # 
Instance details

Defined in Derive.ScoreTypes

ToVal Instrument # 
Instance details

Defined in Derive.RestrictedEnviron

ToVal Instrument # 
Instance details

Defined in Derive.Typecheck

Typecheck Instrument # 
Instance details

Defined in Derive.Typecheck

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

Defined in Derive.ScoreTypes

Methods

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

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

Ord Control # 
Instance details

Defined in Derive.ScoreTypes

Read Control # 
Instance details

Defined in Derive.ScoreTypes

Show Control # 
Instance details

Defined in Derive.ScoreTypes

String.IsString Control # 
Instance details

Defined in Derive.ScoreTypes

DeepSeq.NFData Control # 
Instance details

Defined in Derive.ScoreTypes

Methods

rnf :: Control -> () #

Pretty.Pretty Control # 
Instance details

Defined in Derive.ScoreTypes

Pretty.Pretty ControlRef # 
Instance details

Defined in Derive.BaseTypes

Serialize.Serialize Control # 
Instance details

Defined in Derive.ScoreTypes

ShowVal.ShowVal Control # 
Instance details

Defined in Derive.ScoreTypes

ShowVal.ShowVal ControlRef #

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

ToVal ControlRef # 
Instance details

Defined in Derive.RestrictedEnviron

ToVal Control # 
Instance details

Defined in Derive.Typecheck

Methods

to_val :: Control -> Val Source #

ToVal ControlRef # 
Instance details

Defined in Derive.Typecheck

Typecheck Control # 
Instance details

Defined in Derive.Typecheck

Typecheck ControlRef #

Use a TypedFunction or Function instead of this.

Instance details

Defined in Derive.Typecheck

ShowVal.ShowVal (Typed Control) # 
Instance details

Defined in Derive.ScoreTypes

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

Defined in Derive.ScoreTypes

Ord PControl # 
Instance details

Defined in Derive.ScoreTypes

Read PControl # 
Instance details

Defined in Derive.ScoreTypes

Show PControl # 
Instance details

Defined in Derive.ScoreTypes

String.IsString PControl # 
Instance details

Defined in Derive.ScoreTypes

DeepSeq.NFData PControl # 
Instance details

Defined in Derive.ScoreTypes

Methods

rnf :: PControl -> () #

Pretty.Pretty PControl # 
Instance details

Defined in Derive.ScoreTypes

Pretty.Pretty PControlRef # 
Instance details

Defined in Derive.BaseTypes

Serialize.Serialize PControl # 
Instance details

Defined in Derive.ScoreTypes

ShowVal.ShowVal PControl # 
Instance details

Defined in Derive.ScoreTypes

ShowVal.ShowVal PControlRef #

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

ToVal PControl # 
Instance details

Defined in Derive.Typecheck

Methods

to_val :: PControl -> Val Source #

ToVal PControlRef # 
Instance details

Defined in Derive.Typecheck

Typecheck PControl # 
Instance details

Defined in Derive.Typecheck

Typecheck PControlRef # 
Instance details

Defined in Derive.Typecheck

Type

data Type Source #

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

Constructors

Untyped 
Chromatic 
Diatonic 
Nn 
Score 
Real 
Instances
Enum Type # 
Instance details

Defined in Derive.ScoreTypes

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

Eq Type # 
Instance details

Defined in Derive.ScoreTypes

Methods

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

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

Ord Type # 
Instance details

Defined in Derive.ScoreTypes

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 #

Read Type # 
Instance details

Defined in Derive.ScoreTypes

Show Type # 
Instance details

Defined in Derive.ScoreTypes

Semigroup Type # 
Instance details

Defined in Derive.ScoreTypes

Methods

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

sconcat :: NonEmpty Type -> Type #

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

Monoid Type # 
Instance details

Defined in Derive.ScoreTypes

Methods

mempty :: Type #

mappend :: Type -> Type -> Type #

mconcat :: [Type] -> Type #

Pretty.Pretty Type # 
Instance details

Defined in Derive.ScoreTypes

Serialize.Serialize Type # 
Instance details

Defined in Derive.ScoreTypes

data Typed a Source #

Constructors

Typed 

Fields

Instances
Functor Typed # 
Instance details

Defined in Derive.ScoreTypes

Methods

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

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

Pretty.Pretty ControlRef # 
Instance details

Defined in Derive.BaseTypes

ShowVal.ShowVal ControlRef #

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

ShowVal.ShowVal TypedFunction # 
Instance details

Defined in Derive.Typecheck

ToVal ControlRef # 
Instance details

Defined in Derive.RestrictedEnviron

ToVal ControlRef # 
Instance details

Defined in Derive.Typecheck

Typecheck ControlRef #

Use a TypedFunction or Function instead of this.

Instance details

Defined in Derive.Typecheck

Typecheck TypedFunction # 
Instance details

Defined in Derive.Typecheck

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

Defined in Derive.ScoreTypes

Methods

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

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

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

Defined in Derive.ScoreTypes

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 #

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

Defined in Derive.ScoreTypes

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

Defined in Derive.ScoreTypes

Methods

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

show :: Typed a -> String.String #

showList :: [Typed a] -> ShowS #

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

Defined in Derive.ScoreTypes

Methods

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

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

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

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

Defined in Derive.ScoreTypes

Methods

mempty :: Typed a #

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

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

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

Defined in Derive.ScoreTypes

Methods

rnf :: Typed a -> () #

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

Defined in Derive.ScoreTypes

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

Defined in Derive.ScoreTypes

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

Defined in Derive.ScoreTypes

ShowVal.ShowVal (Typed Control) # 
Instance details

Defined in Derive.ScoreTypes

TypecheckNum (Typed Signal.Y) # 
Instance details

Defined in Derive.Typecheck

ToVal (Typed Signal.Y) # 
Instance details

Defined in Derive.Typecheck

Typecheck (Typed Signal.Y) # 
Instance details

Defined in Derive.Typecheck

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.