Connect with us

Midi File Sounds

Discussion in 'General Electronics Discussion' started by MannaMan86, Jul 29, 2014.

Scroll to continue with content
  1. MannaMan86

    MannaMan86

    19
    0
    Dec 9, 2013
    Hi, I am making sort of a miniature drum set project - basically I want to use an electrical current to initiate a drum sound from a microcontroller. I have some experience with microcontrollers, so the basic setup is not the problem. The problem I have is this:

    Do I store a Midi file library in the microcontroller? Or, do I store aMidi file library of sounds on a Codec (if that's possible), and then just access the codec via microcontroller signal?

    -B-town.
     
  2. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    http://serdaco.com/files/SAM2195.pdf
    Take a look at something like this.
    MIDI is more of a signalling protocol. It does not actually carry audio, but carries various values such as instrument, and duration.
    You can easily program a microcontroller to be a 'MIDI Controller' which you can then easily feed to a computer if you want the MIDI signals to trigger some more advanced samples, sounds or functions. You could also just as easily connect it to something like the Synth I linked above.
    The synth will hold the various MIDI 'voices' that will be played based on the signals it receives.
     
  3. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    As Gryd3 says, MIDI is a data protocol that doesn't contain audio. To convert it to audio, you need a MIDI synthesiser of some kind, which either generates sounds using analogue (or simulated analogue) techniques like FM, or triggers playback of stored sound samples. A stored sound sample is like a WAV file, stored in the MIDI synthesiser, which is played back through a DAC or codec when triggered, to produce an audio signal.

    A codec or DAC does not store sound samples; it simply converts the individual numbers in the sound sample into analogue voltages as the sound sample is played back. So the output from the codec or DAC is a voltage signal that you can amplify to hear the sounds.

    You can store sound samples in your microcontroller, if it has enough memory, or you can store it in off-board memory such as serialflash, as long as the micro can read it quickly enough given the maximum polyphony you need. Parallel Flash ROM is quicker to access randomly and might be a better option. Sound samples are normally recorded at 44,100, 48,000 or sometimes 96,000 samples per second; each sample is normally 16 bits wide (two bytes), and there are two channels if the sound is stereo. Stereo would be desirable, even for a drum kit, because the sounds can be pre-processed to include some ambience (reverb); adding reverb in real time to a clean sound is hard work for a small micro, although you could use an outboard reverb unit.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-