Old 08-07-2014, 03:23 PM   #1
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default Complex numbers for Sound Synthesis

I have just read http://www.verklagekasper.de/synths/...synthesis.html.
They show that it is possible to use complex numbers to optimize DSF synthesis.

So I ask myself, can complex numbers be used in other situations : filters, distortions, physical modelling...
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 08-07-2014, 04:30 PM   #2
Kihoalu
Human being with feelings
 
Join Date: Jan 2007
Location: Silicon Gulch
Posts: 544
Default

.

You are kidding right?!...

Complex numbers are ESSENTIAL for any kind of engineering (electronic, mechanical, magnetic, thermodynamic, nuclear, etc, etc.)

The most elegant equation in all of Mathematics is Euler's identity:

e^(i*pi) + 1 = 0 (e to the power of i times pi plus one = zero)

(i (sometimes j) is the imaginary operator of course, but is also has the transcendental numbers e and pi all in one little equation)

And this is directly related to Euler's formula:

e^(ix) = cos(x) + isin(x) - - (you should recognize this as a "phasor" described in the link you provided)

Why is this important? Well, in electronics it is a way to express both Amplitude and Phase of a Sine Wave with one complex number. And since ALL continuous waveforms can be formed as a sum of sine waves, it is an very necessary way to analyze and synthesize waveforms. All other forms of engineering use this essential tool in many other important ways.

The FFT and DFT would not be possible without Euler's formula, and without the FFT numerical audio compression (mp3) and video compression would not work either.

Keep up your reading... This is a very interesting subject which leads many places.

.
__________________
Inundated by a Perfect Storm of Gluten-Free Artisanal Bespoke Quinoa Avocado-Toast Toilet Paper.
Mahope Kakou (Later Dudes)...

Last edited by Kihoalu; 08-07-2014 at 04:44 PM.
Kihoalu is offline   Reply With Quote
Old 08-07-2014, 05:02 PM   #3
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

I am going to offer my two cents' worth.

The only time that I've come across complex numbers is when trying to accurately model capacitors and inductors in the digital realm. There are advantages and drawbacks to doing this, though, mainly that it would require an analog template to do so.

I am building a phaser plugin inspired by the sounds of the Small Stone phaser pedal used in Nirvana and Smashing Pumpkins songs. Love the sound. Okay, I could go in and try to accurately model the circuit path, with its multitude of tone caps and stages of op-amps, or I could try for an approximation and "get as close as I can". The first approach would require at least one matrix multiply per op-amp stage. The second approach would require no more than one (the canonical first-order digital allpass filter requires one multiply).

Do I attempt as much realism as possible, and include non-linearities, loading, tone controls, potentially even a noise model... or get as close as I can and incidentally retain the ability to radically alter the model if desired?

In my attempt to strike a balance between CPU-friendly code and a decent-sounding effect, I choose the latter. The case for a significant sonic improvement would have to be made to justify the significant increase in CPU consumption.

It should be noted that I'm interested in learning more, and the point made that I haven't studied the theory behind DFT, FFT, etc.
SaulT is offline   Reply With Quote
Old 08-07-2014, 05:17 PM   #4
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by Kihoalu View Post
.
[...]
You are kidding right?!...
[...]
I am aware of all that Kihoalu, Z transforms, Laplace and all the mathematical stuff.
But we do not use complex numbers in our processing, we use real numbers only.
We use complex numbers as a mathematical tool, to solve problems, and then we go back to real. We do not use them in our code. That's what i found interesting in this paper, they stay in the complex realm and take advantage of it.

BTW, all the pretty Z transforms and tools are limited to linear problems. As soon as there is fast modulation or discontinuity... things get complicated, especially if feedback is involved.

Imagine the complex one pole filter / complex multiplication, keep it in the complex form, no biquads, no reduction.

Now, let's play with it.

Let's have a phase rotation that is a non linear function of the modulus. How will this behave ?
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 08-09-2014, 02:37 AM   #5
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

As Kihoalu suggested I reread part of my classic DSP literature

As I stated, almost everywhere complex numbers are used only into the frequency domain (Fourier and friends...) but as soon as we go back to the time domain, we only use real numbers.

Complex numbers are not used very often in the time domain. But when they do they are "constrained" to analytic signals of real signals (for side-band elimination)...

So, I was not kidding that much

I think that complex (or even quaternions or multivariate) time domain signals can be an interesting track to follow for sound synthesis.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 08-09-2014, 06:24 AM   #6
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

I love it when nerds talk dirty.
IXix is offline   Reply With Quote
Old 08-09-2014, 09:42 AM   #7
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Quote:
Originally Posted by IXix View Post
I love it when nerds talk dirty.
Indeed! an interesting read!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-09-2014, 12:50 PM   #8
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

I'd like to add "Wave terrains" to the dirty words :P .

It's the 2D extension of wavetables where "trajectories" replace "phases"

Here is a thesis i just bumped into on the net... looks like crazy stuff, see the attractor p111...
http://ro.ecu.edu.au/cgi/viewcontent...context=theses

or this video:
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-12-2014 at 08:57 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-12-2014, 08:44 AM   #9
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default A chua oscillator JSFX

Here is a Chua oscillator JSFX, like its analog counterpart, it is purely experimental and chaotic.

Chua Oscillator JSFX

Trig 0 to retrigger the osc when it goes to saturation.
Trig 1 - 7 for "presets"

k can control the pitch
use the presets and the fine adjust sliders for fun.


Some wikipedia
http://en.wikipedia.org/wiki/Chua%27s_circuit
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-12-2014 at 08:50 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-12-2014, 09:08 AM   #10
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

Oooooo, that's filthy! I don't understand how it works but by golly it makes some uncompromising noises.
IXix is offline   Reply With Quote
Old 08-12-2014, 09:50 AM   #11
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by IXix View Post
Oooooo, that's filthy! I don't understand how it works but by golly it makes some uncompromising noises.
People still discover things about this simple oscillator. Nonlinearity and feedback are mindblowing to me.

64x upsampled to keep the analog touch. The downsampler is a simple averaging filter... i will improve that to have better high range frequencies...

To record its output i put a track to record mode and i add it as an input FX... I record a long session while playing with it.
Afterwards, i remove it from the input and i play with what i have recorded... slow flange and stereo delay for sort of "Forbidden planet" soundtrack on my laptop.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-12-2014 at 09:59 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-12-2014, 09:54 AM   #12
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

It's a bit of a CPU hog. Can it be optimised a bit? Please tell me you could make a synth out of it!

Ah 64x upsampled. That explains the CPU I guess!
IXix is offline   Reply With Quote
Old 08-12-2014, 10:11 AM   #13
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by IXix View Post
It's a bit of a CPU hog. Can it be optimised a bit? Please tell me you could make a synth out of it!

Ah 64x upsampled. That explains the CPU I guess!
Maybe you can edit the code and turn it down to 16 or so.

I only have my laptop for now, so no white and black keyboard.
It will be difficult to turn it into a "tuned" synthesizer because it is very sensitive to the parameters and nearly unpredictable... most of the time the oscillator goes out of control up to saturation without oscillation :/

Anyway, i like to add nonlinear feedback in synths. In the PMX, you have the delayed feedback that brings some chaotic behaviour to its oscillators.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 08-12-2014, 10:18 AM   #14
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

Quote:
Originally Posted by Smashed Transistors View Post
It will be difficult to turn it into a "tuned" synthesizer because it is very sensitive to the parameters and nearly unpredictable...
Yeah, I figured as much but I'm the optimistic type. Thanks for the fun toy anyway.
IXix is offline   Reply With Quote
Old 08-22-2014, 09:37 AM   #15
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Maybe we can build a sample bank.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 08-22-2014, 10:09 AM   #16
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

It's not really 64x oversampled. It's iterated recursively 64x and the outputs are averaged. That's not quite the same thing.
SaulT is offline   Reply With Quote
Old 08-22-2014, 12:58 PM   #17
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by SaulT View Post
It's not really 64x oversampled. It's iterated recursively 64x and the outputs are averaged. That's not quite the same thing.
Right, it is possible to use better integrators Runge Kutta for example.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 08-22-2014, 04:32 PM   #18
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

I see an issue here, and the reason why this isn't "upsampling." (only one variable is examined to try and keep it simple)

Code:
ax = 0;
...
loop(64,
f = b * x + 0.5 * (a - b ) * (abs(x + 1) - abs(x - 1)); 
  dx = k * alpha * (y - x - f);
  ...
  x += dx * dt;
  ...
  ax += x;
  ...
  x += (rand()-0.5)*0.00001*(xmax-xmin);
  );

ax *= 1/64;
So, here's the problem. ax collects the value of x, then divides by 64. This is the equivalent of averaging 64 samples, and isn't doing what you want. Let me give an example to explain.

If I take a sine oscillator, run it 64 times, then take the average of that output, can you see how the result won't track the output in a smooth fashion? Because the output would be so jerky, it would actually create discontinuities and aliasing. In fact, if your sample rate is 44.1 kHz and your frequency is exactly 689.0625 Hz, you'd get the same value each sample (one full cycle every 64 samples). Since you're resetting the averaging value each sample, it isn't a lowpass function, either - a lowpass function would need a continuous stream of samples.

My suggestion would be to run the oscillator only once per sample. If you want to incorporate a lowpass function of some kind, then use any one of the standards - biquad, state variable, FIR, single-pole, etc.

You're not processing the signal in any way, so there wouldn't be a benefit, or a real purpose, to oversampling.
SaulT is offline   Reply With Quote
Old 08-23-2014, 02:10 AM   #19
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

The k coeff controls the integration step so a small value and many steps works like upsampling... but more elaborate integration scheme exist... The averaging "box" filter freqeucy response is a sinc, it is not a perfect lowpass filter but it is not as bad as you think and very easy to code, but as I was too busy... sun bathing, swimming, night dancing... to add a decent downsampler (which coef are a sinc and freq reponse is a box). I ll do it when I ll be back to my desktop.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-27-2014 at 01:28 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-25-2014, 07:54 PM   #20
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

My quibble is your code is not a sinc filter because it isn't a running value - it is reset every sample. That's why I tried to point out that at srate/64 Hz, using this technique would give you the same value each sample using something like a sine oscillator.

Look, let me put it this way. Add the following line to the @slider section

Code:
slider22:0<0,1,1{off,on}>averaging
And replace the sample block with this

Code:
@sample
ax = 0;
ay = 0;
az = 0;
loop(64,
f = b * x + 0.5 * (a - b ) * (abs(x + 1) - abs(x - 1)); 
dx = k * alpha * (y - x - f);
dy = k * (x - y + z);
dz = k * (-beta * y - gamma * z);
x += dx * dt;
y += dy * dt;
z += dz * dt;
ax = x;          // simple assignment, not accumulation
ay = y;
az = z;
x += (rand()-0.5)*0.00001*(xmax-xmin);
//y+=(rand()-0.5)*0.00001*(ymax-ymin);
);
//ax *= 1/64;      // none of this
//ay*=1/64;
//az*=1/64;
x = min(80,max(-80,x));
y = min(80,max(-80,y));
z = min(80,max(-80,z));
xmax = max(ax,xmax);
xmin = min(ax,xmin);
ymax = max(ay,ymax);
ymin = min(ay,ymin);
zmax = max(az,zmax);
zmin = min(az,zmin);
ax= 2*(ax-xmin)/(xmax-xmin) -1;
ay= 2*(ay-ymin)/(ymax-ymin) -1;
az= 2*(az-zmin)/(zmax-zmin) -1;

sc > 40000 ?
  sc = 40000 :
( buf[sc] = ax;
  buf[sc+1] = ay;
  buf[sc+2] = az;
);
slider20 === 0 ? spl0 = ax : spl0 = ay;
slider21 === 0 ? spl1 = ax : spl1 = az;
sc += 3;

slider22 ? (                    
  ospl0 = spl0 = (ospl0 + spl0)/2;      // simple 2-point averaging
  ospl1 = spl1 = (ospl1 + spl1)/2;
  );
Now fire it up and listen to the difference between when you click the averaging on and off. That is the sound of a simple 2-point average, the same operation you'd find in something like a Karplus-Strong plucked string algorithm. If your averaging operation worked, the result would be even more pronounced.

Last edited by SaulT; 08-25-2014 at 08:12 PM.
SaulT is offline   Reply With Quote
Old 08-27-2014, 01:27 AM   #21
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by SaulT View Post
My quibble is your code is not a sinc filter because it isn't a running value - it is reset every sample.
[...]
If your averaging operation worked, the result would be even more pronounced.
Hello SaulT, thx for the feedback,
I've written this code to show that even a simple nonlinear system cannot be described by the usual DSP tools (Z transform, Laplace et al.) I didn't plan to make a decent implementation of it... just a raw one.

I use the average of the underlying 64 sub-samples that's why i reset it every sample. (While a decent downsampler would use "skirt samples" to get rid of the nasty sidelobes). Most of the time the signal is smooth and sine-like, but when it switches from one orbit to another there are some interesting chirps and clicks happening.

My code has many other flaws and it does not sound the same as the analog counterparts (see the youtube links i posted). I think that it lacks this "electric storm" sound. Sure, a better decimator would improve the result (i've written a lot of C code about them a long time ago... will dig this out sometime) but i think that the major flaw is the integration method.

I use simple (even if upsampled) Euler integrator/accumulators for the 3 variables and they act like a set of one pole filters (poles at DC). So the output is already oversmoothed by the integration method and the rendering of the "chirps'n'clicks" is not sharp enough.

Other integration methods for differential equations would give better results. I think that even the midpoint method would sound much better. (it predicts/approximates and uses the derivative half a step ahead.) Did you used such things in your Moog filter ?

will have a lot of fun things to try when i'll be back ... but now is beach time for me
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-27-2014 at 07:57 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-27-2014, 08:31 AM   #22
Sativa
Human being with feelings
 
Join Date: Aug 2014
Posts: 57
Default

Quote:
Originally Posted by Smashed Transistors View Post
I have just read http://www.verklagekasper.de/synths/...synthesis.html.
They show that it is possible to use complex numbers to optimize DSF synthesis.

So I ask myself, can complex numbers be used in other situations : filters, distortions, physical modelling...
Complex numbers are just real numbers with a special type of relationship between the real and imaginary part.

Anything that can be done with complex numbers can be done with real numbers. Some things are just easier with complex numbers because of the special property they have. It just makes things easier to write or conceptualize.
Sativa is offline   Reply With Quote
Old 08-28-2014, 04:31 AM   #23
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by Sativa View Post
Complex numbers are just real numbers with a special type of relationship between the real and imaginary part.

Anything that can be done with complex numbers can be done with real numbers. Some things are just easier with complex numbers because of the special property they have. It just makes things easier to write or conceptualize.
Sure, quaternions are also made of real numbers.
What i meant is that complex numbers - and more generally multivariate signals - are underused in the processing themselves.

For example a waveform synth would only have a single valued variable (phase) and a single valued output.

Very few systems are based on multivariate signals.

For instance, I think that waveterrain synthesis and effects can be very interesting to explore.

The Chua oscillator is another example. It is a very elementary example of a trivariate system... and yet it produces a wide variety of dirty signals and is difficult to comprehend.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-28-2014 at 05:07 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-28-2014, 04:34 AM   #24
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default RK4 and /2 decimator

Bad weather today, no beach for me ...
so i had time to improve the Chua oscillator

@IXix less CPU and an extended range for k (pitch parameter)
@SaulT a decent integrator and /2 decimator

Chua Osc with RK4 integrator and a decent /2 decimator.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 08-28-2014 at 05:04 AM.
Smashed Transistors is offline   Reply With Quote
Old 08-28-2014, 12:40 PM   #25
Sativa
Human being with feelings
 
Join Date: Aug 2014
Posts: 57
Default

Quote:
Originally Posted by Smashed Transistors View Post
Sure, quaternions are also made of real numbers.
What i meant is that complex numbers - and more generally multivariate signals - are underused in the processing themselves.

For example a waveform synth would only have a single valued variable (phase) and a single valued output.

Very few systems are based on multivariate signals.

For instance, I think that waveterrain synthesis and effects can be very interesting to explore.

The Chua oscillator is another example. It is a very elementary example of a trivariate system... and yet it produces a wide variety of dirty signals and is difficult to comprehend.
I don't see it as a big issue. Additive synthesis can produce a wide range of effects. By using "textures"(sounds) that drive the synthesis you can get all kinds of "dirty" sounds. While such non-linear effects may be more interesting in some cases, it usually is not enough to warrant the dramatically increased computation complexity.

People are used to hearing sound in a specific way. As their ears develop and technology advances, new sounds will emerge if they are meaningful.

For example, maybe you can use the chua attractor to encode audio signals more efficiently, I doubt this is the case though. Who knows until someone tries?

Try this: Make a milkdrop for audio. Instead of fancy graphics, it creates "fancy sounds"... I doubt anyone would appreciate it though. The ear isn't as forgiving as the eye. It maybe due to vision being in 3D and sound in 1D... Vision has much more information in it that must be disregarded by the brain. There are way more optical illusions than aural illusions.

Again, only time will tell. Do what you do... I hope produces something amazing! My only point was that complex numbers, and most numbering systems are really just the counting numbers in disguise. (real numbers are rational numbers + their closure, rationals are just pairs of integers, integers are just natural numbers, and natural numbers are the result of a recursive generator)

The real question is, can the Chua attractor fit inside the Sierpinski carpet??

And what happens when you drive the Sierpinski triangle with the Chua attractor? Does it visit all points in the triangle?

So many questions... so little time!!
Sativa is offline   Reply With Quote
Old 08-28-2014, 04:10 PM   #26
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Hello Sativa,

in fact, I think that the evolution of synthesizers took a break the last two decades... today, it is going backwards. Korg resurrects the MS20 and maybe the Odyssey... Cannot they create something new ?

20 years ago they still dared to develop new synth schemes, see Yamaha and the FS1R or their VL "physical modelling" synths... maybe the last "original" hardware synths.

Even researchers do not venture much on uncharted territory... phD students "mentors" are not adventurous people and they need papers to be published for their careers (been there years ago).

Some software synths are quite nice and some have some personality but most of them mimic the sounds of the analog era. That's sort of sad.

I think it is neither presumptuous nor naive to experiment things that are off the limits of the classical DSP books.

JSFX offers a nice platform for experiments - even if not always CPU efficient.

Let the manifold unfold.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 09-15-2014, 03:09 PM   #27
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default First experiments non linear complex "filter"

Hello,

here are my first experiments with non linear "filters" that use complex numbers.

You can use the ReaSynth Vsti to drive this one with simple waves such as a good old square or sine wave.

The algo consists in a complex valued ringing filter.
Basically, it is a complex number that is multiplied by a rotation complex number. The "rotation" complex number is driven by the pitch sliders and by the internal value (real part)...

for instance, the internal rotation can be faster for the negative part of a signal than for its positive part. It leads to asymetric "ringing" waves, sort of pulses... so it will add harmonics (try with a sinewave).

Everything is modulated by a lfo.
So you have 4 pitches to set.

one for lfo down and signal down
one for lfo up and signal down
one for lfo down and signal up
one for lfo up and signal up.

if you set everything to the same value, you've got a regular ringing filter.

You can also tweek the code and comment the aProc and uncomment aProc2... which use a couple of those... as they are coupled they exhibit some... ahem... chaotic personality.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 01-28-2015 at 02:17 PM.
Smashed Transistors is offline   Reply With Quote
Old 09-16-2014, 10:05 AM   #28
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Thanks Veto,

I've done some research about related topics. The only related work i found is
http://smcnetwork.org/system/files/D...%20filters.pdf
They use complex resonators for FM.

Here is a presentation by Max Mathews https://ccrma.stanford.edu/events/cc...d-musical-uses that shows how complex valued filters differs from their biquad counterparts.


Let's say that what i do is more like phase distorsion.

I think that i will eventually integrate it in a synth with the same kind of control as the PMX synth.

I will do some more experiments, with more elaborated "phase" distorsions and combinations (parallel, series, coupled).
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 09-16-2014 at 11:35 AM.
Smashed Transistors is offline   Reply With Quote
Old 09-16-2014, 10:07 AM   #29
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Here is a pdf schematic that will help to understand it.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 01-28-2015 at 02:17 PM.
Smashed Transistors is offline   Reply With Quote
Old 09-16-2014, 01:32 PM   #30
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Here is a soundcloud track, it is a sine wave processed by 4 CXF in series...
just added compression/limitation, no reverb, no delay.

https://soundcloud.com/thierry-roche.../jsfx-test-cxf
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 09-16-2014, 01:38 PM   #31
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

Ooooooooh! Very interesting!
IXix is offline   Reply With Quote
Old 09-17-2014, 11:14 AM   #32
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

It will take me some time to make something that can be used as a synth engine. I have some amplitude/gain issues amongst others.
Thks for the support
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 09-17-2014, 01:01 PM   #33
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Quote:
They use complex resonators for FM.
And with that simple phrase I started looking at what exactly is meant by a complex resonator, came across this website ( http://www.katjaas.nl/complexintegra...resonator.html ), and something started clicking. This is fascinating stuff.... thank you for provoking my interest.

Quote:
I have some amplitude/gain issues amongst others.
Have you thought about using RMS gain compensation? E.g. determine what your level should be, track the oscillator output with an RMS detector, and based on the difference determine gain compensation every few ms (i.e. multiply by osc_output_rms/target_level)?
SaulT is offline   Reply With Quote
Old 09-17-2014, 03:21 PM   #34
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

IThanks for the link. I think I found a solution to my issue. As I modulate/distort phases only, the signal is mostly analytic, so I can use invsqrt(re2 + im2) to normalise it.. eventualy I will feed the non linear filter with a sine/cosine oscillator so that signals will be analytic all the way...
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 09-20-2014, 01:12 AM   #35
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default A mono synth

hi,

Here is an experimental synth that uses a non linear filter (the non linearities are controlled by 8 sliders) driven by a sine wave.

The filter "cutoff" is controled by the ADSR (the range of the cutoff is set by a pair of sliders).

https://stash.reaper.fm/21846/TiaR_CXF_synth_01.zip
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 09-21-2014, 10:17 AM   #36
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

Thanks. Not quite as dirty and eccentric as I expected but I've not had chance to explore very far. Maybe I'll find more dirt as I dig deeper...
IXix is offline   Reply With Quote
Old 09-21-2014, 02:38 PM   #37
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Quote:
Originally Posted by IXix View Post
Thanks. Not quite as dirty and eccentric as I expected but I've not had chance to explore very far. Maybe I'll find more dirt as I dig deeper...
Hi IXix,
It is a simple version of what i intend to do. At the moment, i manage to get rid of the dirt i don't want : digital aliasing.

Afterwards, i'll get thing richer:
- by adding a detuned oscillator one octave above
- feedback
- feedback though tuned delay lines (sort of physical modeling)
- multiple units (series/parallel/coupled).
...

but first of all, i want to control aliasing.
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Old 09-22-2014, 01:29 PM   #38
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

Quote:
Originally Posted by Smashed Transistors View Post
- a detuned oscillator one octave above
- feedback
- feedback though tuned delay lines (sort of physical modeling)
- multiple units (series/parallel/coupled).
I like the sound of that!
IXix is offline   Reply With Quote
Old 09-23-2014, 10:58 AM   #39
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

Hi IXix & SaulT,

I'm exploring the self modulation techniques. I think that complex resonators can be used in many other ways. For example as a complement to a low pass filter (adding resonance without stability issues).

I'm not sure the synth i'm building will generate "dirty" sounds. At the moment, i get extreme resonance and sync sounds, and i like that! I don't have much aliasing and no stability issues even with high Qs.

Here is the last revision:cXf synth 02
~1% CPU on Intel i5-4440
2 x ADSR
- presets (one slider/selector per ADSR)
- velocity and expression sensitive
- separate ADSR for cXFilter Pitch offset

Oscillators
- cos/sin quadrature oscillators
- secondary osc
- transpose -24 +24 semitones (over or sub tone)
- "fine" detune
- crossfade controled by modwheel

cXFilter:
- Complex valued resonator
- complex input (should be analytic)
- complex analytic state
- real and imaginary part
can be converted to
- instantaneous phase (fast diamond angle or atan2)
- instantaneous amplitude (useful for normalisation)
- stability
- modulation robustness
- Nonlinear audiorate modulations
- Based on input and internal state
- Four point control (diamond angle)
- Forward pitch modulation (based on input signal)
- FedBack pitch modulation (based on internal state)
- Forward res modulation & "sync"
- internal LPF on pitch modulation (anti aliasing)
- output normalisation (inverse of instaneous amplitude)

Oscilloscope:
- helps sound design
- automatic sync & gain
- one sample per pixel
- graphic antialiased
- freeze on mouse click
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...

Last edited by Smashed Transistors; 09-23-2014 at 01:29 PM.
Smashed Transistors is offline   Reply With Quote
Old 09-24-2014, 01:14 PM   #40
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

You sir, are a genius. Although I'm no synthesis connoisseur, I feel that this thing sounds very good (and there's dirt to be had too!). Please tell me you can make it polyphonic!

Oh and I LOVE the built in oscilloscope!
IXix is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.