pd-andy / elm-audio-graph / AudioGraph.Encode

This module exposes two JSON encoders to encode the audio graph and its nodes. You'll typically only need to use encodeAudioGraph but encodeNode is also exposed for testing and other utilities purposes.

encodeAudioGraph : AudioGraph -> Json.Encode.Value

Encodes the supplied AudioGraph as a Json.Encode.Value. This is necessary when you want to send the graph through a port and construct the actual Web Audio implementation in javascript. See the advanced example for more details on how to do this.

encodeNode : AudioGraph.Node.Node -> Json.Encode.Value

Encodes the supplied Node as a Json.Encode.Value. Rarely will you need to use this directly, but it is exposed for debugging and other fringe cases.