Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use SparkFun MIDI Shield: Examples, Pinouts, and Specs

Image of SparkFun MIDI Shield
Cirkit Designer LogoDesign with SparkFun MIDI Shield in Cirkit Designer

Introduction

The SparkFun MIDI Shield (MIDI Shield v13) is a versatile add-on board designed for Arduino, enabling seamless integration of MIDI (Musical Instrument Digital Interface) capabilities. This shield allows users to send and receive MIDI messages, making it ideal for music-related projects such as synthesizers, MIDI controllers, and other audio applications. With its user-friendly design, the MIDI Shield simplifies communication with MIDI devices, making it a popular choice for both hobbyists and professionals in the music and electronics fields.

Explore Projects Built with SparkFun MIDI Shield

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino-Based MIDI-Controlled Solenoid Actuator with LED Display
Image of Auto Glockenspiel: A project utilizing SparkFun MIDI Shield in a practical application
This circuit is a MIDI-controlled musical instrument system that uses an Arduino UNO to read MIDI files from an SD card and control solenoids via a relay module to play notes. An Arduino Nano is used to display song information on an I2C LCD and control LEDs for visual feedback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Teensy 4.0 Audio Controller with Adjustable Volume and Power Management
Image of proj2: A project utilizing SparkFun MIDI Shield in a practical application
This circuit features a Teensy 4.0 microcontroller interfaced with an audio shield for audio processing, controlled by a potentiometer for volume adjustment. It is powered by an Adafruit PowerBoost 1000C with a toggle switch for power control, and includes a 12-pin FFC converter for additional connectivity options.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO R4 WiFi Capacitive Touch MIDI Controller with Visual Feedback and Sound Playback
Image of 自适应乐器: A project utilizing SparkFun MIDI Shield in a practical application
This circuit is an interactive touch-based MIDI controller and audio player. It uses an Arduino UNO R4 WiFi to interface with an MPR121 capacitive touch sensor for input, a MAX7219 8-digit 7-segment display for visual feedback, and a DFPlayer MINI for audio output through a loudspeaker. The system detects touch inputs, plays corresponding sounds, and sends MIDI notes.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered MIDI Controller with nRF52840, AS5600 Encoders, and OLED Display
Image of midi lr driver: A project utilizing SparkFun MIDI Shield in a practical application
This circuit is a MIDI controller that uses an nRF52840 ProMicro microcontroller, multiple AS5600 magnetic encoders, an Adafruit TCA9548A I2C multiplexer, an OLED display, and several pushbuttons. The microcontroller reads the encoder positions and button states, displays information on the OLED screen, and sends MIDI signals based on user interactions.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with SparkFun MIDI Shield

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Auto Glockenspiel: A project utilizing SparkFun MIDI Shield in a practical application
Arduino-Based MIDI-Controlled Solenoid Actuator with LED Display
This circuit is a MIDI-controlled musical instrument system that uses an Arduino UNO to read MIDI files from an SD card and control solenoids via a relay module to play notes. An Arduino Nano is used to display song information on an I2C LCD and control LEDs for visual feedback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of proj2: A project utilizing SparkFun MIDI Shield in a practical application
Teensy 4.0 Audio Controller with Adjustable Volume and Power Management
This circuit features a Teensy 4.0 microcontroller interfaced with an audio shield for audio processing, controlled by a potentiometer for volume adjustment. It is powered by an Adafruit PowerBoost 1000C with a toggle switch for power control, and includes a 12-pin FFC converter for additional connectivity options.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 自适应乐器: A project utilizing SparkFun MIDI Shield in a practical application
Arduino UNO R4 WiFi Capacitive Touch MIDI Controller with Visual Feedback and Sound Playback
This circuit is an interactive touch-based MIDI controller and audio player. It uses an Arduino UNO R4 WiFi to interface with an MPR121 capacitive touch sensor for input, a MAX7219 8-digit 7-segment display for visual feedback, and a DFPlayer MINI for audio output through a loudspeaker. The system detects touch inputs, plays corresponding sounds, and sends MIDI notes.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of midi lr driver: A project utilizing SparkFun MIDI Shield in a practical application
Battery-Powered MIDI Controller with nRF52840, AS5600 Encoders, and OLED Display
This circuit is a MIDI controller that uses an nRF52840 ProMicro microcontroller, multiple AS5600 magnetic encoders, an Adafruit TCA9548A I2C multiplexer, an OLED display, and several pushbuttons. The microcontroller reads the encoder positions and button states, displays information on the OLED screen, and sends MIDI signals based on user interactions.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Building custom MIDI controllers for music production.
  • Interfacing with synthesizers, drum machines, and other MIDI-enabled devices.
  • Creating MIDI-based lighting or stage effects.
  • Developing interactive audio installations or performances.
  • Learning and experimenting with MIDI communication protocols.

Technical Specifications

The following table outlines the key technical details of the SparkFun MIDI Shield:

Specification Details
Manufacturer SparkFun
Part Number MIDI Shield v13
Input Voltage 5V (powered via Arduino)
MIDI Input/Output Standard 5-pin DIN connectors for MIDI IN and MIDI OUT
Additional Features 3.5mm stereo jack for MIDI THRU, potentiometers, and pushbuttons
Compatible Boards Arduino UNO, Mega, Leonardo, and other Arduino boards with standard headers
Dimensions 68.6mm x 53.3mm (fits standard Arduino form factor)

Pin Configuration and Descriptions

The SparkFun MIDI Shield uses the Arduino's pins for MIDI communication and additional features. Below is the pin mapping:

Pin Function
D0 (RX) MIDI IN (receives MIDI messages from external devices)
D1 (TX) MIDI OUT (sends MIDI messages to external devices)
D2 Pushbutton 1 (user-configurable)
D3 Pushbutton 2 (user-configurable)
A0 Potentiometer 1 (user-configurable analog input)
A1 Potentiometer 2 (user-configurable analog input)
5V, GND Power and ground connections (shared with Arduino)

Usage Instructions

How to Use the MIDI Shield in a Circuit

  1. Attach the Shield to an Arduino Board: Align the shield's headers with the Arduino's pins and press it firmly into place.
  2. Connect MIDI Devices:
    • Use the 5-pin DIN connectors to connect MIDI IN and MIDI OUT devices.
    • Optionally, use the 3.5mm stereo jack for MIDI THRU.
  3. Power the Circuit: Power the Arduino via USB or an external power source.
  4. Upload Code: Write and upload Arduino sketches to send or receive MIDI messages.

Important Considerations and Best Practices

  • MIDI Baud Rate: MIDI communication operates at a baud rate of 31250. Ensure your Arduino sketch is configured accordingly.
  • Isolation: The MIDI Shield includes opto-isolation for MIDI IN to protect your Arduino from voltage spikes.
  • Pin Conflicts: Avoid using pins D0 and D1 for other purposes, as they are dedicated to MIDI communication.
  • External Power: If using multiple MIDI devices, consider powering the Arduino externally to ensure sufficient current.

Example Code for Arduino UNO

Below is an example sketch to send a MIDI note when a button is pressed:

#include <MIDI.h> // Include the MIDI library

MIDI_CREATE_DEFAULT_INSTANCE();

const int buttonPin = 2; // Pin connected to the button
const int note = 60;     // MIDI note number (Middle C)
const int velocity = 100; // Velocity of the note
const int channel = 1;    // MIDI channel

void setup() {
  pinMode(buttonPin, INPUT_PULLUP); // Configure button pin as input with pull-up
  MIDI.begin(MIDI_CHANNEL_OMNI);   // Start MIDI communication
}

void loop() {
  static bool notePlaying = false; // Track if the note is currently playing

  if (digitalRead(buttonPin) == LOW) { // Check if button is pressed
    if (!notePlaying) {
      MIDI.sendNoteOn(note, velocity, channel); // Send Note On message
      notePlaying = true; // Update state to indicate note is playing
    }
  } else {
    if (notePlaying) {
      MIDI.sendNoteOff(note, velocity, channel); // Send Note Off message
      notePlaying = false; // Update state to indicate note is not playing
    }
  }
}

Explanation of the Code

  • The MIDI_CREATE_DEFAULT_INSTANCE() macro initializes the MIDI library.
  • The button is connected to pin 2 and configured as an input with a pull-up resistor.
  • When the button is pressed, a MIDI Note On message is sent. When released, a Note Off message is sent.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No MIDI Communication:

    • Ensure the shield is properly seated on the Arduino.
    • Verify that the MIDI cables are securely connected to the correct ports.
    • Check that the Arduino sketch is using the correct baud rate (31250).
  2. Button or Potentiometer Not Working:

    • Confirm that the correct pins are being used in the code.
    • Check for loose connections or damaged components.
  3. Arduino Not Recognized by Computer:

    • Ensure the correct board and port are selected in the Arduino IDE.
    • Try a different USB cable or port.
  4. MIDI Messages Not Received by External Device:

    • Verify that the external device is set to the same MIDI channel as the Arduino.
    • Check the MIDI OUT connection and cable for faults.

FAQs

Q: Can I use the MIDI Shield with boards other than the Arduino UNO?
A: Yes, the MIDI Shield is compatible with other Arduino boards like the Mega and Leonardo, as long as they have the standard header layout.

Q: Can I use the shield for USB MIDI communication?
A: The MIDI Shield is designed for standard 5-pin MIDI communication. For USB MIDI, additional hardware or software may be required.

Q: How do I test if the shield is working?
A: Use a simple sketch to send a MIDI Note On message and verify that the connected MIDI device responds.

Q: Can I use the potentiometers and buttons for non-MIDI purposes?
A: Yes, the potentiometers and buttons can be used as general-purpose inputs for other Arduino projects.