PDA

View Full Version : Programming question...



Eco
08-15-2009, 09:41 AM
To all the programming savvy saber geeks out there, I have a question regarding a new soundboard design.

How difficult/practical would it be to develop a non-driver soundboard, that starts with the basic idle hum sound effect, then uses an accelerometer that increases the volume/pitch/tone/bass of the idle hum in a linear manner when you swing it?

EDIT::
I suppose I should also include that there is no *specific* sound effect for swings, just the variation of the basic idle hum. So the only sound effects on a given font would be: Ignition, idle/swing, clash, power down.

Thaxos
08-15-2009, 10:27 AM
Hmm, interesting idea... Unfortunately I'm not electronic savvy enough to answer this one for you! :( Hopefully someone will though, I'll keep an eye on this.

jtzako
08-15-2009, 10:44 AM
I've been thinking of making one myself but havent done all the research.

I dont think it would be that difficult really. In fact, there are some semi-premade ones out there that could play the sound (even several sounds) and you'd just have to program the accelerometer part and tell it what sound to play.

Unfortunately the pre-made ones I've found do not fit in a saber hilt so they couldnt be used for anything more than a basic template.

Novastar
08-15-2009, 07:53 PM
How difficult/practical would it be to develop a non-driver soundboard, that starts with the basic idle hum sound effect, then uses an accelerometer that increases the volume/pitch/tone/bass of the idle hum in a linear manner when you swing it?Unfortunately, it's not a very "linear" thing regarding:

* the way an accelerometer captures data
* the way you interpret that data and expect it to "translate" into what pitch shifts to apply to the base sound
* playing the sound BEFORE / AS / WITH the swing itself.

On that last point--what I'm saying is... you need a VERY FAST processor to playback sound "real time"... as in what would match the current motion you're making. Especially if you're planning on having a high "granularity" of how quickly the pitch can be changed... based on a minor, minor change or (obviously) a major change.

But fine, fine: ok, skip all that and say you detect motion... great. Now you need to interpret that data... select the sound to play... pitch shift the sound based on the data captured...

All the while, new motions are being detected and/or the motion is changing speed... direction... orientation.

SO... you have to (generally) COMPLETE a sense of motion BEFORE you play a sound with it. Think about this carefully. It's quite a catch-22. Well... without a pretty powerful chip in there. Which means expense goes up... and chip size might generally go up. Heat goes up too (in general). Complexity gets worse as well.

So if that all = "simple"... I say, great. :cool:

Eco
08-15-2009, 08:11 PM
Hm... Sounds easy to me! :D

But seriously, what about using multiple accelerometers all set with a delay on collecting new data. You'd have to set a range of velocities that would still be counted as your baseline. Yes? No?

jtzako
08-15-2009, 08:17 PM
You wouldnt want to use multiple.. just 1 accelerometer with 2 or 3 axis would be plenty. You would, of course, have to have some delay before sensing changes.

I suspect one could make a 'board' that works similar to the way the iphone lightsaber does. (that also uses an accelerometer) That one plays at least 3 different movement sounds (not counting clashes) based on how fast you move the phone. It detects a change in direction to start a new sound.

Novastar
08-16-2009, 12:34 AM
You wouldnt want to use multiple.. just 1 accelerometer with 2 or 3 axis would be plenty. You would, of course, have to have some delay before sensing changes.No. Not if you wanted to capture more data faster. I think Eco was suggesting multiple ACCs to get the same data from multiple sources. Still... this would be a bad idea:

* Faster processor would be a better answer
* More ACC = greater cost... and a lot more room used
* Granted... even a faster processor would be more $$$

So... this is just grasping for straws. Sorry. :(


I suspect one could make a 'board' that works similar to the way the iphone lightsaber does. (that also uses an accelerometer) That one plays at least 3 different movement sounds (not counting clashes) based on how fast you move the phone. It detects a change in direction to start a new sound.The iPhone is pretty expensive, runs on an operating system, and also has a microprocessor that is at least (just guessing) 250x more powerful than the processor in CF. But I imagine it certainly could be done by someone. Always someone. :rolleyes:

jtzako
08-16-2009, 09:19 AM
Yeah, Iphone is expensive and has a faster processor, but the lightsaber app (the motion/sound portion) doesnt need much cpu. Based on some pre-made things I found I dont think this deal would be terribly hard to do with something like a Arduino. (assuming you know what parts you need and how to program it)

Eco
08-16-2009, 11:45 AM
I'm just throwing ideas out there. The swing sensors on anything I've ever had my hands on have always bothered me. Hasbros, MRs, etc. They're all too laggy and inaccurate. Whenever I bought an electronic lightsaber, one of the first things I would do is take the batteries out, because it was more fun for me to make my own sound effects that actually coordinate with my movements.


NEW BRAINSTORM.
If you're familiar with levitation toys, they work by suspending a magnet above the opposite pole of another magnet to levitate. Is there any sort of device that works like a switch, with the walls and levitating magnet being conductive and capable of carrying a current consistently enough to be used as a motion sensor?
(High tech mercury switch)

Novastar
08-17-2009, 03:10 AM
I'm just throwing ideas out there. The swing sensors on anything I've ever had my hands on have always bothered me. Hasbros, MRs, etc. They're all too laggy and inaccurate.Right, the basic toys have a "digital" sensor (1 or 0, on or off), whereas the idea of using a decent accelerometer correctly would yield more of an "analog" response (0-255 for example).

However... an on or off state is (obviously) *MUCH* easier to work with vs. interpreting an analog signal. And simply saying 0-127 = swing and 128-255 = clash... would be a VERY ineffective way of handling the analog signal (as a *crude* example).


NEW BRAINSTORM.
If you're familiar with levitation toys, they work by suspending a magnet above the opposite pole of another magnet to levitate. Is there any sort of device that works like a switch, with the walls and levitating magnet being conductive and capable of carrying a current consistently enough to be used as a motion sensor?
(High tech mercury switch)You got me there... no clue. Well... other than RFID-style or something. I also think you'd need to be a lot more specific about what you mean--quite exactly. As in how this magnet was meant to yield motion. Since you may end up with an "expensive" version of what the Yusan vibration sensors already do in MRs/Hasbros.

FYI for those that don't know: it's just a spring that "waves" back and forth within a tiny cylinder. If the spring touches, you either close (or open--I forget) a circuit. Theeeeeerrrrrrre's your sign: a 1 or a 0. :)

Same with the motion sensors, only I think it's a ball bearing. Roll to this side? Trigger motion. Nothing else until it rolls to the other. Rinse, lather, repeat.

ErikTheHack
08-26-2009, 10:35 PM
What is needed here is to source a accellometer/vibration sensor with potentiometer characteristics -- the accellometer/vibration sensor would read in degrees thus regulating voltage.

I did a little google-ing about and there look to be components that do this however I've yet to locate specific part numbers -- but then I only looked for a few minutes.

I've been toying with a similar idea to yours -- my thought was rather than modifying the digital sample (sound effect) digitally and playing it, the device would modify the playing sound in an analog fashion. Think of this kind of like effects on an electric guitar -- although the source is originally digital in our case. I suppose you could also think of it like the "Loudness" setting on a lot of audio components and/or bass, treble, volume adjustments.

These are all generally analog modifications to the analog signal before it passes into the amplifier -- although volume controls the amp specifically.

There are a lot of examples of PIC sound players on the web to play samples this would need to be mated with a micro-controller, sensors, and amp. An ASIC to read sound samples off a memory card would be nice too.