|This page has links to websites or programs not hosted or created by Scratch or 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 Sound Blocks can create Sounds with the pitch of a MIDI note. A Scratcher can create their own MIDI sequences using sound 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 Sound 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.
Scratch 1.3 was able to generate MIDI from the microphone, via the note block.
MIDI Note System
The MIDI Note System can be seen at work when you use the Play Note () for () Beats block. 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 the “ “. 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.
|Base 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.
In Scratch, the Java Player, and the Flash Player, the MIDI notes all sound different.
- Sound Editor
- Sound Blocks