MUSC 108. Introduction to Music Technology - Fall 2013

03Lab5 - Dynamics 2 - Expression Control

[Overview [Syllabus]

Guidelines for MIDI Dynamics

There are three methods to control dynamics in MIDI.

03Lab1 - MIDI Velocity

Use velocity to produce single note accents and rhythmic drive in each instrument. Higher velocities are used on the strong beats and lower velocities are used on the weak beats. Note velocity sometimes affects the timbre of a note. Modern sample libraries have multiple waveforms for each note depending on the velocity. A piano library may contain samples of each note six different dynamic levels from pp to ff and choose samples based on velocity. A string instrument might use velocity levels to change bowing styles. A trumpet might create a growl effect within a certain velocity range.

03Lab5 - MIDI Expression control (CC11)

MIDI Expression Control (CC11) should be thought of as a local volume control for a single instrument that can be used to create crescendos and decrescendos. It can also be used to shape the swell and decay of a long sustained note.

03Lab6 - MIDI Volume Control (CC7)

MIDI Volume Control (CC7) should be thought of as the master volume control. It is used at the beginning of the song to set the initial balance between instruments.

MIDI Controller 11 (Expression)

MIDI Controller 11 is used as a volume control. It's similar to the volume knob on a car radio. All volume control messages must precede the NON Message the affect.

Controller Name status data1 data2 Notes
    Control number Control value  
Expression $Bn 11 0-127 0 is silence 127 is fff

Paste the data from the 03Lab1 tab into worksheet 03Lab5 at cell A1. Paste it a second time into cell A60. Row 60 should be the time-status-data1-data2 header row. You'll use cells A61:D118 as a scratch pad to experiment with Expression Control messages.

Sort

Sort cells A61:D118 to separate NON and NOF messages.

sort status descending

Delete The NOF Messages

Volume Control messages don't apply to the NOF's. Delete the NOF messages in cells A90:D118 by selecting cells A90:D118 and typing the delete key to the right of the backspace key. Cells A90:D118 should be blank.

Add Labels

Label the ascending and descending portions of the scale E61 and E76.

Added labels

Change The Status Byte To The MIDI Control Message

Status bytes for all MIDI Control messages begin with B followed by the channel number. Change the status bytes in B61:B89 to $B0.

Potential Problem: If you drag the selection rectangle down you'll get a text series.

Excel text series

Instead, you'll have change them by copying B61, then selecting B62:B89 and paste.

Copy and paste to prevent text series effect

Change Data1 Bytes To 11 (Expression Control)

Data1 bytes for all MIDI Control messages are a number indicating which controller is in effect. The expression control data1 byte is 11. Change the data1 bytes in C61:C89 to 11.

Create A Crescendo

Data2 bytes for all MIDI Control messages are a number from 0-127 indicating the value of that controller. For the Volume controller 0 is silence and 127 is maximum volume. You'll use the Data2 bytes to create a crescendo during the ascending portion of the scale and a decrescendo during the descending portion of the scale. Do the crescendo first. To create a smooth crescendo you need to know five things:

  1. the volume starting value
  2. the volume ending value
  3. the volume range = endVol - startVol
  4. the number of cells involved
  5. the increment value that will produce the volume range across the number of cells involved

The starting value

The starting volume will be 40.

The Ending volume

The ending volume will be 127

The crescendo range

127 - 40 = 87

the number of cells involved

The ascending portion of the scale is in cells D61:D75. You could find the number of cells involved by arithmetic: 75 - 61 + 1 = 15, or you could let Excel do it for you. Excel has two formulas to count cells:

Click an empty cell, say F61

Excel 1

The Increment Value Formula

In this example the starting volume is 40 and the ending volume is 127. The increment will be spread over 14 cells. Don't count cell A61 because that contains the initial value 40. Assign these values to these variables

The increment value formula is:

(endVol - startVol) / numCells

You can calculate it in an empty cell in Excel.

Increment formula = 6.21428571

Copy the result 6.21428571.

Use The Fill Series Command To Create A Series

Type 40 into cell D61. Select cell D61 and Choose Fill->Series from the Edit menu. Paste 6.21428571 into the Step value. Make these settings and click OK.

Excel 4

The results should look like this.

Excel 5

Note that the data2 start volume is 40 and the end value is 127.

Create the Decrescendo

We'll do this the easy way.

Enter 127 in F75.

Enter 40 in F89.

Select F75:F89.

decrescendo fill series

Choose Fill->Series from the Edit menu.

fill series decrescendo

The correct values are automatically filled in. Click OK.

PROBLEM - MIDI data values are integers

The ROUND(number, num_digits) function will round values to the nearest integer. Enter this formula into cell D61, =ROUND(F61,0). The zero refers to the number of decimal places.

ROUND function in Excel

Copy the formula to cells D62:D89.

Copy D61:D89. Paste Special by Values into the same place. The finished results should look like this

FInished crescendo in Excel

Sort Into Mididisplay Order

Work on a copy of the data. Select and copy all data in cells A1:D89 and paste into a blank cell in row 1, say H1. That way if things get messed up when you're working with columns A-D you have a backup of the original data in columns H to K.

You'll need a two way sort:

  1. by time ascending
  2. by status descending

Choose these settings and click OK.

sort time status

You'll need to make sure after the soting is done that:

  1. All control messges ($Bn 7) messages come before their NON message
  2. All NOF off messages come after their corresponding NON message

Excel sorts numbers before text. Excel thinks B0 is text and 90 is a number so the sort works correctly Verify that $Bn messages come before the $90 (NON) messages and that $8n messages come after their $90 (NON) messages.

Excel 10

Delete The Extra Header Row

Delete the extra "time status data1 data2" row at the end

The Reset All Controllers Message

The Reset All Controllers message should be the first and last message in your MIDI files. It should be used on every MIDI channel that used a control message.

Controller Name status data1 data2 Notes
    Control number Control value  
Volume $Bn 7 0-127 0 is silence 127 is fff
Expression $Bn 11 0-127 0 is silence 127 is fff
Pan $Bn 10 0-127 0 is hard left
64 is center
127 is hard right
Reset All Controllers $Bn 121 0 Resets common controllers to their default setting

Insert a new first row

Insert a new blank row at position A2. Right click the left margin on the number 2. A popup menu will appear. Choose Insert and a new empty row will be inserted above row 2.

Excel insert row

Create Two Reset All Controllers messages

The Reset All Controllers message should be the first and last MIDI messages in your file.

Controller Name status data1 data2 Notes
    Control number Control value  
Reset All Controllers $Bn 121 0 Reset to default values

First MIDI Message

Enter the data for the Reset All Controllers message ( $Bn 121 0) as the first MIDI message.

Excel 12

Last MIDi Message

Add a Reset All Controllers message to the last data row. Set the time stamp for the final Reset All Controllers message to be equal to the last NOF time plus 1000. If the final time stamp comes to soon, the last note may get clipped short. The NOF message may not instantly stop the sound. Sometimes the sound sample continues a little past the NOF time.

Final CC121 time stamp

Play In MIDIDisplay

Copy the data in 03Lab5 and paste it into MIDIDisplay and Play. You should still hear the rhythmic drive plus the crescendo and decrescendo. Experiment with different tempo settings.

Continue with 03Lab6.

[Overview [Syllabus]

Revised John Ellinger, January - September 2013