LaserBoy
Software => Laser Software => Laser Agent => Topic started by: Agent C on October 09, 2009, 02:46:49 pm
-
These are the files. You'll need the Processing IDE or whatever from processing.org. After you unarchive the files, open lasershow4.pde
You will also need several libraries. Please see the library post further down in this thread.
The code is currently very messy. Maybe having people looking at it will give me an incentive to clean it up - kind of like my basement.
Let's keep specific code changes and what-not in this thread.
-
d-loading now
-
Note that release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.
tried to get jama-1.0.2.jar and put it in the lib folder, the libraries/jama folder
in the sketchbook folder under both the processing folder and the lasershow4 folder.. none worked.. how to i install Jama library corectly?
-
Oh yeah, good point. ;D I should package or at least list the needed libraries. I will check when I get home. The Jsyn sound library is one of the most important for good multichannel sound out in java.
If I recall, I had to install Jsyn as a library in the system Java lib folder. Again, I'll check when I get home as I've installed it on mac and pc.
PS> I don't know if it's worse to reply to my own post or edit an old post like James, but I'll follow convention of the site.
There is a DLL associated with JSyn that talks to the hardware for better performance. This needs to be in the java libs folder if I'm not mistaken. That's why this library needs to be installed for java, which processing relies on.
I have not finished the sound engine to work in windows. It would be nice if it automagically worked but it doesn't because windows does not report the c-media sound card as one interface with 6 channels. Instead it reports something like 3 stereo interfaces and I haven't invested the time to write a platform specific adaptation layer. J-syn is not a high level enough library to do this on its own and there has been discussion about it in the forum. I also think that this may change under windows vista or 7 as the underlying sound architecture has changed. Professional mutli-channel cards on windows can use ASIO drivers I'm told, and there is an ASIO version of Jsyn for windows but it isn't free to download. I'll burn that bridge when I get to it.
-
kool thnx..
-
PS> I don't know if it's worse to reply to my own post or edit an old post like James
That cracks me up! ;D
You're pretty much screwed either way! %)
James. :)
-
its better to reply to your own post FYI..
that way someone that read the post but did not reply, will see that a new post has been entered on the front page.
-
If a post has been editted I see a new post indicator but I can't tell which item was editted. 9 out of 10 times I won't bother to search for it. So, if you want to edit a post that is fine with me but don't expect me to read it. If you add a new reply I will always read it, though.
-
i rest my case :)
-
ok so thats all well and good..
lets get back to Jama...
-
There are two kinds of libraries, processing libraries and java libraries. Processing being java with icing can take advantage of both.
General Java Libraries you will need:
Jama - The Java Matrix Package, useful for rotations and transforms, supposedly highly optimized math routines
JSyn V144 - A low level soft synth package that can talk to multichannel hardware
Processing Libraries you will need
Promidi - Talk to midi controllers
DXF - To load dxf files, this might be included in processing now
How I installed them:
Everything went into the libraries folder of processing, which on a windows system lives in My Documents by default. This includes the general java libraries contrary to what I said in an earlier post.
For example, on my windows box:
C:\Documents and Settings\Administrator\My Documents\Processing\libraries
contains the folders
jama, jsyn, objloader, promidi
and in each one of those folders there is another folder called library, and inside that folder there is the .jar for the library
C:\Documents and Settings\Administrator\My Documents\Processing\libraries\jama\library\jama.jar
For Jsyn, which has a platform specific library (dll, lib, so, etc), you have to copy the platform specific library to the appropriate place described in the docs (eg C:\Windows\system32).
I have edited the first post to direct people to look at this post.
-
bleh.. so confusing... got any links to the libraries?
-
JAMA - http://math.nist.gov/javanumerics/jama/
JSyn - http://www.softsynth.com/jsyn/
promidi - http://creativecomputing.cc/p5libs/promidi/
DXF - distributed with processing
-
great.. but your instructions are lacking..
i would be glad to play with it but i cant even get it to compile..
-
"instructions" ? ???
What?
I thought you were a laserists!
We don't need no stinkin' instructions! 8)
James. :)
-
What OS are you working with?
The code posting is more to satisfy the curiosity of those who wanted to see how the sound engine works and how I get from openGL to audio. There are really all of 12 or so trickfilms (to borrow terminology from the Lasergraph), so there isn't much to do anyway. I'll try to help everyone get it to compile on their platform of choice.
On another note, I'm going to have to rip apart the openGL engine and rebuild it anyway. There is a fundamental flaw in how I handle the laser shape classes that causes unwanted blanks. The way I have it written now automatically inserts a blank at the end of a laser segment. The problem I'm seeing is that a simple closed shape, like a circle, will have a little blank notch in it from when the segment ends, the laser is momentarily blanked, and the segment begins again from the beginning. A more complicated problem is in shapes with multiple segments with closed geometry like a circle of circles. Each circle has a little notch in it. Bleh.
-
That little "bleh" is a real p.i.t.a!
I just fiddled with that exact same thing!
This is where just the right amount of dwell (extra samples) and perfect timing between the colors and the galvos is super critical.
James. :)
-
windows 7 is my OS
-
That little "bleh" is a real p.i.t.a!
I just fiddled with that exact same thing!
This is where just the right amount of dwell (extra samples) and perfect timing between the colors and the galvos is super critical.
James. :)
There are a couple of possibilities, and I agree that dwell is important part. DPSS lasers have a warm up time with analog modulation. I think the warm up time is making the problem look worse. The next thing is sample shifting.
Let's say I want to draw a circle with 1000 points.
I'll start from the buffer as it comes back from the graphics card
Buffer is parsed, x,y,r,g,b values are placed into an array.
x,y values are copied to sample queues that is sent to the sound card at a fixed rate
r,g,b values are shifted 5 points, then copied to their respective sample queues.
Thread grabs the buffer for next graphics frame, which is the circle again.
Meanwhile, scanners start moving, 5 points later the laser comes on, stays on for 1000 samples.
Hopefully there isn't a buffer under-run, and the thread responsible for stuffing data into the queues has managed to stuff another 1000 points in by the time its needed.
The scanners come back to the top of the circle, then start moving again. The laser shuts off 5 samples later, and powers back on 5 samples after that. Hence the gap.
-
Sample shifting is not an easy thing to code!
The offsets have to be maintained through the entire play of the stream.
James. :)
-
I think I will save a few samples from the previous frame, try to ascertain if the last point is lit and the first point of the next buffer is lit and if they are close enough to keep the laser lit. We'll see this weekend if it works.
-
Inspired by a failed battery and a 5 year old chip on my mac laptop, I'm going to be switching development over to windows until I can afford a newer laptop. With this in mind, I'll do a much better job of abstracting the platform dependent portions of the code (ie audio out and maybe now video in). I'm hoping this will get more people testing the software out, too.
-
Might I suggest using Dev-C++ ?
It is GNU GCC, as you probably know.
James. :)