MIDI Keyboards for Producing Music, What They Are and How They Work

MIDI Keyboards for Producing Music

MIDI keyboards have been with us since the early 80s, they have become one of the most used instruments for those who are dedicated to the production of computer music, both amateur level and professional use. In this article we are going to explain how these peripherals work, with which great melodies and songs have been produced during the last three decades.

One of the most famous milestones in electronics was the appearance of the transistor radio, which completely eliminated the old cabinet radios from the market. A process that occurred with the appearance of MIDI keyboards at the beginning of the 80s. Since it was no longer necessary to have a huge piano at home, these compact pianos based on pure and hard electronics could emulate any type of sound and make magic that they are not possible on a conventional piano.

It is one of the most exciting peripherals of all and almost three decades later it is still being used to produce music, for which it continues to function the same as the first day. But what is its internal architecture?

First of all, we are talking about a keyboard

Teclados MIDI notas frecuencia

A MIDI keyboard, regardless of the number of keys it has, is treated as its name says of a keyboard, and if you forgive us the truism this is important due to the fact that the MIDI standard assigns 128 different values to each of the keys of the keyboard. piano, which translates to 11 octaves of 12 different notes. In which each octave brings together the following notes: C, C sharp, D, R sharp, E, F, F sharp, G, G sharp, A, A sharp and Yes.

Tabla notas teclados MIDI

The only exception to this is the eleventh octave where the notes G, G Sharp, A, A Sharp, and Si are not included. In each octave the frequency value of the different notes is doubled if we go up an octave upwards and therefore to the right of the MIDI keyboard. In the case that we go in the opposite direction then the frequency of each note is reduced by half. In other words, the further to the left of the keyboard, the lower the notes will sound and the further to the right, the higher the pitch.

How do MIDI keyboards pick up notes?


The operation of a MIDI keyboard is similar to that of a keyboard, but with the difference that it has the ability to capture the pressing of several keys at the same time. This is what we call polyphony on a MIDI keyboard. Which is essential, since in real life, we can make multiple piano keys sound at the same time to generate musical chords.

Because each note has a value of 7 bits, the fact of playing several notes at the same time supposes several input bits in the processor in charge of synthesizing the sound, this chip is the same type of chip that exists in the cards sound, but with a difference, they do not receive the notes to be played from a program created by the CPU, but rather by the keys pressed by the users.

Chip de sonido PSG

One trick that is done to reduce costs is to use a shift register, which is a type of memory that when it receives new data what it does is output the oldest data through its output port. So the new data displaces the previous one. In this way, the different notes that are played are stored in memory, but their data is transmitted one by one to the synthesizer, which interprets each of the notes according to the channel used.

The number of channels will depend on the sound chip used in the MIDI keyboard, as long as we hold down a key, the channel or voice corresponding to that key will remain active and will not be occupied by any other note unless we lift our finger. Moment in which another wave that reaches it will take its place.

The importance of tempo


Since a MIDI keyboard communicates with other devices, either with its own speakers to generate music from the keyboard itself or to a MIDI input, it not only has to have the ability to transmit each note, but when each one is played and the duration of the same.

On an alphanumeric keyboard, when we press a key, what we send is a signal from said key, in such a way that if we hold down the “a” key then we will see “aaaaaa” written on the screen, which will be interpreted as several keystrokes in a row, in music apart from the different notes we also have the duration of each of the notes, which is the tempo or what we call the measure, which is what the time that a quarter note lasts on the staff, deriving the rest of the notes from the time of a quarter note .

Notas duración

Thus an eighth note lasts half the period of a quarter note, a sixteenth note half an eighth note and therefore a quarter of a quarter note, etc. There are also longer notes such as the white that lasts twice as long as a black and even silences. Reality? The entire time of a song is marked by the period that a quarter note lasts.

To count time, we must know how to differentiate between absolute and relative time. When we talk about absolute time we are talking about exact lengths of time that we have accepted in order to communicate time between us, so we are not referring to seconds, minutes and hours. The relative time, on the other hand, is different and it can be said that each piece of music has its own relative time, not only at the level of the score, but also at the level of the interpretation made by each musician.

Measuring time on MIDI keyboards

MIDI Clock

MIDI keyboards can interpret time in two different ways, one of them relative and the other absolute. When we talk about relative time, what the MIDI keyboard does is send a message of duration of 24 times for the duration of each quarter note.

Relative time is also known as MIDI Clock and was originally used for drum machines and sequencers. This has evolved to be integrated into all systems. Its existence allows you to do things like adjust the speed of loops, synchronize tracks and sequencers. So it allows you to synchronize several devices.

The absolute time, on the other hand, is marked by the SMPTE television standard, this I believe to synchronize music with images for television. Especially so that the melodies agreed with the images. To this day this is not used, as we have software that does this without the need for this system, but originally it was necessary for live television.