web synth docs

patch-network

The patch network is the main code-side interface to the [audio-graph]. The name patch network is used a lot in the codebase, and it refers to this interface through which the audio graph can be queried, manipulated, and managed. It handles things like automatically disconnecting nodes when [audio-connectables] change and remove inputs or outputs, serializing/deserializing the audio graph and loading it on page refresh, and exposing an API for interacting with the audio graph.

The patch network is built on top of Redux, meaning that it is immutable and all modifications to it take the form of actions. All of these actions are accessible via a few top-level exported functions, found here: https://github.com/Ameobea/web-synth/blob/main/src/patchNetwork/interface.ts

patch-network