Saturday, December 28, 2019

Blofeld waveforms

I tried for a day or two to decode the PPG wave tape format, in hopes of seeing the original single cycle waveforms in there somewhere. I did get some traction on decoding the tape format itself, but never enough to find the waveforms.

Enter this:
http://synth.stromeko.net/Downloads.html

On this page it is possible to download the Blofeld User Wavetables. They are said to contain  among other things the ROM waves of the Prophet VS, MicroWave and SQ80. Only problem is, the site had them as a Blofeld sysex midi file only.

I couldn't find any sysex reader, but I found the next best thing, a project that converts wave files to Blofeld sysex files: https://github.com/alvare/wave2blofeld

Reversing the process, with some trial and error, and voilá - I now have a raw PCM file containing the waveforms in 16 bit signed little-endian single channel.

There are some issues though:
- In the original mid file there are some discontinuities, places where I would expect to find a sample at positive max, but instead find one at negative max. I suspect this is due to a rounding error when the mid file was created?
- Even after correcting for max-errors, there still seem to be places with error, but where the peaks are not completely at max.
- All samples are 21 bit in the midi file. I have truncated them to 16bit but as there is data in the  lower 5 bytes, we lose some precision.
- Some of the wavetables have very low amplitude, I suspect these could be doubled.
- Each sysex block has two more bytes right after the initial 0x70 than what is written by the wave2blofeld.

In general, the format is fairly easy. Each wave has its own sysex block. These start with:

[  0]: 0xF0[  1]: 0x83[  2]: 0x19[  3]: 0x3e[  4]: 0x13[  5]: 0x00[  6]: 0x12[  7]: wavetable num[  8]: wave num[  9]: 0x00

Wave data starts at byte 11. Each sample is three bytes long and the original 21bit sample can be


Wave data starts at byte 11. A wave is 128 samples long. Each sample is three bytes long and the original 21 bit sample can be recovered as

sample = (block[i] << 14) + (block[i + 1] << 7) + (block[i + 2])

To convert to a 16 bit value, simply shift right 5. ( >> 5). PS: Data is stored as 21 bit signed.

The wavetable name is found at block length - 18, and is 14 bytes long. Standard ASCII values are used.

The four last bytes are

[408]: 0x00[409]: 0x00[410]: checksum
[411]: 0xF7

Each wavetable consists of 64 waves and each wave is 128 bytes long.

PS: There is data between sysex blocks as well. If decoded, it reads something along the lines of 'Blofeld UserWT', and before each wave it says 'UWTxx wave yy' where xx is the wavetable position and yy is the wave number. I have not cared to look closer into this as it is unimportant for the waves.

No comments:

Post a Comment