Having trouble getting your MIDI tracks recorded in time? This might help...

Tadpui

Well-known member
Here's the scenario: you start a project in Reaper, arm a new VSTi track, turn on the metronome, and record your part. Being the consummate virtuoso on your instrument, you nail the timing perfectly. But when you go back and listen to your newly recorded MIDI track, it has been shifted either ahead or behind the beat. Not just one or two times, but consistently across your whole MIDI track. You've tried the "preserve PDC in recorded items" option and it still doesn't match up. Good luck using this track as the rhythmic basis for the rest of your project!

As far as I understand it, this is an issue across all DAW software and MIDI/audio interfaces, to varying degrees, and it dates back as far as the genesis of DAW software. Different DAWs deal with this in different ways, if they deal with it at all. In my case, it's with a Yamaha DTX series e-drum kit via USB MIDI, into a Win7 PC running Reaper. I'm very much a novice drummer, but at least I hit a note on time every once in a while. But all of my recorded drum tracks were being placed almost 1/4 of a beat ahead of the timeline grid's beat markings. You can imagine trying to build a song on top of timing like that...not impossible but frustrating when your song doesn't agree with the project's timeline. Then try to overdub or punch in/out on that track. Argh!

If there is a definitive answer about this, I couldn't find it. I searched through several forums, and found many people discussing the issue. Some had suggestions, some didn't. After reading through the suggestions a few times, I finally had enough info to try a solution myself. I was actually able to get my MIDI tracks to line up perfectly with the project timeline grid (or as perfectly as my sloppy drumming would allow). So I wanted to put my procedure here, in the hopes that someone might find this helpful.

Step 1: Pick a buffer size

First, you'll want to settle on a buffer size for your particular setup. You'll want to repeat the following steps any time you resize your audio buffer, because it'll change the number of samples that are buffered in memory before being committed to disk. This option can be found in the ASIO control panel for your particular audio interface. For now, I'm going with a relatively large buffer of 512 samples with a 44.1KHz sample rate. On my system, this is a fair compromise between higher latency (larger buffer size) and higher CPU workload (smaller buffer size).

Step 2: Figure out how far off your recorded MIDI tracks are being placed

Start a new project, insert your MIDI instrument on a new track, and arm it for recording. Turn on the metronome, start recording, and play a few notes as closely as possible to the beat. Now, single out one particular note in your MIDI recording...one that you're pretty sure that you nailed right on time. Switch your timeline units to "bars + beats". Enable Reaper's "snap to grid" feature and put your timeline cursor on the beat where that note should have fallen. Now switch the timeline units to "samples", and note the sample number that corresponds to that exact same position on the timeline. In my example, it was sample 80,000.

Now, turn off "snap to grid" and position your timeline cursor at the position where the recorded note was actually placed. In my example, it was at sample 77,000. (OK, so I'm rounding these numbers off for simplicity of this example...use the actual numbers that you observe). So that means that my recorded MIDI notes are being placed 3,000 samples ahead of the beat.

Step 3: Make the required adjustment in Reaper

Now that you know how far off your recorded MIDI notes are being placed, you can ask Reaper to adjust its placement of these notes as they're being recorded. Go to Options->Preferences->Audio->Recording and take a look at the bottom of that dialog box. I like to keep the box checked for "use driver reported latency", since my audio interface does a good job at accurately reporting its own latency. To the right of that are 2 text boxes: output manual offset, and input manual offset. In the Output Manual Offset box that's labeled "samples", enter the number that you calculated in the previous step. I entered -3000 samples. I entered a negative number because my recorded notes were being placed ahead of the beat. If they were being placed behind the beat, I would have entered a positive number. Click OK or Apply to save your new values.

Step 4: Test your changes, and tweak the Output Manual Offset value as needed

Now delete the MIDI item that you recorded in the previous steps, arm your MIDI track for recording again, and repeat Step 2: record yourself playing to the metronome, observe where the recorded MIDI note is placed relative to the beat. It should be much, much closer now, if not right on the beat. Realize that being a human being, your timing is probably not machine-perfect (that's not a bad thing!), so your first test is probably not exactly accurate. So you may have to repeat the test a few times and come up with an average number of samples to use as your output offset.

Anyways, I hope this helps if you're struggling with the timing of MIDI items in Reaper, especially when overdubbing and punching in/out during your tracking sessions. As far as I know, some DAWs provide built-in ways to adjust the delay compensation and some don't. My solution is particular to Reaper, but most likely there is a similar feature in whichever DAW you're using. The options may be named differently, but there is probably an output compensation buried somewhere in your options.
 
Last edited:
Back
Top