How skinnygiraffe1235/quattro-formaggi works
1. System shape
- Quattro Formaggi is a local, real-time performance instrument with three main boundaries: a browser UI, a Node.js bridge/server, and a SuperCollider synthesis engine. The browser is the control surface; SuperCollider is the audio generator.
2. Browser presentation layer
- index.html, style.css, and script.js implement the interactive front end. This layer contains the Mood Pad, piano-roll style input, and performance controls for instrument selection, octave changes, and reverb.
3. User input sources
- The browser accepts multiple performance inputs: computer keyboard, on-screen piano/piano-roll interaction, mouse actions on the Mood Pad, and MIDI controller input. These are all normalized in the JavaScript layer into musical events and parameter changes.
4. Control-state layer in the browser
- script.js is likely the main orchestration point for UI state: current instrument, octave, patch/randomization state, mood coordinates, and reverb amount. The Mood Pad is not just visual feedback; it maps to sound-shaping parameters such as brightness, darkness, softness, and aggressiveness.
5. Node.js bridge
- server.js is the integration boundary between the browser and the synthesis engine. It serves the app and handles OSC-based communication to SuperCollider. The README also lists Socket.IO, so the server likely supports live bidirectional browser-server messaging in addition to OSC transport.
6. Audio engine boundary
- string_engine.scd is the SuperCollider synthesis layer. It implements the actual quartet sound model and is responsible for turning note and control messages into audio. This is the only layer that directly produces sound.
7. Synthesis design
- The engine is based on DWGBowed and related bowed-string techniques, so the quartet is modeled as physically inspired bowed strings rather than sampled instruments. Each of the four voices has its own role: Violin I, Violin II, Viola, and Cello.
8. Per-instrument processing
- The SuperCollider side adds instrument-specific shaping such as resonance, bow noise, vibrato, stereo spreading, saturation, dynamic filtering, and reverb. This suggests a modular preset structure where each quartet member has a tailored timbre rather than sharing one generic patch.
9. Data flow
- The core path is: user interaction in the browser → JavaScript event handling → Node.js/OSC message transport → SuperCollider synthesis parameters → audio output. The reverse path is probably limited to state/status synchronization rather than audio data.
10. Performance controls and routing
- The UI exposes several live-performance commands: instrument switching, octave switching, random patch generation, and reverb adjustment. These are part of the control plane, not separate subsystems, and they affect the current synth preset in real time.
11. Runtime and deployment context
- This is not a typical web app deployed to a remote backend; it is a desktop/local performance stack that depends on a browser, Node.js, and a running SuperCollider environment on the same machine or local network.
12. Repo organization
- The repo is intentionally small and split by responsibility: frontend assets, server bridge, and synthesis script. That separation is the main architectural clue for diagramming: UI, transport, and sound engine are distinct nodes with OSC as the key integration protocol.
Main entry points: script.js Controller · server.js Bridge Server · index.html UI Shell · string_engine.scd String Engine
Components 12
Browser UI
Client-side performance surface and state orchestration.
- UI Shell · Browser entry point that hosts the performance interface.
index.html - Visual Theme · Styling for the performance UI, controls, and pad surfaces.
style.css - Controller · Main browser logic for input handling, state, mood mapping, and live control changes.
script.js - Keyboard · Computer keyboard performance input normalized by the browser controller.
- Mood Pad · Pointer-driven control surface for expressive mood and timbre shaping.
- MIDI · External MIDI controller input mapped into notes and parameter changes.
Node Bridge
Local server and transport layer between browser and synthesis engine.
- Bridge Server · Local Node.js server that serves the app and mediates live communication to the synth engine.
server.js - OSC Link · Message channel used to send control and note events to SuperCollider.
Audio Engine
SuperCollider synthesis and quartet sound generation.
- String Engine · SuperCollider bowed-string quartet engine that turns control messages into audio.
string_engine.scd - Quartet Voices · Violin I, Violin II, Viola, and Cello synthesis roles within the engine.
- Bowed Model · Physically inspired bowed-string synthesis based on DWGBowed-style techniques.
Project Runtime
Repository-level runtime and launch metadata.
- Package Config · Node.js dependency and startup metadata for the local bridge/runtime.
package.json
Connections 12
- UI Shell → Visual Theme: styles · The UI shell is presented through the stylesheet.
- UI Shell → Controller: loads · The browser entry loads the main controller script.
- Keyboard → Controller: events · Keyboard gestures are normalized into musical actions.
- Mood Pad → Controller: events · Mood Pad gestures become timbre and expression changes.
- MIDI → Controller: events · MIDI messages are converted into notes and control changes.
- Controller → Bridge Server: messages · The browser controller sends live control data to the bridge.
- Bridge Server → OSC Link: publishes · The bridge formats events for OSC transport.
- OSC Link → String Engine: controls · OSC messages reach the SuperCollider synthesis layer.
- String Engine → Quartet Voices: implements · The engine instantiates the four instrument voices.
- Quartet Voices → Bowed Model: driven by · Each voice is built on bowed-string synthesis techniques.
- Controller → OSC Link: state sync · Live performance state is translated into engine-facing parameters.
- Package Config → Bridge Server: supports · Node runtime metadata supports the bridge/server process.