Oscillator, about wavetable size and interpolation
-
- KVRist
- 361 posts since 6 Feb, 2003 from UK
Hi there
AM is interesting , I'll have to have a look into it
Cheers
Jon
AM is interesting , I'll have to have a look into it
Cheers
Jon
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
Just listened, I think they sound and look OK.
I think i'll experiment with it.
Thanks,
A.F.
I think i'll experiment with it.
Thanks,
A.F.
stefancrs wrote:observe: my waveforms are not alias free, nor are oversampled waveforms, they are just anti-aliased (reduced aliasing).Can you show us some examples of your waveform ?
ftp://217.215.143.219/
both wav's and mp3's
duty cycle modulation on all the examples, except on the latter part of the triangle example where it is a pure sawtooth all the way. nothing but one oscillator is active. It was a few years since I wrote this softsynth, so it's not really up to date with anything
-
- KVRAF
- 4641 posts since 20 Feb, 2004 from Gothenburg, Sweden
Well. I have replaced them by now with self-phase-feedback oscillators or whatever one should call them I found that method way cooler and more flexible. (way less amounts of code, less cpu usage, higher sound quality)
Stefan H Singer
Musician, coder and co-founder of We made you look Web agency
Musician, coder and co-founder of We made you look Web agency
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
You mean, the samples I listened yesterday : trianglething... are not using that method you were talking about. They sound really analog to me... What is it all about ? Can you send me a short code to get started ? Pleasestefancrs wrote:Well. I have replaced them by now with self-phase-feedback oscillators or whatever one should call them I found that method way cooler and more flexible. (way less amounts of code, less cpu usage, higher sound quality)
Cheers,
A.F.
-
- KVRAF
- 4641 posts since 20 Feb, 2004 from Gothenburg, Sweden
The stuff you listened to was my old oscillators, the ones using integration and stuff. Now I use the y = sin(phase + y * feedback) and the different variatons of them. You don't need no code-snippet to try those out.
Stefan H Singer
Musician, coder and co-founder of We made you look Web agency
Musician, coder and co-founder of We made you look Web agency
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
Nice, i will try for surestefancrs wrote:The stuff you listened to was my old oscillators, the ones using integration and stuff. Now I use the y = sin(phase + y * feedback) and the different variatons of them. You don't need no code-snippet to try those out.
Hope I'll have the time.
-
- KVRian
- 1262 posts since 15 May, 2002 from Finland
Funny, soundwise those synths are my absolute favourites :)Muon Software Ltd wrote:
This is why I have to assume your implementation might have gone wrong somewhere - even putting aside my own work, there is Iblit and PolyIblit out there that sound OK to me, not mention Mercury 1.
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
Just tryed. Nice, waveform ...stefancrs wrote:The stuff you listened to was my old oscillators, the ones using integration and stuff. Now I use the y = sin(phase + y * feedback) and the different variatons of them. You don't need no code-snippet to try those out.
BUT: It's way too mouch bandlimited. For 440 Hz it's limited at ~5KHz. So how did you made it ? If the feedback is too big, it distorts the whole thing.
I'm thinking of creating 1-4 harmonics of this wave and mix them using amplitude 1/n (n=1...harmonics).
Any other methods ?
Thanks,
A.F.
-
- KVRAF
- 4641 posts since 20 Feb, 2004 from Gothenburg, Sweden
Well, actually it isn't bandlimited, it's just a matter of not having that many overtones in it. You will get aliasing at really high tones, you could avoid this by decreasing the feedbacks at higher frequencies (I will try that out later). And I have found that you get more overtones with negative feedback than with positive feedback. Or if it was the other way around :)
If you like the sound of it, use it. I have these different waveforms (shape goes from 0.0 to 1.0)
sine->saw
out = sinf(phase + lastOut * (shape - 0.5f) * 2.0f);
lastOut = out;
saw->square
out = sinf(phase + lastOut * (1.0f - shape) * + lastOut * lastOut * shape);
pwm square1
square1 = sinf(phase - lastOut1 * lastOut1);
lastOut1 = square1;
square2 = sinf(phase + shape * pi * 2 - lastOut2 * lastOut2);
lastOut2 = square2;
out = (square1 + square2) * 0.5f;
pwm square2
float square1 = sinf(phase - lastOut1);
lastOut1 = square1;
float square2 = sinf(phase + shape * pi2 - lastOut2]);
lastOut2 = square2;
out = (square1 - square2) * 0.5f;
though they aren't exactly like this, I have tweaked the feedbacks everywhere, having them at like 1.1 instead of 1.0, giving for instance float square1 = sinf(phase - lastOut1 * 1.1f); in the pwm square2. Some trial and error :)
If you like the sound of it, use it. I have these different waveforms (shape goes from 0.0 to 1.0)
sine->saw
out = sinf(phase + lastOut * (shape - 0.5f) * 2.0f);
lastOut = out;
saw->square
out = sinf(phase + lastOut * (1.0f - shape) * + lastOut * lastOut * shape);
pwm square1
square1 = sinf(phase - lastOut1 * lastOut1);
lastOut1 = square1;
square2 = sinf(phase + shape * pi * 2 - lastOut2 * lastOut2);
lastOut2 = square2;
out = (square1 + square2) * 0.5f;
pwm square2
float square1 = sinf(phase - lastOut1);
lastOut1 = square1;
float square2 = sinf(phase + shape * pi2 - lastOut2]);
lastOut2 = square2;
out = (square1 - square2) * 0.5f;
though they aren't exactly like this, I have tweaked the feedbacks everywhere, having them at like 1.1 instead of 1.0, giving for instance float square1 = sinf(phase - lastOut1 * 1.1f); in the pwm square2. Some trial and error :)
Stefan H Singer
Musician, coder and co-founder of We made you look Web agency
Musician, coder and co-founder of We made you look Web agency
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
Yes, I noticed that a feedback of 1.1 makes better results. And at higher freq i will need to reduce the feedback. The results were nice, but still not bright enough. And the waveform was not really saw, it has is V- peak rounded a little. I also compared with a pure saw wave made with FFT, and this sounded mouch cleaner, but darker also.stefancrs wrote:Well, actually it isn't bandlimited, it's just a matter of not having that many overtones in it. You will get aliasing at really high tones, you could avoid this by decreasing the feedbacks at higher frequencies (I will try that out later). And I have found that you get more overtones with negative feedback than with positive feedback. Or if it was the other way around
If you like the sound of it, use it. I have these different waveforms (shape goes from 0.0 to 1.0)
sine->saw
out = sinf(phase + lastOut * (shape - 0.5f) * 2.0f);
lastOut = out;
saw->square
out = sinf(phase + lastOut * (1.0f - shape) * + lastOut * lastOut * shape);
pwm square1
square1 = sinf(phase - lastOut1 * lastOut1);
lastOut1 = square1;
square2 = sinf(phase + shape * pi * 2 - lastOut2 * lastOut2);
lastOut2 = square2;
out = (square1 + square2) * 0.5f;
pwm square2
float square1 = sinf(phase - lastOut1);
lastOut1 = square1;
float square2 = sinf(phase + shape * pi2 - lastOut2]);
lastOut2 = square2;
out = (square1 - square2) * 0.5f;
though they aren't exactly like this, I have tweaked the feedbacks everywhere, having them at like 1.1 instead of 1.0, giving for instance float square1 = sinf(phase - lastOut1 * 1.1f); in the pwm square2. Some trial and error
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
Ok...But why are you telling me this ?helium wrote:stefancrs is a MSVC user
-
- KVRAF
- 4641 posts since 20 Feb, 2004 from Gothenburg, Sweden
Most aren't if you by saw mean a linear sloping |\|\|\| or /|/|/|. Take a look at a few from different synths.And the waveform was not really saw
Stefan H Singer
Musician, coder and co-founder of We made you look Web agency
Musician, coder and co-founder of We made you look Web agency
-
- KVRist
- 327 posts since 13 Nov, 2002 from Germany, Darmstadt
'cos it's so damn boring here. And I just found it out by looking at
Code: Select all
sine->saw
out = sinf(phase + lastOut * (shape - 0.5f) * 2.0f);
lastOut = out;
-
- KVRian
- Topic Starter
- 574 posts since 6 Jan, 2003 from Somewhere between ))o Left and Right o((
I found a way to make it more like a saw wave...
Instead of phase feedback, i feedback the waveform itself. The waveform it's closer to a saw wave, the spectrum is bright. Little more alias.
out =(sin(phase + out* feedback*3)+(out* feedback*3)+0.78)*0.3;//0.78 (tweaks for DC offset)
Instead of phase feedback, i feedback the waveform itself. The waveform it's closer to a saw wave, the spectrum is bright. Little more alias.
out =(sin(phase + out* feedback*3)+(out* feedback*3)+0.78)*0.3;//0.78 (tweaks for DC offset)