From 1395c56efd419eeba13c6325fcf0fa09c3d43376 Mon Sep 17 00:00:00 2001 From: meleki Date: Fri, 9 Oct 2026 15:31:51 +0200 Subject: [PATCH] Bring the sound pages and Architecture up to date (#85, round 10) Refactoring round 10 checked the wiki against the code since round 9. Most of what had gone stale is about sound. - Architecture: src/core/soundfx, src/core/instrument, src/editor/sound, src/editor/soundfx, src/editor/instrument and src/editor/routing had no row. src/core/music named five of its fifteen modules. The worklet was still called pitchWorklet. New are fxNodes, PreviewParams, nodes/shared, addLink and drawFloatingBox. - Home: "Sound has no mixer, no fade" is not so since the buses, the Master routing and the fades of songs. The rows of Sounds and Songs name what the pages cover now. - Songs: a new song snaps to 1/16 since #365, the intro still said the bar. "Not yet" named the Reverb (#328) and a bus without sound FX, both there by now. - Instruments: "Not yet" named the Phaser (#341), which is there. - Patterns, Songs, Instruments: swing points to #372, the end of a song to #373. Lines that ran past the width are wrapped. - Every path the wiki and the README name exists. Co-Authored-By: Claude Opus 5.5 --- Architecture.md | 59 ++++++++++++++++++++++++++++++++++++++++--------- Home.md | 17 +++++++------- Instruments.md | 13 +++++------ Patterns.md | 6 ++--- Songs.md | 12 +++++----- 5 files changed, 73 insertions(+), 34 deletions(-) diff --git a/Architecture.md b/Architecture.md index 32464f4..1e6da7f 100644 --- a/Architecture.md +++ b/Architecture.md @@ -141,7 +141,9 @@ src/core/graph/ graph model, NodeRegistry/NodeContext/values (a travellin savedValues (#166: the SaveArea a run reads persistent Variables assets from and writes them to, and restoring a save through today's declaration), stateMachine (the State node, a machine's states, the ports they become), variablePorts, propertyPorts, typedValues (#271: what fits a struct type, and a written variable held to its declaration), - lookup (what a node may look up: behaviors, state machines, struct types, what a variable declares), keyRepeat; nodes/{events,flow,data,action,variable}/.ts + lookup (what a node may look up: behaviors, state machines, struct types, what a variable declares), keyRepeat; nodes/{events,flow,data,action,variable}/.ts, + nodes/shared (the ports several nodes share: `checkPort`, the sound pickers, `detachedPort`, + `fxParamsPort`, `playedBusPort`, `letRingPort`) src/core/particles/ nodes (the catalogue), compile (a graph → one function per output), emission (which particles are alive at a second — a pure rule, no state) src/core/store/ serialize (untrusted JSON → Project), projectPlugins (which plugins a project switches on, read off the raw @@ -160,7 +162,26 @@ src/core/music/ time (ticks, 480 to the quarter, tempo and meter, a posit of the test's own; a song's sound items as clips, taken up mid-way where the playhead lands, #334), pattern (#333: a pattern's notes, grid, meter, tempo and loop, held to their rules, and the sequence it plays), song (#334: tracks and items held to their rules, - the sequence a song plays, the level of a track's bus, an item cut at a tick) + the sequence a song plays, the level of a track's bus, an item cut at a tick), + routing + routingNodes (#350: a song's routing graph, a node per track and the output; + `addLink` is the one rule for a link both routings keep), projectRouting (#351: the + Master routing, a node per sound, instrument, pattern, song and bus and the master; a + new asset takes the links most others of its type have), songBuses (the buses a song + plays on, mute and solo as gates), mixer (the master bus and `mix:`), needs (a + sound FX with its parameters, or none), playbacks (what a sequence loads before it + plays), embedded (#355: what a song keeps to itself), ghosts (#339: the notes around a + pattern item), take (#342: a recorded take as 16-bit WAV, cut to where the song started) +src/core/soundfx/ the sound FX graph (#311): nodes (every effect and what it adds to a plan), compile (the + graph walked back from the Output to a plan; a parameter stays open until a voice + starts), parametricEq (#367: the bands, and the curve Web Audio plays of them); the + effects the FX worklet runs, plain classes tested in Node: pitchPlayer (#317/#346, a + phase vocoder), chip (#329), crusher (#322), phaser (#341: Phaser and Flanger), + dynamics (#326), lfo (#320: Tremolo and Vibrato); reverb (#328) and saturation (#323) + for the Web Audio nodes that do theirs +src/core/instrument/ the instrument graph (#331): nodes (Notes, Sample, Parameters, Sound FX, Envelope), + compile (one note walked back from the Output, its triggers and sources), notes (MIDI + numbers and names), envelope (#335), chipPresets (#329: Preset, Randomize and Mutate the + way sfxr makes its sounds) src/runtime/ GameRun (one run: start, tick, `Load scene` — shared by Play and a released game, #266), World, Entity, System interface, Input tracker, CollisionSystem (the editor run's detection), solids (what `Move` collides with and how it slides — one-way solids let it through unless @@ -214,14 +235,21 @@ src/viewport/ WorldViewport (the drawing of a world or a holder, the ba PixelCels (the pixels of pixel art in memory: a painted cel is named at once, the ones the server lacks are uploaded before a save, #130) + pixelArtPicture (every frame composed on the CPU and laid side by side onto one canvas, so a frame is cut out like a texture frame), - SoundLibrary + pitchWorklet (the AudioWorklet that plays a way with a Pitch through - core/soundfx/pitchPlayer, a phase vocoder, #317; a note of an instrument is one voice - of what reaches its Output, each way with its own file, #331; a voice can start and be released - at a second of the audio clock, #332; a clip of a song from a second into its sound until - its end, a bus per track of a song with its level and pan, #334), music (the scheduler on + SoundLibrary + fxNodes (what each stage of a sound FX becomes as Web Audio nodes, and + how the knobs of a playing voice move) + fxWorklet (the AudioWorklet of the effects Web Audio has no node for: a + `Source` plays a sound of its own, a way with a Pitch, #317, or a Chip, #329; an `Effect` + sits between two stages, the pitch of a bus, #346, a Bitcrusher, a Phaser, a Flanger, a + Limiter, a Tremolo or a Vibrato; `Start` keeps either silent until its voice starts, + #332; what each of them works out is in core/soundfx; a note of an instrument is one + voice of what reaches its Output, each way with its own file, #331; a voice can start and + be released at a second of the audio clock, #332; a clip of a song from a second into its + sound until its end, a bus per track of a song with its level and pan, #334; the buses of + the mix and the Master routing, #325/#351), music (the scheduler on the library's clock, its notes played by the project's instruments and its clips by the library: the player of the Pattern and Song tabs, #333/#334, and `__gm.music`) + musicTimer - (the Web Worker whose interval is the scheduler's beat, #332), ShaderLibrary, ParticleLibrary, + (the Web Worker whose interval is the scheduler's beat, #332), takeRecorder + takeWorklet + (#342: the microphone on the library's clock, its samples with the frame they were taken + at), ShaderLibrary, ParticleLibrary, particles (one ParticleContainer per source), tilemap (one container per layer), shaderPicture (the picture a shader is laid over when it shades a camera's frame, #299, or a particle field, #170: drawn anew each time into a render texture kept while its size @@ -269,7 +297,7 @@ src/editor/ App → Editor (layout + ticker), PlaySession (the run), TabButton (how a tab is drawn: the card of the one showing, plain weight, no pressed fill, #176), DocumentTab (a document's tab: kind, name, close cross, a right-click menu), documents (#171: where a new document's tab goes, which one shows after a close, a tab going on to another document — pure, so checkable without a browser), - FloatWindow + floating (#371: a document's pane lent to a window above the editor and given back on Dock; where a window opens and how it stays on the screen). + FloatWindow + floating (#371: a document's pane lent to a window above the editor and given back on Dock; where a window opens and how it stays on the screen; drawn by `drawFloatingBox` like a popup). One editor per kind serves every open document of that kind: `Editor` points it at the one on screen (`AssetTabEditor.showAsset`), and it keeps each document's view through `saveView`/`restoreView` src/editor/plugins/ startPlugins (list, import, host; runs before the first project) → loader (PluginManager: syncTo makes the @@ -362,7 +390,18 @@ src/editor/song/ SongEditor (header: Play, Grid; plays through the schedul follows edits, #334), SongTimeline (heads, ruler and lanes in one widget, dropping assets in, the gestures and keys) + songView (its geometry: tracks, items and their ends, the parts of a head) + songEdit (what a gesture does to the items) + songActions (deleting - tracks and items, shared with the inspector and Delete) + tracks and items, shared with the inspector and Delete), meterView + meterDraw (#359: + the level meters of the heads), TakeMeter (#342: the input's level while recording), + ownFx (#355: a sound FX the song keeps for a song, a track or an item) +src/editor/sound/ SoundEditor (#343: header with Play, the clip's direction and fades), WaveCanvas (the + waveform, the clips as bands, the cut) + waveView (its time axis), SoundPreview (play + and length in the inspector), SoundPicker (the "+ → Sound" rows with their play mark) +src/editor/soundfx/ SoundFxEditor (#311: the graph, a sound to try it on, Play and Stop), PreviewParams (the + header's fields for the parameters a tab plays with, shared with the Instrument tab), + EqEditor + eqView (#367/#370: the Parametric EQ in a tab of its own, its curve on a picture) +src/editor/instrument/ InstrumentEditor (#331: the graph over the keys, Preset, Randomize, Mutate, Audition), + PianoKeyboard + keys (the keys drawn, played by the pointer and the computer keyboard) +src/editor/routing/ RoutingEditor (#351: the Master routing tab, one per project) src/editor/tile/ TileEditor (header + kind), TileCanvas (every tile of the block and a sample map, animated), PictureStrip (the pictures as animation steps; its reorder maths is `dropIndex` in ui/sortable), TilePalette (the tiles as a grid of pictures in the tilemap panel, #139) diff --git a/Home.md b/Home.md index 96d8c41..99dd36b 100644 --- a/Home.md +++ b/Home.md @@ -21,10 +21,10 @@ Live: · Widget playground: