From 27bd937edb8304378ff60c9c7874b6e61b07ce3b Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 25 Sep 2016 23:32:37 +0200 Subject: added LADSPA plugin host (LADSPAStream and Stream:LADSPA()) * E.g. LADSPAStream("sine", 880):play(). The sine plugin is currently twice as fast as the native Applause implementation even though a block size of 1 sample is used (ie. compared to Stream.SinOsc). * all LADSPA features should be supported * Takes arbitrary Streams as input and produces a normal Applause stream. * multi-channel output plugins supported * LADSPA port mapping is possible by array, by name and by argument list. * Even though LADSPAStream is not muxable (it is more like SndfileStream), every input stream or default value is currently converted to a Stream. This can be optimized by storing scalars in their own arrays. They don't have to be ticked. --- applause.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'applause.lua') diff --git a/applause.lua b/applause.lua index 4e87d74..dd0ea56 100644 --- a/applause.lua +++ b/applause.lua @@ -10,7 +10,9 @@ require "table.new" require "table.clear" -- Useful in order to make the module reloadable -local function cdef_safe(def) +-- NOTE: This is global, so it can be used in reloadable +-- submodules +function cdef_safe(def) local state, msg = pcall(ffi.cdef, def) if not state then io.stderr:write("WARNING: ", msg, "\n") @@ -2298,3 +2300,9 @@ function Client:kill() end Client.__gc = Client.kill + +-- +-- Additional modules are loaded with dofile(), +-- so they react to reload() +-- +dofile "ladspa.lua" -- cgit v1.2.3