Kenji's K5000 Message Board Digest - Overview K5000 Resources - Overview
```The Eat at Joe's Kawai K5000 Message Board Digest

------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

Wednesday, 24-Jun-98 22:57:26

209.160.126.27 writes:

I've been a additive synthesis devotee for several years now, and I'm always
looking for new info on creating sounds. Recently, I came across a couple of
formulas for calculating FM sidebands. I thought maybe I could adapt some DX7
patches to my K5 (don't own a K5k, wish I did) using these formulas.
After some trail and error, I had some success. I got out a book with some
DX7 patches in them and "adapted" an e. piano patch. After doing all the
number crunching, I set all the partials and envelopes and voila, it worked. I
don't know how to calculate the amplitudes of the individual partials, so I have
to make an educated guess.
Has anyone tried something similiar?

Leslie

------------------------------------------------------------------------------------------

Thursday, 25-Jun-98 04:33:48

194.172.230.108 writes:

Hi Leslie!
The K5000 should make a very good FM emulator!
In FM, the spectrum is highly dependent on both the carrier/modulator frequency
ratio and the amplitude (and, I think, the phase) of the modulator. Usually
the ratio is whole-numbered (or almost) and modulator gets an amplitude envelope.
With the individual harmonic envelopes of the K5000 it must be possible to emulate
almost all of the FM characteristics, with the K5 perhaps a part of them.
SoundDiver-K5000 (at least the German version) has a brief description of the
built-in resynthesis algorithm in its on-line help which is a very good starting
point. But you don't need the pitch tracking algorithm mentioned there for FM:
The fundamental frequency is simply the greatest common divisor of the
carrier and the modulator frequencies. Then try to do the same as SoundDiver.
(How to do an FFT? -> Search for comp.dsp FAQ!) If there is a small
offset in modulator frequency, it means the same as wiggling (rotating) its
phase. Take the two most characteristic (opposite) phases and loop their spectra!
Only if the frequency ratio is not whole-numbered, you'll have to use the K5000's
AM function to get those non-harmonic spectra.
I wish I had time to do all that, but I'll include it in my "cool ideas" list
for sure.
Maybe soon...
Greetings,

Jens Groh

------------------------------------------------------------------------------------------

Re: Re: FM to Additive Synthesis
Thursday, 25-Jun-98 11:52:59

192.28.2.16 writes:

But doesn't FM make overtones outside of the harmonic series?

leiter

------------------------------------------------------------------------------------------

Re: Re: Re: FM to Additive Synthesis
Thursday, 25-Jun-98 12:39:05

194.172.230.108 writes:

For rational-number ratios, I don't think so. But we should better verify that.
Who has an FM synth? It should be audible!
Unfortunately, the nice FM Java applet from HP doesn't show whether the spectral
lines are harmonics or not.

Jens Groh

------------------------------------------------------------------------------------------

Re: Re: Re: Re: FM to Additive Synthesis
Thursday, 25-Jun-98 14:35:43

209.160.126.99 writes:

For integers, the results are always harmonic. For example the ratio 1:3 would
produce the following spectra: 1,2,4,5,7,8,10,11, etc. The ratio 5:7
produces: 2,5,9,12,16,19, etc. These numbers all belong to the harmonic series.
However, for 5:7, since the 1 is missing,you could treate the 2 as the
fundamental lowering the keyboard an octave. You then have the spectra: 1, 2.5,
4.5,6,8,9.5, etc. The resulting sound is very much like a bell (remember
that Taco Bell comercial?). With most DX7 patches, you don't run into the problem
of inharmonic partials. With some patches, you will have a ratio of
something like 19.276:3. Usually, when I run across a ratio like that, I round
off the numbers, so it becomes 19. Fortunatly, most patches are not like that.

Leslie

------------------------------------------------------------------------------------------

Re: Re: Re: Re: Re: FM to Additive Synthesis
Friday, 26-Jun-98 02:22:27

209.160.126.153 writes:

Oh, by the way, I've written a Word doc describing step by step how I adapted
the DX7's e. piano patch for my K5. If you're interested, I can e-mail you a
copy.

Leslie

------------------------------------------------------------------------------------------

[editor's note:  the Word doc is available in the patch archive]

------------------------------------------------------------------------------------------

Re: Re: Re: Re: Re: FM to Additive Synthesis
Monday, 29-Jun-98 07:59:51

194.172.230.108 writes:

Do you / does anyone have any ideas how to model fed-back FM? It seems that
the results may be arbitrarily complex. A friend who owns a Yamaha
SY77 told me he even managed to synthesize deterministic chaos. He set the
carrier frequency to zero to have a pure sine function nonlinearity and realized
the necessary feedback delay with a lowpass filter. We cannot emulate that kind
of waveforms with the K5k - but maybe some more predictable ones.
Does the integer-ratio argument still apply for fed-back FM?

Jens Groh

------------------------------------------------------------------------------------------

Re: Re: Re: Re: Re: Re: FM to Additive Synthesis
Monday, 29-Jun-98 11:12:34

192.28.2.16 writes:

I can't think of any loops in the K5k structure, except the feedback loops in
the time-based effects.

One possibility would be to sample the output of the K5k back in through the
SoundDiver "Import" function, but that's not exactly real time.

leiter

------------------------------------------------------------------------------------------

Re: Re: Re: Re: Re: Re: FM to Additive Synthesis
Monday, 29-Jun-98 21:55:17

209.160.126.23 writes:

I know the DX7 uses high levels of feedback to introduce noise. At lower levels,
however, it just brightens the sound. A carrier feeding back into itself, with
no other modulators present, could be considered to have the ratio 1:1 (I recently
discovered that carrier is usually listed on the right with the modulators
following on the left). Assuming a low level of feedback, the carrier, at first,
would modulate itself producing harmonics 1,2,3,4, more or less. These would
each modulate themselves generating more harmonics. I tried this out with a
program called Acid Wave. It allows you to create sounds with FM synthesis.
You can also look at a frequency spectrum of the sound making it excellent for
studying samples of actual instruments as well. By continuing to raise the
feedback, I came up with something very close to a saw wave. So, to answere your
question, I think that below the point where carrier begins producing
noise the interger ratio argument still holds.

Leslie

------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

Sunday, 12-Jul-98 22:40:27

209.160.126.89 writes:

Since I've been using your equations, I have tried to think of a way to combine
them with what I know about calculating FM sidebands. This is what I've
come up with so far:

A(c+(m*n))=1/(c+(m*n))
A(abs(c-(m*n)))=1/(abs(c-(m*n)))

Where A is the amplitude, c is the carrier, m is the modulator, and n is the
number the modulator is multiplied by (n starts at 0 and increases by one each
time the equations are used). There is two formulas because FM always generates
sidebands in pairs. If you had the ratio 7:1, where 7 is the modulator and
1 is the carrier, you would get the following:

A(1)=127
A(6)=106
A(8)=103
A(13)=97
A(15)=95
A(20)=92
A(22)=91

This is like a saw with many of its harmonics missing. It sounds like a bell.
A ratio of 3:1 produces a hollow guitar like sound. Another variation of the
formula could be:

A(c+(m*n))=1/n
A(abs(c-(m*n)))=1/n

Here the carrier would be elimanated. A ratio of 2:5 might sound interesting.
What would really be cool would be a formula for calculating a ratio like
22:3:1. This would be kinda hard because each sideband generated by 22:3 would
become a modulator for 1.

These formulas are not meant to calculate the amplitudes of the harmonics as
they would be generated by FM, but rather make the FM spectra easier to
use.

Leslie

------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

FM revisited
Tuesday, 28-Jul-98 05:02:33

209.160.126.126 writes:

Two or three weeks ago, I posted some messages about converting sounds created with
FM to additive synthesis. I started out by taking some DX7 patches and tried to
adapt them to my K5 using some simple formulas. The biggest problem I had was that I
didn't have any way of calculating the amplitudes of the harmonics; I basically
had to make an educated guess. Well I've made some progress in that area. Using
some equations that are more complicated than I ever dreamed of getting in to, I
can now calculate what the amplitudes of the harmonics are suppose to be. I've
written a program for the Atari ST (which started out by using leiter's equations
to create sounds) which includes three (at this time) FM algorithms. The output of
the operators is scaled to match that of the DX7 so that when the modulation level
is set it is equivalent (theoretically) with that of the DX7. The algorithms aren't
nearly as complex as that of the DX7's, but I've generated some nice sounds
anyway. I can transmit results to my K5 when I'm done as well.

I would like to share the results of all this with the rest of you, but I doubt
if very many of you use an Atari. Also the program is written for the K5. If any
of you are writing something like this for the K5000 and would like some help,
let me know. I would love to help out if I could. I would probably get the better
part of the deal since I'm sure I would learn more from you guys than the other
way around :)

On a technical note, I understand the best way of doing FM to additive is to use
relatively simple formulas to calculate a FM waveform and do a Fourier transform
to get the harmonics. Unfortunately, I can't seem to grasp the equations to do
this (sorry Jens), so if any of you can explain it as simply as possible, I would
be greatful.

Leslie

------------------------------------------------------------------------------------------

Re: Fourier Transform
Wednesday, 29-Jul-98 14:21:02

209.160.126.97 writes:

I was wondering if the following formula is correct for calculating FM waveforms:

SIN(xt+m*SIN(yt))

Where xt is the carrier multiplied by time, m is the modulation index, and y is
the modulator multiplied by time.

If this is right, would the following represent a carrier being modulated by two
modulators "in-series"?

SIN(xt+my*SIN(yt+mz*SIN(zt)))

Where xt is the carrier, my is the modulation index for yt, yt is the first
modulator, mz is the modulation index for for zt, and zt is the second modulator.

If I can make this work, it would be a heck of a lot easier than dealing with
those Bessel functions. The number crunching involved in those really prevented
me from creating very complex algorithms. There doesn't seem to be much of a limit
with how complex the algorithms can be with this method. Maybe I can even figure
out how to include a feedback loop.

BTW, so far I've been able to do an Fourier analysis on a square wave and a saw
wave. So I am making progress. I've go a long way to go before I get this stuff
down, though.

Leslie

------------------------------------------------------------------------------------------

Re: Re: Fourier Transform
Thursday, 30-Jul-98 04:37:59

194.172.230.108 writes:

Let me repeat here what I wrote in an email to Leslie in order to let everyone
understand what algorithm he's about to try. I descibed a relatively simple, yet
exact algorithm to emulate FM by additive synthesis:

"It works for periodic signals, so the carrier/modulator ratio must be
whole-numbered. Then they have a common period. Divide this period into 256
sampling intervals and compute the FM signal's time function for each point:
x[i] = sin(2*pi*d*(i/256)*(1+m*sin(2*pi*n*(i/256)))) ; i = 0...255 ;
n/d = carrier/modulator ratio ; m = modulator amplitude. (I hope this is a
correct FM formula.) Then compute a 256-point real-valued FFT (Fast Fourier
Transform) to get the 128 spectral values. (Look for FFT code in any DSP FAQ
on the 'net or get info here:  http://nr.harvard.edu/nr/bookcpdf.html )
These values are complex numbers, thus real/imaginary number pairs. To get
the amplitude, compute squareroot(real^2+imag^2). Throw away the first value,
because its frequency is zero. (You may need to throw away the last harmonic
as well, because it has no phase information.) You're done! For 64 harmonics, you
need 128 rather than 256 time steps."

(Of course, any DFT (Discrete Fourier Transform) will do, not only the special
version called FFT.)

Jens Groh

------------------------------------------------------------------------------------------

Re: Re: Fourier Transform
Thursday, 30-Jul-98 04:55:08

194.172.230.108 writes:

No, SIN(xt+m*SIN(yt)) is phase modulation, not frequency modulation, but the
difference is tiny: SIN(xt+xt*m*SIN(yt)) is FM.  So your cascaded FM should be:
SIN(xt+xt*my*SIN(yt+yt*mz*SIN(zt))) .  Everyone agree?

Jens Groh

------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

```