You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup the build environment as described here, then:
$ git clone https://github.com/stetre/luajack
$ cd luajack
luajack$ make
luajack$ sudo make install
Example
The example below creates a JACK client that simply copies samples from an
input port to an output port. Other examples can be found in the examples/
directory contained in the release package.
-- Script: example.luajack=require("luajack")
-- Open a JACK client:c=jack.client_open("myclient")
-- Create two ports:p_in=jack.input_audio_port(c, "port_in")
p_out=jack.output_audio_port(c, "port_out")
-- Load the 'process' chunk:jack.process_load(c, [[c, p_in, p_out = table.unpack(arg)function process(nframes) -- Copy the samples from the input port to the output port: jack.get_buffer(p_in) jack.get_buffer(p_out) jack.copy(p_out, p_in) end-- Register the (rt) process callback:jack.process_callback(c, process)]], c, p_in, p_out)
-- Register a non-rt callback:jack.shutdown_callback(c, function() error("shutdown from server") end)
-- Activate the client:jack.activate(c)
-- Sleep, waiting for JACK to call back: jack.sleep()
The script can be executed at the shell prompt with the standard Lua interpreter: