---
title: Quick Arduino Drum Machine Music Maker
description: Create a music instrument using Arduino that can play a series of different notes and instruments.
image: https://blog.sparkfuneducation.com/hubfs/IMG_2184.jpg
---

[![Sparkfun](https://www.sparkfuneducation.com/img/logo.png)](https://www.sparkfuneducation.com/index.html)

- [SparkFun Webstore](https://www.sparkfuneducation.com)
- [Higher Ed](https://sparkfuneducation.com/higher-ed/index.html)
- [Contact Us](https://www.sparkfuneducation.com/contact-us.html)
- [Follow Us](https://twitter.com/SparkFunEDU)

- [Home](https://www.sparkfuneducation.com)
- [Blog](https://blog.sparkfuneducation.com)
- [Curriculum](https://www.sparkfuneducation.com/curriculum.html)
- [PD/Events](https://www.sparkfuneducation.com/professional-dev.html)
- [KITS/Materials](https://www.sparkfuneducation.com/materials.html)
- [Educator Stories](https://www.sparkfuneducation.com/educator-stories.html)
- [Activities](https://activities.sparkfuneducation.com)

[Blog Home](https://blog.sparkfuneducation.com/) / [Arduino](https://blog.sparkfuneducation.com/topic/arduino) / Quick Arduino Drum Machine Music Maker

<https://blog.sparkfuneducation.com/rss.xml>

# Quick Arduino Drum Machine Music Maker

BY [Brian Huang](https://blog.sparkfuneducation.com/author/brian-huang) 4/20/17 6:27 AM

[0](https://blog.sparkfuneducation.com/quick-arduino-drum-machine-music-maker#comments-listing)

[Arduino](https://blog.sparkfuneducation.com/topic/arduino), [teaching tools](https://blog.sparkfuneducation.com/topic/teaching-tools)

![](https://app.hubspot.com/settings/avatar/991d88e4ed5e286c939cbd83775d7c88)

Find me on:

[Twitter](https://twitter.com/bri_huang)

This is a quick guide to using an old Arduino Shield called the [Musical Instrument Shield](https://www.sparkfun.com/products/10587). It gives your Arduino the ability to play a whole series of different notes and instruments — just like an old Casio synthesizer keyboard! We have a great [tutorial](https://www.sparkfun.com/tutorials/302) on using this board that was written some time ago. I wanted to revisit this board, so I created a quick, fun project using the tutorial as an example.

![IMG_2184.jpg](https://blog.sparkfuneducation.com/hs-fs/hubfs/IMG_2184.jpg?width=640&name=IMG_2184.jpg)

For this project, you'll need:

- [SparkFun Music Instrument Shield](https://www.sparkfun.com/products/10587)
- [Stackable Headers](https://www.sparkfun.com/products/11417)
- [SparkFun RedBoard for Arduino](https://www.sparkfun.com/products/13975)
- [Solderless Breadboard](https://www.sparkfun.com/products/12002)
- [Five Push Buttons](https://www.sparkfun.com/products/10302)
- [Speaker](https://www.sparkfun.com/products/14023)
- (optional)[Serial LCD](https://www.sparkfun.com/products/9395) and [JST Wire Connector](https://www.sparkfun.com/products/13685) 

Click below for the complete wish list of parts used!

[![Musical Instrument Button Machine Wishlist](https://no-cache.hubspot.com/cta/default/2224003/c4703109-029d-40a5-ae41-27bda788f251.png)](https://cta-redirect.hubspot.com/cta/redirect/2224003/c4703109-029d-40a5-ae41-27bda788f251)

 

## Hardware

The wiring for this circuit is pretty simple. The diagram below does not show the Music Instrument Shield, but when it's stacked on top of an Arduino, it uses pins 3 and 4 — so stay away from those pins. Pin 3 is used for data communication to the MIDI chip, and pin 4 is used to reset and sync the chip.

Connect the five push buttons as shown in the diagram below. In the code, I use the pinMode(##, INPUT\_PULLUP) functions to eliminate the need for external pull-up resistors. As an optional add-on, I have written into the code example to use a [Serial LCD](https://www.sparkfun.com/products/9395) and a [JST 3-Pin Jumper](https://www.sparkfun.com/products/13685) to display the four notes that the device is set to play. 

 

![MusicInstrumentButtonMachine_bb.png](https://blog.sparkfuneducation.com/hs-fs/hubfs/MusicInstrumentButtonMachine_bb.png?width=751&height=547&name=MusicInstrumentButtonMachine_bb.png)

 

## Code Example

Click [here](https://github.com/bhuangSFE/MusicInstrumentButtonMachine/archive/master.zip) to download the code example from my GitHub repository. The Music Instrument Shield takes serial commands on pin 3 at a data rate of 31,250 bits per second. Data is passed from the Arduino to the Music Instrument Shield, instructing it to configure instruments and play notes. 

The Music Instrument Shield has a lot of different functions. In this one, we're setting it to a bank of sounds that are tied to drum beats and special effects. This is on line 57 of the code. 

After we've configured this, we are going to read the four button presses and play one of four notes on the shield. When we press the fifth button (connected to pin 9), we increment the notes that are being played. Based on testing, I found that you can play the notes indexed from 27 up to 87. The code is yours to tweak and modify. Play around with different numbers or instruments. Below is a table of the notes that we play in this example. 

![](https://dlnmh9ip6v2uc.cloudfront.net/tutorialimages/MusicInstrument/small_drumbank.JPG)

Want to learn more? Check out the quickstart guide for the Music Instrument Shield!

[![Musical Instrument Shield Quickstart Guide](https://no-cache.hubspot.com/cta/default/2224003/94250ad4-658d-430c-80f3-acb5f6cb6ffc.png)](https://cta-redirect.hubspot.com/cta/redirect/2224003/94250ad4-658d-430c-80f3-acb5f6cb6ffc)

## Demo

Here's a quick video demonstrating how the whole thing works. I love making "music" and sounds with the Arduino! It brings back memories of playing with my old Casio! Next project is to do some quick recording and playback. Have fun with this and share your ideas in the comments below.

 

 

- [Tweet](https://twitter.com/share)

### Subscribe to SparkFun Education Blog

### Topics

- [helpful information (79)](https://blog.sparkfuneducation.com/topic/helpful-information)
- [Maker Education (60)](https://blog.sparkfuneducation.com/topic/maker-education)
- [teaching tools (55)](https://blog.sparkfuneducation.com/topic/teaching-tools)
- [getting started (54)](https://blog.sparkfuneducation.com/topic/getting-started)
- [Guest Post (44)](https://blog.sparkfuneducation.com/topic/guest-post)
- [computer science (40)](https://blog.sparkfuneducation.com/topic/computer-science)
- [micro:bit (38)](https://blog.sparkfuneducation.com/topic/microbit)
- [student projects (37)](https://blog.sparkfuneducation.com/topic/student-projects)
- [STEM (36)](https://blog.sparkfuneducation.com/topic/stem)
- [programming (34)](https://blog.sparkfuneducation.com/topic/programming)
- [STEAM (31)](https://blog.sparkfuneducation.com/topic/steam)
- [Events (28)](https://blog.sparkfuneducation.com/topic/events)
- [Arduino (25)](https://blog.sparkfuneducation.com/topic/arduino)
- [robotics (20)](https://blog.sparkfuneducation.com/topic/robotics)
- [e-textiles (18)](https://blog.sparkfuneducation.com/topic/e-textiles)
- [Professional Development (17)](https://blog.sparkfuneducation.com/topic/professional-development)
- [basic circuits (17)](https://blog.sparkfuneducation.com/topic/basic-circuits)
- [What is a (16)](https://blog.sparkfuneducation.com/topic/what-is-a)
- [announcement (16)](https://blog.sparkfuneducation.com/topic/announcement)
- [makerspace (15)](https://blog.sparkfuneducation.com/topic/makerspace)
- [Community Partnership Program (14)](https://blog.sparkfuneducation.com/topic/community-partnership-program)
- [Training (13)](https://blog.sparkfuneducation.com/topic/training)
- [raspberry pi (13)](https://blog.sparkfuneducation.com/topic/raspberry-pi)
- [python (11)](https://blog.sparkfuneducation.com/topic/python)
- [AVC (10)](https://blog.sparkfuneducation.com/topic/avc)
- [paper circuits (10)](https://blog.sparkfuneducation.com/topic/paper-circuits)
- [Makey Makey (8)](https://blog.sparkfuneducation.com/topic/makey-makey)
- [SIK (8)](https://blog.sparkfuneducation.com/topic/sik)
- [Adventures in Science (7)](https://blog.sparkfuneducation.com/topic/adventures-in-science)
- [microcontroller (7)](https://blog.sparkfuneducation.com/topic/microcontroller)
- [Internet of Things (5)](https://blog.sparkfuneducation.com/topic/internet-of-things)
- [Processing (4)](https://blog.sparkfuneducation.com/topic/processing)
- [Javascript (3)](https://blog.sparkfuneducation.com/topic/javascript)
- [LilyPad (3)](https://blog.sparkfuneducation.com/topic/lilypad)
- [funding (3)](https://blog.sparkfuneducation.com/topic/funding)
- [weather (3)](https://blog.sparkfuneducation.com/topic/weather)
- [Insider (1)](https://blog.sparkfuneducation.com/topic/insider)
- [Johnny-five (1)](https://blog.sparkfuneducation.com/topic/johnny-five)

All Tags

### Recent Authors

- [Megan Hemmings (79)](https://blog.sparkfuneducation.com/author/megan-hemmings)
- [Maya Kleinbort (22)](https://blog.sparkfuneducation.com/author/maya-kleinbort)
- [Derek Runberg (21)](https://blog.sparkfuneducation.com/author/derek-runberg)
- [Shane Diller (16)](https://blog.sparkfuneducation.com/author/shane-diller)
- [Jeff Branson (15)](https://blog.sparkfuneducation.com/author/jeff-branson)
- [Angela Sheehan (12)](https://blog.sparkfuneducation.com/author/angela-sheehan)
- [Melissa Felderman (9)](https://blog.sparkfuneducation.com/author/melissa-felderman)
- [Megan Arnold (8)](https://blog.sparkfuneducation.com/author/megan-arnold)
- [Brian Huang (6)](https://blog.sparkfuneducation.com/author/brian-huang)
- [Shawn Hymel (6)](https://blog.sparkfuneducation.com/author/shawn-hymel)
- [Shelby Landsman (6)](https://blog.sparkfuneducation.com/author/shelby-landsman)
- [Jahnell Pereira (5)](https://blog.sparkfuneducation.com/author/jahnell-pereira)
- [Hailey Blessing (5)](https://blog.sparkfuneducation.com/author/hailey-blessing)
- [Mike Grusin (3)](https://blog.sparkfuneducation.com/author/mike-grusin)
- [Peter Hanson (3)](https://blog.sparkfuneducation.com/author/peter-hanson)
- [Andrew Milne (3)](https://blog.sparkfuneducation.com/author/andrew-milne)
- [Toni Klopfenstein (2)](https://blog.sparkfuneducation.com/author/toni-klopfenstein)
- [Joanna Drusin (1)](https://blog.sparkfuneducation.com/author/joanna-drusin)
- [Joe Romano (1)](https://blog.sparkfuneducation.com/author/joe-romano)
- [Mrinali P. Kesavadas (1)](https://blog.sparkfuneducation.com/author/mrinali-p-kesavadas)
- [Christa Flores (1)](https://blog.sparkfuneducation.com/author/christa-flores)
- [Michelle Shorter (1)](https://blog.sparkfuneducation.com/author/michelle-shorter)
- [Colleen Graves (1)](https://blog.sparkfuneducation.com/author/colleen-graves)
- [Janelle Curtis (1)](https://blog.sparkfuneducation.com/author/janelle-curtis)
- [Eric Bogatin (1)](https://blog.sparkfuneducation.com/author/eric-bogatin)
- [Athena Zhang Baker (1)](https://blog.sparkfuneducation.com/author/athena-zhang-baker)
- [Janice Levenhagen (1)](https://blog.sparkfuneducation.com/author/janice-levenhagen)
- [Carol Hamilton (1)](https://blog.sparkfuneducation.com/author/carol-hamilton)
- [Vanessa Lail (1)](https://blog.sparkfuneducation.com/author/vanessa-lail)
- [Bobby Chan (1)](https://blog.sparkfuneducation.com/author/bobby-chan)
- [Glenn Samala (1)](https://blog.sparkfuneducation.com/author/glenn-samala)
- [Zack Weaver (1)](https://blog.sparkfuneducation.com/author/zack-weaver)
- [Dr. Jean-Sébastien Blouin (1)](https://blog.sparkfuneducation.com/author/dr-jean-sébastien-blouin)
- [Daphne Sipes (1)](https://blog.sparkfuneducation.com/author/daphne-sipes)
- [Axel Reitzig (1)](https://blog.sparkfuneducation.com/author/axel-reitzig)
- [Justin Weisz (1)](https://blog.sparkfuneducation.com/author/justin-weisz)
- [Kylie Peppler (1)](https://blog.sparkfuneducation.com/author/kylie-peppler)
- [Michael Megliola (1)](https://blog.sparkfuneducation.com/author/michael-megliola)
- [Casey Kuhns (1)](https://blog.sparkfuneducation.com/author/casey-kuhns)
- [Rebecca Grabman (1)](https://blog.sparkfuneducation.com/author/rebecca-grabman)
- [Sylvia Martinez (1)](https://blog.sparkfuneducation.com/author/sylvia-martinez)
- [Charles Randolph (1)](https://blog.sparkfuneducation.com/author/charles-randolph)
- [Ira Sather-Olson (1)](https://blog.sparkfuneducation.com/author/ira-sather-olson)
- [Kathy Strickland (1)](https://blog.sparkfuneducation.com/author/kathy-strickland)
- [Pete Lewis (1)](https://blog.sparkfuneducation.com/author/pete-lewis)
- [Jamie Roth (1)](https://blog.sparkfuneducation.com/author/jamie-roth)
- [Mimi Tran Zambetti (1)](https://blog.sparkfuneducation.com/author/mimi-tran-zambetti)
- [Ryan Jenkins (1)](https://blog.sparkfuneducation.com/author/ryan-jenkins)
- [Kristen Deuschle (1)](https://blog.sparkfuneducation.com/author/kristen-deuschle)
- [Erika Myers (1)](https://blog.sparkfuneducation.com/author/erika-myers)
- [Sara Gonzalez (1)](https://blog.sparkfuneducation.com/author/sara-gonzalez)
- [Celeste Moreno (1)](https://blog.sparkfuneducation.com/author/celeste-moreno)
- [Samantha Nagle (1)](https://blog.sparkfuneducation.com/author/samantha-nagle)
- [Pearce Melcher (1)](https://blog.sparkfuneducation.com/author/pearce-melcher)

All Authors

### Recent Posts

### Submit Your Idea

[![SparkFun Education](https://www.sparkfuneducation.com/img/logo.png)](http://www.sparkfuneducation.com/index.html)

#### Other Resources

- [Contact Us](http://www.sparkfuneducation.com/contact-us.html)
- [About SparkFun](http://www.sparkfun.com)
- [FAQs](https://www.sparkfun.com/static/faq)

- [Customer Service](https://www.sparkfun.com/support)
- [Shipping](https://www.sparkfun.com/support)
- [Terms and Conditions](https://www.sparkfun.com/terms)

#### Sign Up for Newsletter

© Copyright 2016. All Rights Reserved.