กลับไปหน้ารวมไฟล์
midi-player-piano-powered-by-arduino-200f2b-en.md

In early August 2017 I was 15 and looking to partake in some kind of engineering project that would be fun and also help me learn new things. For a long time I had an Arduino Uno that had been sitting in a drawer, and for the first time I took it out to experiment with it and create something new.

For a long time I had been inspired by player pianos — it’s something about the way the keys move on their own that make them so wonderful. I wanted to create something like that — something that didn’t only work but also impressed the viewer — for a cheap cost.

One of my goals in creating this was to show that it’s possible to replicate amazing things for little money, and I think I proved this. While a player system from Yamaha or Pianodisc cost upwards of $10, 000, I built my own system for a relatively cheap $650. Not only that, but once the $10, 000 player piano is purchased, you have to purchase extra apps and songs to play on it. Overall I’m very satisfied with the way the piano turned out, and I’m excited to use it in the future.

A document detailing the process of building the player piano can be seen here: https://drive.google.com/file/d/1uUG9_p_ZxxOJA7IN526V5-fykXMjAesL/view?usp=sharing

Project Perspective

MIDI Player Piano Powered by Arduino is a sophisticated exploration of musical engineering and MIDI-to-mechanical interaction. By focusing on the essential building blocks—the 88-solenoid array and a high-current power system—you'll learn how to communicate and play your acoustic piano using a specialized software logic and a robust mechanical setup.

Technical Implementation: Solenoids and MIDI Logic

The project reveals the hidden layers of simple code-to-music interaction:

  • Identification layer: Eighty-eight JF-1039B Solenoids act as high-resolution pneumatic fingers, providing the physical strike force for each piano key.
  • Conversion layer: The Arduino Mega uses MIDI input (via Serial or Bluetooth) to decode the "Note On" and "Velocity" messages.
  • Processing Logic layer: The Arduino code follows a "sequential decoding" (or queue-timing) strategy: it interprets the MIDI stream and matches solenoid pulses to provide a high-definition musical performance.
  • High-Power Interface layer: Banks of Relays (or MOSFETs) provide the high current and power needed for the 12V/24V solenoids while protecting the micro-controller.
  • Visual Interface layer: A 20x4 LCD Display provides high-definition visual feedback for every MIDI status check (e.g., "Song: Chopin Op. 9").

Hardware Infrastructure

  • Arduino Mega 2560: The "brain" of the project, managing the multi-channel solenoid timing and coordinating the MIDI stream.
  • 88-Solenoid Array: Providing the tactile physical force and orientation for every point of the piano player.
  • Bluetooth MIDI Module: Providing high-speed and reliable data monitoring for low-pin-count MIDI updates from a smartphone.
  • 24V High-Current Supply: Essential for providing the 20A+ current for simultaneous key-strikes and pedal actuation.
  • Custom Mounting Rails: Providing high-precision mechanical housing for the 100+ solenoids behind the piano keys.
  • Micro-USB Cable: Used to program the Arduino and provides the primary power for the initial setup.

Features

  • Play any song from a MIDI file, which is a file type (similar to mp3) that saves the specific notes of a song. MIDI files are widely used, and any song can be found in this file type.
  • Connect to the piano via wired connection to a computer or Bluetooth connection to a smart device.
  • Programs like Synthesia and Piano From Above make it easy to instantly play any song. Use PianoStream, a MIDI streaming app, to play songs on the piano like a radio for hours.
  • Easily record songs to MIDI files using a digital keyboard and instantly play it back on the piano.
  • The piano retains its normal functionality, even while the piano is playing! A pianist is able to practice or play a song along with the piano.
  • Performance - The piano is able to decode the MIDI information and schedule each key to create the intended sound, even if the information sent to the piano is impossible to play.
  • The piano takes control on the damper (sustain) pedal to create a realistic performance
  • The system can control the volume (velocity) of each key to play a note softer or louder depending on the MIDI information received.
  • A control box on the front of the piano enables an on/off switch, volume control with a dial, and buttons to change the piano’s settings.

Playback and Interaction Step-by-Step

The MIDI-to-piano process is designed to be very efficient:

  1. Initialize Hardware: Correctly seat the 88 solenoids on custom rails and connect to the relay banks and the Arduino.
  2. Setup High-Power Sync: In the setup() function, define the MIDI baud rate (31250 bps) and initialize the 88 digital output pins.
  3. Internal Dialogue Loop: The piano constantly performs high-performance MIDI checks and updates the key status in real-time with the music.
  4. Visual Feedback Integration: Watch as your acoustic piano automatically becomes a rhythmic visual signal, pulsing and following your MIDI settings.

Future Ideas & Expansion

  • Be able to record your own MIDI files using the piano
  • Incorporate both audio and MIDI
  • OLED Identity Dashboard Integration: Add a small OLED display on the piano-front box to show "BPM," "Key Signature," and "CPU Load."
  • Multi-sensor Climate Sync Synchronization: Connect a specialized "Record Module" to precisely track and log your own piano performances to MIDI.
  • Cloud Interface Registration Support Synchronization: Add a specialized web-dashboard to precisely track and log your piano history from your smartphone anywhere.
  • Advanced Velocity Profile Customization Support: Add specialized "Pedal Dynamics" (using a Servo) to perform more realistic pedaling for concerts.

MIDI Player Piano Powered by Arduino is a perfect project for any electronics enthusiast looking for a more interactive and engaging musical-robot tool!

[!CAUTION] Always use high-quality waterproof and insulated wiring for the 88 solenoids to avoid overheating and short-circuits during long performances!

DETAILS & DOCUMENTS

A detail of the build process, the code, and other videos can be found on my webpage: https://brandonswitzer.squarespace.com/player-piano

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
  - "1x Synthesia (MIDI Playback software)"
  - "1x MIDI Stream App (Smart device)"
author: "shassandanish1"
category: "Art & Creativity"
components:
  - "1x Arduino MEGA 2560 (Master Controller)"
  - "88x JF-1039B Push Solenoids (One for each key)"
  - "2x JF-1250B Push Solenoids (For pedals)"
  - "11x 8-Channel Relay Modules (or MOSFET Transistor Bank)"
  - "1x Bluetooth MIDI Module (HC-05 or BLE)"
  - "1x 24V 20A DC Power Supply (to trigger solenoids)"
  - "1x LCD Graphic Display 20x4 px (I2C)"
  - "100x Jumper wires (generic)"
  - "1x Custom Wooden Rails for Solenoid Mounting"
  - "1x Micro-USB Cable"
description: "A fun and advanced musical engineering project to convert an acoustic upright piano into a MIDI-controlled player piano using over 88 solenoids and an Arduino."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://github.com/bbswitzer/PianoProject"
encryptedPayload: "U2FsdGVkX19JK6OWVCQyigpyr/pzEfwKfooFIOQl1xxUfH+s8vk+veOeklbUncQHkXnWx0628ffl9vIeCPP9Nafa40zKhDE5wpaCQRl5xRA="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/midi-player-piano-powered-by-arduino-200f2b_cover.jpg"
lang: "en"
likes: 2
passwordHash: "25193ee7560cbabba2fc7508a4517f9b40c07c5d7205455d618b23797b7ad5ba"
price: 2450
seoDescription: "An advanced and playsomely interactive MIDI player piano for beginners interested in Arduino solenoid arrays and music-to-motion projects."
tags:
  - "piano"
  - "midi"
  - "player-piano"
  - "solenoids"
  - "arduino"
  - "advanced"
title: "MIDI Player Piano Powered by Arduino"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/S7Bd992k368"
views: 3184