What microcontroller for sound sample and manipulation

Discussion in 'Embedded Systems and Microcontrollers' started by Chillum, Apr 16, 2015.

  1. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    I realize most microcontrollers have limited memory, but I'd like to load a fart sample (1-2s) and then manipulate it's tone/pitch to achieve 12 notes and halfnotes. Where do I start? Arduino/RaspberryPi (but that would be too easy, for it's got a sound card and cpu and gpu). My budget? I don't know, I've got money saved up, but that's for all my life and not just for electronics, although I favour using it for electronics... :D

    Hit me, and then we'll investigate price options ;) if there are any options
     
  2. BobTPH

    Active Member

    Jun 5, 2013
    784
    114
    dsPIC33FJ128GP802 or 804

    These have a 16-bit stereo audio DAC and 128KB of flash memory, and a 12-bit ADC, which should be enough to do what you want, with just a couple of opamps in addition.

    Bob
     
  3. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    Last edited: Apr 16, 2015
  4. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    Well then you've got to use what you have: adapt, persevere, and overcome.
     
  5. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    I can get the full range of Arduino products
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    If you can find one with the right shield, it could work for you. As I understand what you need it is:
    1. At least 1 A/D channel with a microphone input to do sound sampling.
    2. Enough memory to hold 40,000 samples for each second of sound
    3. At least 1 D/A channel with a speaker output to play back the modified sound.
    The processor in the Arduino may or may not be capable of handling this process. As I understand the implementation the sketches are interpreted. This means the program is recompiled each time it executes. At least this is the way it was with the Duemillenove (ca. 2009). Maybe things have improved since then.
     
  7. Robartes

    Member

    Oct 1, 2014
    57
    13
    In my understanding, the sketches are compiled and then downloaded to the microcontroller - no interpreter runs on the micro. However, the Arduino libraries do add some overhead which might result in code running slower then code that is 'hand rolled' in C.

    That said, the AVR in most Arduinos (an ATMega32 running at 16MHz) should probably be able to handle the 40K samples per second.
     
    absf likes this.
  8. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    Yes, I would think so. 40 KHz. is a 25 μsec period. You won't be able to do much else while you are sampling.
     
  9. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,810
    834
    Is the fart sampling done in real time? Or is your objective to create a system that plays 12 notes and half notes that sound like farts?

    In the latter case, one could perform the sound processing offline, and load the samples into memory at run time.

    ?
     
    absf and atferrari like this.
  10. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    I was thinking make one sample, load it on microprocessor, and use the microprocessor to generate the 12 (11) notes from the base sample
     
  11. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    I believe the ATmega 328 only have 32k memory
     
  12. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    I have a gertboard for Raspberry Pi, that have a ATmega 328(p I think) if it works, I'll port it to much cheaper arduino uno, also with 328
     
  13. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    how much storage do I need to save a 2s wave file, and is it possible to manipulate the pitch/tone of that wav file with a microcontroller? would it be cheaper than a RaspberryPi type B? edit: or type A+? edit: the point is it's a kids project using the RPi listen to switches and play to the headphone out, I'm here to learn, that's why I wanna go the microcontroller route (proudly self taught hand-on mostly, and still very noob)
     
    Last edited: Apr 17, 2015
  14. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    To capture and manipulate a sound clip you do not need a microprocessor.
    Use the mic input on your PC and capture the sound with the sound recorder accessory or any audio recording software.

    To playback the sound you can DIY with a Nuvoton (Winbond) ISD4000 series chip of you can buy any one of the many off-the-shelf modules.
     
  15. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    and manipulating the sound?
     
  16. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,810
    834
    Audacity is open source software that can manipulate the sound clips. It is almost one command to change the tone and pitch.

    I thought I had an idea of what you were attempting Was ready to suggest ways of adding memory to an Arduino or other microprocessor (it's described on the Arduino site), but now feel like your requirements keep changing.
     
  17. Chillum

    Thread Starter Active Member

    Nov 13, 2014
    546
    9
    not requirements that change, looking for solutions change, requirements are still 12 musical farts, however its possible to do it?
     
Loading...