How do we turn a faulty electronic organ into a MIDI piano?

How do we turn a faulty electronic organ into a MIDI piano?

Reading time: 4 minute

In this article we will show you how you can transform a defective electronic organ in a MIDI piano. The application has an interactive purpose, being later useful to children.

To carry out the project we will need an Arduino Uno board (or similar) and cables.

Hardware part

The first step required to carry out this project is the disassembly of the piano (electronic orgies).

After disassembly (in this case) can be seen button array and voltage source, both connected to the piano controller through two ribbon cables, which have a total of 13 wires.

How does a button array work?

In general, button arrays are required to enter data into various applications. The button array for this project consists of 8 rows and 5 columns (see image below).

To determine which button is pressed or not, the microcontroller responsible for this application (the one on the Arduino) must apply voltage to each row and read whether or not there is voltage at the column connections.

For example, if the microcontroller applies signal to row 3 and there is voltage to column 4, then it means that the U15 button is pressed.

Connecting the button array to the Arduino

To connect the array of buttons to the Arduino, the existing ribbon cables have been replaced with some Dupont TT cables.

To be able to control different software as well FL Studio, it is necessary to use the MIDI protocol.

What is the MIDI Protocol?

MIDI protocol (Musical Instrument Digital Interface) is a protocol that allows communication between computers and electronic musical instruments. MIDI data consists of 3 bytes.

The first byte tells us if the grade is ON / OFF and which channel will be used, the second byte transmits to the computer which note we want to play (between 0 and 127), and the third will transmit to the computer "note velocity" (note velocity, which can be between 0-127). In our project, the Arduino Uno development board will send this data using the Serial.write () command. So, the code that will need to be loaded on the Arduino board for this application is presented below:

#it ​​includes const byte ROWS = 5; const byte COLS = 8; byte colPins [COLS] = {21, 20, 19, 18, 17, 16, 15, 14}; byte rowPins [ROWS] = {6, 5, 4, 3, 2}; char hexaKeys [ROWS] [COLS] = {{1, 2, 3, 4, 5, 6, 7, 8}, {9, 10, 11, 12, 13, 15, 16, 17}, {18, 19 , 20, 21, 22, 23, 24, 25}, {26, 27, 28, 29, 30, 31, 32, 33}, {34, 35, 36, 37, 38, 39, 40, 41}} ; Keypad customKeypad = Keypad (makeKeymap (hexaKeys), rowPins, colPins, ROWS, COLS); void setup () {Serial.begin (9600); } void loop () {int customKey = customKeypad.getKey (); if (customKey! = NO_KEY) {Serial.write (B10010001); Serial.write (customKey); Serial.write (100); }}

Before loading the code, you must also add the Keypad.h library, bookstore that you can download here: https://playground.arduino.cc/.

If the light organ (piano) used has more or fewer rows / columns, you must change the variables ROWS and COLS. After that, you need to specify to which pins you connected the rows / columns in the variables colPins / rowPins.

After uploading the code to your Arduino board, you will need to install the following applications on your computer.:

https://www.tobias-erichsen.de/software/ (MIDI loop)
https://projectgus.github.io/ (Hairless MIDI)

The loopMIDI application

The first application (MIDI loop) is used to create a virtual MIDI port, and the second (Hairless MIDI) to send the data received from Arduino to that virtual port.

To create a virtual MIDI port just press the "+" button at the bottom left of the loopMIDI application.

"Hairless MIDI <-> Serial Bridge" application

To connect the Arduino board to the virtual MIDI port within the application "Hairless MIDI <-> Serial Bridge" you have to select the Arduino board type in the "Serial port" menu, and on the right side, in the "MIDI Out" menu, you have to select the "loopMIDI Port".

Also in the application "Hairless MIDI <-> Serial Bridge" you will need to go to File> Prefrences and change the "Baud rate" to 9600.

After making these configurations, check the "Serial <-> MIDI Bridge On" button to start the connection between the Arduino serial port and the MIDI virtual port.

In order to check that everything is in order, after pressing any key on the modified piano, you should receive messages such as "+2.833 - Serial In: Ch 2: Note 6 on velocity 100" in the "Hairless MIDI <-> Serial Bridge" application.

If everything is fine, now you can open an application like FL Studio, go to "OPTIONS> MIDI Settings", to "Input", select the device "loopMIDI Port", then press the "Enable" button on the left , and from the right select Port number 1.

Author Florin Baciu

A comment

Add a comment

Your email address will not be published. Required fields are marked with *

The maximum upload file size: 2 MB. you can upload: image, audio, video, document, spreadsheet, Interactive, text, archive, queues, Other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop files here