Hello everyone.
I know it's been a while since I've put out a new release of LaserBoy, so here it is!
I already know there are bugs in there. I found a sure fire crash condition and I still can't figure out how to fix it.
There are so many new things in this release that I figured I better get it out there so you can all get used to it!
The menus are a little bit more reasonable. They're a bit more "sticky". When you go into most of them now, you stay there until you [Esc] out.
There is also a whole new section in the menus, 'y', LaserBoy wave utilities. From here you can watch waves you made in LaserBoy on the screen (from wave data directly). You can also invert waves for inverting DACs.
I'd like to develop some standards here and I'd like whatever input from all of you I can get. There are things that need to be done to vector data before storing it in a wave to make it work for a laser projector. I'd like to come up with a sensible way of storing that information in the wave file header in a format "legal" way.
This is what I have so far:
For reference:
http://ccrma.stanford.edu/CCRMA/Cour...ts/WaveFormat/
Everything in the wave header is standard up to the bits_per_sample
Code:
// ez_wave_mode flags may be or'ed together.
#define EZ_WAVE_POSITIVE 1
#define EZ_WAVE_END_OF_FRAME 2
#define EZ_WAVE_UNIQUE_FRAME 4
#define EZ_WAVE_UNIQUE_POINT 8
#define EZ_WAVE_OFFSETS 16
#define EZ_WAVE_OPTIMIZED 32
// This is the last standard part of the wave header...
out.put((char) (bits_per_sample & 0x00ff) );
out.put((char)((bits_per_sample & 0xff00) >> 8)); // byte 16
//----------------------------------------------------------------------------
// extra structures added for LaserBoy !!!
//----------------------------------------------------------------------------
// version tag
out.put('L');
out.put('a');
out.put('s');
out.put('e');
out.put('r');
out.put('B');
out.put('o');
out.put('y');
out.put('0');
out.put('6');
out.put('0');
out.put('7');
out.put('2');
out.put('0');
out.put('0');
out.put('8'); // byte 32 "LaserBoy06072008"
// ez_wave_mode binary flags
out.put((char) (ez_wave_mode & 0x000000ff) );
out.put((char)((ez_wave_mode & 0x0000ff00) >> 8 ));
out.put((char)((ez_wave_mode & 0x00ff0000) >> 16));
out.put((char)((ez_wave_mode & 0xff000000) >> 24)); // byte 36
//----------------------------------------------------------------------------
if(ez_wave_mode & EZ_WAVE_OFFSETS)
{
for(i = 0; i < num_channels; i++)
{
out.put((char)( offset[i] & 0x000000ff) );
out.put((char)((offset[i] & 0x0000ff00) >> 8 ));
out.put((char)((offset[i] & 0x00ff0000) >> 16));
out.put((char)((offset[i] & 0xff000000) >> 24));
}
}
//----------------------------------------------------------------------------
if(ez_wave_mode & EZ_WAVE_OPTIMIZED)
{
out.put((char) (parms.lit_dwell_overhang & 0x000000ff) ); // int
out.put((char)((parms.lit_dwell_overhang & 0x0000ff00) >> 8 ));
out.put((char)((parms.lit_dwell_overhang & 0x00ff0000) >> 16));
out.put((char)((parms.lit_dwell_overhang & 0xff000000) >> 24));
out.put((char) ((u_int)(parms.distance_delta_max) & 0x000000ff) ); // float
out.put((char)(((u_int)(parms.distance_delta_max) & 0x0000ff00) >> 8 ));
out.put((char)(((u_int)(parms.distance_delta_max) & 0x00ff0000) >> 16));
out.put((char)(((u_int)(parms.distance_delta_max) & 0xff000000) >> 24));
out.put((char) ((u_int)(parms.longest_dwell_microsec) & 0x000000ff) ); // float
out.put((char)(((u_int)(parms.longest_dwell_microsec) & 0x0000ff00) >> 8 ));
out.put((char)(((u_int)(parms.longest_dwell_microsec) & 0x00ff0000) >> 16));
out.put((char)(((u_int)(parms.longest_dwell_microsec) & 0xff000000) >> 24));
out.put((char) ((u_int)(parms.insignificant_distance) & 0x000000ff) ); // float
out.put((char)(((u_int)(parms.insignificant_distance) & 0x0000ff00) >> 8 ));
out.put((char)(((u_int)(parms.insignificant_distance) & 0x00ff0000) >> 16));
out.put((char)(((u_int)(parms.insignificant_distance) & 0xff000000) >> 24));
out.put((char) ((u_int)(parms.zero_angle_tolerance) & 0x000000ff) ); // float
out.put((char)(((u_int)(parms.zero_angle_tolerance) & 0x0000ff00) >> 8 ));
out.put((char)(((u_int)(parms.zero_angle_tolerance) & 0x00ff0000) >> 16));
out.put((char)(((u_int)(parms.zero_angle_tolerance) & 0xff000000) >> 24));
out.put((char) ((u_int)(parms.frames_per_second) & 0x000000ff) ); // float
out.put((char)(((u_int)(parms.frames_per_second) & 0x0000ff00) >> 8 ));
out.put((char)(((u_int)(parms.frames_per_second) & 0x00ff0000) >> 16));
out.put((char)(((u_int)(parms.frames_per_second) & 0xff000000) >> 24));
}
//----------------------------------------------------------------------------
// and the rest of the wave file follows...
out.put('d');
out.put('a');
out.put('t');
out.put('a');
I'm thinking of creating a 4 channel LaserBoy wave format that would be {X, Y, TTL, Luminous} for monochrome systems.
This is the kind of stuff that needs to be figured out and standardized ASAP, before there are any number of different variations floating around out there. Any help, suggestions, experimentation, debugging, moral support would be greatly appreciated!
Also, the whole mechanism for sample offsets is totally screwed up! If anyone would like to look at that and kick me in the head, please do!
Oh yeah............. duh!
http://hacylon.case.edu/laser/LaserB...06_08_2008.zip
James.