Module

Hylograph.Music.Interpreter.WebAudio

Package
purescript-hylograph-music
Repository
afcondon/purescript-hylograph-music

#MusicSelection_ Source

newtype MusicSelection_ (state :: Type) (parent :: Type) (datum :: Type)

Music selection type for audio sonification

Instead of DOM elements, this represents scheduled audio events. The phantom types work the same way as in D3 for type safety.

Instances

#MusicM Source

newtype MusicM a

The Music interpreter monad

Carries an AudioContext reference for scheduling notes. Uses ReaderT pattern to thread the context through computations.

Instances

#runMusicM Source

runMusicM :: Ref AudioContext -> MusicM ~> Effect

Run a music program with an existing context ref

#initMusicContext Source

initMusicContext :: MusicM Unit -> Effect Unit

Initialize audio context and run a music program

Creates the Web Audio context and executes the computation. Must be called in response to user interaction (browser requirement).