Crash-tan
1.50.2 Patch Release
Crash BASIC 1.50.2 Release Notes
written by Crash-tan
BIG SONGS LOAD FASTER
If you've ever handed Crash BASIC a big, busy piece of music — a dozen tracks, FM instruments, a couple of minutes long — and watched the game hitch when it loaded, this one's for you. That hitch is gone-er.
Here's what was happening under the hood. Before your song can play, Crash BASIC renders the whole thing to audio ahead of time — every note, every voice, sample by sample. For the punchy FM instruments (the ones with that classic synth-brass and slap-bass bite), rendering each voice meant scratching out a little temporary workspace for every single sample. At the audio quality we render, that's forty-four thousand times a second, per voice, across the length of the song. On a heavy multi-track piece that adds up to hundreds of millions of tiny bookkeeping steps that had nothing to do with the music itself — pure overhead, and in the browser it's the slowest kind of overhead there is.
The fix
Every FM voice now works out its layout once, when the instrument is set up, and reuses that same workspace for the entire note instead of building a fresh one each sample. The wiring between operators — which layer feeds which — is figured out ahead of time too, rather than being untangled from scratch on every sample. Same synthesis, same signal path, the exact same audio down to the last sample; it just stops doing the busywork.
The result is that heavy, FM-heavy, multi-track songs render substantially faster — the fuller and more layered the piece, the more it helps. A simple two-track chiptune tune was never the problem and won't sound or load any different; it's the big arrangements that get their time back.
Nothing to change in your code, and nothing changes about how anything sounds. Your songs are bit-for-bit identical — they just get to the speaker sooner.