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.

Wednesday, December 25, 2019

Waveform/wavetable oscillators

Wow, it's been a while since I've posted anything. But christmas is here, I'm back at my in-laws and the creative juices are flowing once again ;)

This morning I started out searching for drum machine roms - more specifically for the Linn drum machines, but extended to the DMX/DX, Sequential Circuits Drumtraks and finally the sample roms for the 909.

I found most at http://www.electrongate.com/dmxfiles/index.html - and the Linn drum ones can be found using the wayback machine and searching for electrongate, they have been removed from the Electrongate site for copyright reasons. The 909 roms can be found as 8-bit wav files at http://www.colinfraser.com/tr909/my909.htm (they are shifted by two bits to get 8 bits, the two lowest bits are not used). The original 6 bit hex files can be found at https://nuxx.net/wiki/9090

But having found these, I started wondering if I could find more famous and useful roms. I remembered searching for the PPG Wave waveforms many years ago. I can't remember if I actually found them, but this time around it was near impossible. I did find some stuff but it's for the Waveterm and probably not the original waves.

I did however realise that it is hard to search for something without knowing the proper terms. After a while I found a post where someone were looking for the same thing, so here are some useful terms:

- Waveform

By definition "a curve showing the shape of a wave at a given time."

- Single cycle waveforms

This is as the name suggests, one cycle of a (complex) waveform. For a sine wave it would be one top and one bottom. By searching for this I found Adventurekid (https://www.adventurekid.se/akrt/waveforms/) which has a ton of waveforms.

- Wavetable

Now, this is where it gets confusing. There are various definitions, but a good one seems to be:
A table of (single cycle) waveforms. Often, these are varied over a wavetable, and moving/interpolating between them changes the timbre of a tone.

- Table-lookup

As in 'table-lookup oscillator', using part of a wavetable as the source of an oscillator

See here for a full explanation: https://en.wikipedia.org/wiki/Wavetable_synthesis

Here is a threat about interpolation on the PPG Wave and its successors: https://www.gearslutz.com/board/electronic-music-instruments-and-electronic-music-production/1273412-ppg-wave-doest-interpolate-between-single-cycles.html

A great resource for all things PPG: http://www.ppg.synth.net/waveterm/wt_lib.shtml

...and the waveterm: https://www.hermannseib.com/waveterm/history.shtml

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

and about finding the single cycle wavs: https://www.kvraudio.com/forum/viewtopic.php?t=256143

More about the waveforms: https://www.kvraudio.com/forum/viewtopic.php?t=135120


For a nice article, check this out: http://www.muzines.co.uk/articles/a-deeper-wave/1042