2016-07-29 Update zh.po for Ardoru 5.0
[ardour.git] / scripts / synth1.lua
index d0c6ad7a52f9d344968844d18a679faccee66e26..90da05d41e8b1604bdf687cc39d87f3edc247942 100644 (file)
@@ -1,21 +1,25 @@
 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},
+       --      { 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
        }
 end
 
-function dsp_midi_input ()
+function dsp_has_midi_input ()
        return true
 end
 
@@ -34,7 +38,6 @@ end
 
 function dsp_run (ins, outs, n_samples)
        -- initialize output buffer
-       assert (#outs == 1)
        local a = {}
        for s = 1, n_samples do a[s] = 0 end
 
@@ -65,8 +68,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
@@ -96,5 +99,7 @@ function dsp_run (ins, outs, n_samples)
        synth(tme, n_samples)
 
        -- copy
-       outs[1]:set_table(a, n_samples)
+       for c = 1,#outs do
+               outs[c]:set_table(a, n_samples)
+       end
 end