From Test-Scratch-Wiki

MIDI stands for Musical Instrument Digital Interface, and is a standardized coding that allows Scratch to create Sounds. A Scratcher can create their own MIDI sequences using Sound Blocks.

Note Note: This article may require some knowledge of music to understand.

How it Works in 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 "Middle C". Adding or subtracting 1 is the equivalent to moving 1 "half step". Adding or subtracting 12 changes the note by 1 octave.

Notation

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:

Notes

The note names are written on the keys. Notes written in the two most common clefs (Treble clef and Bass clef) are connected to the piano. All notes can be written in an infinite number of ways. The most common enharmonic notes are included. A line going from a long red box means the notes go to the same key on the piano. Even though the drop-down keyboard shows only two octaves of notes (48 to 72), a number can be put in manually to get any note. To change octaves, simply add or subtract 12.

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 122 (approximately 1.06), with A4 being 440 Hz.

Clef Note MIDI number Frequency
Bass C3 48 131 Hz
C♯3/D♭3 49 139 Hz
D3 50 147 Hz
D♯3/E♭3 51 156 Hz
E3 52 165 Hz
F3 53 175 Hz
F♯3/G♭3 54 185 Hz
G3 55 196 Hz
G♯3/A♭3 56 208 Hz
A3 57 220 Hz
A♯3/B♭3 58 233 Hz
B3 59 247 Hz
Base and Treble C4 (middle C) 60 262 Hz
Treble C♯4/D♭4 61 277 Hz
D4 62 294 Hz
D♯4/E♭4 63 311 Hz
E4 64 330 Hz
F4 65 349 Hz
F♯4/G♭4 66 370 Hz
G4 67 392 Hz
G♯4/A♭4 68 415 Hz
A4 69 440 Hz
A♯4/B♭4 70 466 Hz
B4 71 494 Hz
C5 72 523 Hz

Beats

This table shows the beat number values for the most common rhythms in the most common time signatures, interpreted in the most basic way.

WholeNote.png DottedHalf.png HalfNote.png DottedQuarterNote.png QuarterNote.png QuarterTriplets.png Dotted8th.png 8thNote.png 8thTriplets.png Dotted16th.png 16thNote.png
TimeSig4.png 4 3 2 1.5 1 0.67 0.75 0.5 0.33 0.375 0.25
TimeSig8.png 8 6 4 3 2 1.33 1.5 1 0.67 0.75 0.5
TimeSig2.png 2 1.5 1 0.75 0.5 0.33 0.375 0.25 0.167 0.1875 0.125


Pros and Cons

Using MIDI in Scratch is a useful feature, but it has a few flaws:

Pros

  • A Scratcher can easily create and mix music.
  • Once a MIDI File 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 MIDI note simple and effective.

Cons

  • Sounds created with MIDI files 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.

Troubleshooting

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.

Differences

In Scratch, the Java Player, and the Flash Player, the MIDI notes all sound different.

Soundfont Download

Scratch 2.0's Soundbank as a Soundfont can be downloaded here.

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.