LÖVEpd [Announcment and troubleshooting]

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
PaulForey
Prole
Posts: 4
Joined: Wed Apr 11, 2012 3:42 pm

LÖVEpd [Announcment and troubleshooting]

Post 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.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: LÖVEpd [Announcment and troubleshooting]

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LÖVEpd [Announcment and troubleshooting]

Post by bartbes »

Love's loader for dynamic libraries should work regardless, though.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: LÖVEpd [Announcment and troubleshooting]

Post 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
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
PaulForey
Prole
Posts: 4
Joined: Wed Apr 11, 2012 3:42 pm

Re: LÖVEpd [Announcment and troubleshooting]

Post 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
jonbro
Prole
Posts: 8
Joined: Tue Oct 02, 2012 10:18 am

Re: LÖVEpd [Announcment and troubleshooting]

Post 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!
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests