Suggestion: New module or formula system to control Harmonic Ratios and Pitches

Hello developer team,

Please note that I am using a translation tool to write this post, as English is not my native language. I apologize for any awkward phrasing.

First of all, thank you for making such an amazing additive synthesizer.

I have a suggestion to make the engine even more powerful. Would it be possible to implement a feature that allows us to modify the Ratio or Pitch of each harmonic using mathematical formulas?

I know Radical1 already has the Harmonic Stretch module, but I am looking for a way to manipulate partial frequencies with mathematical expressions independently. This could either be integrated into the existing system, or it could be a completely separate, dedicated new module apart from the current Formula module.

For example, by using h (harmonic bin) in a mathematical expression, we could create unique effects such as:

  • Inverse effects: Inverting the harmonic structure or scaling frequencies backward.
  • “Magnetic” attraction effects: Mathematically snapping or gently pulling specific partials toward designated target frequencies, musical scales, or chords.

Giving users mathematical control over the partial frequencies/pitches would take Radical1’s additive synthesis to the next level and allow for unprecedented sound design possibilities (like complex microtonal structures and crystalline inharmonic textures).

Thank you for your hard work and for reading my request!


1 Like

Hi! Thanks for your feedback, and I’m glad you’re enjoying our work! I think this is a great idea, it sounds exciting to play with – and I also find the current formula is cool but too limited in expressiveness compared to what the engine is actually capable of.

The trouble I’m having with it is I can’t figure out what the formulas would actually look like, concretely. Your “inverse effects” could be achieved by having something like our existing formula with another expression for “what frequency is this partial” in addition to the amplitude.

Magnetic attraction is different beast. Waterfall Glide is one example of an effect that does something like that, but it’s just one of so many possibilities. The trouble with magnetic attraction is it requires state which further complicates the design – it’s not just about what the input frequency is now, it’s also about what our own output was last timestep. And I don’t have a good idea for how to phrase that as a formula. And what if you wanted an effect that required two pieces of state, e.g. the last frequency and the average amplitude over the last second or something?

At some point you stop wanting to maintain your own hand-rolled programming language and just embed someone else’s well-designed work, and once we start talking about state, that’s my instinct. But we can’t just throw python in there, for example, because we need things to be allocation-free, mutation-free, and easily parallelizable. Something more like a shader language, but I find those pretty baroque and hard to work with.

Do you have some idea how you would want the code to look for your effects, if you could have the language of your dreams?

Thanks again for your interest!

Luke

Thanks again for the detailed explanation.

After thinking about it more, I realized that the most important part of my request is not necessarily stateful processing.

The “magnetic attraction” example from my original post was only one possible use case.

What I am primarily interested in is giving users mathematical control over the frequency placement of individual partials.

Conceptually, I imagine something like a Frequency Formula or Ratio Formula that allows users to define where each partial is placed.

For example, expressions such as:

h**1.02

could create stretched harmonic series,

while:

h + 0.1*sin(h*0.5)

could create subtle inharmonic structures.

Or conditional expressions such as:

(h > 8) * (h**1.03) + (h <= 8) * h

could affect only higher partials.

Ideally, this Formula would support the same operators, functions, and conditional expressions that are already available in the current Formula system.

One thing I find particularly interesting is the possibility of working in both ratio space and frequency space.

For example, it could be useful to access values such as:

ratio (the current frequency ratio of the partial)

and:

partialFreq (the actual frequency of the partial in Hz).

These two representations are related, but they are useful for different types of sound design.

Ratio-based operations are very natural for things such as:

- stretched harmonic series

- inharmonic spectra

- microtonal frequency mappings

- harmonic structure design

Frequency-based operations are useful for things such as:

- formant attraction

- resonance attraction

- fixed-frequency harmonic quantization

- spectral alignment to arbitrary frequency sets

Another interesting possibility would be a helper function such as:

snap(value, targetSet, amount)

which attracts a value toward the nearest element in a user-defined target set.

For example:

snap( partialFreq, harmonicSeries(55, 70, 82.4), 0.8)

Here, harmonicSeries() would generate a target frequency set from one or more fundamentals.

For example:

harmonicSeries(55)

could generate frequencies such as:{55, 110, 165, 220, 275…}

while:

harmonicSeries(55, 70, 82.4)

could combine multiple harmonic series into a single target set.

This could attract partials toward the combined harmonic structures of multiple fundamentals, enabling chord-like spectral designs.

Another use case could be:

snap( partialFreq, {800, 1200, 2500}, 0.8)

which could attract partials toward a formant structure or resonant frequency set.

With:

amount = 0 the original value remains unchanged.

With:

amount = 1 the value fully snaps to the nearest target.

Values between 0 and 1 would smoothly interpolate between the original and snapped positions.

Because the target set is user-defined, the same mechanism could potentially be used for:

- harmonic quantization

- chord-based spectral attraction

- microtonal systems

- formant structures

- resonant frequency sets

- Colour Bass style spectral design

- experimental inharmonic spectra

To me, the exact implementation is less important than the capability itself.

Whether this takes the form of a Frequency Formula, a Ratio Formula, or some combination of both, I think giving users mathematical control over partial frequency placement would open up a huge range of new sound design possibilities.