Skip to main content

Handling Latency While Recording

Author cognitone

When you play a phrase on your master keyboard, it takes some time for the MIDI message to arrive at the virtual instrument plug-in, and then for the sound to be rendered and played back to you through your speakers or headphones. With a default sample rate of 44 kHz and a buffer size of 512 samples, this is 11.6 x 2 = 23.2 ms. If there's a limiter, maximizer or other mastering tool in the MASTER module of your global rack, that accounts for another 10 - 50 ms.

What's more, weighted piano keys already feel slow because it takes a moment for the hammer to hit the string. You may be accustomed to this, but when combined with technical latency, it exacerbates the perceived delay.

Playing in time with so much delay is a challenge. The audio engine sends all input immediately to the instrument (like any DAW), even before Synfire processes the input. There is not much it can do to further reduce the lag, but you can. Here are a few things you can do to minimize latency and lag.

Set Block Size to 128 Samples

You can even go lower if your instruments can deal with that. A smaller block size means that MIDI input is handed over to the instrument more frequently, which reduces the time it has to wait for the next packet of notes. This setting is found in Playback >> Audio/MIDI Setup on the Audio tab.

Use Audio Engine For MIDI Input

Enable this option to make sure MIDI input is received and processed directly by the program that hosts your instruments. Otherwise it will have to run through the local network first. Also enable input latency compensation. If you are playing consistently late or early, Synfire will shift your take accordingly. This setting is found on the parameter inspector for the Take parameter. 

Remove Mastering Plug-ins

Limiters, maximizers, compressors, delays, and other effects can significantly increase the time it takes for rendered audio to reach you through speakers or headphones. This is easy to overlook when you are struggling with latency. Temporarily remove these effects from your AUX or MASTER modules on the global rack and all INSERT slots of the other rack modules. 

When you are done recording, you should restore your previous buffer size and mastering effects.

Use a Keyboard With Local Sound

You can also use a synthesizer with local sound output as your master keyboard. This gives you instant feedback on your performance. Although you will hear a different sound, the immediate response will help you maintain proper timing. Don't forget to mute the sound in Synfire until your take is complete.

 

Comments

Wed, 2025-01-08 - 13:38 Permalink

Hi.

Good information here, thanks!

The advice is simple and direct, and so easily followed.   No problem there.

However, I would like to understand this on the next level if possible.

re:

The audio engine sends all input immediately to the instrument (like any DAW), even before Synfire processes the input. 

and

Use Audio Engine For MIDI Input

Enable this option to make sure MIDI input is received and processed directly by the program that hosts your instruments. Otherwise it will have to run through the local network first. 

Would it be possible to explain the different elements/stages of each path -

Use Audio Engine For MIDI Input Enabled  - Path A:    ....

Use Audio Engine For MIDI Input Disabled  - Path B:    ...

IOW, starting at the controlling keyboard, what is Path A all the way to actual sound, and then what is Path B all the way to actual sound.

(And in this context, I don't understand what "run through the local network" means.  All the gear is USB connected, what does the "network" (i.e. my wired or wireless ethernet LAN) have to do with it?)

Thanks for what further explanation you can provide.

Wed, 2025-01-08 - 19:21 Permalink

The engine is a separate process connected to Synfire over TCP/IP network locally. When midi goes to the engine it is timestamped, played by the plugin, and sent to Synfire later (timing no longer matters). When midi goes to Synfire it has to travel through the network to reach the plugin.