ReaperTips

From CockosWiki

Revision as of 21:31, 29 December 2009 by MikeLacey (Talk | contribs)
Jump to: navigation, search

Main Page > REAPER Documentation


Contents

Reaper Tips & Tricks

How to deal with interface latency (delay/lag)

(Taken from an (excellent) forum post of the same name by Lokasenna)

Latency is the time it takes for a signal to open the door, come in, take of its jacket and boots, and sit down in REAPER's living room for a chat. Most equipment in your recording chain, especially analog (non-digital) stuff, won't add a noticeable amount of delay. However, digital things often will, and your computer's audio interface will typically add a fair bit.

Depending on how powerful your PC is, "a fair bit" can mean anything from 5ms (well below what most people can distinguish, but still enough to drive hardcore studio nerds insane) to 500ms (1/2 a second -- "Jesus, this drummer is horrible"). You may have noticed this if you've ever used guitar software like Amplitube, Guitar Rig, Revalver, or any of the sexy free plugins floating around the internet. That weird half-second between hitting a chord and hearing it through the speakers? That's latency, and that's what we're about to fix.

Well, sort of.

The first thing you want to do is minimize the latency you have to deal with by adjusting your interface's (your soundcard's) settings, particularly the buffer size. Buffer size refers to the size of each bundle of information that gets sent to REAPER by your soundcard. A smaller buffer means REAPER will receive incoming audio faster, but it will also put more of a strain on your computer. Conversely, a larger buffer is easier on the PC, but will make REAPER wait around longer until each bundle is full.

The rule of thumb here is that you want the buffer size as small as possible without causing any hiccups, glitches, or stutters in the audio signal. Trust me, if it's too small, you'll hear it.

We should now have a reasonably quick signal path going into REAPER. If you plug in a guitar, whatever you play should be coming right back out of the speakers with a minimum of fuss. When you play a chord you should hear it out of the speakers without too much delay. (If the delay is still horrible, if your system simply can't handle a low latency, your best bet is to monitor through a real guitar amp while recording a direct signal into the computer, and then put it through Guitar Rig afterward).

Go ahead and record something simple, a basic rock beat, the riff to "Smoke On The Water", whatever - something easy. Record it to a click, as tight as you can. Now have a look at what you've recorded. Chances are it's not as tight as you thought it was. In fact, if you haven't already spent some time dealing with latency, I'd bet good money that the signal is significantly off from the click.

I think it's time for an illustration: File:Http://stash.reaper.fm/4399/Latency Compensation.JPG

Edit: Big image, so I've changed it to a link.

I can hear people asking "What the hell am I looking at?" Simply put, this is how you deal with interface latency.

When doing performing the tests described below, set the track's Record Monitoring to OFF, or you could quite easily mess up your speakers with feedback. I take no responsibility for any inadvertent damage.

The first track, labelled "Source", is a simple click (In Reaper, Insert | Click Source). This is the most accurate signal to use for examining your latency, since it's all tidy and perfect.

Track two, "Interface", demonstrates the latency my interface is adding. To measure this, I simply ran a patch cable from the interface's output to the input, played back the click source, and recorded it coming back in. As you can see, the signal is significantly late. Exactly how much is a question we'll get to in a moment, but I'm not quite done here.

Just for fun, I wanted to see if there was a notable delay being added by the speakers and/or the two feet of space between my ear and the speaker. "Speaker" was recorded with a microphone against one of my monitors, and as you can see it did add a tiny amount of latency. However, the difference is so small that it might as well not exist. "Chair", recorded through a microphone placed beside my head, shows a bit more added time - but anyone with some basic physics already knew that.

The speed of sound, in air, is 1100ft/s. As my head is in the ballpark of two feet from the speaker, the signal should take an extra 1.8ms to get to me. Guess what? It does. Now, in the grand scheme of things 1.8ms doesn't make a bit of difference. Nobody, anywhere, ever, is capable of noticing 1.8ms of delay. At least, not by itself. But, as a guitarist, 1.8ms is enough to annoy me. Why? Simple: Doubling.

Pretty much anyone playing hard rock or metal these days will double (or quadruple) their guitar tracks. That's just how you get that big huge guitar sound we hear everywhere. In most cases, guitarists want their doubled tracks to be as tight (played in sync) as possible. The farther apart the two tracks are, the sloppier the sound. A little sloppiness might be fine for AC/DC and the Stones, but with today's ultra-perfect, ridiculously fast technical metal, the bottom line is all about inhuman precision. Given how simple it is to fix, I'd just as soon not have an extra 1.8ms lurking in the shadows of my mixes, tempting me to poke around and clean it up.

That's all just my opinion, however, and in most cases fixing the interface latency alone will be enough to keep you happy.

So, having discovered this evil delay in our signal, how do we fix it? Thankfully, the companies who manufacture interfaces are one step ahead of us. Most interfaces can make an educated guess as to how much latency they're adding and pass it along for Reaper to work with.

Here's where you want to look:


Checking off "Use audio driver reported latency" will have Reaper move all of your recordings back by whatever amount the interface says. But does it work? Have a look at the fifth track, "Interface, Reported Latency". In this case the interface is clearly trying to do the right thing, but is nowhere near the right number.

Every interface is different. Some might be spot-on with their guess, others might be worse than mine. If this option works for you, that's awesome.

It looks like we'll have to solve this problem ourselves. In order to get a measurement of our latency, as accurate as possible, here's what we'll do:

1. On Reaper's toolbar, turn off Snap To Grid (the magnet icon). 2. Right-click the Transport bar and tell Reaper to give use Samples as a time base. (A sample is one digital "tick" of audio information, and is the most precise unit of measurement you can use) 3. Zoom in nice and close, so the original and delayed clicks cover most of the screen. 4. Very carefully, drag a time selection from the start of the original to the start of the delayed signal.

Your screen should resemble this:


On the Transport bar, the third Selection box tells us how long our selection is. In my case, with "Chair" as our target, the delay is 2160 samples.

Back in the Preferences menu, next to the option to use our reported latency, are a few boxes that let us do the same thing manually. Unchecking "Use reported latency" and entering your own measurement under Input | Samples will tell Reaper to ignore the interface, and just move everything back by whatever you tell it to.

Looking back at our first image, the final two tracks show the same tests as above, but now compensated for their respective delays. Manual compensation has clearly done the trick, which means any further timing issues are now entirely my own fault as a musician.

Time for a drink....

Optimize playback / Improve performance

Make any changes to your system with some care, don't blindly follow advice including the advice below. The suggestions listed below don't (in general) look as if they will harm your system but ... take care.

The italics below are mine (MikeLacey) and are based purely on my experience. As I said, take care :-)

  • Defragment your hard drives regularly. This will make for smoother playback and reduced latency. - Reasonable advice, unfragmented files are easier for XP to read
  • If you only have 1 hard drive, partition it into 2 drives: 1 for the operating system and programs, and one strictly for audio files. - It's not clear how much resource this will save but it will probably not do any harm and could make your system easier to mantain.
  • You can improve your DAW system by adding another hard drive that is used solely for audio files. - Reasonable advice as far as it goes in that it will separate audio file disk i/o and other disk i/o to some extent. Separate disk drives though, may not work completely separately unless you set them up to do so. Reads and writes on one disk may well block reads and writes on another. You will get some perfomance improvement but if your system really *is* i/o bound you need to talk to an expert and, probably, do more than just add another hard disk.
  • By default, Windows 2000/XP logs the I/O traffic of your hard drive. It doesn't do anything except use up system resources. To disable it, go to the run menu and type diskperf -n and hit enter.(Note that there is a space before the minus sign). - Reasonable advice as this will save some CPU and disk resource. Not much though and you'll have to remember to do this each time you boot your machine.
  • Visit www.musicxp.net for a listing of things you can do to optimize your Windows XP install for audio.

The suggestions below have come from various sources. I've arbitrarily missed a couple out because they seemed, to me, to not make sense or were too risky, or both. Read the warnings.


  • Disable indexing - save CPU
Open Windows Explorer, right-click the partition, select properties and un-check 'Allow Indexing Service to index this disk for fast searching'
  • Disable themes - save RAM
  • Set a fixed pagefile size - Reasonable advice - reduce disk fragmentation, but make sure you allow enough space for the pagefile
  • Disable quick user switching - It's not clear how much resource this will save but it will probably not do any harm.
  • Disable secondary logon - It's not clear how much resource this will save but it will probably not do any harm.
  • Disable remote assistance - It's not clear how much resource this will save but it will probably not do any harm.
  • Disable system restore - But make sure you have a convenient way to get back to a working system configuration.
  • Set visual appearance to best performance. - Save CPU'
Start > Settings > Control Panel > System > Advanced > Performance Settings > Visual Effects Tab > Adjust for best performance
  • Processor scheduling should be set to background services and not Programs. - Reasonable advice. DAWs, including REAPER, run processes in the background.
Start > Settings > Control Panel > System > Advanced > Performance Settings > Advanced Tab > Background Services
  • Switch off desktop background image - save RAM
Right Click Desktop > Properties > Desktop Tab > Background None
  • Disable Screen Saver - save CPU and RAM
Right Click Desktop > Properties > Screen Saver > None
  • Disable Fast User Switching - It's not clear how much resource this will save but it will probably not do any harm.
Start > Settings > Control Panel > User Accounts > Change the way users log on or off > Untick Use Fast User Switching
  • Switch Off Power Schemes - It's not clear how much resource this will save but it will probably not do any harm.
Start > Settings > Control Panel > Power Options > Always On > Turn off monitor and turn off hard discs to Never
  • Switch Off Hibernation - It's not clear how much resource this will save but it will probably not do any harm.
Start > Settings > Control Panel > Power Options > Hibernate > Untick Hibernation
  • Disable System Sounds - It's not clear how much resource this will save but it will probably not do any harm.
Start > Settings > Control Panel > Sounds and Audio Devices > Sounds Tab > Sound Scheme to None.
  • Do Not Map Through Soundcard - It's not clear how much resource this will save but it will probably not do any harm.
Start > Settings > Control Panel > Sounds and Audio Devices > Hardware Tab > (highlight your soundcard from the list) > Properties > Audio Devices > (highlight your soundcard from the list) > Properties, and check the "Do not map through this device" checkbox.
  • Disable Automatic Updates -- Reasonable advice. Only do updates when you choose to.
Switch off Automatic Updates by going to Control Panel, System, Automatic Updates and ticking the box labelled "Turn off automatic updating. I want to update my computer manually.".
  • Disable Offline Files - Reasonable advice. Offline files are CPU intensive.
Start > Settings > Control Panel > Folder Options > Offline Files > Untick "Enable Offline Files"
  • Disable Hide Inactive Icons - save (some) CPU
Start > Settings > Taskbar and Start Menu > Taskbar TAB > Uncheck "Hide Inactive Icons"
  • Disable Automatic Desktop Cleanup Wizard - save CPU
Start > Settings > Control Panel > Display > Desktop > Customise Desktop > Untick "Run Desktop Cleanup Wizard every 60 days"
  • Disable NTFS Last Access Time Logging (NTFS Only) - save CPU Do this very carefully if at all, editing your registry using regedit is risky as regedit WON'T tell you if you've made a mistake that will stop your machine from booting, or worse.
Start > Run > regedit > HKEY_LOCAL_MACHINE > SYSTEM > CURRENTCONTROLSET > CONTROL > FILESYSTEM Add a new DWORD value - "NtfsDisableLastAccessUpdate" (without quotes) and set the value to 1. Then reboot to make changes effective
  • Disable Notification Area Balloon Tips - save some CPU Do this very carefully if at all, editing your registry using regedit is risky as regedit WON'T tell you if you've made a mistake that will stop your machine from booting, or worse.
Click Start , click Run , type regedit , and then press ENTER. HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Explorer\Advanced Right-click the right pane, create a new DWORD value, and then name it EnableBalloonTips . Double-click this new entry, and then give it a hexadecimal value of 0 . Quit Registry Editor. Log off Windows, and then log back on.

Forum Submitted Tips

The following tips are covered in depth on the Reaper Forum.

  • Tips & Tricks Sticky thread - see this thread.
  • A way to change keyboard shortcuts, and automate some functions - see this thread.
  • Create a CD burning cue sheet from markers in a project file - see this thread.
  • View midi in a score view - see this thread.


Beginner Tips

Intermediate Tips

Advanced Tips






Main Page > REAPER Documentation