Module
WAGS.Control.Types
- Package
- purescript-wags
- Repository
- mikesol/purescript-wags
#Frame Source
type Frame (env :: Type) (audio :: Type) (engine :: Type) (proof :: Type) (res :: Type) (graph :: Type) (a :: Type) = env -> WAG audio engine proof res graph a
Represents a single frame of an audio scene. Conceptually, this is a snapshot in time of audio.
env
: The outside environment influencing audio. Contains things like mouse clicks, the current time, and MIDI events.audio
: The audio context. This isUnit
when testing andFFIAudio
when rendering actual audio.engine
: The type output by the audio rendering engine. This isInstruction
when testing andEffect Unit
when rendering actual audio.proof
: A proof term representing the current moment in time.proof
is a type-safe way to make sure that a frame at timen
is not composed (ie via bind) with a frame at timen + 1
.res
: A monoid containing a residual from the audio computation. Use this if you need to pass computations from an audio graph to downstream consumers. In general, it is best if computations happen before audio graph rendering, so it's best to useres
only in cases where a computation is dependent on values that can only be calculated in the audio-graph, ie scheduling based on the audio clock.graph
: TheGraph
, meaning the current audio graph of the frame.a
: The term within the frame. This is often some form of accumulator that represents an evolving state over time.
#AudioState' Source
type AudioState' audio (engine :: Type) res = { instructions :: Array (audio -> engine), res :: res }
Type used for the internal representation of the current audio state.
#InitialGraph Source
type InitialGraph = Record ()
The Graph
at which any scene starts.
#InitialFrame Source
type InitialFrame env audio engine res a = Frame env audio engine Frame0 res InitialGraph a
The FrameT
at which any scene starts.
#InitialWAG Source
type InitialWAG audio engine res a = WAG audio engine Frame0 res InitialGraph a
#unsafeUnWAG Source
unsafeUnWAG :: forall audio engine proof res graph a. WAG audio engine proof res graph a -> { context :: AudioState' audio engine res, value :: a }
"For office use only" way to access the innards of a frame. Obliterates type safety. Use at your own risk.
#unsafeWAG Source
unsafeWAG :: forall audio engine proof res graph a. { context :: AudioState' audio engine res, value :: a } -> WAG audio engine proof res graph a
"For office use only" way to construct a frame. Obliterates type safety. Use at your own risk.
- Modules
- FRP.
Event. MIDI - WAGS.
Change - WAGS.
Change. Optionals - WAGS.
Comonad - WAGS.
Connect - WAGS.
Control. Functions - WAGS.
Control. Functions. Validated - WAGS.
Control. Indexed - WAGS.
Control. Types - WAGS.
Create - WAGS.
Create. Optionals - WAGS.
Debug - WAGS.
Destroy - WAGS.
Disconnect - WAGS.
Edgeable - WAGS.
Graph. AudioUnit - WAGS.
Graph. Edge - WAGS.
Graph. Graph - WAGS.
Graph. Node - WAGS.
Graph. Oversample - WAGS.
Graph. Parameter - WAGS.
Interpret - WAGS.
Math - WAGS.
NE2CF - WAGS.
Patch - WAGS.
Rendered - WAGS.
Run - WAGS.
Util - WAGS.
Validation