Frequency sweep when modulating sine waves with ramp waves [understand?]

monetus's icon

Any type of ramp wave F-modulating a sine wave seems to create a sweep in frequency, rather than an instantaneous response, when you change pitches. With a large enough harmonicity and brightness, you can clearly see the sideband partials glide into unison when changing notes. I've yet to really figure out what causes this since I've been dealing more with UI stuff. I was curious if someone with a better understanding of trigonometry or dsp could enlighten me?

Max Patch
Copy patch and select New From Clipboard in Max.

Check this patcher out, and swap the tri~s for rect~s to see/hear the difference I hope I described well enough.

brendan mccloskey's icon

Hi
I can't get the behaviour you describe from your patch; you might want to strip it down and make it "plug-n-play' for the forum, I had to make a few changes to get it to work.
A couple of points:
- I didn't really understand your patch, for example, driving a phasor+cos, with another phasor to generate a sinusoid;
- is rect really a ramp wave?

I built a simple demo patch, modulating a sine wave with either rect/tri/phasor, and I can't get the behaviour you describe, so I have to assume it's something to do with the design of your carrier oscillator, which I don't understand. Interestingly, using a phasor as the modulator shifts the centre frequency of the carrier ? ? Once Bessell functions and trig come into it, I'm lost.

Max Patch
Copy patch and select New From Clipboard in Max.

:(

Brendan

monetus's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Sorry if that was confusing, this patch removed the dc mod, fm crossfade, phasor synchronizing that was only there to show how my actual synth is organized. `

-Ya, sorry, the locked phasor was useless in regards to the carrier in that last patch. My actual synth has dual oscillators crossfaded in the carrier and fm logic, so that phasor was needed.
-No, the rect was there as the control to show that it doesn't glide. The tri~ can be replaced with a saw~ and it still creates the glide between partials on my computer.

When I play a note and then play another note there is a glide between the frequencies. This isn't so however, with pulse or sinusoid waves. On the spectroscope I can clearly see my main two partials start away from each other, then glide into position. The thing I really don't understand is that the the frequency glides from different starting positions; sometimes the partials start very close together and glide away, sometimes they start very far away and glide together. Hmm. Win 7. 64 bit -max 6.1.9
-And In regards to your patch Brendan, I wasn't using the orignal frequency to modulate the depth of the fm. I like that added layer, kudos.

Thank you bunches for taking a look.

brendan mccloskey's icon

Yeah, I think I spotted it :)

Max Patch
Copy patch and select New From Clipboard in Max.

You were multiplying fCar by fMod, before adding it to the fCar. And this is not FM synthesis as I understand it, it's applying an amplitude sweep before modulating the carrier; by all means use it as a novel implementation of FM synthesis. Later on I'll post an example of a variant on standard FM synthesis, quantized FM synthesis, if you're not already familiar with it, but til then here's your patch with the 'error', or root of the problem highlighted:

Brendan

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Chaos FM

monetus's icon
Max Patch
Copy patch and select New From Clipboard in Max.

wow, I got lost in that for a little while. That is brilliant and gives me a hell of a lot to think about. I think I added a chaos slider playing around. `
`

And yep, that was the bit of math that was causing the sweep. Thank you, I bullheaded my way through the FM logic. Hmm, sometimes all those extra harmonics are nice since I use waveshaping and filters afterwards. I'm going to play around with any random bizarre FM idea I think of for awhile now; see if I can come up with some smooth ways of transitioning between simple FM, my accidental FM, and variations on QM. Hmm, I'll post again soon.

monetus's icon
Max Patch
Copy patch and select New From Clipboard in Max.

So I just pulled this out of my fm poly~ patch. I quite like it, but it still needs a lot of refinement. I'm having trouble figuring out the best way to make the s&h trigger as a function so I've just quantized the phasor to note values. I'd like to preserve the original spectra when using the s&h to modulate complex waves, but right now they are fixed, creating lots of noise. For now, I''m considering ways to make the fm signal correspond with the pitch mod of the s&h to cancel that out. Then I'm going to tackle the phasor. Give me a few minutes and i'll whip this into a demo patch

monetus's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This should work for a demo. If you aren't using m4l though you will have to replace the live.property with a transport, just need the current tempo.

On a related note, The frequency sweep is still there in this type of frequency modulation, which from every example I see, is the standard approach. Hmm, I'm going to trudge through some bessel functions maybe. Wish me luck