Results 1 to 6 of 6

Thread: LaserBoy 06-08-2008

  1. #1
    Join Date
    Jan 2006
    Location
    Akron, Ohio USA
    Posts
    1,754

    Default LaserBoy 06-08-2008

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Akron, Ohio USA
    Posts
    1,754

    Default

    There is also a new feture in the 'o', file output menu, 'i' saves all of the system settings in a file called LaserBoy.wtf. If this file exists, LaserBoy loads it.

    James.

  3. #3
    Join Date
    Jan 2006
    Location
    Akron, Ohio USA
    Posts
    1,754

    Default

    Eeeiiiwww!

    For some reason this version of LaserBoy is absorbing key strokes!

    Bummer.

    Let me know if your computer bursts into flames.

    Take pictures!

    James.
    Last edited by James Lehman; 06-08-2008 at 20:40.

  4. #4
    Join Date
    Sep 2006
    Location
    Netherlands
    Posts
    1,435

    Default

    ... new feture in the 'o', file ...
    Maybe it's your keyboard ;-)

  5. #5
    Join Date
    Jan 2006
    Location
    Akron, Ohio USA
    Posts
    1,754

    Default

    No. I'm pretty sure it's boned up.

    I'll fix it! I just have some other horrible things to do with my computer time right now.... like work.

    James.
    Last edited by James Lehman; 06-09-2008 at 14:39.

  6. #6
    Join Date
    Jan 2006
    Location
    Akron, Ohio USA
    Posts
    1,754

    Default

    Whoo Hooo!

    I think I'm on the right track now!

    I had a phone conversation with drlava the other day. He looked at my code for about 2 seconds and said "What that?", referring to a couple of weird looking hexadecimal constants.

    THAT is something that compiled OK in pure Linux, I guess. It's also what is messing everything up in my sample shifting routines.

    Now I have to carefully examine my old Linux code and see what is really going on, but I think I get it now!

    Thanks man!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •