4 category = "Instrument",
6 author = "Ardour Lua Task Force",
7 description = [[A debug and test-instrumentation synth. This plugin is useful with Ardour's "Dummy" backend "Engine-Pulse" mode to verify capture alignment. This plugin generate the exact same audio-signal from MIDI data that the backend also generates: Note-on: +1, Note-off: -1.]]
10 function dsp_ioconfig ()
11 return { { midi_in = 1, audio_in = 0, audio_out = 1} }
14 function dsp_run (ins, outs, n_samples)
16 for s = 1, n_samples do a[s] = 0 end
19 ARDOUR.DSP.memset (outs[c], 0, n_samples)
22 assert (type(midiin) == "table")
23 for _,b in pairs (midiin) do
24 local t = b["time"] -- t = [ 1 .. n_samples ]
25 local d = b["data"] -- get midi-event
26 if (#d == 3 and (d[1] & 240) == 144) then -- note on
28 outs[c]:array()[t] = 1.0
31 if (#d == 3 and (d[1] & 240) == 128) then -- note off
33 outs[c]:array()[t] = -1.0