Invert polarity of sampler
-
The phase is independant from the frequency because they all use the fixed wavetable length of 2048 samples.
But to be honest the experiments I made with additive synthesis lead me to discard any efforts of reproducing the phase of harmonics because you simply don‘t hear it - but I am curious about your findings ;)
-
@Christoph-Hart I can hear the difference, but is much more obvious looking at the waveform. These are the 16 same sinewaves played together.
No phase:
Phase shifted:
I guess nature planed the waveform to look like last one :)
-
Yes, that the waveforms look different is obvious, but as far as I know, human ears have a very hard time to distinguish phases between harmonics.
I found an interesting read about this subject here:
-
@Christoph-Hart Excellent paper! Will read it carefully at bed! My guess is phase is audible when it contributes to create a "recognizable" waveform (as in the images I posted. Here are 2 examples, same harmonics, with and without phase shift.
My theory is that partials phase should be placed to contribute to a major simple waveform (I mean a waveform you can visually remember or recognize), shaping the final waveform by adding small variations of a major curve to make it look smooth. Just flip any of the partials on a additive sawtooth waveform and you'll see ramp to be distorted. (maybe Im crazy, but this is what I suppose)
-
I haven't read the paper yet, but for what I know, the phase is important when two or more sources are reproducing the same frequency, as the crossover frequency in a 2-way speaker for instance, where alignment is crucial... But if you take two frequencies far away enough below and above the crossover freq, the ear cannot notice a poor alignment (except if you change it in real time).
-
@ustk my post is related to phases within harmonics on the same sound. I guess phase alignment on speakers is kind of different stuff I can't understand yet
-
It was an image, but the behaviour is approximately the same if your harmonics are not identical, and the phase will automatically move in relation anyway
-
@ustk oh I got it :)
-
BTW, the most apparent difference between your sound examples is that the unshifted sample is clipping pretty badly so you're not really hearing phase distortion, but real distortion :)
-
@Christoph-Hart yeah. Sorry. Will send a leveled one. Are the same partials, same amplitude... But unphased raises some weird peaks.
By the way. Having a hard time trying to calculate phase rotation. (since harmonics rotates differently based on #).
Any clue on how to calculate this?
-
@Christoph-Hart is there a way to do sinewaves to start when they cross zero Y value? Got some artifacts when phase is not close to 180 or 360
Despite this, results are amazing
-
Lol, if you want them to start at zero, phase is either 0 or 180 degrees :)
What you need in this case is a simple envelope with an attack time of about 3-5 ms to remove the click.
-
@Christoph-Hart LOL I know. Doing this workaround alreay.But I'm guessing if there's a way to keep phase angle but delay the start n samples until sinewave crosses zero. Don't know if it makes sense.
I measured phase as is and is doing what it's supposed to do. Just trying to do a custom trick since artifact are a problem for anyone using phase shift
-
@Christoph-Hart said in Invert polarity of sampler:
I think I'll add this to the SimpleGain module
Has this been added to the SimpleGain module? I didn't see it when I had a look.
-
@Crystal-Audio It has been added. There isn't a button for it, but you can find it in the Simple Gain API
-
-
@dustbro @lalalandsynth I'm having trouble locating Simple Gain in the api. I don't see it when I search for "Simple Gain" and I didn't notice it when I scrolled through the full list. Is there a special place to find the modules in the api browser?
-
@Crystal-Audio yeah it's in the module browser. Check the image above.
-
@hisefilo can you explain a bit how you go about additive synthesis ? I gather you have a sound that you want to recreate , you look at the partials and then add sines to recreate it ?
If i am correct , what do you use to analyse the partials and dont they all change per note?
Very interested and would love to hear how you approach this.
-
@lalalandsynth You can use SPEAR to find modes:
http://www.klingbeil.com/spear/
Sine Wave - Set exact frequency (from array)
- Sound -> Analyze -> Select whatever sound you want.
- Edit -> Select Partials Below Threshold (mode-selection sensitivity).
- View -> Print Average Frequencies
- Window -> Console
You'll see a list of primary modes. If you want to bring them into HISE in a neat way you can use Google Sheets:
- Copy the values into a Google Sheet (as a vertical list).
- Data -> Split Text to Columns (select the Space operator).
- Save the sheet as a .csv with comma-separated values.
- Open it in whatever text editor, then just copy + paste the values into an array.
To get the residue file, which is whatever is left when the modes are removed, just hit delete with the modes still selected, and export that file.
Now you can import the array to HISE and setup Sine Wave Generators, using Ratio to setup the partials. Unfortunately there's no way to just read from the array, so you'll have to figure out the ratios (you can automate it with a for loop and something like this:
moderatio = (modes[i] / modes[0]) - 1; modules[i].setAttribute(modules[i].FineFreqRatio, moderatio);
For each mode, it divides the current mode by the fundamental (mode[0]), which gives you a general ratio.
It's not 100% accurate, but it's free and definitely good enough to start experimenting. The main weakness is that you don't have a lot of information about decay times for each mode, which is where paid software might come in...
I'm praying HISE 3.0 gives us a way to just set sine wave frequencies exactly, so we can just read them from arrays. I could basically make any sound I want with that, with some tweaking... My favourite part of additive synthesis/physmod is once I have a sound, I can tweak it by just shifting the modes and their relationships around, eg: stiffness property involves sharpening certain modes, you can even script random robin on every note.
And yes, for some instruments, every note has different partials. This would again be a lot easier if we could set exact freqs