The wahsp package

[ Tags: bsd3, library, web ] [ Propose Tags ]

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]

Properties

Versions 0.2
Dependencies aeson (==1.0.*), base (>=4.8 && <=4.9), data-default-class (==0.1.*), kansas-comet (==0.4.*), natural-transformation (==0.3.*), remote-monad (==0.3.*), scotty (==0.11.*), semigroups (==0.18.*), stm (==2.4.*), text (==1.2.*), wai-middleware-static (==0.8.*) [details]
License BSD3
Author Nicholas Shaheed
Maintainer nshaheed@ku.edu
Category Web
Home page https://github.com/nshaheed/WebAudioHs/
Bug tracker https://github.com/nshaheed/WebAudioHs/issues
Uploaded Sun Sep 18 01:02:30 UTC 2016 by nshaheed
Updated Sun Sep 18 04:10:49 UTC 2016 by nshaheed to revision 1
Distributions NixOS:0.2
Downloads 64 total (2 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2016-09-18 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


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