Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/osch/lua-ljack
Lua binding for the JACK Audio Connection Kit
https://github.com/osch/lua-ljack
jack jackaudio linux-audio lua lua-audio lua-binding lua-capi lua-library lua-midi midi
Last synced: 5 days ago
JSON representation
Lua binding for the JACK Audio Connection Kit
- Host: GitHub
- URL: https://github.com/osch/lua-ljack
- Owner: osch
- License: mit
- Created: 2022-02-22T08:22:42.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-10T01:02:35.000Z (about 1 year ago)
- Last Synced: 2024-11-17T01:12:32.586Z (2 months ago)
- Topics: jack, jackaudio, linux-audio, lua, lua-audio, lua-binding, lua-capi, lua-library, lua-midi, midi
- Language: C
- Homepage:
- Size: 147 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LJACK
[![Licence](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE)
[![build status](https://github.com/osch/lua-ljack/workflows/build/badge.svg)](https://github.com/osch/lua-ljack/actions/workflows/build.yml)
[![Install](https://img.shields.io/badge/Install-LuaRocks-brightgreen.svg)](https://luarocks.org/modules/osch/ljack)Lua binding for the [JACK Audio Connection Kit](https://jackaudio.org/).
This binding enables [Lua] scripting code to registrate ports and to manage port
connections and Lua audio processor objects for the JACK Audio Connection Kit.
Realtime audio processing of [Lua processor objects](./doc/README.md#processor-objects)
has to be implemented in native C code.[Lua]: https://www.lua.org
#### Further reading:
* [Documentation](./doc/README.md#ljack-documentation)
* [Examples](./examples/README.md#ljack-examples)## First Example
* This example lists all JACK ports and connects the first MIDI OUT port with
the first MIDI IN port if these are available:
```lua
local ljack = require("ljack")
local client = ljack.client_open("example01.lua")
local function listPorts(type, direction)
local list = client:get_ports(".*", type, direction)
print("Ports", type, direction)
for _, p in ipairs(list) do
print(" ", p)
end
print()
return list
end
local audioOutList = listPorts("AUDIO", "OUT")
local audioInList = listPorts("AUDIO", "IN")
local midiOutList = listPorts("MIDI", "OUT")
local midiInList = listPorts("MIDI", "IN")
if #midiInList > 0 and #midiOutList > 0 then
local p1, p2 = midiOutList[1], midiInList[1]
print(string.format("Connecting %q\n"..
" with %q...", p1, p2))
client:connect(p1, p2)
end
```