[Solved] Value Mapping Limitation for Bindings

I am getting close to linking Cantabile with RME’s TotalMix in order to make use of Direct Monitoring for the dry sound (in order to reduce latency). I am setting up Cantabile to match TotalMix’s faders. One hitch:

TotalMix faders have a range of -65dB to +6dB. I need to map that -65dB to +6dB range in bindings which are triggered on Gain value changes and produce 0…127 MIDI values (for communication with the Controller Bar and for sending out LoopMIDI to TotalMix itself). However, the lowest value I can select in the “Source range from:” field is -59.9:

ValueMappingLimitation_2022-09-11_133557

This completely messes everything up in my scheme.

Is there a way around this @brad? Am I missing something ???

Hrm… Cantabile considers an attenuation level of -60db as effectively silent. I guess I could drop that to -65 if that would help?

1 Like

Thinking about this more… what happens if you set the source min to -∞.

(The db values are display only and internally get converted to a scalar value where -∞ is a multiplier 0).

If I changed the min db display value to -65db, all that does is changes the number you enter for 0, so -∞ should give you the same result.

(Guessing here, let me know what happens)

1 Like

The issue is more than just a single value, since I am using the value mapping to scale the Amplitude from the incoming Gain value.

As it currently stands, the Gain values in the range -65 to -60dB get mapped onto 0 and values in the range -60 to +6dB get expanded into the 7-bit 0…127 range, which then is a mismatch with TotalMix. This amounts to a loss of the bottom five MIDI values in the 128 value range.

To get a custom .cantabileControlCurve file that matches TotalMix, I can’t see any other way than to extend the range so that -65 dB can be entered (rather than -59.9).

(As far as I can tell, TotalMix does not represent -inf … the lowest value on the Faders and the value corresponding to MIDI 0 is -65dB)

Some other random Thoughts …

I am thinking that if Cantabile wants to be able to match the control curves of external devices (mostly interfaces, but potentially devices that respond to MIDI commands to set Gain levels), then a wider range is needed.

The other choice would be to keep one of the stock control curves in Cantabile, and then just send a translation of whatever Cantabile has for a gain to the external device. Since that can be done using the SysEx interface (I think the SysEx interface can actually send any MIDI message?) then any transformation can be implemented. Downside of this is that the translation will not be 1:1, and values will get chopped off at each end of the scale for at least one of the devices (Cantabile vs. the external device).

Nearing home plate on my quest to link Cantabile with TotalMix (RME’s control / mixing app for their audio interfaces). This will let me use direct monitoring in TotalMix and reduce latency on my dry signal.

C4’s current limitation on the setting of values is one of the last wrinkles in the scheme. I’ll describe my setup and maybe someone can suggest a workaround (other than having @brad alter C4 to change the limit).

Once the wrinkles are straightened out, I’ll post the full .cantabileControlCurve file needed to align C4 with TotalMix.

The first decision was whether to align the control curves of C4 and TotalMix. I felt that they 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 the two curves:

So I decided to align C4’s Gain curves with TotalMix

First step was to implement a custom control curve. I’ll save the gory details for another post, but basically I’m changing the key functions (from Cantabile (New)):

"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)",

… to functions based on how TotalMix renders control curves:

"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)",

With this new control curve installed, all sliders in Cantabile work just like those in TotalMix.

Second step: Create dummy routes in C4 to hold Gain values from the rotary encoders I want to pass to TotalMix, and map my rotary encoders to control the Gain of those dummy routes.

Third step: Bind changes in the dummy Gain values to MIDI CC commands sent to LoopMIDI and on to TotalMix. The binding looks like this:

This is where the issue arises – the lower limit of the binding in C4 is -59.9 dB. TotalMix goes down to -65 dB.

The result is this mismatch of 0.3 db at -3dB (-3.0dB vs -3.3dB) …

… and 4 dB down at -45dB (-49.9dB vs -45.9dB):

Hi @ClintGoss

I’m happy to make a change for the next build to change the minimum db attenuation level. Say -80db?

In the meantime you could hack around this by directly editing the cantabile song or rack file:

  1. Save the file in Cantabile
  2. Open it in a text editor
  3. Look for the section "bindings".
  4. Location the “sourceRangeMin” for the correct binding (put something in the comments field before saving to help identify it if you have a lot of bindings)
  5. Change it "sourceRangeMin": 0.0005623413251903491, (which is the scalar equivalent of -65db)
  6. In Cantabile File|Revert the song or rack to reload it with the change.

image

I just tested this in 4054 and in the binding slot it shows -65db:

(but if you click it to edit it shows neg infinity)

This should get you going for the time being.

Brad

2 Likes

Didn’t think of hacking the rack file! I’m getting soft …

That will do quite nicely … and -80dB sounds good.

I should really survey the apps associated with other makes of interfaces to see what the bounds on their curves look like … although the complexity of setting up this dual-type of mixing arrangement may be too much hassle for most C4 users. In the end I’m buying 4msec of latency improvement for quite a bit of extra routing and coordination …

Thank you so much!!

Hoping @brad can get this update into v4055 … it’s not in v4054 and I’ve been unable to edit the XML for the dozens of bindings where this happens in my setup.

I’m planning to set aside bindings for tomorrow + N days to get a new build out which will include this.

3 Likes

I can confirm that this issue has been solved in v4055.

The new lower limit of values is -79.9dB and -80db (and below) are taken as -∞.

1 Like