Bug: Loop information in WAV files wrongly parsed (workaround found)

Official support for: kv331audio.com
Post Reply New Topic
RELATED
PRODUCTS

Post

- Reproduction -

Use a SFZ file to wrap a (looped) WAV file like this:

Code: Select all

<region>
sample=Harp D50.wav
pitch_keycenter=C5
Do not add loop information into the SFZ file in order to ensure that SynthMaster will try to parse the smpl chunk.
The WAV file must contain a LIST - INFO -chunk before the smpl chunk that contains the loop information.

- Expected Result -

The wave should play looped as defined in the meta data.

- Actual Results (varying) -

a) The wave is playing but without loop

b) The wave is playing repeatedly at a fixed "tempo" that depends on the quality setting of the engine (the higher the faster).

c) The wave isn't playing at all.

- Workaround -

After hours of doing research, I could track down the problem to be the presence of INFO (or other) chunks before the smpl chunk.

Act of "repairing" the WAV file:

I identified the chunks using the tool "RiffPad" (http://www.menasoft.com/blog/?p=34).
I removed the chunks with "HxD" hex editor (https://www.mh-nexus.de/en/hxd/) and corrected the length information in the header.
Another approach is to open the WAV in a Sound Editor, save it completely without meta data (you lose the loop information), reopen it, rebuild the loop, save it again with (minimal) meta information.

- Implementation Suggestion -

When parsing the WAV file and reading the chunks do not recurse. Skip all uninteresting chunks at the top level until you reach the smpl chunk. The you'd be more robust against slightly corrupted length information in sub chunks.

I have to say that all other musical software products I use have no problems with such files, SynthMaster is the only one which is very sensitive about the anatomy of a WAV file.

Additionally, it (sometimes) seems to be not possible to override the WAV-internal loop information by providing the info in the SFZ file.

Post Reply

Return to “KV331 Audio”