wahsp: A haskell binding of the Web Audio API ala blank-canvas

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

wahsp (Web Audio HaSkell Protocol) is a binding for Haskell to the Web Audio API ala blank-canvas. Audio sources, effects, etc. can be combined, manipulated, and otherwise controlled using haskell and are then rendered in the the browser (see the above link for browser compatibility).

Example:

module Main where
import Web.Audio

main :: IO ()
main
main = do
  webAudio 3000 $ \doc -> do
  send doc $ do
    osc1  <- createOscillator 200 0 Sine
    gain1 <- createGain 0.5

    connect $ osc1 .|. gain1 .||. eCtx

    start osc1

[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2
Dependencies aeson (>=1.0 && <1.1), base (>=4.8 && <=4.9), data-default-class (>=0.1 && <0.2), kansas-comet (>=0.4 && <0.5), natural-transformation (>=0.3 && <0.4), remote-monad (>=0.3 && <0.4), scotty (>=0.11 && <0.12), semigroups (>=0.18 && <0.19), stm (>=2.4 && <2.5), text (>=1.2 && <1.3), wai-middleware-static (>=0.8 && <0.9) [details]
Tested with ghc ==7.10.3
License BSD-3-Clause
Author Nicholas Shaheed
Maintainer nshaheed@ku.edu
Revised Revision 1 made by nshaheed at 2016-09-18T04:10:49Z
Category Web
Home page https://github.com/nshaheed/WebAudioHs/
Bug tracker https://github.com/nshaheed/WebAudioHs/issues
Uploaded by nshaheed at 2016-09-18T01:02:30Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 823 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2016-09-18 [all 1 reports]

Readme for wahsp-0.2

[back to package description]

wahsp

Overview

wahsp (Web Audio HaSkell Protocol) is a binding for Haskell to the Web Audio API ala blank-canvas Audio sources, effects, etc. can be combined, manipulated, and otherwise controlled using haskell and are then rendered in the the browser (see the above link for browser compatibility).

Installation

As of the writing of this README, remote-monad 0.3 is only available on github and must be built from the repo.

Full installation instructions:

git clone https://github.com/nshaheed/WebAudioHs.git
cd WebAudioHs
cabal install natural-transformation
git clone https://github.com/ku-fpg/remote-monad.git
cd remote-monad/
cabal install
cd ../
cabal install

Example

Here is a basic program that creates a 200Hz sine wave and plays it

module Main where
import Web.Audio
 
main :: IO ()
main = do
  webAudio 3000 $ doc -> do
    send doc $ do
      osc1  <- createOscillator 200 0 Sine -- create an OscillatorNode
      gain1 <- createGain 0.5              -- create a GainNode

      connect $ osc1 .|. gain1 .||. eCtx   -- connect these nodes together, and then connect them to the audio context

      start osc1 -- make sounds!

Other Examples

Code for examples are located in the example/ folder.

To install:

cd examples/
cabal install

The resulting executables are located in ~/.cabal/bin/

Documentation

  1. hackage
  2. Web Audio API documentation