The state saver (private/src/StateSaver.hpp) handles persistence of runtime control state to/from JSON.
StateSaver bridges live in-memory values and serialized patch/project state:
ToJSON)SetFromJSON)In TheNonagonSquiggleBoyInternal, it is saved and loaded alongside Nonagon and SquiggleBoy state.
SquiggleBoyConfigGrid also persists sample-source directory choices. It writes a sampleDirectoryRelative array with one relative path per voice; on restore, each non-empty path is resolved under the configured sample root and loaded asynchronously through IoTaskThread::PushLoadAudioBufferBankFromDirectory(...).
StateSaverTemp<NumScenes> stores compact per-scene snapshots for registered values:
1/2/4/8)This design keeps serialization generic while preserving exact typed values.
StateSaver works with scene logic so scene-specific values are retained: