diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-23 20:48:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-23 20:48:02 +0100 |
commit | 180843f9bd28b191c7404245ba0a121107992511 (patch) | |
tree | c60312dc09f76c2f55ba2383245c427e15c38dea /share/scripts/_fir.lua | |
parent | bf649cd68ad46c34a656700aa6cb89416d648c64 (diff) |
Also move Lua scripts to share subfolder
Diffstat (limited to 'share/scripts/_fir.lua')
-rw-r--r-- | share/scripts/_fir.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/share/scripts/_fir.lua b/share/scripts/_fir.lua new file mode 100644 index 0000000000..64448ef8f6 --- /dev/null +++ b/share/scripts/_fir.lua @@ -0,0 +1,36 @@ +ardour { ["type"] = "dsp", name = "Lua FIR Convolver", license = "MIT", author = "Ardour Lua Task Force", description = [[Another simple DSP example]] } + +function dsp_ioconfig () return + { + { audio_in = 1, audio_out = 1}, + } +end + +local conv + +function dsp_configure (ins, outs) + conv = ARDOUR.DSP.Convolution (Session, ins:n_audio (), outs:n_audio ()) + + local cmem = ARDOUR.DSP.DspShm (4) + cmem:clear () + local d = cmem:to_float (0):array() + d[1] = .5 + d[2] = .5 + local ar = ARDOUR.AudioRom.new_rom (cmem:to_float (0), 4) + conv:add_impdata (0, 0, ar, 1.0, 0, 0, 0, 0) + + cmem:to_float (0):set_table({1, -1, 0, 0}, 4) + ar = ARDOUR.AudioRom.new_rom (cmem:to_float (0), 3) + conv:add_impdata (0, 0, ar, 1.0, 0, 0, 0, 0) + + conv:restart () + collectgarbage () +end + +function dsp_latency () + return conv:latency() +end + +function dsp_runmap (bufs, in_map, out_map, n_samples, offset) + conv:run (bufs, in_map, out_map, n_samples, offset) +end |