Maximize / adjust volume of a sample

I want to run “Process -> Maximize Volume” and “Adjust Volume…” commands from my script. I can’t find anything in the API about them.

Is there a way to run menu commands from a script? Or somehow get access to the underlying functions?

isn’t it already possible to access the raw sample data using lua? Then you could implement one of those algorithms from musicdsp.org or other places… You want to maximize and then lower the volume to ensure its all the same level? Of course having access to lot of implemented stuff would be much more easy… So many easy extensions of the lua Api could simplify tools dev’s life…

isn’t it already possible to access the raw sample data using lua? Then you could implement one of those algorithms from musicdsp.org or other places… You want to maximize and then lower the volume to ensure its all the same level? Of course having access to lot of implemented stuff would be much more easy… So many easy extensions of the lua Api could simplify tools dev’s life…

Yeah. I’ve just never done anything with raw sample data… yet.

I imagined something like sample:maximize() or even menu:invoke(“Process -> Maximize”) would be simpler than looking up the algorithms from musicdsp.org or other places :slight_smile:

But it’s something for me to look into I guess…

hm peak maximization should be pretty simple, like searching for highest value and then multi plicate everything with the difference…?

yes, I’ve just never done it yet.

and the way I’m asking for is even simpler - just a single command.

but if that’s not available (and I’m guessing it’s not) then I will go the DSP route.

I’ve never done any DSP stuff before, so this would be my first work with it.

The following snippet contains plenty of copy-paste opportunities:

https://gist.github.com/bjorn-nesby/85c81d97098123b727d8

Background: I am working on a lua library for Renoise 3.1 called xLib. It’s going to support vLib but focus on the Renoise internals.

The code you see above is part of that library, but it’s not assembled into an actual, ready to use tool.

Running any of that code on a large sample is going to be sloooooooow

thanks!