One thing I wanted to avoid was making this obscenely costly. Plugins can be CPU and memory intensive, so larger EC2 instances would be needed. However, running even one of these continuously is very expensive, let alone a fleet of them. I initially tried working with a single instance and attempting a sort of preemptive scheduling / context switching, but this quickly fell apart: the signal chain between sessions would become polluted, and it was extremely brittle.
It's around this time that I found that EC2 spot instances can be considerably cheaper. With aggressive session cleanup and instance lifetime limits, I could probably keep this doable.
Limitations:
* Max session time is an hour.
* Only a single signal chain is supported, with an instrument being the root node and one or more effects after it. Parallel chains are technically supported by the engine, but I decided against implementing it in the browser for simplicity.
* Plugins marked with "demo" are paid products with a publicly available demo version. These demos will emit crackles or dropouts, so if you like the plugin, consider purchasing it from the developer.
* Snapshots allow you to freeze your graph (plugin order, parameter values) at a specific time, and also share your snapshot with others. Currently, snapshots are stored in memory only, as I didn't want to over engineer a durable store for a demo app. Also, once your session is over, snapshots are deleted along with it.
* Some plugins may work better than others.
Implementation details:
* Sessions provision EC2 spot instances, or grab hibernating instances from a pool if one is available.
* Each EC2 instance runs a worker binary that maintains a graph of nodes, with each node being a Podman container that communicates with the worker via Unix sockets.
* Podman images include WINE and yabridge for VST3 only plugins; container initialization time is kept low thanks to fuse-overlayfs preventing redundant copying of the WINE prefix.
* Each container has a small VST/CLAP host that reads input via the control socket; output can be GUI frames or audio blocks.
* Output is streamed over a WebSocket, with WebAudio for scheduling playback