DIYTech
Work function of a MIDI keyboard

In order to understand the MIDI keyboard, we should know about the musical keyboard first. A musical keyboard is the set of adjacent depressible levers on a musical instrument which cause the instrument to produce sounds. Keyboards almost all share the common layout shown. Musical instruments with keyboards of this type include the piano, harpsichord, virginals, clavichord, organ, electric piano, digital piano, synthesizer, "arranger keyboard" or "home keyboard" (also called "electronic keyboard"), celesta, dulcitone, accordion, melodica, glasschord, and carillon. Since the most commonly encountered keyboard instrument is the piano, the keyboard layout is often called the piano keyboard. The twelve notes of the Western musical scale are laid out with the lowest note on the left; the larger keys (for the seven "natural" notes of the C major scale: C, D, E, F, G, A, B) jut forward. Because these keys are often coloured white on a keyboard, these are often called the white notes or white keys. The keys for the remaining five notes which are not part of the C major scale (namely C#/D#, D#/E#, F#/G#, G#/A#, A#/B#) are set back. Because these keys are often coloured black, these notes are often called the black notes or black keys. The pattern repeats at the interval of an octave. The arrangement of longer keys for C major with intervening, shorter keys for the intermediate semitones dates to the 15th century. Many keyboard instruments dating from before the nineteenth century have a keyboard with the colours of the keys reversed - darker coloured keys for the white notes and white keys for the black notes. A few electric and electronic instruments have had this feature. It should be noted that the reverse-colored keys on Hammond organs such as the B3, C3 and A100 are not playable keys; they physically latch when pressed like radio buttons, and serve as selector switches for preset sounds. There are 21 white keys on the keyboard and 15 black. How to make a MIDI Keyboard
MIDI keyboard connects to computer sound card or synthesizer module to create MIDI code. This Project is built around the 8031 microcontroller. Once keyboard circuit diagram is drawn out, one can construct scanning circuitry that continuously loops through a test of each key to see if it is open or closed. Circuit Components
Microcontroller, memory, keyboard/switch interface, MIDI/RS232 interface and power supply Software Algorithm
- The software loops through a check of each 1st switch for every key. - If it finds that switch 1 is open it checks to see if it was open the last time it looked. If this is the case it continues scanning. - If it finds that it is open but was closed the last time it looked then it stores info that it is now open and then sends the "note off value" for that key out the midi port. - If it finds that switch 1 is closed then it checks to see if switch 2 for that key is open. - If it is open then it increments the velocity register value and continues the scan. If it finds that switch 2 is closed then it checks a register to see if that note is already on. If so then it continues the scan. - If not then it sends the "note on value for that key out the midi port and also sends a velocity value from the velocity table that is incremented for each key check loop. Therefore, the more times that the software loops the lower the velocity value sent. Reference: Wikipedia, Internet. Compiled by Sumaiya Tanjina, student of Electronic and Telecommunication Engineering, IUB.
Comments