Safe Haskell | Safe-Inferred |
---|
Low-dependency basic types for derivation.
Synopsis
- newtype Instrument = Instrument Text
- instrument_name :: Instrument -> Text
- empty_instrument :: Instrument
- newtype Control = Control Text
- control_name :: Control -> Text
- checked_control :: Text -> Either Text Control
- newtype PControl = PControl Text
- pcontrol_name :: PControl -> Text
- default_pitch :: PControl
- checked_pcontrol :: Text -> Either Text PControl
- parse_generic_control :: Text -> Either Text (Either Control PControl)
- data Type
- all_types :: [Type]
- type_to_code :: Type -> Text
- code_to_type :: Text -> Maybe Type
- data TimeT
- data TransposeT
- = TDiatonic
- | TChromatic
- | TNn
- data Duration
- time_t :: TimeT -> Type -> Maybe TimeT
- transpose_t :: TransposeT -> Type -> Maybe TransposeT
- duration :: TimeT -> Typed Signal.Y -> Maybe Duration
- data Typed a = Typed !Type !a
- type_of :: Typed a -> Type
- val_of :: Typed a -> a
- merge_typed :: (a -> a -> a) -> Typed a -> Typed a -> Typed a
- untyped :: a -> Typed a
- type_to_transpose :: Typed Signal.Y -> Maybe Pitch.Transpose
- type ControlValMap = Map Control Signal.Y
- type TypedControlValMap = Map Control (Typed Signal.Y)
- type ControlMap = Map Control TypedSignal
- type FunctionMap = Map Control TypedFunction
- type Function = RealTime.RealTime -> Signal.Y
- type TypedFunction = Typed (RealTime.RealTime -> Signal.Y)
- type TypedSignal = Typed Signal.Control
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.
Instances
instrument_name :: Instrument -> Text Source #
Control
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
.
Instances
String.IsString Control Source # | |
Defined in Derive.ScoreT fromString :: String.String -> Control # | |
Read Control Source # | |
Show Control Source # | |
DeepSeq.NFData Control Source # | |
Defined in Derive.ScoreT | |
Eq Control Source # | |
Ord Control Source # | |
ToVal ControlRef Source # | |
Defined in Derive.REnv to_val :: ControlRef -> Val Source # | |
ShowVal.ShowVal ControlRef Source # | |
Defined in Derive.DeriveT show_val :: ControlRef -> Text Source # | |
ShowVal.ShowVal Control Source # | |
ToVal ControlRef Source # | |
Defined in Derive.Typecheck to_val :: ControlRef -> Val Source # | |
ToVal Control Source # | |
Typecheck Control Source # | |
Pretty.Pretty ControlRef Source # | |
Defined in Derive.DeriveT pretty :: ControlRef -> Text Source # format :: ControlRef -> Doc Source # formatList :: [ControlRef] -> Doc Source # | |
Pretty.Pretty Control Source # | |
Serialize.Serialize Control Source # | |
ShowVal.ShowVal (Typed Control) Source # | |
control_name :: Control -> Text Source #
checked_control :: Text -> Either Text Control Source #
Use this constructor when making a Control from user input. Literals can use the IsString instance.
PControl
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.
Instances
pcontrol_name :: PControl -> Text Source #
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
Tag for the type of the values in a control signal. Untyped goes last because the parser tries them in order.
type_to_code :: Type -> Text Source #
data TransposeT Source #
Instances
Show TransposeT Source # | |
Defined in Derive.ScoreT showsPrec :: Int -> TransposeT -> ShowS # show :: TransposeT -> String.String # showList :: [TransposeT] -> ShowS # | |
Eq TransposeT Source # | |
Defined in Derive.ScoreT (==) :: TransposeT -> TransposeT -> Bool # (/=) :: TransposeT -> TransposeT -> Bool # | |
Ord TransposeT Source # | |
Defined in Derive.ScoreT compare :: TransposeT -> TransposeT -> Ordering # (<) :: TransposeT -> TransposeT -> Bool # (<=) :: TransposeT -> TransposeT -> Bool # (>) :: TransposeT -> TransposeT -> Bool # (>=) :: TransposeT -> TransposeT -> Bool # max :: TransposeT -> TransposeT -> TransposeT # min :: TransposeT -> TransposeT -> TransposeT # | |
Pretty.Pretty TransposeT Source # | |
Defined in Derive.ScoreT pretty :: TransposeT -> Text Source # format :: TransposeT -> Doc Source # formatList :: [TransposeT] -> Doc Source # |
Some calls can operate in either RealTime or ScoreTime.
transpose_t :: TransposeT -> Type -> Maybe TransposeT Source #
Instances
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.
type ControlMap = Map Control TypedSignal Source #
type FunctionMap = Map Control TypedFunction Source #
type Function = RealTime.RealTime -> Signal.Y Source #
type TypedFunction = Typed (RealTime.RealTime -> Signal.Y) Source #
type TypedSignal = Typed Signal.Control Source #