Norns Script Control Reverb Levels Etc

Probably a stupid question, but is it possible to setup aspects of the Norns audio engine (levels, reverb, compressor etc.) from a Lua script?


Yup, I do this to modulate the reverb in Timeparty by setting audio.level_cut_rev. You can see the other available methods on the audio table here

1 Like

That’s good to know.

Is it considered bad practice to mess with these values from your scripts, though? I’m thinking of possible impacts on other scripts a user might switch to after trying mine.

Would I change these settings in my script’s “init” function?

I’m not sure if it’s bad practice, but I can’t think of a way it would impact other scripts. I guess if your script turns reverb off and another script expects it to be on that could be an issue, but the user can always change these values in the system menu regardless of what your script does anyway.

I guess the bigger issue would be for the end user, if for example they had a global compressor setting that they really liked, and your script changed all of their settings.

You could update these values anywhere. In the init would make sense if you want to initialize your script with certain values for some reason.

all params can be modified with code. see the norns studies. now that audio params are available, this is the preferred way to modify these.

Thanks guys. I’ll go ahead and have my script set reverb level and maybe compressor settings, too, in that case.

1 Like

It’s not clear what the range of this value should be. Is is 0-1, or something else?

That’s a good question. In my own script I’m modulating values from around 0-18, but I think the range is the same as the db range you can see in the menu, which looks like it’s around -63 - 20.

@tehn or @zebra can probably provide a better answer.

Also, as tehn mentioned I would use use the new params instead of calling audio.level_cut_rev directly (I forgot these existed). You can see all the param names by calling params:print() in your script. I’m not sure if these are documented anywhere else, but you can also see them in the Audio.add_params() function of that file I linked earlier.

If you do call the audio functions directly (but don’t :slight_smile: ), make sure to wrap the value in util.dbamp, or it could get very loud and hurt your ears and/or speakers (I’m speaking from personal experience :cry: ) Fortunately It looks like the audio param methods will do this for you.

the “low level” audio.level_ setters take raw amplitude in [0,1].

the audio parameters use decibels in [-{huge}, 0]. use the map method on one of them to map [0,1] to decibels, or use set to set decibel level directly.

i’d sort of prefer a more specialized audio taper but maybe that will happen in 3.0