Reloading a LUA DSP script

Hello,

Wanting to experiment with sound, I’m trying to modify simple_synth.lua with my (first) LUA code.

Does please anyone know if it’s possible to reload this script after modifying it, without having to reload the entire session?

Thanks :slight_smile:

1 Like

Yes, you can just remove and reload the plugin itself from the mixer strip.

1 Like

Thanks,

And is it, please, possible, in a LUA DSP plugin, to show on the plugin some data, like, for example, the result of a calculation between some input params and plugin internal values?

If I add, for example, in your simple_synth.lua this input:

function dsp_params ()
  return {
    { ["type"] = "input", name = "Max Time", min = 0.01, max = 2.0, default = 0.2 },
  }
end

Can I display, on the plugin, Max_Time*3, for example?

Two options, you can have a control output:

function dsp_params ()
 return
 {
   { ["type"] = "input", name = "Max Time", min = 0.01, max = 2.0, default = 0.2 },
   { ["type"] = "output", name = "Times Three", min = 0.03, max = 6 },
 }
end

or render an inline display.

An example of the former would be ardour/share/scripts/voice_activate.lua at master · Ardour/ardour · GitHub which outputs current signal level. For the latter search the examples for “function render_inline” there are many examples.

Hello,

This works perfectly, thanks!

Another thing would be to display, on the LUA plugin, a mathematical function; why not one period of the output signal, per example.

a[s] = a[s] + math.sin(6.283185307 * phase) * vel / 167

Do you, please, think it’s possible with LUA?

No it isn’t. There is only the generic UI, which can show standard plugin control port parameters. You could use an inline display to render anything though.

Keep in mind that doing per sample calculations in Lua is very slow. It is handy to prototype things, though, or some quick dirty solution where performance isn’t too relevant.

The main idea for Lua DSP is to use it as glue to call C++ code, which can make use of SIMD.