I’m doing a series of lessons in electronic music, naturally all in renoise

Anyways, I wanted to demonstrate how adding sines up the overtone series will end up with a saw wave. Since the strength of the n’th overtone should have amplitude 1/n, I need to be able amplify for instance the 2nd overtone by 0.5. I solved it by using an amplifier plugin, but how does this translate into db’s, so I can stick with native-only plugins and use the gainer?

You can even play with the maths in real time with the *formula meta device that contains the math library. Try to paste this in your track dsps section :

Hey , I’ve done the same thing ,I have a renoise template song that has 20 sine wavers ( partials ) 1.2.3…20 each having their own vmixer channel …render the whole lot to sample …
It’s a great method for creating new waveforms

That sounds nice (and looking at the available variables, this could be fun for other stuff indeed). However I can’t make it work

I put “lin2db(A)” in the formula field, and selected the “Gain” of a gainer device I put the same channel as distination. But no matter what values I put slider A to, the gain is at -INF. It seems the formula device tries to write -6.0205999132796 to the “slider” of the gainer, but the slider goes from 0-1. So I need to translate the db to renoise-device-slider-language

If I input print(math.lin2db(0.5)) in the scripting terminal it correctly prints -6.0205999132796, so it seems the formula is ok?

It ended up being dead simple, the correct formula was “A * .25”. Connected to the gain of a gainer device will allow me to set slider A to 0.5 which moves the gain to -6.021dB, etc…