Skip to content

Commit

Permalink
Bumps version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Solomon committed Jul 8, 2021
1 parent 35a9ba3 commit 9240a4a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.8] - 2021-08-07

### Added

- `startUsing` allows the quick bootstrapping of audio graphs at the beginning of a scene.

## [0.3.7] - 2021-07-07

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "purescript-wags",
"version": "0.3.7",
"version": "0.3.8",
"description": "Web Audio Graphs as a Stream",
"scripts": {
"build": "spago build",
Expand Down
14 changes: 14 additions & 0 deletions src/WAGS/Control/Functions.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module WAGS.Control.Functions
( start
, istart
, startUsing
, modifyRes
, imodifyRes
, makeScene
Expand All @@ -25,11 +26,13 @@ module WAGS.Control.Functions
) where

import Prelude

import Control.Comonad (extract)
import Data.Either (Either(..))
import WAGS.Control.Indexed (IxWAG(..), IxFrame)
import WAGS.Control.Types (AudioState', EFrame, Frame, Frame0, InitialWAG, Scene(..), Scene', WAG, oneFrame, unsafeUnWAG, unsafeWAG)
import WAGS.Interpret (class AudioInterpret)
import WAGS.Patch (class Patch, ipatch)

-- | The initial `Frame` that is needed to begin any `Scene`.
-- |
Expand Down Expand Up @@ -124,6 +127,17 @@ istart m = makeSceneR (\e -> let IxWAG f = m e in f start)

infixr 6 istart as @!>

startUsing ::
forall env audio engine res graph control.
Monoid res =>
AudioInterpret audio engine =>
Patch () graph =>
control ->
(forall proofA. WAG audio engine proofA res { | graph } control ->
Scene env audio engine proofA res) ->
Scene env audio engine Frame0 res
startUsing control next = const (ipatch $> control) @!> next

-- | Loops audio.
-- |
-- | The first argument is the loop and the second argument is the incoming graph that gets rendered before the loop.
Expand Down
15 changes: 15 additions & 0 deletions src/WAGS/Control/Functions/Validated.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module WAGS.Control.Functions.Validated
, makeSceneRFlipped
, makeSceneR'
, makeSceneR'Flipped
, startUsing
, loop
, iloop
, branch
Expand All @@ -22,11 +23,13 @@ module WAGS.Control.Functions.Validated
) where

import Prelude

import Data.Either (Either)
import WAGS.Control.Functions as Functions
import WAGS.Control.Indexed (IxWAG, IxFrame)
import WAGS.Control.Types (EFrame, Frame, Frame0, Scene, WAG)
import WAGS.Interpret (class AudioInterpret)
import WAGS.Patch (class Patch)
import WAGS.Validation (class GraphIsRenderable)

makeScene ::
Expand Down Expand Up @@ -146,6 +149,18 @@ istart = Functions.istart

infixr 6 istart as @!>

startUsing ::
forall env audio engine res graph control.
Monoid res =>
AudioInterpret audio engine =>
GraphIsRenderable graph =>
Patch () graph =>
control ->
(forall proofA. WAG audio engine proofA res { | graph } control ->
Scene env audio engine proofA res) ->
Scene env audio engine Frame0 res
startUsing = Functions.startUsing

freeze ::
forall env audio engine proof res graph x.
Monoid res =>
Expand Down

0 comments on commit 9240a4a

Please sign in to comment.