|This page has links to websites or programs not trusted by Scratch or hosted by Wikipedia. Remember to stay safe while using the Internet, as we can't guarantee the safety of other websites.|
MIDI stands for Musical Instrument Digital Interface, and is a standardized protocol and file format. Some of Scratch's music blocks can create sounds with the pitch of a MIDI note. A Scratcher can create their own MIDI sequences using music blocks.
|Note:||This article may require some knowledge of music to understand.|
How it Works on Scratch
MIDI sounds in Scratch are created by certain music blocks. These are mainly the Play Note () for () Beats and Play Drum blocks, with volume, tempo, and instrument values being set by other blocks. Put together, a whole range of sounds can be created.
MIDI Note System
The MIDI note system is used by Play Note () for () Beats. When selecting the note, you either type in a number or press a key on the virtual piano. The number represents the MIDI note. 60 is Middle C. Adding or subtracting 1 is the equivalent to moving 1 half step. Adding or subtracting 12 changes the note by 1 octave.
MIDI can sometimes be tricky to use on Scratch since it does not have the regular notation for notes and durations. These diagrams might help:
There are 128 notes on the MIDI keyboard, numbered from 0 (C-1, about 8.18 Hz) to 127 (G9, 12500 Hz). Each note is 1 higher than the previous, and the ratio of frequency is always 12√ (approximately 1.06), with A4 being 440 Hz.
|Bass and Treble||C4 (middle C)||60||262 Hz|
This table shows the beat number values for the most common rhythms in the most common time signatures, interpreted in the most basic way.
Pros and Cons
Using MIDI in Scratch is a useful feature, but it has a few disadvantages:
- A Scratcher can easily create and mix music.
- Once a MIDI script has been created, it is very easy to change certain aspects of the sounds such as instrument, volume, tempo, and note.
- Many songs can be replicated thanks to the MIDI note system.
- The use of blocks makes playing MIDI notes simple and effective.
- Sounds created with MIDI scripts may sound repetitive, low quality, or incorrect.
- Users with little musical knowledge may have trouble understanding how the MIDI note system works.
- Scratch offers no method for exporting the MIDI notes (but this can be trivially solved with two lists and a loop over them).
Sometimes MIDI sounds do not work. If this happens, the most likely solution to the problem is to turn up the MIDI sounds on your computer, which is most commonly found in the volume control panel. It may also be called SW Synth. If this is turned up and the MIDI sounds still do not work, try restarting your computer.