Technology


I have been developing a couple projects with some friends for the Propeller chip. Which is an extraordinarily powerful micro-controller. The latest project uses the Ping))) sensor and the Hydra Sound System (HSS) to generate sounds based on your hand position over the ping sensor.

To make sense of the HSS sfx_play interface I wrote a little program that allows me to adjust the parameters in real time using a keyboard attached to the propeller. I use it to find a sound then write down those parameters for future use.
tp03.zip This requres the HSS.

Starting around 5:20am CST on 05.22.07 it looks like a spammer is using my domain name as the From: field in their spam. I had a catch bucket turned on for the domain and in less than 30 minutes I got around 1000 bounce notices. Had I had the bucket turned off I never would have seen them doing this.

I wish there were something I could do about this, but there isnt. The mail isn’t going through my server at all. I’m only being refrenced in the From fields. See Wikipedia Email Spoofing and Joe Job Like Automated Spam

I have just posted my howto article about using classical art to make expert color corrections to photos.

See my gallery of tonemap images.

The Speech Code Generator.

About a week ago Vern got a Soundgin™ sound module. He had a few hours to play with it before I took it away. Besides just being an awesome sound generator it has about 70 built in allophones for speech synthesis. The one he ordered came with the chip and a board with a rs-232 interface, an amp, and power circuit. Its super easy to talk to the chip over a serial connection. Commands are given to it by sending bytes of data. Speech is done the same way just send the code for an ‘a’ (which is xC1) and the chip will gladly say ‘a’ until you give it another command. Like pause (xFC).

Vern does most of his robot development using the Basic Stamp II which is a really nice board. So I set out to write some code that would generate BS2 code to generate speech. To accomplish this there are a few steps.

First the English text needs to be converted into a machine format. Luckily CMU did all the work for this when they made Festival and Flite (Festival Lite.) I am using a package from flite called t2p. Its operation is pretty simple:

$t2p "Hello World"
gives: pau hh ax l ow1 w er1 l d pau

Next those phones that t2p spit out have to be converted into the format that the sound module uses. For this I wrote a php program inspired by one that someone else had written in perl for his tts project using the speakjet chip. The code comes down to two things. A translation table and a preg_replace line.


$patterns[70] = ‘/PAU /’; $replacements[70]=”\xFC”; // .FD0
$patterns[71] = ‘/AX /’; $replacements[71]=”\xC1″; // .au
$say=preg_replace($patterns, $replacements, strtoupper($input_text));

Then for testing the codes I wrote a python program to just simply take stdin one character at a time and send it to the chip. Keeping a close watch on the CTS line. My testing flow looked like this:

t2p "Hello World" | php5 -q ./cmu2sg.php | ./send_to_serial.py

Now that the main part of testing is over I have written the php code to call t2p then give the output in BS2 format. I’m sure a lot more tweaking could be done to the conversation table. To improve the CMU phones to sound chip conversion. Right now I think I am only using about 1/2 of the available ones.

Sometime last year I was given a laser pointer that had 3 buttons on it. One to light the laser, an up arrow and a down arrow. It came with a IR to usb receiver that showed up under linux as a keyboard device. Obviously this was meant for doing presentations using the up and down buttons to advance the slide show. I hooked it up and used it to control XMMS.

Even though the commands that the thing was sending didn’t line up XMMS’s previous(Z) and next(B) buttons. I learned that by pulling up the menu and pointing to an option then hitting the key would reassign the function to that key.

About 2 dance parties later and the remote fell out of my pocket and was damaged.

Since then I have tried a couple of different things. None were to my satisfaction. Most of the presenter remotes or IR->USB adapters are in the $60-80 range. Way to high for me.

One thing I tried was using a Playstation 2 to usb adapter and connecting that with a wireless PS2 joystick. It worked ok. But having to have a huge ps2 adapter on you just to change songs kinda sucked…. Plus it was a little clumsy to FF and REW.

Today when I was at Frys I saw a little package in the PS2 isle (sku 3638375 ). It had a wired ps2 vibrating controller, a old school ps2 vertical stand, and a IR wireless remote and adapter for $7.90, I bought it. That is in my price range. (I am sure the price was only that low because the stand in it is for an old model ps2 that Frys no longer carries.)

I hooked it up enabled the Joystick Control 1.2.10 plugin for XMMS then mapped the keys. This thing works perfectly. It is really responsive. As a plus I also have an extra ps2 controller.

As part of the purging process of becoming a nomad we are trying to make an archive of important data. This is not an easy task. We have about 30 Gigs of photos. I know there are duplicates in the data but I haven't done anything about it until now.

In integrity part1 I told how to check the md5deep database (just a text file with md5sum and filename) to see if there are any duplicates. Example:  sort -n md5.test_data.txt | uniq -D -w 32 This will check the first 32 bytes of the md5 sums after sorting them. This works great for detecting duplicates.

But what can I do about them? Sometimes I have a duplicate on purpose. For example if I have a directory tree with 500 photos from a single shoot I want to make a directory with the "best of." I could do several things: Make symbolic links to the files, copy them to a new folder, or store best of stuff outside the main backup tree. I opt for just making a copy of the file into a "bob" folder. It is wasteful of space but this is the method that I choose.

So now that I have copied them I have files with duplicate md5sums. After pondering on this for a while I came up with the idea of changing the jpeg comment field to say something like: "I know this is a copy" or "Best Of Photos."

To accomplish this I am using my good friend jhead - the jpeg header manipulator. Example:

find ./best_of_best/ -type f | xargs -n1 jhead -cl \"Best of Photos\" 

This does the trick… now each file even though it is really the same photo with the same image data and same file name has a different md5sum.

Some duplicates in the archive are caused by sloppy photo management. Sometimes I do not delete the files off of a card before taking more and end up having more than one copy of a photo in different directories. With the jpeg header trick I can now either delete them or just change the comment field.

I suppose in the future when I start using the comment field more this method could overwrite valuable comment info. I guess when that becomes a problem I will add checks to make sure the comment field is empty before overwriting.

A few weeks ago I did some photography of skulls using a laser. After that experiment my friend Vern and I started talking about putting the laser on two servos and making it computer controlled. He built an apparatus for me in a surprisingly short time.

  He mounted a $ store laser to a servo to control tilt and mounted that servo to another one to control pan. Simple. He hooked both of these up to a basic stamp controller and mounted them to a board. Then wrote code to make the laser sweep side to side and up and down. 

I took the code he sent me made some modifications and did the first test. You can see from the hires version that it looks like the laser is sweeping past each line twice. I'm not sure why this is.

On the second test I decreased the vertical step so that the lines are closer together and the exposure is longer.

For the third test I made the lines really close together to almost bathe the scene in laser light.

Now I decided it was time to turn it into a grid. So I rewrote the code to sweep left to right while moving top to bottom. Then to switch directions and move top to bottom while sweeping right to left.

The grid came out more regular than I had expected.

For the last test of the evening I just tightened the grid up.

If you are curious here is what the scene looked like with the lights on and with the laser sweeping. You will notice in all the photos that there is a red light on the left hand side. That light is the laser.

Here is the Basic Stamp Code that made the grid.

My cat likes to chase a laser pointer. While I was playing with him the other day I ran the laser point across a poster that I made hanging in my living room. I noticed that as the spot passed over black areas of the poster the light reflected back dimmed and over a lighter area the reflectivity increased. I discovered something that people had discovered thousands of years ago. That different materials absorb light differently. Not a big thing, I know.

But this gave me an idea. What if I were to do a long exposure on a camera as I swept the pointer back and forth. It should make a series of lines of varying widths. That might look neat. I decided to give it a try. 

I guessed the best way would be to build something to hold the laser and sweep it past the object while moving it up and down. A screw seemed like the perfect way to do this. As it sweeps past the object it lowers automatically. I never did come up with a way to make the pointer sweep left to right while moving down. Gravity kept interfering. What I did come up with was mounting the screw horizontally so that the pointer sweeps top to bottom and moves left to right.

At the hardware store I picked up a threaded rod and some washers. This one is 5/8" diameter.  I built my light kit (which I will explain later in another post) into a simple cube with a place to hold two ends of the screw. On one end of the screw I put a mounting to hold the laser pointer and on the other a place to attach a hand drill.

 For my first test I used a alien skull I had sitting on a shelf.  The skull doesn't really have areas that bring out the absorbing light that originally attracted me to this project but it does have a nice 3d shape.

The photos of the first pass and the second one came out a little dark so I had to enhance them. The results are good.

Next I want to try mounting a laser pointer on a computer controlled thingy. My friend Vern says he can build a device that can position the laser pointer given an X and Y position. He will build it using two servo motors and a basic stamp processor. This will allow me to do things like sweep a grid pattern over an object while doing the long exposure.

I hope the photos from the next one come out looking as groovy as these did.

The first test image:

The second test image:

After creating the page for the MP$ calculator, I decided to give a go at updating the Austin Storm Center to use some of the layout technology that I had used in the MP$ calc.

The main thing that gives both of the sites their unique look and feel is the <fieldset> and <legend> tags. I believe these were first introduced in HTML 4.0 so older browsers probably won't support them. I really need to get a look at them on an old browser. I wonder if I have a really old copy of Knoppix or something with an old firefox. Someone needs to make a site where you can view how your page works on different browsers and vesions.

I decided to go with some pretty progressive color schemes. That is to say I used a complementary color scheme. Things from opposite sides of the color wheel. Putting blues and orange/yellow next to each other. Very web 2.0 8)

« Previous PageNext Page »