an episode (or chapter) in the trans.fail series— an ongoing artistic research project into the transitional nature of failure across a broad spectrum of digital media and socio-political spheres. At its core, it is a long-term, continuously evolving experiment in live coding and computational art that seeks to deconstruct sonic images, aiming for a synesthetic experience built through synchronized clusters of intensities drawn from desiring subjectivities and critical theory. Abstraction, affective thinking, deconstruction, glitch, non-narrative algorithmythmaking, and rhythmachines come together in signal and noise.
# 1. Create a Lua state
var lua = LuaState.new()
# 2. Import Lua and Godot APIs into the state
# Optionally pass which libraries should be opened to the method
lua.open_libraries()
# 3. Run Lua code using `LuaState.do_string` or `LuaState.do_file`
var result = lua.do_string("""
local vector = Vector2(1, 2)
return {
this_is_a_table = true,
vector = vector,
}
""")
# 4. Access results from Lua code directly in Godot
# When errors occur, instances of `LuaError` will be returned
if result is LuaError:
printerr("Error in Lua code: ", result)
else:
print(result) # [LuaTable:0x556069ee50ab]
print(result["this_is_a_table"]) # true
print(result["vector"]) # (1, 2)
print(result["invalid key"]) #
# 5. Access the global _G table via `LuaState.globals` property
assert(lua.globals is LuaTable)
lua.globals["a_godot_callable"] = func(): print("Hello from GDScript!")
lua.do_string("""
a_godot_callable() -- 'Hello from GDScript!'
""")
compiling class library...
Found 867 primitives.
Compiling directory '/usr/share/SuperCollider/SCClassLibrary'
Compiling directory '/usr/share/SuperCollider/Extensions'
Compiling directory '/home/random/.local/share/SuperCollider/Extensions'
numentries = 1336105 / 20684480 = 0.065
5920 method selectors, 3494 classes
method table size 21830856 bytes, big table size 165475840
Number of Symbols 15644
Byte Code Size 463473
compiled 606 files in 1.01 seconds
Info: 4 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Emacs: Initializing lisp interface.
Class tree inited in 0.02 seconds
*** Welcome to SuperCollider 3.13.0. *** For help type C-c C-y.
Emacs: Index help topics in 0.949 seconds
Emacs: Built symbol table in 0.0548 seconds