Tempo mapping and time stretching MIDI in Reaper

In my earlier post about cleaning up old Portastudio recordings, I showed how it could be done using stretch markers. This post shows an alternative way that may be quicker. It also shows up all the frustration and problems I had in tempo mapping.

I found that creating new tempos did not work intuitively and it seemed to add extra bars and knocked out the markers and timing for no particular reason.etc. etc. etc. The designers of Reaper have made a complete arse of something that should be so simple.

Reaper has a neat facility that inserts a tempo change for a section of music bounded by two ordinary markers. You are able to specify the time signature and number of bars and it calculates the tempo and adjust the beats grid for the region.

The reasons for doing this are :

  1. In score writing, markers are placed at points of interest e.g. a scene change. You may want the first bar to start here and the music to end on the next marker. You want an integral number of bars to fill the gap.
  2. You want to synchronise a recorded track (MIDI or Audio) to a fixed tempo.
  3. You want to clean up some freely recorded keyboard playing by locating markers at the start of each bar. Once every thing is bar wise it can be quantised with reference to the beats grid.
  4. You may need to mix time signatures. e.g 5 bars of 4/4, 3 bars of 3/4.

To do this manually :

  1. Double click at the track headings between two markers. This will set a time selection exactly between the markers.
  2. Right click and select “Create measure from time selection (detect tempo)
  3. A dialog allows you to enter the time signature and number of bars required.
  4. A tempo change is inserted and the grid is changed to accomodate the necessary bars.

But don’t expect this to work if you haven’t changed the timebase – see later !!!!

 

The following shows a process to tempo map both MIDI and WAV tracks.

 

Firstly, I recorded a MIDI track of an oom-pah-pah piano with deliberate speeding up and slowing down. The start of the oom shows as a long low note and it does not line up with the underlying grid.

Although oom-pah-pah is technically 3/4 time, I am going to assume it is in 4/4 time. i.e. I want the start of the oom to be the start of a bar and for there to be 4 beats before the next oom.

 

I then generated a audio (WAV) track from the MIDI and this is shown as the second track. Notice how the MIDI and WAV align together

 

 

I then played the tracks from the beginning and pressed the “M” key at the start of each bar. This generated a marker (the vertical red line) at the start of each bar. I then made small adjustments to align the marker with the start of the oom.

 

 

I then went to the project settings and set the Timebase to “TIME”. This is necessary to switch off any automatic time stretching when the grid is changed.

 

 

I also created two useful Actions and linked them to the Alt-F12 and Alt-F11. In Reaper you are able to create custom actions that contain a list of the in-built system actions.

 

The first action sets up a time selection between two adjacent markers at the current cursor. It then inserts a tempo change so that region selected occupies 1 bar and is divided into 4 beats. (note that the default is 4 beats, this can be changed by doing the action manually and entering the correct info in the displayed dialog box)

 

The second action selects all the tracks and splits the tracks at the marker positions. I found that if the MIDI track was not split it was not possible to change tempos independently.

 

 

This action really caused me a headache !! You have to “Ignore project tempo” for MIDI tracks. Why is this here ?? Surely the midi track should obey all tempo changes at all times. Surely the project tempo is a tempo change marker at the start of the project. The legend is confusing as well — if i tick the box does it ignore the project tempo and use a tempo of 120 bpm instead.

Select the MIDI track and select the Source Properties dialog from the Items menu.

 

 

I manually inserted a tempo change for the first bar to ensure the number of beats per bar (e.g. 3/4 4/4) was correct and the number of bars was 1.

I then put the cursor to the start of the project and pressed the Alt-F12 key to invoke my custom actions macro. This inserted tempo changes at each marker. You can see how the grid aligns to the markers for the actions carried out so far. The actual tempos are shown just below the marker text.

 

I then displayed the Master Track by right clicking in the left hand side of the track display. You can see that each tempo is displayed using a horizontal turquoise line.

 

I then pressed the Alt-F11 key to invoke my second action macro. This splits each track at the tempo change. This must be done for any tempo manipulations. Don’t know why but if you don’t do it you will get unexpected side effects. The tracks can be glued back together afterwards.

 

The aim is to be able to alter the tempo changes and have the tracks adjust automatically. e.g.

  • Remove all the points and have a constant tempo.
  • Make some bars have a constant tempos and others to have different tempos.
  • Make a tempo change gradually by drawing a tempo profile.
However, none of this is possible until the project settings are changed back to BEATs in the following dialog:-

 

 

 

Finally the tempo can be adjusted as shown below and the MIDI and WAV tracks are time stretched to fit exactly.