Page 1 of 1

LÖVEpd [Announcment and troubleshooting]

Posted: Wed Apr 11, 2012 10:42 pm
by PaulForey
Hello all!

I'm trying out a project. I think it's going very well. It doesn't work.

The long-and-short of the project is this: I wish to be able to utilise the excellent audio/DSP (ish) library libpd (based on Pure Data from within LÖVE. I want to use to make interesting audio/visual experiments/games and generally have fun.

I am calling this monstrosity LÖVEpd and it has a github here.

Being new to this I'm working fairly slow. What I've got so far is a simplistic Lua wrapper for libpd's most important functions. Lua and C seem to be working nicely and I can open a Pure Data patch, send it messages, and receive audio data (big ol' list of numbers).

Where I'm at at the moment is getting LÖVE itself to actually run the Lua that interacts with libpd. What I get is this annoying error:

Code: Select all

Error: error loading module 'luapd_wrapper' from file './luapd_wrapper.so':
	dynamic libraries not enabled; check your Lua installation
stack traceback:
	[C]: ?
	[C]: in function 'require'
	main.lua:4: in main chunk
	[C]: in function 'require'
	[string "boot.lua"]:331: in function <[string "boot.lua"]:227>
	[C]: in function 'xpcall'
My best guess is that I'm going to have to recompile LÖVE itself to have libpd/the wrapper linked in there, but honestly I'm none too sure. I'm currently working on this from a Mac OS X 10.5 machine and I'm having trouble compiling LÖVE at all (I really hate xcode). I'm in the process of upgrading to 10.7. I'm hoping that someone will tell me that upgrading isn't necessary :o:

So anyway, this is part project announcement and part cry for help. Let me know that you think.

Re: LÖVEpd [Announcment and troubleshooting]

Posted: Thu Apr 12, 2012 12:14 am
by slime
The official builds of LÖVE have Lua linked statically, however in order to load C-lua libraries via require() Lua needs to be linked with LÖVE dynamically. My OSX LuaJIT build of LÖVE 0.8.0 has LuaJIT linked dynamically so it should work (although I have not tested it personally). There are some additional complications with making the Windows version of LÖVE work with a dynamically linked Lua, so my regular LuaJIT build for windows is not dynamically linked with LuaJIT, however I have a separate one here which is - but with the downside that printing to the console won't work.

Re: LÖVEpd [Announcment and troubleshooting]

Posted: Fri Apr 13, 2012 6:30 am
by bartbes
Love's loader for dynamic libraries should work regardless, though.

Re: LÖVEpd [Announcment and troubleshooting]

Posted: Fri Apr 13, 2012 8:41 am
by miko
bartbes wrote:Love's loader for dynamic libraries should work regardless, though.
As I understand this code: http://www.lua.org/source/5.1/loadlib.c.html the messages show only when Lua is compiled without -DLUA_DL_DLOPEN (unix), -DLUA_DL_DLL (windows) of -DLUA_DL_DYLD (mac os) - so yes, recompilation of Love would be needed.
Also, check out this thread: http://lua-list.2524044.n2.nabble.com/q ... 44490.html

Re: LÖVEpd [Announcment and troubleshooting]

Posted: Sun Jun 03, 2012 3:12 pm
by PaulForey
Thought I would update here since I've actually made some progress now.

I've been on my Windows machine recently, so there's no actual progress on my Mac version of this, but the Windows version is running! When I make Love run my project folder, it will load and run my luapd DLL and lovepd lua script and I've currently got a black screen which I can click to fire missiles at and the sound effects for the missiles are generated via libPD. Yay.

Now I have to make the Mac version work, and then the Linux version, then actually make a game/demo.

Big-ups to the IRC folks for helping me out so far :D

Re: LÖVEpd [Announcment and troubleshooting]

Posted: Tue Oct 02, 2012 10:23 am
by jonbro
I know this is an old thread, but this is cool work. I might be able to help out with the mac version of this. I will take a look at it soon!