Audio latency, buffer size and sample rate explained

Audio latency, buffer size and sample rate explained

I hear the term “Latency” a lot when talking about audio processing. What does it really mean?
How do you set your gear and Gig Performer to work for you, not against you?

What is latency? It’s simply the amount of time that passes between the sound being generated and perceived by your brain. Basically – it is a delay.

Audio latency, Buffer size, and sample rate explainedWhat does it really translate to when playing on stage? Suppose the person on the left  is approximately 10ft away from the speakers behind him. The speed of sound is approximately 1,000ft per second which basically means that it takes about 10 milliseconds for sound to travel from the speakers to the person’s ears. The latency here is about 10ms.

Audio latency, Buffer size, and sample rate explainedNow consider this guy who is using a pair of in-ear monitors. There is almost no distance between the in-ear monitors and the ear so the latency here is basically non existent. As soon as the sound is produced – the person hears it. Latency is zero milliseconds.

What is the buffer size? It is basically the maximum number of samples that will be collected before your plugins get to process them. Your audio interface is an analog-to-digital as well as digital-to-analog converter. It takes any audio input, converts that into digital form and then on the output side – converts those numbers back to analog audio.

What is the sample rate? The sample rate determines how many samples your audio interface will capture every second and do the above mentioned conversions. 44.1KHz is a common sampling frequency for live use. Why 44.1KHz?

How does this relate to latency? If your buffer size is 256 and your sampling rate is 44,100 times per second (Hz means cycles per second) then your latency will be (256/44,100) seconds which is 0.0058 seconds or 5.8ms

Now you can experiment with this. What kind of impact will doubling the sample rate have? If you set it to 96KHz you will get 256/96,000 = 2.7ms latency. Basically – the buffer fills up twice as fast. If you change the buffer size to 128 and leave the sampling frequency at 44.1KHz – you will get latency of 2.9ms and so on.

How does this impact your processing power? A smaller latency value simply means that your computer needs to work harder to process all those samples in time. It does not impact the sound quality.

We now come to the perceptions of latency and how to properly adjust these values.

I started with the explanation of the difference in latency between in-ear and floor monitors. I’m a fairly tall person (over 6ft) so for me – the minimum amount of latency with a floor monitor positioned right under my feet will be around 6ms. If I switch to a pair of in-ear monitors – that latency drops to zero.

I have to be honest and say that the 6ms difference in latency between a floor monitor and an in-ear monitor does not impact my playing nor perception of things. This is why I personally use a buffer size of 256 and sample rate of 44.1KHz. By the way, we’re talking about live performance here, not recording which should be done slightly differently.

If I cut my sample buffer in half to 128 samples – I would save about 3ms of latency or approximately 3ft of distance between me and my monitor. I honestly cannot feel the difference which means that 256 samples is a better choice for me. There is no point in pushing my computer to work harder than it should if I cannot perceive the difference.

Some people swear that they can hear the difference of 3ms latency. I applaud those people and I believe they can hear some kind of difference. It has been scientifically proven that people can perceive between 3ms-10ms difference. It seems that our brain cannot distinguish anything below 3ms.
I have heard claims that some people can tell the difference in latency of 1.5ms (128 vs. 64 buffer size at 44.1KHz). While I have no doubt that these people can hear “something” – I am having hard time that it is really latency difference they can hear.

Do an experiment. Move away and towards your floor monitor by 3ft and also change the volume on it to eliminate the perception of distance connected with loudness and honestly ask yourself if you can tell the difference in latency. Think about all the players before the in-ear monitors were used on stage? They would move around the stage a lot. Sometimes 6ft from the monitor, sometimes 12ft or more and their playing never felt sluggish or different even with whooping 6ms-12ms latency added.

Audio latency, Buffer size, and sample rate explainedHow about a conductor and players in a full orchestra? The violins are maybe 5-6 feet away from the conductor (5-6ms latency) while the timpani player may be 30ft or more away (30ms latency). How about players on opposite sides of each other in the orchestra?

Do any of the players sound out of time with each other? or does the conductor hear all the notes attacking at different times?

So next time you open your Gig Performer – ask yourself what is the highest possible sample buffer size that works for you on stage. Using higher buffer size will run your computer cooler and allow you to run more great plugins in parallel without pops and crackles.

One addition to all these calculations is the latency induced by your audio interface. Not all audio interfaces are created equally. Some are great and have low internal latency for both A/D and D/A conversions and some are adding a bit more so you’d have to lower you buffer size to get the same result. To find out how much latency is your interface introducing into your rig – use the Gig Performers’ built-in Latency Measurement Tool. Here is a screenshot of it:

Latency Measurement Tool Gig Performer

 

Instructions on how to use it are right there within that window. You can find this tool under the “Windows” menu in Gig Performer.

As you can see – this awesome interface is introducing less than 6ms of latency for both A/D and D/A conversion. If you are playing keyboards only – you cut this number in half as you only need the D/A part of the conversion so for this interface it will be less than 1ms.

Note: Gig Performer 4 provides you with a feature to see how much latency every new plugin adds to your setup. Simply hover over your plugin block to show a tooltip and look for the Latency information.

Plugin Latency Indicator Gig Performer

Find out more in our User Manual.


Conclusion … use the sample rate of 44,100 and the highest buffer size that does not impact your playing performance. Think of it as “headroom” for your processing power. If you have a bit of headroom – you will be able to beef up your gig with more interesting plugins without impacting performance.

.

Related topics:
 – Optimizing your computer for a glitch-free audio performance (User Manual)
 – The Ultimate Guide to Optimize your Windows PC for the Stage (free e-book)
 – How to optimize your Mac for a gig
 – Latency measurement tool
 – Some research on latency, jitter and buffer size (Community)

 



Scaling curves allow you to control the shape of the output of a widget or convert an incoming note velocity to a new velocity. Various predefined curves are available and they can be tweaked as necessary. You can also just draw your own curve as well to achieve the effect you require.

 

MIDI File Player Plugin


You can load up to 128 MIDI song files in a single plugin instance. Switch from one song to another, mute tracks and/or change their channel numbers. Tempo can be controlled by individual songs or you can use the global tempo and tap tempo to control the BPM interactively.

 

Favorites and Presets


Create a sound by placing and interconnecting your desired plugins, such as a synth, some effects and perhaps a mixer. Select them all and then save the selection as a named favorite. The favorite will subsequently show up in all plugin insert menus, making it easy for you to recreate that configuration whenever you need it again. This feature is also very powerful for creating your needed sounds on your studio computer and then transferring them to your touring laptop.

 

Probabilistic Sound Designer


Parameters you select in an open plugin are captured into the Probabilistic Sound Designer dialog window. When you click Randomize, you're only adjusting those selected parameters. Each entry in the PSD dialog has a curve but unlike widgets where the curve controls scaling, in the PSD the curves are used to define the probability of particular values being selected. Make sure the filter cutoff never gets too slow so as to block all sound. Perhaps adjust the max range of the VCA attack parameter so that the sound doesn't have too much delay. Constrain the octave ranges of the oscillators, perhaps ensuring that 1/3rd of the time we select 8' and 2/3rds of the time we select 4'. The possibilities are endless.

 

More Widgets


Numerous new widgets are included in Gig Performer - a new sustain pedal, plastic knobs, drum pads and more colored sliders. Shapes can be colored with different borders and fill colors and morphed from rectangular to circular. Your creativity is now the limit to creating fabulous front panels in Gig Performer.

 

MIDI Message Helper


Select MIDI devices by name. Choose the MIDI message type and adjust the appropriate parameters for the specific type

 

  

Layout management


Gig Performer supports arbitrary resizing. Layout your widgets the way you want - resize the main window and the widgets will grow or shrink as necessary to maintain the same interrelationships. No matter what size screen you have, your front panels will still be neat and usable.

 

Undo Support


If you move your widgets around and/or resize them, or even delete them by mistake, the Undo facility will correct your mistake. Minor moves to a widget by mistake will no longer spoil your design

 

Plugin Channel Count


Some plugins support a large number of outputs and they depend on the traditional channel strip to control how many ports should be available.   When you only need a stereo pair, it is convenient not to have a large horizontal block. In Gig Performer, the number of available ports  is controlled by the channel count override, which can be applied to individual plugins and will be remembered when the gigfile is reloaded or if the plugin is saved as a favorite.

 

Input muting and output fading


Rather than a single audio length tail, Gig Performer 4 gives you the ability to control input muting and output fading separately. Input muting controls how much time it takes for audio input to be silenced when you leave the rackspace. Output fading controls how much time will be taken for audio to fade out when you leave the rackspace.

 

Faster Plugin Finder


Instead of searching through menus of perhaps hundreds of plugins (you know who you are!), the Quick Plugin Finder makes it easy to find the plugin you need by simply typing partial strings. For example, as shown here, to find the Modartt Pianoteq 7 plugins, it's enough to type pia mod 7 (in any order, by the way)  to restrict the list of available plugins to those matching your query. The Quick Plugin Finder also knows about manufacturers, presets and favorites.

 

  

Touch Friendly Input


Any entry field can be changed by either dragging your mouse (or finger) up or down, or by using the large popup touchpad where you can just tap on the squares to enter a value. The large popup keypad also does validation so you can't enter an invalid value. You can also just tap the BPM field to pop up a larger view where you can quickly change tempo, tranpose, trigger Tap Tempo and enable Ableton Link, the last allowing you to synchronize Gig Performer with any other application that also supports Ableton Link.

 

New Tuner Display


The tuner view makes it easy for guitarists to quickly check and adjust their tuning. You can toggle into the tuner view from any other view and toggle right back as soon as you're done. All output will be silenced automatically while you're in tuning mode. You can adjust the concert reference pitch from its default of 440 Hz to suit your own needs. The tuner view fills the entire screen so you can easily see it from a distance.

 

GP Script Enhancements


GP Script adds new language improvements such as multiple initialization sections, initialization with declarations and enhanced callbacks. The WidgetValueChanged callback now supports multiple widgets. Sysex messages are now built-in with numerous supporting functions. String array handling is much faster. Integer bit manipulation is now built-in. A new global GigScript allows incoming MIDI messages to be modified and redirected on the fly. It also allows you to define keyboard macros for your computer keyboard to control Gig Performer itself. For complete information, please review the GP Script Language Manual available through the Help menu.

 

Scriptlets


Scriptlets make creating custom MIDI processors easy. You don't have to be a programmer to use them - you can just download scriptlets from our ever-growing collection on our website and drop them right into your rackspaces to use them. Use scriptlets for simple operations such as turning your single notes into chords, modifying, duplicating or converting one kind of message into another, automatic chord latching (AutoSustain), threshold detection, sysex manipulation... imagination is the limit.

 

Other Improvements


  • System Actions plugin
  • MIDI Out to OSC converter
  • Comment plugin
  • New GUI dialog to define MIDI events to send on song part change
  • MIDI Out blocks can automatically send multiple MIDI events
  • Open/close a plugin editor from a widget
  • Choose default startup view
  • Quick find for plugin parameters
  • Large collection of startup hints
  • OSC Patchbay mode
  • Plugins now default to stereo I/O
  • Dragging presets into the wiring view will automatically create the required plugin
  • Numerous other minor (but nice) usability and workflow enhancements

Numerous other enhancements and optimizations serve to make Gig Performer 4 a superb platform for performing artists.

 

Songs and Setlists


You can organize your rackspaces into songs and your songs into setlists and then just select the setlist you need for a show. Then simply cycle down through the parts, or use your control surface or a MIDI Guitar pedal controller to select individual parts directly.

 

Predictive Loading


Predictive Loading™ is an advanced feature that reduces your RAM and CPU resources by only loading rackspaces (or songs) as needed.

 

 

The Global Rackspace


The Global Rackspace can receive audio from whatever rackspace is currently active. Instead of inserting effects in every rackspace, simply insert them once in the Global Rackspace and all your local rackspaces will have access to them. The Global Rackspace can also send audio to the currently active rackspace. So you can insert a looper that receives audio directly from your guitar (say) and then send the looped audio to different effects in different rackspaces. If a particular instrument such as a piano or organ is needed everywhere (or almost everywhere), put it in the Global Rackspace.

 

   

Zoomable Wiring View


Gig Performer 4 provides a virtual view allowing you to spread out your blocks and connections to make them easier to see and manage, even if you have a very small screen. You can zoom in or out and you can use the Auto-Fit option to position your blocks to fit in the available space.

 

 

What's new in Gig Performer 4.5


  1. Record what you play, complete with all effects - multiple channels of mono or stereo wave files
  2. The Follow Hardware feature lets widgets update automatically to match your controller values when you switch rackspaces
  3. Plugin blocks can now be easily dragged to insert them between other plugin blocks
  4. Widgets can be hidden when not in edit mode.
  5. Widgets support various CC relative modes
  6. The MIDI Thru option lets widgets respond to messages while allowing them to pass through to plugin blocks
  7. The Global MIDI Monitor now displays outgoing MIDI messages
  8. Audio options can now be exported and reimported to make it easier to support multiple audio configurations
  9. OSC now supports named targets
  10. Song Part OC assignments can now be globally changed and applied
  11. GP Script has a new Timeline callback, a MIDI connect/disconnect callback and many new system functions
  12. New parameters in the System Actions plugin now provides even more global control of Gig Performer

Click here to see the complete list of release notes for Gig Performer 4.5