X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=scripts%2Fsynth1.lua;h=2a8288ba52282ff7e8149440117522dab73a5aaa;hb=7a0b53f75e6a670ce8cc0de35b20d276d6f64be8;hp=264d6dcb99e7cf9dc5467c2de1e2e1535b44207d;hpb=eed0a7965c1934b534f6a294ef936277801d8a14;p=ardour.git diff --git a/scripts/synth1.lua b/scripts/synth1.lua index 264d6dcb99..2a8288ba52 100644 --- a/scripts/synth1.lua +++ b/scripts/synth1.lua @@ -1,30 +1,24 @@ ardour { ["type"] = "dsp", name = "Simple Synth", + category = "Instrument", license = "MIT", - author = "Robin Gareus", - email = "robin@gareus.org", - site = "http://gareus.org", - description = [[An Example Synth for prototyping.]] + author = "Ardour Lua Task Force", + description = [[An Example Synth for Prototyping.]] } function dsp_ioconfig () return { - -- { audio_in = 0, audio_out = -1}, -- any number of channels - -- { audio_in = 0, audio_out = 1}, -- values > 0, precisely N channels - { audio_in = 0, audio_out = 2}, -- values > 0, precisely N channels - { audio_in = 0, audio_out = 4}, -- values > 0, precisely N channels - { audio_in = 0, audio_out = 8}, -- values > 0, precisely N channels - -- { audio_in = 0, audio_out = -6}, -- values < -2, up to -N channels, here 1,..,6 + -- { midi_in = 1, audio_in = 0, audio_out = -1}, -- any number of channels + -- { midi_in = 1, audio_in = 0, audio_out = 1}, -- values > 0, precisely N channels + { midi_in = 1, audio_in = 0, audio_out = 2}, -- values > 0, precisely N channels + { midi_in = 1, audio_in = 0, audio_out = 4}, -- values > 0, precisely N channels + { midi_in = 1, audio_in = 0, audio_out = 8}, -- values > 0, precisely N channels + -- { midi_in = 1, audio_in = 0, audio_out = -6}, -- values < -2, up to -N channels, here 1,..,6 } end -function dsp_midi_input () - return true -end - - local note_table = {} local active_notes = {} local phases = {} @@ -69,8 +63,8 @@ function dsp_run (ins, outs, n_samples) local tme = 1 -- parse midi messages - assert (type(mididata) == "table") -- global table of midi events (for now) - for _,b in pairs (mididata) do + assert (type(midiin) == "table") -- global table of midi events (for now) + for _,b in pairs (midiin) do local t = b["time"] -- t = [ 1 .. n_samples ] -- synth sound until event