Dual Mixing for Low Latency / Direct Monitoring

In my unrelenting quest to reduce latency in my WindSynth rig, I have begun using the Direct Monitoring provided by the RME interfaces for my direct signal. This avoids the 4.16msec round trip latency cost of routing my dry signal through my UCX-II.

This post is an outline of how one might implement Direct Monitoring in Cantabile. Its taken me 8 months to get to this point, and I hope this post can speed things along for other low-latency fanatics. However, note that (as Brad has been known to say): “The scope of this work is a bit daunting, but I was determined to see it through.”

Overview

My approach is a dual-mixing strategy that replaces a simple Cantabile route for my dry signal with a path in TotalMix. This required some gnarly complexities in my Cantabile setup. Some key elements:

  • Dummy routes in Cantabile to hold Gain values from physical rotary encoders.
  • Bindings that map rotary encoder input to adjust Gain sliders in Cantabile (for FX) and Faders in TotalMix (the dry signal) simultaneously.
  • A custom .cantabileControlCurve file that aligns the Gain sliders in Cantabile with the faders of TotalMix (RME’s mixing App).
  • An adjustment of the lower bounds of Value Mapping in Cantabile to accommodate the lower bound of TotalMix faders.
  • An internal MIDI routing app – LoopMIDI – to feed MIDI data from Cantabile to TotalMix.
  • Play my brains out, enjoying the new, lower latency.

Here is the general scheme, showing routing of MIDI with yellow arrows:

The route named TotalMix Main Gain is controlled by a rotary encoder and holds the current value of what the Prim 1/2 fader should be in TotalMix. Bindings output MIDI commands through LoopMIDI to TotalMix, which has to be configured to listen to the LoopMIDI port (and have Enable Protocol Support enabled).

Note that the popup slider is a different scale than the one typically used by Cantabile. I could have kept Cantabile’s standard Gain control curve. However, I felt that Cantabile and TotalMix are so different, that it would be a constant pain trying to keep the two straight and handling end conditions.

Here’s a comparison of all the curves used by Cantabile versus the control curve of TotalMix:

The default Cantabile (New) curve (light blue) is significantly different from TotalMix (dashed red) at the low end.

Control Curves

I recorded the dB fader values of TotalMix resulting from each of the 128 MIDI values it can receive, plotted them and tried to discern the formula used by TotalMix. No joy.

However, Matthias Carstens (an RME founder) was kind enough to send me the formulas that allowed me to create a custom .cantabileControlCurve file.

The key formulas in the control curve file are implemented by a pair of fuctions. The default control curve file (Cantabile (New)) uses these functions:


"positionToScalar(x)": "pow(10, (log(x, 10) * slope - (log(zeroDbPos, 10) * slope)) / 20)",

"scalarToPosition(x)": "pow(10, (log(x, 10) * 20 + (log(zeroDbPos, 10) * slope)) / slope)",

The corresponding functions for TotalMix are:


"positionToScalar(x)": "pow (10, ((x > 0.63440860215) ? ((x*32.8235294145) - 26.8235294118) : ((x * x * -94.8544366899) + (x * 153.176470567) - 65)) / 20)",

"scalarToPosition(x)": "clamp( ((log(x,10)*20 >= -6) ? ((log(x,10)*20 + 26.8235294118) * 31.1666666641) : (826 - Sqrt(-34869 - 220660*log(x,10)))) / 1023, 0, 1)",

The derivation and manipulation of these functions is contained in detail in the TotalMix.cantabileControlCurve file that I developed, available HERE.

Value Mapping Limitation

The lower bound of the explicit range of the Source of a Value Mapping in Cantabile is -59.9dB. Since the lower bound of TotalMix sliders is -65 dB, the Cantabile limitation make the two sliders out of step, especially at lower dB settings.

The problem was addressed by @Brad, who provided a temporary workaround, and will change the lower bound in the next C4 release.

Full details in the Value Mapping Limitation for Bindings post.

Two Modes

For safety and fallback reasons, I decided to implement a hardware (MIDI) switch to allow me to go back to the older, non-direct monitoring “All In Cantabile” setup. At the push of a button I can switch direct monitoring on and off. This is useful in a few situations (described below) and also use for testing the change of 4msec latency.

Wrinkles

I can no longer simply record an output of Cantabile to get my final-mix sound. The final mix is coming only from the RME audio interface. And, since I’ve run out input ports on my RME (UCX-II), I can’t take a feed back from the RME. To record something specific (a riff I want to preserve), I switch back to [non-Direct Monitoring] routing, or record it to a thumb drive with the Direct USB Recording feature of the UCX-II.

MIDI control of TotalMix is problematic (for me, at least). I was lucky to find out how to control the Output faders. There is apparently some issue with a non-disclosure that RME signed with Mackie, and they don’t publish all of their MIDI implementation. Because of this, I’ve had to use two stereo ADAT channels and a physical ADAT loopback (0.25 msec added latency … Grrrr) simply to be able to mute a channel and control a separate monitor output feed.

Was it worth it?

Conventional wisdom is that we can’t detect latency less than 20msec. That’s hogwash in my book. I suspect this was done by a “Listen to this” … “Now listen to this” type of test – not representative of how we actually play.

I can reliably hear (in a blind test – 9 out of 9 times) the effect of lowering the latency by 4msec. But, again, that’s not the point.

When actually playing, I now believe that a minimal latency setup dramatically affects the way I play. I’m now playing short, fast runs and ornaments that I always played on physical wind instruments, but had fallen away over the last 2 years on the WindSynth. They’ve come back into my fingers almost immediately with the lower latency, and it’s now a true pleasure to play.

2 Likes

Can RME’s DIGICheck help with recording?

I’m planning on trying out remote control of TotalMix too.
Would using OSC to control it help out?
Then you could use OSC/PAR to convert from MIDI to OSC from C4.

I guess you’re aware of this unofficial Mackie document:
Mackie Control MIDI Map.pdf

1 Like

Yes, that’s the 2008 Jeremy Lee document. Jeremy uncovered the Pitch Wheel commands that affect the faders on the TotalMix Input row. Unfortunately, there is no easy way to select which mix you are affecting (i.e. which output is selected) when modifying the input faders.

Recording is pretty easy on the UCX-II as it is … But I had not considered using DigiCheck - I’ve never used it for that … Thanks!

Had not considered OSC, mostly because I’ve never used it … Looking at the implementation chart (which is quite old - 2012 - maybe I’m not looking at the current implementation) … it doesn’t seem like they actually implement any more than what has been revealed by RME and discovered by the community for the MIDI implementation … Hmmm.

I’v had a little play with this TouchOSC project:

TouchOSC for windows is nagware so worth checking out.
I’ve routed it to OSC enabledTotalMix and have it working.

It amazes me, given the unlimited configurability of OSC, that RME still don’t have absolute addressing for submixes.
It seems that you still have to select the submix you want to work on.

1 Like

I’ve managed to fake absolute submixes.
I have 2 sliders, one sets analog input 1 level for the phones submix and the other sets the analog input 1 level for the main mix.
By using Cantabile’s binding delays and scaling I can make one slider do the 3 actions needed:

  1. select a subMix
  2. set to busInput (so that volume commands are mapped to physical input levels)
  3. and set the level of that input

The binding for 2 is set to 1ms delay, for 3 it’s 2ms.

I suspect all hell will break loose if you operate both sliders at the same time.

edit: they also work without the delays

I did use a bank-switching approach for a while, with delays to get it to work (although my delays turned out to be much higher than yours … don’t recall the details of what I was doing). Anyway … it did seem to be unreliable under some load testing.

== SideStory
I have an innate fear of arbitrary delays based on “expected” processing times. Worked at the NY Stock Exchange and the guy in the cube next to be was the master adding delays, so that the myriad of machines that needed to boot at 3AM would all come up in order and be ready to run the floor. Well … of course … four years down the road, the scheme was a rats nest of delays that got bumped and tweaked and … one day … the floor never came up. After many tries. Till like 11 AM … no trading … BIG headaches.
== End SideStory

So I think I’ll live with what I’ve got for now … I really do need to go back to just playing …

I think that using OSC allows for little or even no delays because of the higher bandwidth compared to loopMIDI, and the lower latency of windows networking subsystem.
Yeah, for sure things are going to be different under load.
For my rig, this approach could a be workable alternative. At the mo I’m solving the redundancy problem by having two identical pcs with RME AIOs feed into a Motu 828es over ADAT. The Motu has full mixing via OSC so I can mute either pc and control mix levels all from a MIDI controller (and OSC/PAR).
But the Motu isn’t an RME and currently it’s in the repair shop after an analog input started to make a fizzling noise.

The main problem in using the RME TotalMix OSC approach might be their insistence on using toggles rather than absolutes for buttons.

1 Like

Right! … another gotcha. This was the cause of my having to burning an ADAT track just to implement an absolute mute (rather than a toggle) by setting the fader to -INF or 0dB as needed.

Your setup does seem to be even more complex than mine … and probably beyond where I am willing to go … here’s my current rig setup, in situations where I have a keyboard player:

:slight_smile: I do hope you send a copy of your rig diagrams with your tech rider.
Mine don’t get past a scribble with pencil and paper. Yours are truly excellent.
How’s the Faderfox btw? I’ve been tempted by those and the Midi Fighter Twister but can’t decide.
I’ve been meaning to post in the ‘show us your rig’. I wouldn’t say it’s more complicated than yours but it’s definitely heavier. Everything is packed into 2 shockracks and a mixer rack case. It’s mostly pre-wired so set up time is around 30mins. In a bid to reduce latency and increase repairability I built two 3u rack pcs (minimum size to allow fullsize pcie cards). But the upshot is that I need a racked monitor, KVM, keyboard/trackball, and UPS.
It all fits in a Ford Focus, but it’s a 2 person lift and must be close to 100kg.

I’m at 70lbs shipping weight max, and the whole deal fits mostly onto a single board that I pull out and place on a table.

Faderfox is great … TINY for what it does. I rarely switch banks and try to do everything with 16 rotary + push encoders. Some rare function are in other banks. Feels very solid and have had no issues with it.

Power supplies are generally in another ship case and get connected via wrapped snakes - that’s the majority of my 15 min setup time …

My setup rider shows none of this complexity … just square footage footprint, table, power how close (need to be within 12 feet for me) and audio connections.