Hello. New member looking into making a plugin. Does Juce have any existing methods to add harmonics to a signal for use as a plugin in protools or logic. The goal is to add specific harmonics and set the amplitude of each harmonic added with a knob or slider and save the preset. There is no other goal for my first experiment other than this.

Is there a resource to hire a consultant to discuss the idea and viability of my goal and assist making a prototype?

Thanks.

You would most likely want to look into making some kind of waveshaping function, possibly polynomial waveshaping?

As an example of you had a 100hz sine wave going into the plugin and you changed the sine wave to 200hz that would give you the second harmonic. 300hz gives you the 3rd. Then have a way to adjust the volume of each harmonic individually. Ideally achieve at least 800hz out of 100hz fundamental. Granted this is for illustration. You donât want what is coming in the plugin but the math works the same for whatever comes in. I could give another analogy of pitch shifting 100hz up 1 octave.

So you want to pitch shift the pluginâs input to each desired harmonic?

Or do you want to take the input signal & adjust the relative amplitudes of the frequency bins corresponding to each of these harmonic bandsâŚ?

1 Like

I want to input any signal and have control over which harmonics are added as well as amplitude of which are added. I donât know if pitch shifting is how people are making plugins that add harmonics, but the end result is that on all that I test with using sine waves as the fundamental the effect is x2, x3 etc. the photo shows a 100hz sine wave going through a UAD plugin that adds harmonics. So you see 200 300 400 500 600 sine waves added by the plugin. I want separate control of whatâs added.

I hope this helps explain. I know electronics and coding for microprocessors but not fluent C++

1 Like

This is not archieved by pitchshifting. You apply nonlinear processing to the signal.

You want to turn Waveform (a) into Waveform (b)

Maybe check chapter 19 of Will Pirkles âDesigning Audio Effect Plugins in C++: For AAX, AU, and VST3 with DSP Theoryâ to understand the concept

have control over which harmonics are added as well as amplitude of which are added.

should be possible

1 Like

Thanks for the reference. Iâll check it out.

Does anyone on here offer hourly zoom? Iâd like to get a quick overview and prefer to have someone walk me through the basics and run and example, build, run on protools to see the flow.

the basics are just this:
for each sample:
sample = tanh(sample);

experiment with different waveshaping functions to find out how they affect the harmonics. beware that this process (distortion) can add aliasing and intermodulation if some harmonics are above nyquist. but honestly donât fiddle with that before getting the basic functionality done, because itâs a lot

Thanks. Generally speaking you cannot selectively add specific harmonics with a distortion or saturation Method, which is why I am experimenting with pitch shifting. With pitch shifting I can replicate a specific harmonic since a harmonic is a multiple of the original sound. X2 x3 etc. When you square a wave off you inherently produce lots of odd harmonics. If you simulate tubes you add a degree of even and odd. If you use asynchronous voltage offsets up or down you can produce even or odd. But you cannot add a specific harmonic. Since I have simulated what I want to accomplish using pitch shifters in series My first task is to learn how to create a pitch shift function. When I can shift a sound +12 semi or 1 octave then I will find out out to put 2-5 of them in series to achieve around 10 octaves. Next have a separate knob to set the level for each shifter. Iâm not suggesting wave shaping wonât work so Iâm open to testing that. Ideally find someone that can spend some time on zoom. I know Xojo very well and other coding platforms.

1 Like
1 Like

yeah, I thought you meant pitch shifting

the thing is, if you duplicate + pitch-shift your original signal to each new desired frequency for each harmonic you want to add, youâll end up with a composite output signal thatâs more like a âchoirâ of the original sound, rather than a signal recognizable as only the original input with extra frequencies added.

To illustrate this point, the process of âtake input signal & shift it to a bunch of desired fundamental frequenciesâ is exactly how Jacob Collierâs vocal harmonizer works: Hide and Seek - Jacob Collier [Live at House] - YouTube

Notice how the output sound definitely has the characteristics of a âchoirâ of voices, rather than sounding like Jacobâs voice with more frequencies added.

if pitch shifting is what you want, I may be able to help you, since Iâve done quite a bit of research in this area.

But I dunno if thatâs really what youâre going for.

Thanks. Pitch shift sounds good on pure sine waves but not good on anything else. But it was a good way to show the idea of separate harmonic control. So it wonât work. I donât know if the idea is achievable as Iâve never seen it done to separate out a harmonic. Ideas welcome! Iâd be happy to pay for a bit of advice to get started.

Do you mean that pitch shifting things other than sine waves doesnât achieve your desired result, or that the quality is too low?

Because itâs certainly possible to develop robust, higher-quality pitch shifting algorithms that are better at maintaining the timbre of the original signal.

But if pitch shifting is simply not achieving your desired result, then waveshaping is probably the way to go.

Thanks for the stack ex link. I donât know enough to understand it but maybe someone can help me that understands if it has promise.

Pitch shifting anything other than pure sine waves sounds bad In terms of faking harmonics. I tried it just now in vocals and itâs bad. You are transposing 1 octave just for the second harmonic

right. but what pitch shifter are you using? chances are, itâs just not a high-enough-quality pitch shifting algorithm.

What Iâm trying to figure out is, if you had a pitch shifter thatâs super high quality, like at the level of Jacob Collierâs harmonizer, that could perfectly reproduce the input sound at the desired frequencies, would that be what you want?

Because that is possible. But it would give you a choir-like sound, because youâre recreating the entire sound at each new pitch. So Iâm trying to figure out if thatâs what you want or not.

I tried autotune with no formant. Also tried little alter boy but found out it adds tons a of harmonics even when doing nothing.

I wouldnât say choir is the goal. However when you add a second harmonic, it is a doubling of the original frequencies. 1 octave up. pitch shifting 1 octave isnât the same result somehow.

OK, thatâs what I was trying to figure out. It sounds like youâll want some sort of waveshaping function, unfortuantely thatâs not really my area of expertise.

This is because your original signal contains an entire spectral envelope â fundamental frequency, whatever harmonics are already present, and probably some noise content â and a pitch shifter shifts this entire signal. So pitch shifting up one octave will reproduce the original fundamental, and the original harmonics present, and the original noise content all up one octave.

It could be possible to isolate just the original fundamental frequency before pitch shifting, which would give you more of a âpureâ shifted frequency.

The issue here is that a âharmonicâ naturally produced by an acoustic instrument is not an exact copy of the fundamental frequency at a different pitch, itâs more of an acoustic resonance that produces additional frequencies, but also has an auditory effect on the fundamental frequency itself.

Itâs possible waveshaping is the answer. You could also look into physical modeling synthesis, to model the ways that an acoustic signal would resonate with its harmonicsâŚ ÂŻ_(ă)_/ÂŻ