Kawai K1: Why I recorded all waveforms again

While the waveform pack by Chvad was pretty good to have something to start with, I had some issues, both for the PCM based waveforms and the single cycle waveforms.

PCM waveforms

Chvad sampled the waveforms at note number D4, which sounds good when being played back in a wave player, but the problem it causes is that you lose a lot of the high frequency spectrum when being played on lower midi notes.
Secondly, there is no chance to filter any noise that is emitted by the K1.

Therefore, I decided to sample the PCM waveforms on note D1 instead.

Recording was pretty straightforward, I played the same midi note over and over again and selected the different waveforms inbetween my note pressed. The result looked like this:

PCM waves 205-256 recorded at midi note D1

To make my life a little easier, I wrote a tool to help extracting single files out of this big recording.
What the tool does is, firstly, it detects blocks of silence and audible data. What I use this for is to know when a new waveform starts. This gives a total amount of 52 blocks of audio data, with silence in between them, which matches the PCM waveforms 205-256.
Secondly, as there are waveforms that need to be looped during playback, I created code to detect them. My tool can read wave markers and work on loops according to these markers. There are two types of loops that I need to support:

  • Loops that I define manually with a specified start and end point
  • Loops where I only define a region where a loop is, together with a maximum length. The loop start and end is then detected automatically
A loop that I define manually
A loop that is auto-detected

After I had defined all required markers, the whole file looked like this:

All PCMs with loop markers

After executing my tool, the output was a nice list of loopable PCM waveforms that were ready to be used in my K1 emulation VSTi

Single Cycle Waveforms

What always made me wondering is the fact that the single Visitors appears to have some sine wave sound, whose pitch is modified by the LFO, but when inspecting how the single is made, you’ll notice that there is no sine wave selected as a source at all. The waveform that is driven by the LFO is wave 204, which sounds quite different and looks like this:

It is not a sine wave at all, it sounds more like some synthesized waveform, frankly, the K1 manual names this waveform SYNTH_01

While testing something else on the real K1, I noticed something strange. I pressed a note and modified the coarse tune while holding the note down. When I released the note and retriggered it, the sound was different! I tested this a couple of times and every time, the sound was different after retriggering when I modified the coarse tune while holding a note.

I had an idea what that means and after doing a test recording of a waveform for all notes, ranging from 0 to 127 I had the proof: Single cycle waveforms are multisamples!

Waveform 19 (SAW) from note 0 to note 127

If you take a closer look at the image, especially at the frequency spectrum in the lower part, you’ll see that some harmonics get lost as the note number is rising.

That explained a lot. No wonder that I never had that original K1 sound. As the recordings by Chvad were only one version of each waveform, I had to record every single cycle waveform again, but this time for each note number.

It took a lot of hours to get this done but it was definitely worth it. I’ve setup a simple track in Cubase to play all notes from 0 to 127 and recorded all 204 single cycle waveforms.
It turned out that not every waveform contains multisamples. And for some of them, the way they use them is really strange. Usually, if you do this, you cut harmonics before they reach the nyquist frequency to prevent aliasing. But in the case of the K1, this is not (properly) done. Some multisamples clearly change the tone when you play on the keyboard, for others, they even make it worse by adding harmonics instead of removing them, which increases the aliasing even more.
Some examples:

Waveform 8 (Sine variant), no multisamples, large aliasing issue on higher notes.
Waveform 14 (Saw variant), highest overtones are dropped too early, making it sound dull
Waveform 37 (Square variant), no multisamples and huge aliasing
Waveform 94 (piano / electric piano), a new subharmonic is added
Waveform 98 (piano, electric piano), highest harmonics are increased in volume just before nyquist, increasing aliasing even more

As you can see, there are a lot of variantions. If you want an exact recreation, you need to take all different multisamples into account.

Single Cycle Waveforms conversion tool

Once more, I extended my tool to deal with these recordings. I manually added markers to the notes that I want to extract. You can see the markers in the screenshots above. My tool uses these markers to extract loops of the waveforms at their respective positions and exports to single files.

Notice the note numbers on the left. The tool names these markers to make sure that the root note of the loop is known, so the playback is done at the correct pitch.

After all 204 files are created, they are merged into a single file, which allows me to load them more easily. The result is a 1,66 MB wave file with over 500 markers in total, named as wave120_note84, etc.

The sound has improved a lot, in many areas, its very similar to a K1 now, just as it should.
What I didn’t do yet, as it is a lot of manual work, is to clean up the recordings a bit. There is a bit of K1 noise that could be easily filtered out, but it would need to be a manual process for each waveform and for each multisample, as the used frequencies are different for each one, leading to over 500 manual tweaks.

Another minor thing is that, although the original K1 wave rom consisted only of 512kb of data, my data size is about 24mb in total as I have every waveform as 32 bits floating point data. It is not much nowadays for a plugin to be that large, but an optimization would be nice.

7 Gedanken zu „Kawai K1: Why I recorded all waveforms again“

  1. Quite clean work.
    That the single cycle is partly multisamples is astonishing.
    I would have loved to be there.
    Do you still need sounds?
    I created several songs here completely with K1 (without effects).
    Years ago I noticed that the random sequence was different from one to the other K1, did you ever notice that? Maybe it was just the firmware.
    It remains exciting, I’m curious about the GUI (please no 3d)

    1. Interesting thought. I compared the random pattern of the LFO of my K1m to an LFO recording that I’ve found somewhere online and the pattern was identical.

      At the moment, my emulation still uses true random values but I’m going to add the random pattern of my K1m instead. But its very likely that a firmware update could result in different random patterns.

      As for sounds, for the moment I have plenty of them. I still need to test your AM sound, thanks a lot for sharing!

    2. GUI might be problematic, I’m very bad at UI stuff. I recently started to create a mockup, but its far from being finished. The lower section will be quite different as I want to be able to edit everything at once (the original K1m edit menus are terrible in my opinion):


  2. Hi Nils,
    you have made a great job, and I know too well the amount of work behind it… 6 years ago, I did exactly the same job for the Kawai K1, the Korg DW8000 and the Technics SX-AX7 synths, as I work on a project to emulate the sound engines of these machines in a FPGA (in other terms, I worked on emulating the KTG-001 chip in an FPGA)
    By the way, so bad I did not know that you were working on that project before, I would have shared my work with you, that would have helped you a lot.

    Just a small comment about what you way for Wave8 (8x sine variant). In fact, IT IS multisample, but the 12 first waves are coded in the exact same way in the Wave ROM. Since they only contain one harmonic (wave 1 is fundamental, wave 2 is harmonic 2 (so 2x base frequency), wave 3 is harmonic 3 (3x base frequency), they are perfect sine and look exacly the same for the five sub waves.
    The KTG-001 chip works in a quite simple way (KTG means Kawai Tone Generator, it is the ASIC reading the Wave ROM and driving the DAC output converter through a synchronous serial link). In this chip, there is 32 „slots“, each of them acting exactly the same and producing one wave, all of them being mixed with a digital adder at the end of the macro-cycle (there is one macro cycle every 20us, so each basic cycle in the KTG-001 takes 625ns to produce one sample for one oscillator)
    For each oscillator, the uPD78301 processor initializes a set of registers giving the base address of the looped wave in the ROM. I disassembled the uPD78301 code and I found that, whatever the wave number, the processor only checks the MIDI note number and loads the register with an address with offset 0, 128, 256, 384 or 512 depending on the MIDI note number.
    Back to wave 8, what happens is that the memory content is the same for the 5 samples. This wave is a 8x sine, so it’s like the KTG uses a phase increment of 8 each time the macrocycle is executed. The problem is that the KTG-001 also uses increments larger than 1.0 (increments are coded as fixed-point values in the KTG-001), so it plays the wave at 16 or even 24x the fundamental frequency for some notes!
    And as waves are coded on 256 samples whatever the note, playing this wave on the upper part of keyboard gives a resulting wave being much, much over the Nyquist frequency 🙂

  3. I wonder if emulating these chips on cpu is by far better than putting waveforms together with some kind of similar sounding filters/eg’s. No need for fpga or any complex hardware to do this. I think these kind of projects are the future, because they’re conserving that part of history in a library-style manner.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert