From the original SynthMaker forum (2004–2014), with its members’ names and dates.
oddson ·
Here's a additive wavetable editor/OSC that handles 50 partials (or is that 49).
additiveOSC.osm
Its essentially fallout from the TableSynth stuff I did months ago.
In this file it's connected to the wavetable OSC.
It seems funny to send sine waves to a bandlimited wavetable OSC, maybe someone can comment on this (is there another/better way to go?)
As always I welcome all comment - good and bad.
Shifrin ·
Nifty 😉
As for using the bandlimited wavetable osc, seems like a fair way to approach things - probably more efficient than generating all 50 partials in realtime, or via iFFT or something (if that's ever implemented!) 🙂
Shif.
rl ·
This is a very CPU friendly approach for static waves! I'm working for a couple of months now on an additive synthesizer and for wave-morphing and formant filtering I'm doing dynamic wave calculation (realtime!) using an oscillator bank. Even with as efficient algorithms as possible I'm still on 20% CPU for a single oscillator. Looks like in the end I will recode that in pure assembly.
here is a sneak preview:
From my observiation the phase doesn't add much to the sound, so I have ommited phase calculations.
I'm doing band-limiting by incorporating the bins up to freq * k < fs/2, but for your approach I think it' s definitely ok.
The whole bar drawing wouldn't be that great without the Float Array Draw module that was silently introduced for the wave draw module some time ago. Kudos to the SM team for that (I already started to build my own interpolated array drawing module)
rl ·
how long is your FFT length?
which window function do you use?
how are you calculating magintude and phase?
you're discarding the upper half of the results of the FFT result, right?
Large ·
rl wrote: how long is your FFT length?
Is that the same as "Number of samples" in the waveloader?
256 samples in the wave file, and 256 for the "Limit" of sample for the wave loader.
I'm assuming that sticking with "power of 2" numbers will minimize problems.
rl wrote: which window function do you use?
I don't know.
rl wrote: how are you calculating magintude and phase?
I think that's done by Oddson's AdditiveOSC. You'll have to check it for errors.
I used a "Graph FFT" to split the magintude and phase for loading into the AdditiveOSC.
Then I did some things to convert that data to (0-1), as seen in the OSM.
rl wrote: you're discarding the upper half of the results of the FFT result, right?
No. Only the first line. For some reason, it messes up the result. Again, a bug somewhere in the FFT, as this first line shouldn't have to be removed.
Large ·
rl wrote:
Large wrote: Help!
Post your schematic and we can see what we can do for you.
Thanks!
Here's the OSM and the wave file used for loading / testing.
The problem, I think, is with the phase calculations, they seem slightly off. I don't don't how to fix this.
Eventually I'll need this to have more harmonics, like up to 2048. Maybe tweak a few things to make that possible 🙂
rl ·
observations on first sight:
-
Yes there seems to be some problems with phase calculations. at least the Graph FFT module delivers different phase values than the FFT - Real/Img to Magnitude/Phase pair.
-
The result of the FFT is symmetrical at N/2, so discard the upper half of the results
I did some quick and dirty edits to your schematic. At least with the reference square wave is seems to work ok now.
MegaHurtz ·
Rl ? Maybe you know, Im struggeling wit this.. If you have a compound signal
with sine A and B merged together. How does one get the amplitude of sine A
by knowing it`s frequency?
Large ·
Thanks rl. But it doesn't yet work on my system.
I loaded the attached square wave and this is what resulted.
Try loading the 256 sample square wave.
Do you see what I see here?
rl ·
ok, back to the basics:
Here is a schematic that does an FFT and an iFFT. It also works with your square wave. There must be something wrong with oddsons schematic. Also seems that Graph FFT has a bug. The phases are wrong. I will file a bug report.
Large ·
Thanks for your help rl.
And hopefully your bug report will result in the module being fixed.
oddson ·
rl wrote: ...There must be something wrong with oddsons schematic...[/attachment]
That's entirely likely. Remember it was an attempt to build an additive OSC before the FFT/iFFT primitives were available. I could be a simple as the intrinsic errors inherent in many estimations of sine waves being added together.
I haven't actually been following the latest part of this thread... I would think extending the stock Additive OSC to include a phase editor and higher partials would be more appropriate than reviving my old monster.
I'm still not sure why you'd want to take a wave and FFT it just to reverse it and build the wave again. 😕
Large ·
oddson wrote: It could be a simple as the intrinsic errors inherent in many estimations of sine waves being added together.
No estimating, really. The harmonic formula reads about like this:
Harmonic Sine wave 1(The Fundamental) = Frequency X 1
+
Harmonic Sine wave 2 = Frequency X 2
+
Harmonic Sine wave 3 = Frequency X 3
+
Harmonic Sine wave 4 = Frequency X 4
+
Harmonic Sine wave 5 = Frequency X 5
...And so on; the more numbers you use, the crisper the sound.
oddson wrote: I would think extending the stock Additive OSC to include a phase editor and higher partials would be more appropriate than reviving my old monster.
1.) Only if they could load a wave cycle, and gather the harmonic volume and phase info correctly, using (0-1) values.
2.) Then have two FLOAT ARRAYS out; one for harmonic volume and one for harmonic phase, so the user could attach two text strings and gather that (0-1) data for other uses.
oddson wrote: I'm still not sure why you'd want to take a wave and FFT it just to reverse it and build the wave again. 😕
1.) Resynthesis.
2.) You then have access to harmonic data, and can alter the sound in ways that are impossible with just a wave.
.
.
.
MegaHurtz ·
oddson wrote:
rl wrote: ...There must be something wrong with oddsons schematic...[/attachment]
That's entirely likely. Remember it was an attempt to build an additive OSC before the FFT/iFFT primitives were available. I could be a simple as the intrinsic errors inherent in many estimations of sine waves being added together.
I haven't actually been following the latest part of this thread... I would think extending the stock Additive OSC to include a phase editor and higher partials would be more appropriate than reviving my old monster.
I'm still not sure why you'd want to take a wave and FFT it just to reverse it and build the wave again. 😕
The difference in sound between windows is quite big.
Don`t know how they did it here...triangular?.
Next to the possibility something could be plain ole wrong here, in the analysis part.
We yust don`t know.
Maybe the best thing is to build one from scratch.
oddson ·
Large wrote:
oddson wrote: It could be a simple as the intrinsic errors inherent in many estimations of sine waves being added together.
No estimating, really...
Really! much estimating. This thing uses 50 - 256 point float arrays mixed together to build it's composite waves. And the phase stuff is limited to one data point shifts in these arrays.
The FFT stuff was not available and the wave table stuff was still a 256 points max... It's not really an accurate way to make up an arbitrary waveform... it's more like a draw-bar organ with more drawbars.
This thread was to show a little project I hacked together as best I could with my skill level and the limitations of the program at the time. It's not going to get you what you want.
Whether the stock FFT version can do it isn't something I can say and hamming windows etc. is way out of my league.
MegaHurtz ·
Its always a bit of a paradox with the fft`s.
larger bins= lower accuracy in the area our ears are most sensetive.
smaller bins = higher accuracy with lack of low frequency`s.
with a 256 binsize you have approx (44100/256) 172 hz and up.
combined with (256/2) 128 possible frequencys
rl ·
Right. That's the point where more sophisticated techniques will be used like wavelet transform, e.g. splitting the bands, doing high-res analysis on the lower band and a low-res analysis on higher bands,...
MegaHurtz ·
This is the first time I ever heard of the wavelet transform.
Tough enough to make a grown man cry 🙂
MegaHurtz ·
Eureka! I now got the amplitude of sine A in A+B. With the frequency of sine A.
One day theres a new DFT coming.. DMT ooh 🙂
oddson ·
FYI - I was trying to split this thread and it looks like I've accidently deleted the posts right after this old turd got resurected. Sorry! 😊
MegaHurtz ·
allow me to remove this atrocity from your retina.
MegaHurtz ·
You did mean ole Hilbert no?
TomC ·
oddson wrote: FYI - I was trying to split this thread and it looks like I've accidently deleted the posts right after this old turd got resurected. Sorry! 😊
The dog ate my homework...
Wrote something here? To have a post removed or your name hidden, write to [email protected].