cs526 logo
rainbow animatio

Homework #2: MIDI

Goal:

  • Learn how to use tool to create a MIDI file.
  • Learn the basic encoding techniques utilized by MIDI
  • Assignment Date: 2/3/2010

    Due Date: 2/10/2010

    Description:

    Part 1:

    Part2:

    1. The following is a MIDI file similar to Ballade2.mid.
      4d 54 68 64    4-character chunk ID: "MThd"
      00 00 00 06    length of the header: 6 bytes
      00 01          file format: format 1
      00 10          # of tracks: 16 tracks in this file
      00 c0      MSb=0, resolution per quarter note: 192 ticks per quarter note
      4d 54 72 6b    4-character chunk ID: "MTrk"
      00 00 00 7c    length of the track: 124 Bytes

      delta time track event   Intepretation
      ========= ===========    =====================================
      00 ff 7f 03 00 00 41     meta event, (?) 3 bytes
      00 ff 58 04 04 02 18 08  Time signature meta event, 4/4 meter?
      00 ff 51 03 0a 49 6d     Tempo meta event, 674157 microsec/quarternote
      00 ff 59 02 00 00        Key signature meta event, C major
      00 ff 01 2a 43 6f ...    Copyright meta event?

      4d 54 72 6b              4-character chunk ID: "MTrk"
      00 00 09 61              length of the chunk data: 2401 bytes

      delta track event   Interpretation
      time
      ===== ===========   =====================================
      00    ff 21 01 01   meta event?
      00    ff 03 14 50 ... instrument name, 20 bytes, Piano Treble
      00    c1 02         Program change on channel 1, patch #2
      00    b1 07 61      Control change on channel 1, volume level 91
                               (loud, 80 normal)
      00    b1 0a 7f      continuous controller(MIDI knob), max. postion(127)
      00    91 37 7f      Note on channel 1,note=55(G,octave3), vel=127(loud)
      60    39 7f         note=57, vel=127(loud) after 96/192 quarternote
                            (A, octave3), running status without command
      60    3c 7f         note=60(C, octave4), vel=127 after eighth note
      5e    41 7f         note=65(F, octave4), vel=127 after 94/192 qnote
      8140  43 7f         note=67(G, octave4), vel=127 after 192/192 qnote
      10    81 37 40      Note off, note=55, vel=64(med.) after 16/192 qnote
      8130  91 41 7f      Note on, note=65, vel=127 after 176/192 quarternote
      06    81 3c 40      Note off, note=60, vel=64 after 6/192 quarternote
      0c    37 40         note=55, vel=64, after 12/192 quarternote
      4e    91 37 7f      Note on, note=55, vel=127, after 78/192 qnote

      1. How long is the playtime of the first note (G Octave3) in terms of seconds?
      2. If the above MIDI code after 4e 91 37 7f is followed by 00 91 30 60, explain these four bytes using the format similar to the above interpretation.
      3. Assume that after 91 37 7f, we stop all notes with 60 41 00 00 43 00 00 37 00 00 FF 2F 00,
        1. How long is the music?
        2. Without counting the header and those bytes above 00 91 37 7f, how many bytes are used to encode the music using MIDI?
        3. If we use the PCM encoding method for the same music with 44.1kHz sampling rate, and 16 bit per sample, stereo recording, how many bytes will be generated?
        4. What is the size ratio between that of PCM encoded data for this music and that of the MIDI?