I want to create Pure Data patches using the Lua language, so I can use these sounds inside Lua applications. For that, I'm using this code:
require("pd")
require("pdlua")
-- create a new Pure Data patch
patch = pd.newPatch(1, 1)
-- create an object and connect it to the output
pd.sendMessage(patch, "pd dsp 1")
pd.sendMessage(patch, "pd object [osc~ 440]")
pd.sendMessage(patch, "pd connect 0 0 1 0")
-- send a message to the object to start generating a sound
pd.sendMessage(patch, "pd message 1 0 bang")
Entretanto, ao executar o código eu tenho o seguinte retorno:
lua: teste.lua:2: module 'pdlua' not found:
no field package.preload['pdlua']
no file '/usr/local/share/lua/5.4/pdlua.lua'
no file '/usr/local/share/lua/5.4/pdlua/init.lua'
no file '/usr/local/lib/lua/5.4/pdlua.lua'
no file '/usr/local/lib/lua/5.4/pdlua/init.lua'
no file './pdlua.lua'
no file './pdlua/init.lua'
no file '/usr/local/lib/lua/5.4/pdlua.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './pdlua.so'
stack traceback:
[C]: in function 'require'
teste.lua:2: in main chunk
[C]: in ?
But I have the pdlua library installed on my computer (Linux Mint 20.04). Any suggestions what's going on?