Documentation
¶
Overview ¶
Package voiceunpack implements the fizzle voice unpack command. It extracts individual FZV voice files from an FZF full data dump.
It stands in for the on-device DIR / COPY workflow: on the sampler, recovering voices from a full dump means loading the dump, then picking each voice in the DIR menu and COPYing it back out, once per voice. Unpack parses the bank sector (or sectors, for multi-bank dumps), decodes each voice header in the voice area, slices its audio block out of the audio area, and writes one .fzv per voice with the audio offsets rewritten as if the voice had always been alone.
UnpackMultiDisk handles multi-disk dumps, stitching disk 2's audio continuation onto disk 1 before slicing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unpack ¶
Unpack reads the FZF full dump at fzfPath and writes one FZV file per voice into outputDir. Output files are named after the voice name embedded in each voice header, e.g. "HOOVER.fzv". If two voices share the same name a numeric suffix is appended. outputDir is created if it does not exist.
func UnpackBank ¶
UnpackBank reads the FZF full dump at fzfPath and writes only the voices the bank at bankIdx references through its `vp[]` array (0-based). Multi-bank dumps store one bank sector per bank, and each vp[] maps that bank's key-split positions to voice-slot indices. Those mappings can repeat (one voice covering several splits) and slot ranges can overlap across banks, so the legal voices for bankIdx are vp[0..bstep-1], not a sequential slice of the unpacked array.
Duplicates in vp[] emit a single voice; key-split sharing lives in the FZF, not at the file-extraction level.
func UnpackData ¶
UnpackData reads the FZF full dump at fzfPath and returns one FZV byte slice per voice paired with that voice's file-level slot index. The slot index is the position in the voice area (spec §2-1's `vp[]` target), which is what bank metadata is keyed on. NoSound placeholder slots are compacted out of the returned slice; the parallel slotIndices slice tells the caller which slot each emitted FZV belongs to so per-voice bank lookups stay aligned.
The slot indices are load-bearing: indexing bank arrays by the compacted position instead silently mismaps names, key ranges, and outputs whenever a dump opens with NoSound slots, as CASIO139.FZF does. sfzexport tracks the export side of the same defect as F6.
func UnpackDataFromBytes ¶
UnpackDataFromBytes is the in-memory twin of UnpackData. It takes a raw FZF byte slice and returns one FZV byte slice per voice plus the parallel file-level slot indices.
Audition paths use it to render the voice being edited without a disk round trip: edits land in model.(*Model).bytes, those bytes unpack here, and the resulting FZV goes to voiceextract.ExtractPlayback.
The address rewrite matches UnpackData's (see subtractSampleOffsets): wavst/waved/genst/gened become relative to the extracted voice's audio bytes rather than the combined wave area's.
func UnpackMultiDisk ¶
UnpackMultiDisk extracts voices from a 2-disk full dump. It reads voice headers from disk 1 and concatenates audio from both disks so that all voices (including those whose audio is on disk 2) are extracted with complete audio data.
Types ¶
This section is empty.