Page 8 of 25 FirstFirst ... 6 7 8 9 10 18 ... LastLast
Results 71 to 80 of 242

Thread: Open Saber Sound Project

  1. #71
    Council Member
    Jedi Council Member
    xwingband's Avatar
    Join Date
    Nov 2005
    Location
    The training simulators, duh!
    Posts
    5,899

    Default

    An acceleromter is way too much as dicussed before. Besides having the be able to measure the change you have to code what to do with it. The way Erv's CF does it is that it measures the change of the acceleration and you set a range of the values to equal the sounds. So a sharp change in acceleration is a clash and a gradual change is a swing.

    The advantage of sensors like on the MR is there is no interpretation. It's on or off. If you put a button in place of it there wouldn't be a difference. The coding would be basically "If input (sensor) is on then play sound.wav"

    Now with a timer you could probably setup neat things that would be considered "premium" features. Program in if it's on for X amount of time then play a lockup and you'd have a lockup button. Cool stuff if you ask me.
    RED LEADER Standing by!

  2. #72

    Default

    I have no idea why this post was put here, but it was really written in response to post #75 -- reposting it since it should have been impossible for me to post before I registered (which, if you look at when I joined and when this post time is, that's what happened).
    Last edited by Banaticus; 08-26-2008 at 01:17 AM.

  3. #73

    Default

    Ok, two posts later, I confidently predict that there will be this amazing post by Orthus. Maybe one post later, but it's coming, I can feel it.

  4. #74

    Default

    Next post is Orthus' post -- I'll post again after it about how much I liked it. Crazy forums.

  5. #75

    Default Just joined and it's not that bad...

    Ok, I stumbled upon this thread and it caused me to register. I started building a sound board using an Arduino as my prototyping platform http://www.arduino.cc/
    Once I figure out the minimum components, I plan on building a custom board using the same micro controller family as the Arduino uses. Sound can be shifted out on a pulse-width modulation pin using a converted sound file as the source. Then you hook an audio amp to that pin to amplify the signal (you can get the parts at Radioshack) and hook a laptop speaker (they're nice and small) to that. So far I have power up/power down and hum done. I started playing around with a 3-axis accelerometer, but this seems to be overkill if you want a simple swing sound. I've been trying to make the output from the accelerometer dictate pitch of the swing and it's kinda hairy. I have nothing to show for several hours of tinkering with the swing stuff.
    Admittedly, I'm a computer science professor that works in robotics, so I'm comfortable with both hardware and software, but it's not that many parts and the programming is basically stuff you can find on the Arduino forums, Make Mag's website, or Hack-A-Day.
    I used a Hasbro board in my first (and only) saber that I built for my son (honestly, it was for him, I swear ) and that board gave me fits due to the poor quality of the wire they used and the swing sensor/sound that just doesn't give a nice effect.
    Attached Images Attached Images

  6. #76

    Default

    I registered on these boards for no other reason than to reply to your post, Orthus. If you could post any kind of schematic or any other information, I'd be thrilled, otherwise, I'll be checking out those other boards and trying to blaze the same path as you.

    I've seen a lot of people discussing how big we want the microcomputer, whether we want one board or two for LED's, etc. This thread is in the "Saber Sound" forum -- let's ignore the LED's and concentrate on the sound. There are plenty of schematics for creating your own rechargable battery setup or wiring in your own LED's, but nothing anywhere for sound.

  7. #77

    Default model

    model railroaders use sound and light circuits for their trains. They usually work off of simple motion sensors. Anyway, I stopped buy Sparkfun.com and built a list of required components for mp3, led, microcontroller (picaxe/atmel), motion detection, vibration motor, etc. The total cost seemed to be really close to the $170 something bucks for the crystal focus. Only thing I was not sure on was the PCB which I think Erv must have custom made but I e-mailed about it anyway. I am actually more excited about the open sound project now because I want to see what collabaritive thinking comes up with and how it compares cost wise to the feature rich Crystal Focus.

    ***EDIT***

    OK I somehow missed the http://www.replicantfx.com/ link. I checked it out and it looks really good. Lots of pins make me think possibilities. Good find X-Wing.
    Last edited by swear000; 08-26-2008 at 12:48 AM. Reason: New Info

  8. #78

    Default

    It's going to be more expensive.

    By the way, you might want to check this out. His English isn't the greatest, but who really cares, we're in this for the schematics and technical talk, not well formed sentences. Plus, there's a schematic, drawing, pictures, it's a great place to start: http://<br /> <br /> http://www.ra....html?di=47975
    Make a sound card is no more a complex issue. If you use great IC PCM2702 from BURR BROWN / Texas Instruments you can create a fully functional USB sound card. This sound card can be powered from USB port and has one stereo output. You don’t need to install any driver for Windows XP and Vista, because they are already inside. This is really plug and play. Few months ago I have seen USB sound card called Alien DAC. The construction on the project web page inspired me to build this thing also.

    Description

    The core of this construction is 16-Bit Stereo Digital-To-Analog Convertor with USB interface PCM2702.

    PCM2702 needs only few additional parts to work. The schematic is not complex. Sound card can be powered directly from USB port (jumper W1) or from external power supply (jumper W3). PCM2702 needs two power supply 3.3V (3V-3.6V) and 5V (4.5V-5.5V). I used fixed output voltage LDO TPS76733Q for 3.3V (IO2) and adjustable output voltage LDO TPS76701Q for 5V (IO3). Both LDO are produced by TI, I used this because I had it in my drawer. Any similar LDO can be used. Output voltage of IO3 should be set to little bit lower than input voltage to allow LDO good stabilization, in my case output voltage is set to 4.8V. Output voltage can be set by adjustable resistor R33. In case of low power supply, IO3 can be shorted by jumper W3. LED D3 signalizes power on . . .

  9. #79

    Default

    Quote Originally Posted by Banaticus View Post
    I registered on these boards for no other reason than to reply to your post, Orthus. If you could post any kind of schematic or any other information, I'd be thrilled, otherwise, I'll be checking out those other boards and trying to blaze the same path as you.
    I've seen a lot of people discussing how big we want the microcomputer, whether we want one board or two for LED's, etc. This thread is in the "Saber Sound" forum -- let's ignore the LED's and concentrate on the sound. There are plenty of schematics for creating your own rechargable battery setup or wiring in your own LED's, but nothing anywhere for sound.
    Okay, here's a link for the amp. It's simple and I'ver been using the version with bass boost, since I want to build a sith saber and there's a background rumble in the sound files:
    http://www.hobby-hour.com/electronic...ower-audio.php

    The Arduino Diecimila I'm using is about $35 US, but the ATmega chip it's based on is around $11. Here's where to acquire an Arduino, but my final design will just use the ATmega chip since I have a device programmer in my lab:
    http://www.makershed.com/SearchResults.asp?Cat=43
    The code I'm running is here, stolen from Michael Smith off an Arduino forum and altered to test powerup, powerdown, and hum. The file soundcomb.h that is included has the
    raw sound data dumped into an array called
    sounddata_data[].

    /*
    * speaker_pcm
    *
    * Plays 8-bit PCM audio on pin 11 using pulse-width modulation (PWM).
    * For Arduino with Atmega168 at 16 MHz.
    *
    * Uses two timers. The first changes the sample value 8000 times a second.
    * The second holds pin 11 high for 0-255 ticks out of a 256-tick cycle,
    * depending on sample value. The second timer repeats 62500 times per second
    * (16000000 / 256), much faster than the playback rate (8000 Hz), so
    * it almost sounds halfway decent, just really quiet on a PC speaker.
    *
    * Takes over Timer 1 (16-bit) for the 8000 Hz timer. This breaks PWM
    * (analogWrite()) for Arduino pins 9 and 10. Takes Timer 2 (8-bit)
    * for the pulse width modulation, breaking PWM for pins 11 & 3.
    *
    * References:
    * http://www.uchobby.com/index.php/200...-sound-part-1/
    * http://www.atmel.com/dyn/resources/p...ts/doc2542.pdf
    * http://www.evilmadscientist.com/article.php/avrdac
    * http://gonium.net/md/2006/12/27/i-wi...before-i-code/
    * http://fly.cc.fer.hr/GDM/articles/sndmus/speaker2.html
    * http://www.gamedev.net/reference/art...article442.asp
    *
    * Michael Smith <michael@hurts.ca>
    */

    #include <stdint.h>
    #include <avr/interrupt.h>
    #include <avr/io.h>
    #include <avr/pgmspace.h>

    #define SAMPLE_RATE 8000

    /*
    * The audio data needs to be unsigned, 8-bit, 8000 Hz, and small enough
    * to fit in flash. 10000-13000 samples is about the limit.
    *
    * sounddata.h should look like this:
    * const int sounddata_length=10000;
    * const unsigned char sounddata_data[] PROGMEM = { ..... };
    *
    * You can use wav2c from GBA CSS:
    * http://thieumsweb.free.fr/english/gbacss.html
    * Then add "PROGMEM" in the right place. I hacked it up to dump the samples
    * as unsigned rather than signed, but it shouldn't matter.
    *
    * http://musicthing.blogspot.com/2005/...c-startup.html
    * mplayer -ao pcm macstartup.mp3
    * sox audiodump.wav -v 1.32 -c 1 -r 8000 -u -1 macstartup-8000.wav
    * sox macstartup-8000.wav macstartup-cut.wav trim 0 10000s
    * wav2c macstartup-cut.wav sounddata.h sounddata
    */

    #include "soundcomb.h"

    int speakerPin = 11;
    volatile uint16_t sample;
    unsigned int lastSample, count = 0;

    // This is called at 8000 Hz to load the next sample.
    // Array indices 0 to startdata_length are powerup/down
    // Indices startdata_length+1 to sounddata_length is the hum
    ISR(TIMER1_COMPA_vect) {
    if (sample >= sounddata_length && count < 10) {
    // Repeat the hum section of data
    sample = startdata_length+1;
    count++;
    }
    else if (count < 10) {
    // Play powerup, then keep going into the hum data
    OCR2A = pgm_read_byte(&sounddata_data[sample]);
    ++sample;
    }
    else if (sample > 0)
    {
    // We've hummed long enough to test, so play the
    // Powerup section backwards to get powerdown
    if (count == 10)
    sample = startdata_length+1;
    --sample;
    OCR2A = pgm_read_byte(&sounddata_data[sample]);
    count++;
    }
    else
    stopPlayback();

    }

    void startPlayback()
    {
    pinMode(speakerPin, OUTPUT);

    // Set up Timer 2 to do pulse width modulation on the speaker
    // pin.

    // Use internal clock (datasheet p.160)
    ASSR &= ~(_BV(EXCLK) | _BV(AS2));

    // Set fast PWM mode (p.157)
    TCCR2A |= _BV(WGM21) | _BV(WGM20);
    TCCR2B &= ~_BV(WGM22);

    // Do non-inverting PWM on pin OC2A (p.155)
    // On the Arduino this is pin 11.
    TCCR2A = (TCCR2A | _BV(COM2A1)) & ~_BV(COM2A0);
    TCCR2A &= ~(_BV(COM2B1) | _BV(COM2B0));

    // No prescaler (p.15
    TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10);

    // Set initial pulse width to the first sample.
    OCR2A = pgm_read_byte(&sounddata_data[0]);


    // Set up Timer 1 to send a sample every interrupt.

    cli();

    // Set CTC mode (Clear Timer on Compare Match) (p.133)
    // Have to set OCR1A *after*, otherwise it gets reset to 0!
    TCCR1B = (TCCR1B & ~_BV(WGM13)) | _BV(WGM12);
    TCCR1A = TCCR1A & ~(_BV(WGM11) | _BV(WGM10));

    // No prescaler (p.134)
    TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10);

    // Set the compare register (OCR1A).
    // OCR1A is a 16-bit register, so we have to do this with
    // interrupts disabled to be safe.
    OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000

    // Enable interrupt when TCNT1 == OCR1A (p.136)
    TIMSK1 |= _BV(OCIE1A);

    lastSample = pgm_read_byte(&sounddata_data[sounddata_length-1]);
    sample = 0;
    sei();
    }

    void stopPlayback()
    {
    // Disable playback per-sample interrupt.
    TIMSK1 &= ~_BV(OCIE1A);

    // Disable the per-sample timer completely.
    TCCR1B &= ~_BV(CS10);

    // Disable the PWM timer.
    TCCR2B &= ~_BV(CS10);

    digitalWrite(speakerPin, LOW);
    }

    void setup()
    {
    startPlayback();
    }

    void loop()
    {
    while (true);
    }

  10. #80

    Default

    Quote Originally Posted by Orthus View Post
    Ok, I stumbled upon this thread and it caused me to register. I started building a sound board using an Arduino as my prototyping platform http://www.arduino.cc/
    Once I figure out the minimum components, I plan on building a custom board using the same micro controller family as the Arduino uses. Sound can be shifted out on a pulse-width modulation pin using a converted sound file as the source. Then you hook an audio amp to that pin to amplify the signal (you can get the parts at Radioshack) and hook a laptop speaker (they're nice and small) to that. So far I have power up/power down and hum done. I started playing around with a 3-axis accelerometer, but this seems to be overkill if you want a simple swing sound. I've been trying to make the output from the accelerometer dictate pitch of the swing and it's kinda hairy. I have nothing to show for several hours of tinkering with the swing stuff.
    Admittedly, I'm a computer science professor that works in robotics, so I'm comfortable with both hardware and software, but it's not that many parts and the programming is basically stuff you can find on the Arduino forums, Make Mag's website, or Hack-A-Day.
    Orthus: I am interested to see your progress on the accelerometer. Eventually I would like to see the project use accelerometers and pitch-shifting. I had a look at the Arduino, but I thought the Atmega series chips were abit overboard for our needs. If you ate trying to tackle using accelerometers however, it may be necessary. How are you storing the sound files?

    Quote Originally Posted by Banaticus View Post
    I've seen a lot of people discussing how big we want the microcomputer, whether we want one board or two for LED's, etc. This thread is in the "Saber Sound" forum -- let's ignore the LED's and concentrate on the sound. There are plenty of schematics for creating your own rechargable battery setup or wiring in your own LED's, but nothing anywhere for sound.
    Banaticus: I think ignoring the LEDs side of the project would be a grave mistake. Inside a saber there is very little room for extra boards and controlling LEDs with the same microcontroller as the sound board is much simplier than 2 independent systems. It makes little sense not to combine the two. The very fact that there are plenty of schematics for LED drivers and that the sound side is going to be more difficult means that the bulk of conversation will be sound related anyways. Ignoring the, albeit simple, LED driver would not be serving the community best.

    Also, I don't understand why we would be interested in a USB sound card? I am sure you had a reason for posting it, what am I missing?
    Last edited by Clockwork; 08-26-2008 at 12:50 PM. Reason: Answered posted before question

Bookmarks

Posting Permissions

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