levo

Fundamentals of Data Representation

MIDI and Data Compression

  • 4 things to know
  • Paper 2

Overview

Recall questions on the purpose of MIDI, its event messages and files, and on lossy and lossless compression and run length encoding.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Describe what a MIDI file stores, and contrast it with a sampled sound file.

Evaluation

State the disadvantages of MIDI.

Numbers

Apply run length encoding to the string AAAAABBBCCCCCCCD.

Process

Explain the principle behind dictionary-based compression.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is the purpose of MIDI?

    Model answer

    MIDI is a standard protocol that lets electronic musical instruments, synthesisers, sequencers and computers communicate with one another. Crucially it does not carry any recorded sound: it carries instructions describing how music should be performed, which the receiving device then plays using its own sounds.

  2. 2

    What are event messages in MIDI, and what do they contain?

    Model answer

    Event messages are the instructions MIDI sends whenever something happens in a performance. Each carries the type of event, the channel it applies to and the data it needs. A note-on message identifies which note has been pressed and with what velocity — how hard, which sets the volume. A note-off message says that note has been released. Other messages change the instrument voice, adjust volume or modulation, or bend the pitch, and each event is stamped with its timing so the sequence can be replayed exactly.

  3. 3

    Describe what a MIDI file stores, and contrast it with a sampled sound file.

    Model answer

    A MIDI file stores a timed list of event messages — effectively a set of instructions saying which note to sound, on which instrument, at what moment, how loudly and for how long. A sampled file stores the measured amplitude of the actual sound thousands of times a second. A MIDI file is therefore closer to a musical score than to a recording, and produces sound only when a device interprets it.

  4. 4

    Describe the advantages of using MIDI files to represent music.

    Model answer

    They are very much smaller than sampled audio, because a few bytes of instruction replace tens of thousands of samples per second, so they need less storage and transmit faster. They are easily edited: a single wrong note can be corrected, the tempo altered, the key transposed or the whole piece reassigned to a different instrument, all without touching anything else and with no loss of quality, since editing instructions degrades nothing. The data can also be displayed and printed as conventional musical notation, and it can drive real instruments and lighting rigs.

  5. 5

    State the disadvantages of MIDI.

    Model answer

    It cannot represent sounds that are not made by an instrument it can instruct — most obviously vocals, speech and real-world sound effects, which need a sampled recording. And the result is not fixed: the same file played on two devices sounds different, because each supplies its own instrument sounds, so the composer cannot guarantee what the listener hears.

  6. 6

    Why is a MIDI file so much smaller than a sampled recording of the same piece?

    Model answer

    A sampled recording stores an amplitude value for every sample, tens of thousands of times per second, regardless of how much is happening musically. A MIDI file stores data only when an event occurs — a note starting, a note ending, an instrument changing — so a piece with a few thousand notes needs only a few thousand short messages, however long it lasts.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Fundamentals of Data Representation, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.