Repository navigation
descry v1.0.5
three weeks of work, and most of it is the unglamorous kind: races, silent
corruption and knobs that did nothing. a sampler workflow overhaul on top.
sampling & wavetables
- complete sampler capture / slicing workflow — recording, trimming,
transient and equal chopping, per-slice reverse, slice-to-phrase and
slice-to-kit, beat-sync repitch, and a wav browser that handles 8/16/24/32-bit
and float files. all of it realtime-safe: SD and decode work happens off the
audio lock, then swaps under it - capture any sampler window as a permanent oscillator — the visible window
becomes a single-cycle USER wavetable plus a matching wavsynth instrument, DC
removed and normalised, persisted across reboots. record a vowel through the
mic, play it as an oscillator - host-side tools for building sample/wav libraries and pushing them to the
console over FTP
fixes
- two use-after-free races between the UI and the audio worker — preview
voices were published to the mixer beforenote_on(), so if a buffer fill
landed in that window the worker deleted the voice as inactive and the UI then
callednote_on()on freed memory. separately, every destructive sample edit
(normalize, reverse, fade, crop, wav load, resample, drum regen, mic record)
mutated a vector a live sampler voice was reading — a realloc there is heap
corruption. newstart_voice()andcut_slot_voices()close both. found in
an external audit of v1.0.4 - a full SD card could destroy the project you were saving — saves went
straight over the target file, so a failed write left a torn file while the UI
reported success. saves are now atomic (temp file, verified, renamed) and
loads are transactional, so a short read can no longer leave the live project
half-old and half-new. loading also validates and clamps anything the player
indexes into or divides by, instead of trusting the file - sampler LENGTH disagreed with the engine — the UI drew the window as
[start, start+length), the engine read LENGTH as an absolute end frame.
invisible at the default 100%, but any moved START played something other than
what was on screen: START 50 + LENGTH 50 played an empty window instead of the
visible second half - mic recordings were 39 cents flat — the 3DS mic delivers 32728 Hz, the
engine plays 32000, and nothing resampled. every recording ever made was 2.3%
slow. now resampled on stop - long wavetable filenames never loaded — the scan buffer counted
.wav
against a 20-byte limit, leaving 15 characters of real name, so
AKWF_hvoice_0001.wavand friends were skipped. that is the dominant naming
convention for single-cycle packs, so the usual symptom was an empty list with
no explanation - wavetable slot order was not alphabetical, despite the header saying so —
it sorted a 32-entry window and took the first 16, so with more than 16 files
the surviving set depended on raw FAT order. since projects store the slot as
an index, a saved project could come back playing a different waveform - CHA FF skipped its guaranteed trigger once every 256 rolls (off-by-one on a
0..255 range) - a deep down-transpose under DLY jumped ten octaves up — the note wrapped
through unsigned before being clamped, so −1 became 255 became 127 - full-scale peaks read as silence on the meters — negating
INT16_MIN
wrapped back to itself - cross-core flags were
volatile, not atomic — no happens-before between
the UI on core 0 and the audio worker on core 1. also, a failed audio init
leaked everything it had already acquired - the in-app help page documenting the SD layout and export was invisible —
a page fits 18 lines before it hits the footer and that one had grown to 24, so
everything from "SD layout" down was drawn off-screen
song exports (#6)
exports were hardcoded to a single render.wav, so rendering a second project
silently destroyed the first, and there was no way to name the file — reported by
@francorv99.
exports now go to renders/ named after the current project, and an existing
take is never overwritten: repeat renders become NAME_01.wav, NAME_02.wav, …
so you can bounce a whole session before pulling the SD card. hold R in the
PROJECT view to rename, and the view shows the exact target
(SEL -> renders/NAME.wav) before you press SELECT. rename mode existed
already but nothing on screen advertised it, which is half of why this was
filed — there is a R=RENAME hint now.
tests
make tests builds and runs the host-side suite. six tests had no build rule at
all and were dead weight nobody ran. test_slice was worse than useless: it only
printed results and always claimed success, and it probed chop sensitivity on a
break with a silent floor where the setting cannot matter — 80, 150 and 220 all
produced byte-identical output, so that knob could have been completely broken
without anyone noticing. it asserts now, on material where sensitivity actually
does something.
note
the SD layout no longer has render.wav — it is renders/ now. no project or
sample data is affected; a leftover render.wav is simply unused and can be
deleted by hand.