Creative Commons images are CC BY-NC-SA 3.0

Description: Do you ever wish your Arduino was more musically talented? Or maybe your project could use some cool sound effects. The SparkFun Musical Instrument Shield is an easy way to add great sounding MIDI sound to your next Arduino project. This board is built around the VS1053 MP3 and MIDI codec IC, wired in MIDI mode. Simply connect a speaker/stereo/pair of headphones to the 1/8" stereo jack on the shied and pass the proper serial commands to the IC and you’ll be playing music in no time!

The VS1053 contains two large tonebanks including various piano, woodwinds, brass, synth, SFX and percussion sounds. The shield is also capable of playing several tones simultaneously (maximum polyphony of up to 31 sounds!). Take a look at our example code to get an idea of how easy it is to add musical zest to your next Arduino gadget.

In this version, we’re using a better regulator, corrected the speaker connectors, and have the reset pin pulled high. We’ve also included solder jumpers for pin 3 and 4 so they’re selectable.

Documents:

Replaces:DEV-10529

Recommended Products

Customer Comments

  • The example code has a wee bug in it. If you’re trying to send pitch bend messages you get weird behavior. Pitch bend messages are 3-bytes long, but the talkMIDI() function only sends the third byte for messages where the command is less than or equal to 0xB0. Change the line:

    if( (cmd & 0xF0) <= 0xB0)
    

    to

    if( (cmd & 0xF0) <= 0xB0 || (cmd & 0xF0) == 0xE0)
    

    and this should send pitch bend properly.

  • Can anyone tell me if I can load my own samples into this thing? I have a custom instrument, with 32 notes, that I would love to play polyphonically. Thanks in advance!
    Revision: I am looking at the datasheet, and it says the chip has a “user-loadable Ogg Vorbis encoder”. That sure sounds like it can be loaded with my samples, unless I’m missing something.

  • Hi Everyone, A word of advice on the musical instrument shield speaker connection: The way the board is wired the sleeve connection on the 1/8 TRS stereo jack is connected to a pin called GBUF on the VS1053. According to the datasheet this pin should not be connected to ground. http://www.vlsi.fi/fileadmin/app_notes/vs10XXan_output.pdf This means if you are plugging the shield into a stereo, another embedded device, or computer etc that has its sleeve connected to ground (which is common) then you may be hurting your musical instrument shield and degrading the audio performance. If you are connecting to headphones or non amplified speakers then there will be no problem because these are isolated from ground.

    I made a simple fix to enable connecting the sleeve to ground for my application. There are many different ways to make this fix. This is just one. Cut the PCB trace going from GBUF to the TRS jack. Solder a wire from GND to pin 1 of JP3. Now you have a ground referenced audio output. Be aware that the output pins LEFT and RIGHT now have DC bias relative to the TRS sleeve on them which will need to be handled appropriately depending on what you are connecting your shield to. For example if you want the RIGHT and LEFT signals to have zero bias voltage insert a large capacitor in series with each signal to block the DC. If you are feeding the outputs of the shield into another 3.3V or 5 V device it may be best to make a direct connection because there will be approx 1.8V bias on the pins.

    What does GBUF do and why is it bad to connect it to ground? To make a long story short, audio signals are AC and have a zero average value (DC). It is important to drive loudspeakers, some amplifiers, and headphones with zero average waveforms otherwise they will not sound right or may get damaged. Since the VS1053 is powered by monopolar power supplies it will have a DC bias on its audio output pins. The DC bias (average DC) is typically ½ the chip voltage. This is done so that both positive and negative waveforms can be accurately played out of the chip. A clever way to zero out this DC bias when connecting to headphones or speakers is to use a reference voltage that has a value of this bias voltage. GBUF is that reference. If you then measure the voltage across the LEFT and GBUF or RIGHT and GBUF outputs the average voltage will be zero.

    GBUF is created inside the chip using some form of amplifier, kind of like an op amp. There is probably a little bit of signal processing inside that sets GBUF to precisely the average voltages of RIGHT and LEFT. If you connect GBUF to ground you short circuit the internal amplifier in the chip to ground. This can cause all sorts of havoc inside the chip. At best it will distort the output amplifiers because there will be excess currents flowing. At worst the chip will overheat and become damaged.

    I hope this will help people out with their projects. Fixing this made noticeable improvements to the music quality of my project. Happy tinkering.

    Aleks

  • Where can I hear samples of the various musical instruments that outputs from this device? I am particularly interested in the saxophone sounds. I’ve searched and searched, but can’t find examples of the sounds.

  • please, can I use Music Instrument Shield for playin mp3 or MIDI from Raspberry Pi ??

  • Does this music instrument shield works with Arduino MEGA?????

  • I’m confused, what is the specific message to send pitch bend commands? Can I use this to create a theremin type sound?

  • Does this device support breath controller input CC#2 or does it ignore it?

  • Can you play the midi in stereo / control which speaker the sound comes out of? Meaning, soundA out of the left speaker, soundB out of the right speaker, and soundC out of both? Thanks!

  • Hi, I want to build an organ but I have some questions. If I use arduino and other IC to send MIDI data to this shield, will it work? Thanks Mike

  • Anyone getting incredibly weak volume coming from the L and R outputs on this shield? It’s so faint that when I hook it up to an 8ohm 0.5 watt speaker, I have to hold it against my ear to hear anything at all. The headphone jack seems to be working fine though. I’ve set the midi volume to 120 and the velocity to 90 so it’s not that.

    Is this normal or is there a problem with my shield?

  • This music instrument shield is a real help for those who want to improve the quality sound of their favorite music. I bought recently a dac converter and I’m very pleased with the way that music sounds now.

  • How many piano keys can be used with this shield? I have a 37-key toy electric keyboard that I would like to hook-up to it.

    • This shield is really designed only for the musical output, not reading inputs. So how you read your keys is up to you, but we do have a few parts that might help.

  • Has anyone gotten the sustain command to work? I’m using the MP3 enabled version of this board I’ve tried sending the MIDI command, using the example code provided by microtherion here: Real Time MIDI Code, talkMIDI(0xB0, 0x40, 0x7F);

    and its not sustaining.

    EDIT: Nevermind, I got it working.

  • Just posted some basic code on bitbucket to pipe MIDI straight to this shield from the MIDI Shield, using a Leonardo and a little pin re-wiring (moving the buttons to 8,9,10, to avoid conflict). Makes a cheap (~$75), no-frills, hackable midi sound module.

  • Hello! I’ve uploaded the sketch with few modifications suggested in the comment section. Serial monito indicates Arduino is running it fine. However I don’t have audio output yet and oscilloscope shows only static noise. Is there something I should check? thank you! :)

  • Seems a little odd that this isn’t compatible with the MIDI Shield (DEV-09595) out of the box, since these shields are clearly a useful combination. Couldn’t you just move pins 3 and 4 to pins 8 and 9 to allow these to work together without rewiring or a go-between shield?

  • I just picked one of these up. The datasheet indicates the VS1053 has reverb capability when in MIDI mode. It can apparently be set to Auto or Off or to a variable Delay. Running the example code, it sounds like reverb is off. Can you suggest how to use reverb in MIDI mode? Thanks!

    • I was also looking for more details. The specs manual is not really useful but I found this post that helped me figure out how to at least deal with the individual channels reverb parameters:

      talkMIDI(0xB0, 0x0c, 0xFF); // REVERB decay

      talkMIDI(0xB0, 0x5b, 0xFF); // REVERB level

      where 0x0c and 0x5b are the MIDI commands, and 0xFF is the value (0x0 to 0xFF) for the parameter.

      Source: http://www.vsdsp-forum.com/phpbb/viewtopic.php?t=471&p=1827

  • Hi I have been trying to access the guitar sound son the vs1053 chip. I have chosen 0x00 the default bank and tried using the patch change command to access the instrument, however I have been unable to do so (it keeps defaulting to piano sounds ). Has anyone else had any such issues with any instruments.

    • Make sure you are sending the correct channel. I had this same bug where I was changing the bank on channel 0, but trying to play notes on channel 1.

  • I’ve used this shield for an electronic MIDI bagpipe. If you want to hear how it sounds take a look at http://xulioc.wordpress.com/2012/04/15/openpipe-breakout-arduino-musical-shield/

  • Help. I have yet to sucessfully uploaded a sketch - I tried the examples provided, modified as per the posts, but no go. Does anyone have a sketch running on 1.0 they would like to share? I am not yet up to speed on SoftwareSerial. Thanks in advance for help offered.

    • I’m also having trouble running IDE 1.0.1. Never got the damn thing to play one note! I will try the fix in the above post (chris.egervary). Failing that, I will install a legacy version of the IDE. Fingers crossed.

      • I tried the fix in chris egervary’s post above. Pleased to say that it worked like a charm! Just to recap: 1. Replace references to “NewSoftSerial” with “SoftwareSerial” 2. Replace “mySerial.print(cmd,BYTE)” with “mySeral.write(cmd)”

  • I was having a problem with this part making lots of white noise. After trying multiple things to reduce this problem, I eventually noticed that the power light was staying on even after my external power source was off. I set the reset pin to INPUT mode and the noise went away. Both examples show this pin being set to OUTPUT mode but even when I hooked it up the normal way, directly to the Arduino, I was getting this noise. Hopefully this saves some people the headaches I had.

  • so I’m using arduino 1.0-rc1 and ran into a problem with the example codes - heres the solution:
    first - in order to include the serial library rather than
    include NewSoftSerial mySerial(2, 3);
    you need to use
    include SoftwareSerial mySerial(2, 3);
    second - mySerial.print(cmd,BYTE) becomes mySerial.write(cmd)
    and this format needs to be used for all instances of mySerial

    • Thank you! - I’m a little disappointed that SparkFun is has not updated this and a number of their examples to address the Arduino 1.0 IDE. Other (unnamed) competitive vendors are doing a much better job supporting their shield product examples.

  • Hi,
    can anyone please tell me the latency of the chip from getting the command, until it plays wav/flac/ogg files from flash?
    greetings,
    Simon

  • I am working on a (patent pending) musical toy prototype using this vs1053 MIDI breakout. You can hear various sound samples of the MIDI instruments on the VS1053 to get a feel for what it sounds like. Happy creating!
    http://www.youtube.com/watch?v=KiCoMHCS9Iw

  • just a suggestion for the next revision, you could add a 5-pin DIN connector footprint to the proto area so you could hook an external midi source to the chip.

  • I know this board is polyphonic, but 1 instrument at a time correct?

    • midi can send signals for 16 channels and each channel can play a different instrument. Right now I have this working so a drum beat plays on channel 2 and a melody plays on channel 1 at the same time:
      // channel 1
      talkMIDI(0xB0, 0x07, 127); //0xB0 is channel message, set channel volume
      talkMIDI(0xB0, 0, 0x79); //Bank select melodic
      // channel 2
      talkMIDI(0xB1, 0x07, 127); //0xB0 is channel message, set channel volume
      talkMIDI(0xB1, 0, 0x78); //Bank select drums
      talkMIDI(0xC1, 5, 0); // set instrument to # 5
      // then to trigger the notes:
      noteOn(0, ThisNote, 127]); // play channel 1
      noteOn(1, ThisDrum, 127]); // play channel 2
      This did take some time to wrap my head around because I have never worked with midi at this level of detail. Cheers!

      • Have you been able to get good control of the output timing? I was able to produce some basic algorithmic music, but I’d love to be able to program in more “feel” to the canned drum parts, for instance. I’ve converted a midi beat into an array of noteOn/noteOff signals with associated “tick” timing, but my programming skills are lacking when it comes to triggering those on time as they arise. For instance, I want to trigger kick and hi-hat at or around tick 0, snare at tick 96, hi-hat at tick 150, etc., with each tick only 5-10 ms, depending on tempo. Has anyone done or seen something similar? Many thanks for any advice.

        Btw, your SongPainter project is great!

    • I think what you can do is play one note, than change instruments, and play another instrument etc.
      Max is 31 notes, but I don’t believe it is limited to a single instrument.

  • Anyone have an mp3 file that plays the instruments?

    • Now that I have it running, I could make a demo mp3; lets see if I can get around to it in the next few days.

    • The IC comes preloaded with TONS of instruments! Take a look at the datasheet.

  • Anyone seen a good tutorial or guide on how to get this up and running? The example code(s) are nice, but they don’t really show the full functionality of the board.
    Thanks!

  • Can someone summarize the differences between this VS1053 and the VS1103? The VS1103 seems to have a bit “more” of the same but the VS1053 appears more popular.

    • VS1053 has MP3 support when VS1103 can only play PCM and ADPCM.
      VS1053 has very poor quality MIDI instruments in soundbank and I think VS1103 is the same.

      • FWIW, I have tried the VS1103, and the MIDI samples are pretty good. The sound is very close to a vintage SoundBlaster card (Yamaha OPL3).

      • I would consider the midi samples quite fair - actually better than the quicktime midi defaults (my opinion). If you only play short notes (< 100 ms) on the VS1053 they do sound bad because many of them have a longer attack and decay time. Set the note length to 150 to 300 ms to hear the actual capability. I was quite surprised how nice they sounded when plugged into a pair of YAMAHA studio monitors. And this VS1053 chip has stereo stage positioning that I like as well.

  • I have the old version which makes a lot of noise when I power it up until the sketch starts running (just a few seconds). Can I fix this by pulling the reset pin high (like this version)?

Customer Reviews

No reviews yet.