Module

WAGS.Cursor

Package
purescript-wags
Repository
mikesol/purescript-wags

#cursor Source

cursor :: forall edge audio engine a q r s t env proof m res p. Monad m => TerminalIdentityEdge r edge => Cursor edge a r p => BinToInt p => a -> FrameT env audio engine proof m res (UniverseC q r s t) (UniverseC q r s t) (AudioUnitRef p)

Focus on a particular audio unit in a graph. Use in conjunction with change to modify an audio unit.

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

Graphs can be focused on different elements, allowing multiple cursors to be generated from the same graph.

let
  graph a b = Speaker (Gain 1.0 (a (SinOsc 440.0) /\ b (SinOsc 330.0) /\ Unit))
cursor1 <- cursor (graph Focus Identity)
cursor2 <- cursor (graph Identity Focus)
changeAt cursor1 (SinOsc 444.0)
changeAt cursor2 (SinOsc 332.0)

For more complex graphs, decorators can be used to auto-generate cursors. See WAGS.Graph.Decorators.

To see examples of cursors, check out test/Ops.purs and examples/wtk/WTK/TLP.purs.

#Cursor Source

class Cursor (p :: EdgeProfile) (a :: Type) (g :: Graph) (ptr :: Ptr) | p a g -> ptr where

Like cursor, but starting from an arbitrary edge in a graph. This is useful when, for example, the cursor needs to be obtained for an audio unit that is not yet connected to a speaker. In most cases, however, you'll want to use cursor, which uses Speaker as the top-most unit.

Members

Instances

#CursorRes Source

class CursorRes (tag :: Type) (p :: Ptr) (i :: Node) (plist :: EdgeProfile) | tag p i -> plist

Instances

#Cursor' Source

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

Internal helper class used for Cursor.

Instances

#CursorX Source

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

Internal helper class used for Cursor.

Instances

#CursorI Source

class CursorI (p :: EdgeProfile) (a :: Type) (g :: Graph) (ptr :: PtrList) | p a g -> ptr

Internal helper class used for Cursor.

Instances