Freedom Odds

Guitar Motion Sensor

page 1 2 3 4 downloads

Rapid Progress

July 15, 2008

Things are happening fast on this project! I have been posting about it on two guitar forums and receiving all sorts of great ideas and constructive criticism from experienced guitarists. Together, acting as members of the guitarist community, we are refining the product into something that *should* be very satisfactory to most people who want it. In fact, things are changing so fast that I'm not going to go back and update information on previous pages that has become outdated, i'll just continue to add what I learn on this and future pages, so check back occasionally for updates if you are following the project. Now, for some new ideas and design improvements, read on.

Welcome Aboard Jason!

As I mentioned on page 2, someone else has jumped on board the guitar motion sensor project. His name is Jason, he lives on the left coast of the USA, and he is 16 years old. I have exchanged some emails with Jason and we just spoke on the phone a few hours ago - he seems to be creative, intelligent, and observant. So observant, in fact, that he has already made a significant contribution to the project by identifying a superior USB interface board that we now plan on using instead of the A-PAC2 described on page 1. It is another Ultimarc product and I'll describe it in the next section, so keep reading for that information. For this early contribution, for some other great thoughts he had to share, and for volunteering to help us all out by pioneering his own guitar motion sensor, I hereby award Jason the title of "co-inventor", haha. Look for more great contributions from this bright young person as the project evolves. Welcome aboard Jason.

The New USB Interface

The image to the right shows the new U-HID Nano from Ultimarc, web page here. Ultimarc, being an innovative leader in the field of arcade controls, has engineered this product and it is just perfect for our application. In fact, this board is so small that the guitar-mounted box has now shrunk down to the size of a roll of dimes (or a fat tootsie-roll). Thankfully it is elongated in shape just like our accelerometer board is (photo on page 1), so we can mount them together in a row inside a small PVC pipe or a square channel of conduit. The U-HID Nano has a nine-pin header and Ultimarc also sells mounting hardware plus a cable with connectors on both ends (though we will cut the cable and use only part of it). They also include a USB cable as well, and I will ask them if they can provide a long cable of 10 feet or longer for a small additional charge. One pin of the nine-pin header is ground, and the other eight are user assigned by some PC-only software. Each of those eight pins can interface to a button, a potentiometer, an LED, provide +5V power, or one of several other options. So it will just be a matter of configuring the board to provide one +5V power output, accept three analog inputs, and interface to the two switches that our experienced guitarist advisors wanted. That leaves two unused inputs that could accommodate a pair of gyros, or perhaps a sensitivity potentiometer, or perhaps just remain unused. So thanks to Jason for identifying this great product for us, well done!

Adding a Control Box

Yesterday an experienced guitarist and forum moderator suggested that we provide an interface for guitar foot pedals. The idea is to set the "extremeness" of two effects, or in other words the sensitivity, and then having the phi and theta angles vary the effects within the limit of that setting. This led to some discussion about an external box with a USB interface that could have a set of buttons, switches and dials in addition to the pedal jacks. It was even suggested that the box could have some retro styling like a retro-scifi appearance, haha - how cool is that? Well, to paraphrase a famous 70's TV show, "We have the technology. We can build it". The image to the right is a photo from the Ultimarc web site of the U-HID Nano's big brother, called simply the U-HID. This board works like the U-HID Nano that will be mounted on the guitar, except that it has a lot more pins for interfacing with a lot more controls. The only information that is lacking right now is the electrical interface for the guitar pedals, where to buy panel-mount 1/4" jacks, and how to wire those jacks. That's not a big deal, we can figure that out and when I do I'll describe it on this rapidly expanding web page. Furthermore, the person who suggested this control box offered to do stuff like perform testing, write reviews, and possibly even host a product web site. More collaboration, I love it! Although I am doing all this for free, there will be some people who want a kit for their own DIY project or who just want to buy the dang thing and we will try to accommodate them if such demand is sufficient to warrant the effort.

It's Going to be a Product!

Wow, do I have some great news to report to you this afternoon! Planning to purchase the Ultimarc U-HID Nano for the guitar motion sensor prototype, I sent an email to a fellow named Andy at Ultimarc asking about some technical details. I mentioned the tremendously positive response that I've been receiving from the guitarist community, and in the closing paragraph I suggested that he might want to consider adding this product to his product line. Well, I almost jumped out of my chair when I read his response, which was that he found the idea very exciting, he saw the huge market potential, and he asked if we could discuss it on the telephone! WooHoo, I replied in email and asked him to call me at his earliest convenience. Well, we talked for a long time and I could tell he was a sharp engineer with plenty of knowledge and skills, as you would expect from a company that makes such excellent products. I shared lots of technical details with Andy and we discussed how to best implement the product, but anyway, long story short they are going to create the product and offer it to us at a very reasonable price!

Knowing how simple the design is, I am confident that a competent engineering team like the folks at Ultimarc will be able to create the prototype and develop it into a production product in a very short time. This means that you can stop making plans to DIY the circuit boards and start making plans to just buy the thing when it's ready! Sometime in the near future Ultimarc will send me a prototype so that I can begin developing the ChucK-based effects software that we will need to complete the system. So great news, this thing is becoming a reality faster than I had imagined it would! Now I'll inform the forum readers and begin other design tasks like figuring out what guitarists want on the control box and so forth. I also need to create some more demonstration software in the mean time, just so that you can do mouse-controlled effects examples on your computer to convince you of just how really cool this product is. What a fun day this has been!

Wah Pitch Demo

On the forum at www.justinguitar.com, someone mentioned that it would be good to have some demos of the concept so that people could try them out to decide if they really wanted to invest in the hardware. Well, I already had Guitar Mouse, which uses your guitar and either a microphone or an adapter to vary a double-wah effect, but then I thought: "what if they don't have a guitar, or don't have one handy?". So I created the Wah Pitch Demo to make testing the HID effect control concept even easier and more universally available to folks. On the downloads page you'll find the ChucK source code for the wah pitch demo. Just load it up and run it, and it will start playing a computer simulated guitar. Thanks to the ChucKist kijjaz for providing the guitar model that we are using, and thanks to me for the Boolean Sequencer that plays the tune. Thank me, thank me very much! Haha.

So, anyway, just move the mouse around slowly on the screen and ChucK will sense the mouse as an HID device just like it will sense your guitar. Move the mouse left for low frequency wah and right for high frequency wah, or wiggle the mouse horizontally for a rapid wah. Move the mouse down for low pitch shifting and up for high pitch shifting. Actually the mouse does not work on an absolute coordinate system so the exact position on the screen required to accomplish any given combination of wah and pitch may change as you move around. But don't worry about that, it's just a software detail. Just use the full screen to get the most effect. Move the mouse in circles or figure eights or whatever strikes your fancy, and notice the response. Well there you have it, a demo that requires only a computer with speakers and a mouse, what could be simpler? Wouldn't it be cool to get this kind of control just by moving your guitar around?

Keeping it "Open"

I received the following email from a guitarist and I thought I'd include it on this GMS page.

Hey, I noticed you might be simply releasing this as a product, which is cool, but I really hope we can continue with having the DIY option, as my idea involved building one of these right into the guitar I want to make. Are you planning to pull all of the information and software for the "open" version? Thanks!

Yes, I most certainly will continue to provide all the information I have for anyone who wants it, freely. This commercialization of the project is simply intended to make it easier for everyone to DIY their own especially for folks with limited electronics experience, and to provide a faster, easier path for those who just want the dang thing with as little hassle as possible. You're still free to go back and build the sensor according to my earler plans or to conceive your own monstrosity if you like, just realize that I'll be writing the software to interface with the Ultimarc product(s). And by the way, my hat's off to you for making your own guitar, that's a project that I would find very challenging, being more of an electronics and software type. Well, we each have our own set of skills and motivations, don't we? Good luck and happy guitar DIY adventures!

Call for Links

I've been sharing information from me to you so far, and at this point I'd like to make a request. In order to develop the effects software, I kinda need to know how to actually program some effects, heh. I already have reverb, wah, pitch and comb filters in my repertoire, and some of my fellow ChucKists on the ChucK forum have been discussing ways to create distortion in a thread there, so I'll have to read up on that. But that's all I know. So I'm asking that if you know how to write an effect in software, if you know of some links about the subject, or even if you know of sites that have circuit-based info about effects, then please take a moment to send me your links. I have the electronics background to read schematics and half of the time actually understand them as well, so even electronics links would be helpful. After all, I can only code what I know and plenty of folks will want plenty of effects, so please educate me, thanks.

Routing Audio

In addition to providing a collection of effects in the various ChucK programs that I plan to create for you, however possible I would like to facilitate the routing of audio within the computer from one application to another. That way you will be able to take advantage of existing effects software which is a huge variety of effects, I'm learning. Now, I'm a total beginner at routing audio, but I am doing it on my eMac using the SoundFlower application, which is available here. There is also Jack, which is here. Both of these are Mac OSX applications, and Jack is also a Linux application, but I don't know of any Windows solutions. Jack wouldn't run on my system, probably because I'm using OSX version 10.3.9 and I haven't upgraded to the latest operating system. But SoundFlower works just fine, and I am sending my iTunes output into ChucK for Ambiophonic enhancement right now.

In addition to SoundFlower and Jack, ChucK has OSC (OpenSoundControl) and MIDI capability, so presumably it will be possible to route audio in either of those ways as well. Actually I must admit that I know nothing much about OSC and MIDI, so I'll have some learning curve to go through before I am able to code them up for you. Anyway, long story short, there *should* be a way to route your guitar signal into your favorite effects processing software in addition to the GMS controls. Hmmm, now that I think of it there may even be a way to use OSC to send the accelerometer control information into some of the effects software, though I have no idea how at this time. Well, I'm opening up a can of worms now so I'd better be quiet about the whole thing until I learn more about it, eh? I'll keep you posted.

Contol Box

July 16, 2008

Today I took a shot at designing the control box, which I made as simple as possible. It will have a U-HID board from Ultimarc in it and four channels of control. These channels correspond to the four degrees of freedom that may be possible with a single 3-axis accelerometer. These are: vertical angle, horizontal angle, jump, and strafe. As shown in the image, there is one dial, one footswitch, and one pedal jack for each channel. The pedals are optional, and the software will auto-detect the presence of a pedal.

The concept of the dial/pedal is to set the "extremeness" of each effect, or in other words the range. This was requested by an experienced guitarist and it makes sense to provide some control over how much of a given effect is applied. The footswitches control which effect is selected by cycling through all of the available choices in a loop. The visual feedback is provided on the screen of the computer, in the text output window and/or graphically.

Although this will be the suggested DIY control box for now, the design will probably change as I get feedback from guitarists. Also, you are free to add your own controls as long as you can modify the software accordingly. I will try to write the code such that it is as easy as possible to make such modifications. Oh, and also the code will have a keyboard interface where the 1, 2, 3, and 4 keys act as the select buttons, and the alphabetetic keys below them act as the dials. That is, the q is channel 1 plus and the a is channel 1 minus, and so on. If other controls are requred, then I'll use other keys and modify the control box to suit.

For styling, I plan to keep the original cast aluminum finish for that crude, industrial look, and then to use cut-out magazine letters under clear tape for the lettering. That way, it will have an original appearance and will have the feel of a message from some criminal maniac to the police trying not to be detected, heh. Kinda twisted, I know, but it might look cool. I welcome you to offer suggestions regarding this design.

Contol Box Simplified

July 17, 2008

I simplified the control box to be the one shown in the image to the right. The left button selects which channel we are on, the right button selects which effect to apply to that channel, and the potentiometer selects the extremeness of the effect. Then if you have a pedal plugged in, the pedal overrides the potentiometer.

I was thinking, which is often dangerous haha, about using a large diameter PVC pipe for the enclosure. Wouldn't that be a cool effects box, a huge cylinder or half-cylinder? The cylinder could be cut lengthwise and either capped off and sealed on the bottom or heck, why not just leave it wide open? What do you think about that?

Guitar Mouse Issues

So far two people have reported trying the Guitar Mouse program and both of them said they had trouble with it. I dunno why, it it is difficult for me to help out when I'm so far away naturally, and maybe I tuned up Guitar Mouse to work on my setup and not yours. So my suggestion is to just punt and ditch Guitar Mouse. It's not all that noticeable of an effect anyway. Instead I'd recommend trying the Wah Pitch Demo which I have added to the download page. The Wah Pitch Demo makes it's own cheezy guitar song so you don't need to muck around with guitars and microphones and audio feedback that might occur and all that jazz. Just fire up the Wah Pitch Demo software and listen for the guitar, then start moving your mouse around... well, you read about it earlier on this page, no need to repeat all that. So punt Guitar Mouse and try the Wah Pitch Demo!

Software Coding Started

Just to keep you fully updated, I started working on the effects software last night. So far it isn't much, but I did work on the user interface a bit. Those two buttons on the above simplified control box will be the left and right shift keys. These are nice big buttons located to the left and right of the keyboard, so they should be easy to press at a gig. The pot / dial / foot pedal will be done by the x-axis of the mouse. That way someone can just slide their finger across the surface of a track pad to set the extremeness, and it's not like it's a two-dimensional thing, just one-dimensional for ease of use. And, um that's it. two buttons and horizontal mouse movement is all we need to control this application.

Also, each effect gets its own Object-Oriented-Programming class (OOP class). This makes the code modular and easy to maintain, reusable also, plus allows me to instantiate mulitple objects. That multiple instantiation facilitates the assignment of any effect to any channel. So if you want you can put a pitch shifter on each channel. Further, the number of channels is specified at the beginning of the program to be four, but could be any number. That way you could simplify things down to two channels or boost it up to eight, all depending on what type of sensor you have. After all, this thing works on sensing acceleration, but you might want one sensed motion to control more than one effect. Or you might want to put a potentiometer or three on the thing and control effects that way. It will all be possible with this simple software that supports complex configurations.

PVC Pipe Contol Box

OK, so the image to the right looks like it's in a fish tank, eh? Well that's OK, it's just a quick drawing that I made and captured with my phonecam to show you what I meant by using a PVC pipe as the effects box enclosure. I figure just leave the plastic as-is, don't bother sanding or cleaning or painting, and just cut it in half with a reciprocal saw. Then drill some holes and file out the USB interface hole, mount the parts, wire it up and be good to go! Good enough for use, though it might be smart to put a rectangular bottom on it for reliability. No problem there, easy to do.

Now, though I may prefer the rough-cut saw edge on the bottom of the enclosure, you might want it to be nice and flat or you might find that it is wobbly a little bit. No problem, there's an easy solution. To accomplish this you will need a piece of sandpaper, some tape, and a flat surface that can take some abrasive abuse. Don't do this on a marble kitchen counter of fine wood dining room table, obviously - um did I mention abrasives? OK, so the sandpaper should be medium. Coarse or fine will also work, heh, just depends on how long you will sit there rubbing it down. I suggest 80 grit sandpaper though 120 or 150 would work OK. Tape the corners of the sandpaper down on the flat surface. Rub the half-sawn PVC pipe over the flat sandpaper repeatedly in lengthwise strokes until it is smooth. There, it's all smooth now, aren't you glad you did that?

So that's my take on an enclosure. But don't listen to me, be creative! Make your own! Use an electrical box or something, cheap and very industrial looking. Send me a photo of your control box and I'll post it here for everyone to enjoy!

Drunken ChucK Coder

Hah! You thought I couldn't drink and code ChucK at the same time! Fortunately I can indeed program while intoxicated, though it is certainly slow going. I started adding changes to Revision 1 of GMS (GMS1.ck) and saving them as GMS2.ck hours ago, and now finally there appears to be a good stopping point and some tastefully written good code. Certainly not as tasteful as a salmon spread sandwich that I just enjoyed for a midnight snack, but tasty code nonetheless.

So head thyself over to the downloads page for GMS2.ck, which has actively working reverb that varies under mouse control. What's to do next? Why, add more effects, I believe. Now the code has the structure it needs for the most part, though I may refine it a bit, but it's mostly there. So why not add some more of the basic effects that I know how to add? Sure. I'm not sleepy. More to follow, either that or the beer will get the best of me and I'll crash like Evil Kneivel on a bad day! Cheer folks, and happy guitar adventures always!

A Message From Andy

As part of my little GMS adventure, I plan to stay in touch with Andy of Ultimarc. You can too, his email is on the Ultimarc website under the contact link. I welcome you do drop him a line and tell him you're into the project, if only to help reinforce how much we all want this to happen in a way that makes for great DIY and fun guitar playing.

Anyway, I waited a couple of days (caught up on some sleep too) before emailing Andy cause I didn't want to bother him too much. Andy replied back with a brief status report about chip selection. I had originally planned to use the ADXL330 chip which has an analog output, but Andy thought that using a chip with a digital interface would be much faster. Yes, I assured him, I had seen 3-axis acceleromter chips, or at least one of them, with an I2C interface at the very least. Well, Andy replies now that such chips are way too expensive, so we're back to plan A of using an analog chip. This will be no problem and will not affect proper system operation, it just affects details like bandwidth capacitor selection and the like. Also Andy reports that he has ordered the parts for the first prototype.

So anyway, it's good to hear from Ultimarc and to know that they have taken the next step toward our goal of a simple accelerometer to USB solution for mounting on the guitar. Great news, I'll contact Andy again with a status report on my progress early next week.

Drunken Coder Strikes Again

I added wah to the list of effects in the software now, so things are looking up. However, i am now running into shred limitations. You see, a shred is a background process that waits for something to happen in ChucK's little world and then acts accordingly. If you get too many shreds going, things slow down to a crawl. Well, we're not there yet but we will be if I keep adding effects. So what I need to do is figure out a way to shut down unused shreds and start up used shreds. Fortunately this is not too diffucult, it just requires some effort and I'm getting sleepy now, or at least I'm tired of programming. So I'll just leave shred optimization for the next go round and enjoy some forum posting in the mean time. So good news software wise, it's all just falling right into place!

Bitchin' Betty

You will please accept my apologies for a section heading like that, but "Bitchin' Betty" is in fact the name that the Harrier aircraft pilots gave to their female-voiced computer warning system. See, extensive psychological testing indicated to McDonnel Douglass employees that a calm, soothing female voice saying "Your fuel is low", or "Radar detected" would best inform the pilot without overly alarming him or her. So all Harrier aircraft were equipped with a female voice to warn or otherwise inform the pilot of important details that occur during flight.

So now, in doing this guitar project, I wonder if it would not be cool to have our own version of "Bitchin' Betty". As your foot switch cycles through the four stages, she could say "Stage one", "Stage two", and so on. Then as your other foot switch cycles through the effects, she could say "Reverb", "Wah", "Echo", etc. I can record the voice from Apple's speech synthesizer into .wav samples and play them back as menu selections occur. Just a thought. Do you want a "Bitchin' Betty" on your software interface? Let me know via email.

GMS Rev 5

July 18, 2008

Well, that was fun last night, all that beer and coding and such, but today it's back to normal and I'm plugging away at the code. I've released revision 5 just so you can have the very latest code that I have. In Rev 5 for one thing, I solved the problem of how to do shred management (thanks to Kassen on the forum for help) so that we don't end up with 100 shreds bogging down that slow, older processor that I have in my cheap second-hand laptop computer. That's nice and clean, plus I added wah and distortion to the effects list to compliment the reverb that was already there.

So we now have some useful software that can work with a guitar or a music player depending on the software configuration that you have. To summarize from previous sections, you can do the following. You can put a 1/4" to 1/8" adapter on your guitar and plug it into the line-in jack on your computer, then you will hear the effects applied to your guitar on the speakers. You can do the previous with headphones instead of speakers. You can play your guitar into a microphone and listen to the distorted sound on headphones. If you have Linux or Mac, you can use Jack (Linux + Mac) or SoundFlower (Mac) to route audio from any audio player into ChucK. To do that on a Mac with SoundFlower, you just set the output to SoundFlower 2 channel, then go into the ChucK miniAudicle preferences and select SoundFlower 2 channel as input. I don't know how to route audio on Linux or Windows at this time, so you're on your own there, good luck.

As with the earlier revisions of the code, you use the left shift key to change stages from stage 0 to stage 3, the right shift key to change effects for a given stage, and the mouse for extremeness (horizontal) and control input (vertical). Right, now you're good to go! Enjoy!

Videos

July 21, 2008

Ahhh... relaxation. I've been taking it easy for close to two days now, because I'm a little burned out from the past week of activity. But as I was tapering off into a state of total worklessness, I found enough energy to create some videos for you. I'm using this software called Snapz Pro X, which is freeware, just Google it, for the Mac. Awesome software. If you wanta make a movie, install it, press apple-shift-3, click on some boxes and press enter. Suddenly your'e filming. Do whatever you want and then hit apple-shift-3 and you've got a movie.

Well Snapz Pro X made it easy, so I've created three videos for you. Two of them are at the current bottom of the dowloads page, where you see GMS Rev 9, and GMS Rev 10 Movie headings. Read the sentence (it's amazing how many people click without reading, haha), which will tell you which of the links to click to get the movie. Then there's a second movie under the GMS Rev 10 Movie heading - note that I have not released GMS Rev 10 itself, it's just the movie.

There's a third movie if you liked those. It is on my music page, which has a link at the bottom left of each web page, just click on music. Read what it says (before clicking), and then you'll know what to click. Confucious say "First read, then click!".

Voice Feedback

July 22, 2008

After some trouble debugging, I finally realized that the problem with the GMS 10 program's "Betty" computer voice was just improperly recorded samples. So i recreated all the samples this time and it worked very well. Then I decided to add some more samples describing the effects selection as well. So now we have our voice feedback, yay! Not only that, but it's customizable. Let's say you like Betty's voice, but you would prefer to hear Aretha Franklin's voice instead. Well, all you have to do is get recordings of Aretha's voice saying certain words and put them into wav files. Below is a list of all the sound samples used by the program so far.

"StageZero.wav",
"StageOne.wav",
"StageTwo.wav",
"StageThree.wav",
"Lock.wav",
"None.wav",
"Reverb.wav",
"Wah.wav",
"Distortion.wav",
"Tremolo.wav",
"Volume.wav"

Then you would make a subdirectory called "Aretha" and change the word "Betty" at the top of the program to "Aretha". It's a very simple way to organize the audio samples that give the GMS software its personality. Hah, this should be fun if people get a kick out of it, imagine all the krazy voices that can be used by the program! So anyway, a little progress today but not much. If I get more done I'll post about it.

On Board Controller

I've thought up another controller alternative, and this is the one that I believe would be simplest, easiest, and best to implement. Just to remind you, a guitarist wanted to be able to set the "extremeness" of each effect with a footpedal - you know, guitarists love their pedals. This was a cool idea, so in the preceeding sections of this page I took a few tries at designing a control box to support that idea. Well, that one is still valid, but I have a better one. You see, in trying to simplify things down so that the control box would be simple, I made the user interface so completely simple that it can be mounted directly on the guitar!

It's just a two-button plus one-pot interface, so all we need are two buttons on the guitar's accelerometer sensor, plus one of the measurements of angle, say the vertical angle. This way, let's say you want full extremeness which is the most common setting, I would imagine. Then you point the guitar up to the sky and start pressing the two menu buttons until your effects are locked. Then once the software says "Lock", you're good to go. Someone who wants varying degrees of extremeness would be moving the guitar handle up and down to set that. So, a very simple idea that will provide us with a guitar-mounted controller. I think I'll make mine that way.

I've also given some thought to the freeze and kill switches. The freeze switch can be a pull/push type of switch as was requested by one guitarist, pull it out for normal operation and hit it closed to freeze the current settings. Then for on/off, what could be simpler than just unplugging the USB cable? That would save a switch, which helps keep the project simple.

As for an enclosure, i'm thinking of a piece of PVC pipe, about one inch outside diameter and maybe four inches long. This will be sanded flat on the bottom and attached to a plate specially shaped to mount under the jack plate. The two control buttons will be on the side of the pipe, facing out from the guitar, and the freeze button will be mounted on the end piece. The sensor board is mounted with standoffs to the bottom plate with recessed screws, and the USB connector protrudes from the end piece. Now that is a very simple, clean, and easy to make enclosure - should be fun!

copyright 2008 Les Hall

My stuff: Sports Prediction, Commentary, Oscillator, Music, HS TechSpy, and Dome Homes.

Web Site Hit Counters
Hit Counters
Contact me inventor-66@comcast.net