-function dsp_configure (ins, outs)
- -- store configuration in global variable
- audio_ins = ins:n_audio ()
- -- allocate shared memory area, ringbuffer between DSP/GUI
- self:shmem ():allocate (4 + bufsiz)
- self:shmem ():clear ()
- self:shmem ():atomic_set_int (0, 0)
- local cfg = self:shmem ():to_int (1):array ()
- cfg[1] = samplerate
- cfg[2] = bufsiz
+ -- create a ringbuffer to hold (float) audio-data
+ -- http://manual.ardour.org/lua-scripting/class_reference/#PBD:RingBufferF
+ rb = PBD.RingBufferF (2 * rate)
+
+ -- allocate memory, local mix buffer
+ cmem = ARDOUR.DSP.DspShm (8192)
+
+ -- create a table of objects to share with the GUI
+ local tbl = {}
+ tbl['rb'] = rb;
+ tbl['samplerate'] = rate
+
+ -- "self" is a special DSP variable referring
+ -- to the plugin instance itself.
+ --
+ -- "table()" is-a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR.LuaTableRef
+ -- which allows to store/retrieve lua-tables to share them other interpreters
+ self:table ():set (tbl);