Experimenting with mixed PM/AM synthesis


#1

Recently i've been working on a hybrid synthesis method (that's based on pm and am synthesis)
To keep things short, an "operator" is composed of two sine oscillators, the carrier and the modulator.
Instead of using the modulator osc to directly pm the carrier, i multiply it by the previous operator output.

With this topology you can produce both a square wave and a saw wave (well, sort of):
square wave
saw wave
You can hear it implemented in my sptnk/osc/multi object, that morphs between square and saw.
What's interesting is that you can easily bandlimit the output by just tweaking parameters. The s-rate code is really light (like ~300 cycles per object) and sounds quite warm to me.
The only downside is that the output is not really bright as a traditional blit oscillator, and the way i implemented produces some instabilities with intermediate shapes.

I tried to generalize the topology with this formula: (y[t] is the current output and y[t-1] is the previous output)

 y[t] = sin(p + F*y[t-1] + sin(p*C+D)*(A*y[t-1] + B))

(this way i can implement both straight phase modulation and self phase modulation (other than the hybrid modulation method)
p is the phase of the carrier oscillator
The phase of the modulator osc is given by p*C +D (that allows me to have a consistent phase relationship between mod and carrier)
A, B and F are modulation indices that let me mix (in this order order) the amplitude modulated feedback, the modulator and the straight feedback.

My plan was to find coefficients to fake several waveforms (for example pulse width modulation) and make an ultralight bass oscillator, just wanted to share these ideas with the community


#2

Some updates on the oscillator: i implemented some really cool code in octave (which is the poor man's matlab) that allows me to generate a bunch of random parameters for the object, test the formula and confront the spectrum of the generated wave with the spectrum of the wave i want to replicate.
These are some waves i generated (1000 tentatives per wave, but i can push it easily to 10000 or more since the code is so good and efficient (edit: actually it seems i can't go much further than 10000 since octave runs out of memory :laughing: )):
50% pulse width


40% pulse width

30% pulse width

20% pulse width

10% pulse width

My next plan is to generate a bunch of coefficients, filter the best ones and make some polynomial fitting to morph between waves :slight_smile:


#3

PW fatness test part 2
I have run the code for one hour, doing 98 tests (10000x4 coefficients generated per test, starting from pw = 0.5 with bounded parameters)
.

Audio is still generated from octave, you'll have to wait until this weekend before i can drop an actual test. However it sounds quite ok to me


#4

Great experiments @Sputnki :smiley:

maybe you can have a look to this paper, it shows how to use Genetic Algorithms to match synthesis parameters with a reference model.


#5

Experimental failure: the coefficients i generated with such fatigue did not work in axoloti world, for unknown reasons.
So, i took on the good old heuristic approach and realized this:

First a real pwm wave, then my pwm wave, then the two waves played together, with center panning, then the two waves panned left-right (you can easily guess which one is the fake pw)

Tell you, it does not sound like the wave i generated in octave, not even close. But at least now i have a tidy workspace to do my experiments on.


#6

Hi @Sputnki,

How did you do the feedback ?
If you used existing objects, you may be aware of the implicit 16 sample delay.

I think that if you want a 1 sample delay feedback you will have to code a specific object.


#7

1 sample delay feedback, without any filtering. Everything done in fixed point math. I'm pretty sure there's nothing wrong with the code, i believe the problem arises from my coefficient testing technique in octave (computing 1024 samples -> fft -> taking the absolute value -> evaluating the difference with a non bandlimited pw)


#8

Perhaps a normalising coefficient in the phase modulation index, a 2π or something like that ?


#9

Already taken into account..


#10

Hm, I do not get the full math but hopefully you are also interested in some more general remarks.

1 - That the sounds tend to be less bright seems to be logical since those first waveforms had relatively gentle edges. If you want bright overtones you need harde edges, like clipping a low frequency guitar signal through a preamp brings extra overtones. But I gues you already knew that.

2 - I love the concept but would like to hear what more esoteric waveshapes sound like. Will such sounds for instance differ substantially from normal FM. For simply recreating existing "analog" waveshapes this must surely be a bit over the top. Or am I simply too impatient and is that something you want to do as a next phase?

Marc


#11

At first i wanted to see if i could estabilish a nice procedure to generate coefficients, and i believe there's no better way to do it than on test signals that are easy to generate and with very specific timbral properties (like pulse waves, triangles and sawteeths).
The problem is that i don't have an academic knowledge in dsp and i have very little spare time (i'm currently rushing to get a degree in a totally different subject :grin:)
I promise i'll produce something, sometime!
One thing i would like to try is to generate "resonant" waves, kinda like a sawtooth filtered through a lowpass filter with cranked resonance, but without the filter.


#12

Yep, that is a very good argument. If one wants to get a clear picture of the specific behaviour staying close to classic waveforms certainly makes sense. The mad musician in me however always immediately wants to go for weirdest possible sound. :star_struck: :man_mechanic:

I wish you success with getting that degree. Priorities are priorities after all. Do however please keep us posted about any future developments.