---------- Forwarded message ---------- From: Mike McGonagle mjmogo@gmail.com Date: Mon, Mar 3, 2008 at 6:15 PM Subject: Re: [PD] Simple tutorial on using Lua with PD To: Claude Heiland-Allen claudiusmaximus@goto10.org
On Mon, Mar 3, 2008 at 5:37 PM, Claude Heiland-Allen < claudiusmaximus@goto10.org> wrote:
Mike McGonagle wrote:
Hello all,
Over the weekend, I was trying to figure out how Lua works with PD. While I have everything installed from the extended stuff, I still can't quite figure out where to begin.
The examples should be clear enough I hope, if you have any specific questions about a specific example then please ask :-)
Well, I guess what is troubling me is that we I try to run the "lua-help.pd", and click on the [load hello( message, it produces the following:
error: lua: error in dispatcher: [string "pd.lua"]:226: attempt to index local 'atoms' (a nil value)
And then I tried the "luax-help.pd" file, and everything appears to work fine.
I guess my troubles seem to stem from "where should everything go, and what is the difference between 'lua' and 'luax'"?
Is there some sort of README, or something, that explains how to work with "pdlua"? I did try to run the help file that is in the distribution, but when I clicked on the [load hello( message, it complained about not being able to find some 'atom'.
That bug is already fixed in my SVN repository, thanks to robc for spotting it (iirc):
svn co https://devel.goto10.org/svn/maximus/pdlua pdlua
So, is your SVN different from the one that Pure Data is using? I downloaded the latest version this morning at about 11:30am Central time.
Best place to start is reading through the examples, but there is some documentation too, and also the source code for details.
Could you explain some things about how Lua uses the search paths? And where we should be putting our files?
Also, is there some documentation about what things are provided by 'pd.lua'? Or is all that stuff just what is needed to get things loaded and running (ie, no user accessible methods).
I don't use pd-extended so I don't know how much of pdlua is included, also it would be nice for pd-extended to use svn:external or whatever the mechanism is for tracking other repositories, maybe the stable releases could use my stable releases and maybe the autobuilds could use the development svn version.
Any links to where I can get your latest?
Mike
On Mon, Mar 3, 2008 at 6:17 PM, Mike McGonagle mjmogo@gmail.com wrote:
I don't use pd-extended so I don't know how much of pdlua is included,
also it would be nice for pd-extended to use svn:external or whatever the mechanism is for tracking other repositories, maybe the stable releases could use my stable releases and maybe the autobuilds could use the development svn version.
Any links to where I can get your latest?
Opps, sorry, guess I just wasn't looking... Thanks for the link...
Mike
Mike McGonagle wrote:
I guess my troubles seem to stem from "where should everything go, and what is the difference between 'lua' and 'luax'"?
'lua' is a load-once loader, much like C externals - once you load them you can't change them easily (but see the mutation examples).
'luax' is a load-repeatedly loader, much like Pd abstractions - each time a [luax mything myargs a b 1 2] is created it reloads the script and uses it to create an object.
that makes it easier to convert 'luax' to 'lua' once you have something working satisfactorily).
Note: the next version of pdlua will change the filename extensions from .lua to .pdlua and .luax to .pdluax to avoid polluting Lua's namespace with the names of Pd objects written in Lua.
svn co https://devel.goto10.org/svn/maximus/pdlua pdlua
So, is your SVN different from the one that Pure Data is using? I downloaded the latest version this morning at about 11:30am Central time.
I don't know who/how/why my code is in pd's SVN, but it's fine as long as whoever imported it tracks my changes, I guess (which is what the special SVN features are designed for).
Could you explain some things about how Lua uses the search paths? And where we should be putting our files?
Lua uses the Pd search path, so it will look relative to the containing patch first, then the other Pd path settings.
Also, is there some documentation about what things are provided by 'pd.lua'? Or is all that stuff just what is needed to get things loaded and running (ie, no user accessible methods).
It's about 50/50 split between internal stuff (generally prefixed with a '_' character) and public stuff, you shouldn't really need to read it if the documentation is adequate, but I admit docs are the last thing to get done.. The doc/ folder and the examples/ folder are the best place to start, I think.
Hope this helps,
Claude Heiland-Allen wrote:
Note: the next version of pdlua will change the filename extensions from .lua to .pdlua and .luax to .pdluax to avoid polluting Lua's namespace with the names of Pd objects written in Lua.
svn co https://devel.goto10.org/svn/maximus/pdlua pdlua
So, is your SVN different from the one that Pure Data is using? I downloaded the latest version this morning at about 11:30am Central time.
I don't know who/how/why my code is in pd's SVN, but it's fine as long as whoever imported it tracks my changes, I guess (which is what the special SVN features are designed for).
anyone objects if i remove pdlua from the pure-data repository and include an external reference to claude's upstream repository? it shouldn't make a difference, and pdlua will stay automatically in sync.
fgamsdr IOhannes