Module

WAGS.Change

Package
purescript-wags
Repository
mikesol/purescript-wags

#Change Source

class Change (p :: EdgeProfile) (a :: Type) (graph :: Graph) (b :: Type) | p a graph -> b where

Change all of the audio nodes in edge profile p using the template laid out by type a for graph.

myCursor <- cursor (Speaker (Gain 1.0 (SinOsc 440.0 /\ Focus (SinOsc 330.0) /\ Unit)))
change' (asEdgeProfile myCursor) (SinOsc 332.0)

Note that change' increments the changeBit in the universe by 1, aka Succ. This use of inductive types in an indexed bind operation guarantees that we never go "back in time" after having changed an audio graph.

Members

Instances

#ChangeP Source

class (Change (SingleEdge p) a graph b) <= ChangeP (p :: Ptr) (a :: Type) (graph :: Graph) (b :: Type) | p a graph -> b where

Internal helper class used for changing audio nodes.

Members

Instances

#gets Source

gets :: forall m res a' a b currentIdx g changeBit skolems env audio engine proof. Monad m => AudioInterpret audio engine => AsGetter a' a => Changes a g b => a' -> FrameT env audio engine proof m res (UniverseC currentIdx g changeBit skolems) (UniverseC currentIdx g changeBit skolems) b

Rolls multiple gets into a single function.

#Changes Source

class Changes (a :: Type) (g :: Graph) (b :: Type) | a g -> b where

Rolls multiple changes into a single increment of the changeBit. This is useful when writing loops. A loop may have many or no changes, and this allows all of them to be executed in a single transaction. As an example, see examples/wtk/WTK/TLP.purs. In the playKeys function, each finger may potentially change, and each change is rolled into the a value that is ultimately passed to changes.

Members

Instances

#ChangeInstructions Source

class (AudioInterpret audio engine) <= ChangeInstructions (audio :: Type) (engine :: Type) (g :: Type) (h :: Type) | g -> h where

Internal class used to make term-level instructions for audio unit changes.

Members

Instances

#ChangeInstruction Source

data ChangeInstruction a b

Constructors

Instances

#Modify Source

class Modify (tag :: Type) (p :: Ptr) (i :: Graph) (nextP :: EdgeProfile) | tag p i -> nextP

Internal helper class used for changing audio nodes.

Instances

#Modify' Source

class Modify' (tag :: Type) (p :: Ptr) (i :: NodeList) (mod :: NodeList) (nextP :: EdgeProfile) | tag p i -> mod nextP

Internal helper class used for changing audio nodes.

Instances

#ModifyRes Source

class ModifyRes (tag :: Type) (p :: Ptr) (i :: Node) (mod :: NodeList) (plist :: EdgeProfile) | tag p i -> mod plist

Internal helper class used for changing audio nodes.

Instances

#SetterVal Source

class SetterVal a  where

A term that can be coerced to an setter for a control-rate audio parameter.

Members

Instances

#change Source

change :: forall edge m res a b currentIdx graph changeBit skolems env audio engine proof. Monad m => AudioInterpret audio engine => TerminalIdentityEdge graph edge => Change edge a graph b => a -> FrameT env audio engine proof m res (UniverseC currentIdx graph changeBit skolems) (UniverseC currentIdx graph (Succ changeBit) skolems) b

Similar to change', but starting from the top-level node, which is usually a Speaker.

#get Source

get :: forall edge m res a' a b currentIdx graph changeBit skolems env audio engine proof. Monad m => AudioInterpret audio engine => TerminalIdentityEdge graph edge => AsGetter a' a => Change edge a graph b => a' -> FrameT env audio engine proof m res (UniverseC currentIdx graph changeBit skolems) (UniverseC currentIdx graph changeBit skolems) b

Similar to get', but starting from the top-level node, which is usually a Speaker.

#get' Source

get' :: forall edge m res a' a b currentIdx graph changeBit skolems env audio engine proof. Monad m => AudioInterpret audio engine => AsGetter a' a => Change edge a graph b => Proxy edge -> a' -> FrameT env audio engine proof m res (UniverseC currentIdx graph changeBit skolems) (UniverseC currentIdx graph changeBit skolems) b

Uses the incoming graph as a getter. Its values will be discarded and filled with the current values.

#changeAt Source

changeAt :: forall ptr a b env audio engine proof m res currentIdx graph changeBit skolems. Monad m => AudioInterpret audio engine => Change (SingleEdge ptr) a graph b => AudioUnitRef ptr -> a -> FrameT env audio engine proof m res (UniverseC currentIdx graph changeBit skolems) (UniverseC currentIdx graph (Succ changeBit) skolems) b

Similar to change', but starting from an AudioReference ptr (the result of cursor) instead of starting from an edge profile.

#getAt Source

getAt :: forall ptr a' a b env audio engine proof m res currentIdx graph changeBit skolems. Monad m => AudioInterpret audio engine => AsGetter a' a => Change (SingleEdge ptr) a graph b => AudioUnitRef ptr -> a' -> FrameT env audio engine proof m res (UniverseC currentIdx graph changeBit skolems) (UniverseC currentIdx graph changeBit skolems) b

Similar to get', but starting from an AudioReference ptr (the result of cursor) instead of starting from an edge profile.