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

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 it can be parsed without quotes.

Constructors

Instrument Text 

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 # 

Methods

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

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

Ord Control # 
Read Control # 
Show Control # 
String.IsString Control # 
DeepSeq.NFData Control # 

Methods

rnf :: Control -> () #

Pretty.Pretty Control # 
Pretty.Pretty ControlRef # 
Serialize.Serialize Control # 
ShowVal.ShowVal Control # 
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.

ToVal ControlRef # 
ToVal Control # 

Methods

to_val :: Control -> Val Source #

ToVal ControlRef # 
Typecheck Control # 
Typecheck ControlRef #

Use a TypedFunction or Function instead of this.

ShowVal.ShowVal (Typed Control) # 

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 # 
Ord PControl # 
Read PControl # 
Show PControl # 
String.IsString PControl # 
DeepSeq.NFData PControl # 

Methods

rnf :: PControl -> () #

Pretty.Pretty PControl # 
Pretty.Pretty PControlRef # 
Serialize.Serialize PControl # 
ShowVal.ShowVal PControl # 
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.

ToVal PControl # 

Methods

to_val :: PControl -> Val Source #

ToVal PControlRef # 
Typecheck PControl # 
Typecheck PControlRef # 

Warp

data Warp Source #

A tempo warp signal. The shift and stretch are an optimization hack stolen from nyquist. The idea is to make composed shifts and stretches more efficient if only the shift and stretch are changed. The necessary magic is in compose_warps.

The order of operation is: stretch -> shift -> signal. That is, if the signal is "f": f(t*stretch + shift).

Instances

Eq Warp # 

Methods

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

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

Show Warp # 
DeepSeq.NFData Warp # 

Methods

rnf :: Warp -> () #

Pretty.Pretty Warp # 

Type

data Type Source #

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

Constructors

Untyped 
Chromatic 
Diatonic 
Nn 
Score 
Real 

data Typed a Source #

Constructors

Typed 

Fields

Instances

Functor Typed # 

Methods

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

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

Pretty.Pretty ControlRef # 
ShowVal.ShowVal TypedVal # 
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.

ToVal ControlRef # 
TypecheckNum TypedVal # 
ToVal TypedVal # 

Methods

to_val :: TypedVal -> Val Source #

ToVal ControlRef # 
Typecheck TypedVal # 
Typecheck ControlRef #

Use a TypedFunction or Function instead of this.

Typecheck TypedFunction # 
Eq a => Eq (Typed a) # 

Methods

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

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

Ord a => Ord (Typed a) # 

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) # 
Show a => Show (Typed a) # 

Methods

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

show :: Typed a -> String.String #

showList :: [Typed a] -> ShowS #

Monoid a => Monoid (Typed a) # 

Methods

mempty :: Typed a #

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

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

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

Methods

rnf :: Typed a -> () #

Pretty.Pretty a => Pretty.Pretty (Typed a) # 
Serialize.Serialize a => Serialize.Serialize (Typed a) # 
ShowVal.ShowVal (Typed Control) # 

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.