1. Derive the distributive probability function for the first eight measures of Yankee Doodle using a second order Markov process. Your distributive probability function should be stored in a 2-dimensional array where rows represent note pairs and columns represent single notes. Also define a lookup table to indicate the note(s) associated with each row and column. (How would you store the lookup table information using C++ or some other programming language?)
G A B C D E F G-A 1 A-B 1 B-C 1 B-G 1 C-B 0.5 0.5 C-C 1 C-D 1 C-E 1 D-C 0.5 0.5 D-E 0.67 0.33 E-C 0.5 0.5 E-D 1 E-F 1 F-E 1 (all other entries 0)
2. Based on your answer from (1), derive the cumulative distribution function for the distribution function you calculated.
G A B C D E F G-A 1 1 1 1 1 A-B 1 1 1 1 B-C 1 1 1 1 B-G 1 1 1 1 1 1 C-B 0.5 0.5 0.5 1 1 1 1 C-C 1 1 1 C-D 1 1 C-E 1 1 1 D-C 0.5 1 1 1 1 D-E 0.67 0.67 0.67 1 E-C 0.5 0.5 0.5 1 1 E-D 1 1 1 1 E-F 1 1 F-E 1 1 1 (all other entries 0)
3. Use markov1.cpp with a seed of 240 to generate a series of 10 random numbers for you. Use these numbers to generate a new computer music composition based on the cumulative distribution table from (2). Your composition should start with the first two notes of Yankee Doodle.
C C 0.327 D 0.596 E 0.226 C 0.973 E 0.913 D 0.755 C 0.505 C 0.352 D 0.326 E 0.589 C
4. You are asked to add an additional 24 commands to the MIDI 1.0 specification. Each command requires the inclusion of a MIDI channel number. Design an efficient method to add these 24 commands to the specification. What would the status and data bytes be for these new commands?
The following status bytes are undefined: 11110001, 11110100, 11110101. Therefore, we can come up with the following commands types: 11110001 0xxxnnnn 11110100 0xxxnnnn 11110101 0xxxnnnn where xxx is some 3-bit opcode and nnnn is a MIDI channel number. Since there are 8 possibilities for xxx, these three types define 24 different commands, each with a built-in channel number.
Is there a way to hook up 4 MIDI instruments together so that any one of the four instruments can act as the Master of the other three at any given time? Either draw a diagram giving one such configuration or explain why it cannot be done.
It cannot be done. A slave can receive data from only one master through its IN port. An instrument cannot pass a command through its THRU port (slave) and its own command throught its OUT port (master) to another single instrument at the same time since there is only one IN port. (NOTE: Using THRU boxes and MIDI splitters, it could be done with additional hardware, but direct MIDI device connections won't work.)
COURSE INFORMATION | HOMEWORK ASSIGNMENTS
COURSE PROJECT | CS240 HELP DESK