Repository navigation
instruments degrader
Working manual · 0.0.1-alpha · source snapshot 16 November 2026
INST has DEGRADER and PACK rows immediately after its sample slots. Press A on DEGRADER. Up/Down moves between CHANNEL and the list rows; Left/Right moves among channels or between the rate and depth lists. A selects the focused value. Y toggles bypass without losing the settings; B or Start closes. The current values use theme Signal and keyboard/controller focus uses Selection. The popup reuses the shared dialog panel, silhouette and shadow; it has no mouse requirement.
Start playback before opening the popup to hear changes to a sounding SINGLE Forward/Loop instrument. Committed changes replace the prepared sample bank on the UI thread and preserve the sequence clock and active voice time/pitch. Conversion and old-buffer destruction occur outside the SDL stream lock. The bounded voice pointer update and queued-audio flush occur under that lock. There may be a small discontinuity when switching representations; this is not a crossfading effects engine. Other instrument modes retain their existing silent playback limitation, although all assigned slots can be packed.
Referenced WAVs are opened read-only. Settings belong to InstrumentData, not the scene or voice. The original decoded source and converted representations remain in a bounded immutable playback bank; equal source/settings share a conversion and note triggers never reconvert. Live changes reuse decoded source PCM. A fresh Stop/Play reopens external sources, including externally changed files. Replacing a SAMPLE slot removes only that slot's baked representation and shifts retained slots when inserting multiple samples. Disabling settings restores source PCM. The bank is limited to 64 MiB, with at most 32 MiB decoded per sample. A live bank swap temporarily retains old and new banks; packing processes one source at a time.
core/audio/Synth/_INST/SampleDegrader is the canonical conversion implementation for preview
and packing. It performs channel conversion, linear rate conversion, then signed
PCM quantization. MIXED uses (L + R) / 2; every channel option safely resolves
mono to mono. SOURCE preserves the property; requested rates/depths above the
source are clamped to the source. Linear conversion intentionally allows aliasing
for this lightweight lo-fi implementation. It can be replaced independently of
the UI. Quantization rounds and saturates to signed N-bit values. SDL continues
to receive stereo float32 at 48 kHz regardless of effective sample resolution.
PACK opens a cancel-first confirmation naming Instruments/XX.cti beneath the
content root; confirming replaces that instrument file through SaveManager's
atomic-save path. It packs all assigned slots, writes the CTI, then attaches the
same baked PCM to the current document. Save the project to persist that document
change in CTP. Failed conversion or export leaves the document and source WAVs
unchanged. Already packed slots are skipped, making repeated PACK idempotent.
An all-packed instrument displays BAKED in the dialog and locks its degrader
controls. Assign a WAV again to work from an external source. For mixed storage,
settings affect only referenced slots. No original high-resolution PCM is stored
alongside the packed result. Original portable path strings remain as metadata.
CTI v1 loading is available through InstrumentSerializer; an INST import browser
for standalone CTI files is not part of this change. Packed project playback works
without external sources. See the format specification (repository reference: file-formats/project-v7.md).
DATA measures packed PCM separately and excludes its source paths from external
dependencies, while still counting references used by other unpacked instruments.
Build and test with cmake --build build --config Debug and
ctest --test-dir build -C Debug --output-on-failure. Tests cover conversion,
packed sizes and equivalence, source preservation, malformed data, resource
budgets, controller input, themed rendering, serialization, cache separation,
live voice replacement and SDL dummy-device synchronization. The instrument test
writes instrument-tests/sample-degrader.bmp in the build directory.
Physical RG35XX H performance and listening quality require hardware checks.
If a connected physical controller wins discovery during the existing sdl_input test, run CTest with SDL_JOYSTICK_HIDAPI, SDL_JOYSTICK_RAWINPUT, SDL_JOYSTICK_DIRECTINPUT, SDL_JOYSTICK_WGI, SDL_JOYSTICK_GAMEINPUT and SDL_XINPUT_ENABLED set to 0 in the test process environment. This isolates the virtual controller and does not change application bindings.
| Documentation still to add |
|---|
| Annotated current-build screenshots and a recorded controller walkthrough for this topic. |
Repository sources used for this page:
docs/sample-degrader.md
This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.