Skip to content

Commit

Permalink
Small doc edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Solomon committed Apr 25, 2022
1 parent edb54c7 commit e32bd24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions examples/docs/Subgraph/SliderEx.purs
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,13 @@ px =
Proxy :: Proxy """<section>
<h2>Hello subgraph</h2>
<p>To make a subgraph, you need two things:</p>
<ol>
<li>An index type. This type needs to implement the <code>Hashable</code> typeclass. You can use this to customize whatever the resulting subgraph will be.</li>
<li>The subgraph itself, which is a single audio node that must be prefaced by <code>mkSubgraph</code>.</li>
</ol>
<p>Subgraphs have the type <code>Event (Event (StreamingAudio outputChannels lock payload))</code>. Streaming audio is a data type with two constructors: <code>Sound (Node outputChannels lock payload)</code> to create a subgraph and <code>Silence</code> to turn it off. The inner event listens for sound/silence, and the outer event adds subgraphs to the scene. You can create as many subgraphs as you like: wags automatically frees up resources when you send the <code>Silence</code> event. Note that, once you turn a subraph off with <code>Silence</code>, you can't turn it back on again. In this case, just create a new subgraph.</p>
<p>Here's a simple subgraph that is connected to a slider. As you slide the slider, new nodes are provisioned. Each one has a pseudo-random pitch.</p>
<pre><code>@txt@</code></pre>
@ex1@
<p>Note how, in this example, we use a delay to turn off audio nodes. One nice thing about subgraphs is that, when they are removed, their nodes are turned off <i>and</i> their events are cancelled, which means that there will never be a case where a subgraph keeps playing or consuming events after it has been removed.</p>
</section>
"""

Expand Down
2 changes: 1 addition & 1 deletion examples/docs/Subgraphs.purs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ px = Proxy :: Proxy """<div>
</p>
<p>
Subgraphs fix this problem. They provide a concise mechansim to dynamically insert audio graphs based on events. Subgraphs have the type <code>Event (Event (StreamingAudio outputChannels lock payload))</code>. Streaming audio is a data type with two constructors: <code>Sound (Node outputChannels lock payload)</code> to create a subgraph and <code>Silence</code> to turn it off. The inner event listens for sound/silence, and the outer event adds subgraphs to the scene. You can create as many subgraphs as you like: wags automatically frees up resources when you send the <code>Silence</code> event. Note that, once you turn a subraph off with <code>Silence</code>, you can't turn it back on again. In this case, just create a new subgraph.
Subgraphs fix this problem. They provide a concise mechansim to dynamically insert audio graphs based on events.
</p>
~suby~
Expand Down

0 comments on commit e32bd24

Please sign in to comment.