Follow these directions LabSetup.html
Here's how it will sound. You can use this method in your midterm project.
1. Open Au Lab.
2. Open MIDIDisplay.
Download and unzip GFB.zip.
Alternatively you could open the course common folder and drag the file GFB.xls file to the desktop of your iMac.
Open GFB.xls and create a new tab named GFBtempo.
Copy all data from the GFB tab and paste it into the GFBtempo tab. You'll be working in the GFBtempo tab.
Click in A1 to select A1.
Type Shift-RightArrow until A1:H1 is selected.
Type Command-Shift-DownArrow.
Click in A1 to select A1.
Type F8 to turn extended selection on.
Scroll until you can see Row 360.
Click in H360.
Type F8 to turn extended selection off.
Columns I and following should be blank. Starting in cell J1 create these header labels.
Enter 0 in J2 and select J2 Use the Edit->Fill->Series menu to create a time series in column J with a step size of 1000 and ending at 23000. Insert additional note times for
Hint: You can add them at the end and then sort only Column J
You want to correlate a millisecond time in Excel to a specific measure in the GFB score. Enter this formula in K2.
Here's an explanation:
Copy K2 and paste into remaining column K cells.
Now that you've got the measure numbers you want to correlate the millisecond time to a specific beat within the measure. Enter this formula in L2.
Here's an explanation:
First thing to notice is that it's a compound formula using the MOD function and the ROUNDDOWN function. The ROUNDDOWN function is the inner function, and the MOD function is the outer function. The results of the inner function are calculated first and that result is used in the outer function. Let's look at the inner function first.
ROUNDDOWN(number, decimal places)
MOD( number, modulus)
Copy L2 and paste into the remaining cells of column L. The results should look like this.
A tempo map is a list of all tempo changes in the song. The tempo map contains the measure and beat number where the tempo change occurs and the new tempo value. The starting tempo of GFB is 100 beats per minute. Here's a textual description of where the tempo changes occur in the GFB audio example.
Add these tempo comments in column N. Then fill in these tempo changes in column M.
Note: These are exaggerated tempo changes designed to make them apparent while listening.
Select M8:M13 and choose Fill->Series from the Edit menu. Click OK.
Select M14:M18 and choose Fill->Series from the Edit menu. Click OK.
Select M18:M28 and choose Fill->Series from the Edit menu. Click OK.
The results should look like this.
You need to get rid of the decimal places. You've used the ROUNDDOWN formula before. This time, with cells M18:M28 selected, choose Cells from the Format menu. Select Number in the list on the left and set the Decimal places to zero. Click OK.
The final result should look like this.
Create a new called "scratch." Paste the above data into scratch at cell A1.
Select D1:D28
Choose Advanced Filter from the Data menu.
Check the Unique records only box and click OK.
You should see this. Notice the row numbers in blue are no longer consecutive. The duplicate data has been hidde.
Copy the unique data.
Go back to the GFBTempo tab and paste the unique data into J1. Remove data after J22.
Before | After |
---|---|
Track 1 can contain multiple Tempo meta events called a tempo map. Currently there is only one tempo meta event that sets the tempo at the start of the song. It occurs at PPQ = 0 and represents a tempo of 100. The song will stay at that tempo from beginning to end.
The format of a single tempo meta event is:
A tempo map contains multiple tempo meta events. The FF 51 3 signature never changes. What does change is the PPQ time for the measure and beat number where the tempo change occurs and the three hex bytes that represent the new tempo in microseconds per quarter note.
The first NON occurs at time 0. Enter 0 in N2. The remaining PPQ times can be calculated using the same formula you used in Lab5. Enter this formula in O3 and press Enter.
Copy O3 and paste into remaining cells of column O.
This one's easy. Subtract 1 or 2 PPQs from the first non zero PPQ. All other PPQ's stay the same.
Use this formula:
Enter this formula in P2 and press Enter.
Copy P2 and paste into the remaining cells in column P.
If you just needed to convert one tempo to hex, you could do it in Google.
This time we'll use the Excel function DEC2HEX( ) because there are several tempos to convert. Enter this formula into Q2 and press enter.
Select and copy P2 and paste into the remaining cells in column P.
The Standard MIDI File meta event for Tempo expects the hex number to be split into three parts.
Five Hex Digits | Six Hex Digits |
|||
Hex Number | Converted | Hex Number | Converted | |
A2C2B |
A 2C 2B |
99BEEF |
99 BE EF |
Enter this formula intoR2.
Enter this formula into S2
Enter this formula into T2
Copy these three formulas down their respective columns. The results should look like this.
The MID formula you used works correctly on hex numbers with five digits. You'd need a different formula for six hex digits. The last microsecond value had six hex digits and needs to be changed. Change hex1, hex2, hex3 for the 10A55D value to this:
You're going to delete the one existing tempo event and replace it with 21 new ones. Select entire row 25 by clicking on the number 25. Right click and choose Delete.
You'll need to insert 21 additional rows in track 1 for the new tempo events. You can use the right click Insert option 21 times or you can do this. Select the same number of blank cells in Column I as there are values in column J.
Important: All cells in column I must be blank.
Select entire row 25. Right click and choose Insert Copied Cells.
You should see 21 blank rows appear above the old row 25.
Copy the PPQ times from column O and Paste Special by Values in column A25.
Copy the three hex digits from R2:T23 and Paste Special by Values into E25.
Fill in B25:D25 with the tempo meta event signature FF 51 3. Copy and paste into B26:D45. The finished tempo map should look like this.
Copy the SMF data in columns A through H. Paste into MIDIDisplay and export as a Standard MIDI File.
Paste into MIDIDisplay and export.
Save As GFB.mid to the Desktop. If there are errors MIDIDisplay will report them by line number. The line number should be close to the line number in the Excel spreadsheet.
Select the SMF file on the Desktop and press the space bar to play it. You should be able to hear the tempo changes.
If you have problems with your SMF you can use a debugging tool I wrote called "debugSMF."
Open the Terminal application.
Type debugSMF followed by a space.
Drag the icon of the MIDI file unto the Terminal window and type Enter.
You'll see a text version of the MIDI file. You can copy and paste it into Excel. It can help you discover what's wrong if your SMF export isn't working.
Here's some explanation.
label | hex | decimal | tempo in bpm |
Tempo: | 927c0 |
600000 |
[M.M. = 100] |
PPQ | Bn | data 1 | data 2 is valid |
1 | Ctrl | 7 | OK |
PPQ | Cn | data 1 | data 2 is valid |
1 | PrgC | 10 | OK |
PPQ | 9n | data 1 | data 2 is valid |
24 | NON | 72 | OK |
PPQ | 8n | data 1 | data 2 is valid |
456 | NOF | 72 | OK |