![]() ece481 | doering | ece labs | ece | rhit |
|
![]() | Hardcopy of all MATLAB code that you develop |
![]() | Name of AFS public directory containing your MIDI files |
![]() | Brief write-up summarizing your results |
Write a function that generates the header chunk preamble. The function should accept format type, number of tracks, and quarter note division as input parameters.
Write another function to generate the track chunk preamble. It should accept track length as a parameter
Write a function that accepts a decimal number and produces the variable-length format number
Write a function that accepts a patch number between 1 and 128 and a MIDI channel number to produce the MIDI bank-select event codes to select a voice (patch).
Write a function that generates the “end-of-sequence” code. TIP: The end-of-sequence code is an event like any other, so remember to insert a delta time before the event.
Write a function to generate the “set tempo” code. The function should accept an integer in units of microseconds.
Write a pair of functions that generate note-on and note-off MIDI events, respectively. The functions should accept note number and velocity as input parameters.
Write a function which accepts a delta-time in seconds and produces the delta-time sequence in ticks (variable length format, remember).
Pull together everything you have written so far to generate a test file. For example, try an ascending scale of notes spaced 1 second apart. Use the Windows MediaPlayer (Start à Programs à Accessories à Entertainmentà MediaPlayer) to play the file. Does the timing work out correctly?
You may find it helpful to troubleshoot your test file by using a hex editor such as XVI32. Of course, you can also use a combination of getbytes and hexdmp, too.
Write a function that accepts a note list (a matrix where each row contains a delta-time and note event) and produces an appropriate sequence for the track. The function should accept MIDI channel number in addition to the note list.
Write a simple composition that makes use of as many features as possible. Use at least two tracks, each with a distinct channel and voice. Experiment with single-note sequences, chords, note-on velocity, etc.
Describe the goal of your composition.
|