Monday, April 30, 2012

Speaking of speakers...

I decided a while ago to remake the speaker panel since it wasn't up to par with the rest of the machine. The old version was also crooked and I'm actually quite ashamed that I left in the machine for so long... But I'm finally seeing the end of that now!

Using a piece of left over plywood from the intended playfield wood (more about this in another post) I used the decal as a template so that the edges match up perfectly. It has been given two coats of black paint to resist smaller scratches.

1) Comparison of the old (upper) and the new (lower) speaker panel. Much nicer!
Note the unpainted interior - I'm avoiding painting any surfaces that might get exposed to heat. Good or bad?

So far so good!

Then the first (ever!) decal was applied to the panel giving it a rather professional finish in an instant. I've always been fond of having decals on the speaker panels since it gives a more complete, non generic, look to the final machine.

2) Decal applied. This was printed way back when, but have not been put to use yet. I'm urging not to apply the rest of the decals yet since the machine is still under construction - what if I accidentally scratch the sides? Doh!

Finally - the speaker grills were mounted. My original plan was to use the classic "internal" speaker grills, but I failed somewhat miserably cutting perfectly round circles... And in the end - I like it this way.
3) And here it is - somewhat representative of the final version! Looks quite nice in my opinion. But I'll probably play around a little more with the black next time around, since it looks a little bleak compared to the superblack on the speaker grills. Well well, you live - you learn.

Next I will apply the display protector (with a sun filter screen), mount the display and speakers. I may also mount an inner protector/rim inside the display cavity. I've not yet decided if I will be keeping the current way of accessing the interior from the back or switch the hinges and have the speaker panel swing towards the front.

Thursday, April 12, 2012

FPGA thoughts

I noticed that Sparkfun has a FPGA development board for around 40$.
That's very cheap considering what you get!

To go FPGA or not to go FPGA, that's the question...

Ballroom Bits!

Sat around last night and corrected the DMD export script.
It turns out that the image data was not properly created (wrong colors etc) - I believed this problem was in my "color = color/nr_of_shades" but as it turns out, it was a different problem completely.
This became apparent once I added a previsualization image directly on the computer by simply creating a new temporary image from the converted data, where the image I did the conversion on had already become garbled even before the conversion had begun.

Now every image is first converted to a grayscale 8-bit image, then posterized (gathering similar colors) into a 3-bit image (7 shades + black). Looks stunning and no need to create indexed images first etc.

I also got the bit packing in place so that each pixel only consume 3 bits in the DMD-file. For a single frame image I went from 4096 bytes to 1366 bytes. On top of this I added a header of 2 bytes containing the number of frame in the image, for a total byte count of 2+(1366*amount_of_frames).  Each frame is actually 1365 bytes and 3 bits, with 5 bits padding.

This should mean I get the same amount of data loaded in 1/3 of the time it's previously taken to load an image of the SD card. I say should - because it's untested as I didn't have time to write the matching software on the Chipkit board.

When that's done I need to tweak the preview image so that I get a more accurate preview of the final image as it would appear on the DMD. The current image contains a little too even color distribution where the DMD has most of it's shades in the upper half of the scale. It's either this, or more preferably, tweak the actual DMD rendering routine so that I get a more even color distribution - Hopefully I'll be able to go darker in color now that the SD card loading is faster (more processing time available for rendering).

Now, if only I could get rid of the initial 5 ms unnecessary SD-card buffering as well...

A couple of pics for comparison:
1) As seen on the computer screen. A little too perfect and too red, as the next picture shows...

2)  The same file loaded and displayed on the DMD, complete with smearing on the camera.
As you can see, a lot of the finer shades are not represented properly. I need to tweak this a lot, i.m.h.o.

Saturday, April 7, 2012

Those noisy rules...

Despite the lack of updates recently, quite a lot of work has been done on the machine.

I've evened out the surface of the cabinet including repainting and filling various dents and differences that would be visible through the decals when applied. That took quite a while to do. With a little luck the surface should be ideal for the decals now.

I've also begun recreating the speaker panel on the head, since the one I have now is not ideal - the display hole is a bit too small and the panel itself is slightly arched due to the nature of the wood I've used. I'm thinking it should be possible creating the panel in acrylic to get small or no edges between the artwork and the "glass". I might also do a combination with a wooden frame overlaid with a acrylic surface.

I've begun the selection of sound clips and combining them with the ruleset. I've used up around 180 samples out of 255 possible for sound effects and around 30 samples for music - while still filling all the major elements. The extra slots can be used to create variations of the elements already in place, avoiding hearing the same sample whenever you hit the same target repeated times, for example. I could also flesh out the current features allowing additional Splicers to take part etc.

The plan is to have two identical sets of sound samples for the sound effects and one unique set for music.
With a little planing I could vary the two sound effect sets slightly - for instance, all mode start samples for a specific mode could be limited to only one card since no other samples will be playing during that time.
But I do want to avoid this since that would require special code to handle each case instead of just "playSound(x)". But in case space is running out...

Some of the features I've planed I'm having troubles finding sound samples for. I might have to wing it a little and either create my own samples or use external sound samples outside the Bioshock universe...