Instrument Macros with Linear Scaling don't scale linearly

Version/System Info:

Renoise 64-bit, V3.1.0, Built Jan. 9, 2016

​Linux 4.4.35-1

Reproduction (see attached .xrns):

  1. Add a sample to create a new instrument
  2. ​Add ADHSR envelope for Volume parameter
  3. ​Set ADHSR envelope to beats mode​
  4. ​Set all ADHSR envelope parameters to 0.0 beats
  5. ​Map Macro 1 to ADHSR parameters: Attack, Decay
  6. ​Settings: Attack 0.0->1.0 beats, Decay 1.0->0.0 beats, both use linear scaling
  7. ​Manually set Macro 1 to 50.0%

​Expected Result:

Macro 1 is at 50.0%, both attack and decay for Volume AHDSR should be 0.5 beats (i.e. for any value of Macro 1, attack + decay should equal 1.0 beats)

formula: {min} + [({max} - {min}) * {macro value}]

​attack: 0.0 + [(1.0 - 0.0) * 50%] == 0.5

decay: 1.0 + [(0.0 - 1.0) * 50%] == 0.5

Actual Result:

​Both attack and decay for Volume AHDSR are at 0.125 beats

​Setting Macro 1 to 79.35 will make attack 0.5 beats

​Setting Macro 1 to 20.65 will make decay 0.5 beats

Additional Notes:

I notice that the sliders for the duration of an envelope stage are non-linear in output. When sliding the macro knob back and forth, the mapping seems to be correct w.r.t. the slider positions (i.e. at 50.0% macro setting, both sliders are horizontally aligned).

​It seems like the macro is doing what’s expected, but using any other kind of scaling on the mappings won’t give me the desired behaviour. I assume because the macro mapping dialog is smart enough to know that the envelope is either ms-based or beats-based (you see the min/max units change if you toggle the clock icon on the envelope GUI), that the linear scaling would work independently of how the slider input decides to map the positions.

I think this is no bug, but simply the way renoise is designed. The macro doesn’t really care what it is controlling, it just fetches a value description from a controlled device for visual feedback, but it won’t adjust any ranges because of this.

Yes, the ADHSR sliders you mentioned don’t follow a linear value slope, but have some exp action going on so you can finetune small time values but still reach the big values at the other side of the range. This is true for many of renoise’s devices’ parameters.

The macro, like doofers or hydras or so, just linearly zoom over the slider range of whatever they are connected with. Think of it like the slider being moved in linear fashion, and not the values that the slider positions correspond with being interpolated. If that parameter range’s values themselves are following a curve and not linear fashio, the results will also be bent. The macro won’t “learn” the value curve of what it is controlling, it just daftly scans over the range of the slider within the values you config it with. It is not the macro where the problem stems from, but the fact that the adhsr timing value knobs aren’t linear.

There can be workarounds if you know the formulas that the slider ranges are bent with. And then using a formula device to correct things. I’ve done this with the filters, making them keytrackable for example. Without the formula correction it would be badly out of tune - a keytracker will return a linear value over the note range, while the frequency knob of the filter follows another wierdly bent curve. With a correction fomula in between it is very very close to perfect tuning. Just as an example of what is going on, and how this could be handled if it is problematic for certain setups.

It’s clear that it’s implemented the way you describe.

As for the formula device, I prefer to use that when I’m doing something creatively. I could definitely sit down and sample the slider output at equally-spaced points, and probably come up with something that would work, but that’s very non-musical work. :stuck_out_tongue:

At that, I could make it work once, but let’s say in a future version of the software the range maximum changes, or the curve is adjusted. Now all my old project files may not be forward-compatible. If the macro isn’t actually mapping to beat/ms durations (recall, the dialog is aware of the envelope GUI’s unit setting), it would be more intuitive to just have the ranges specified as [0.0, 1.0] for the purpose of a macro.

At a minimum, it could be worth a small note in the documentation so that anyone using the tool can have a clear picture of what expected behaviour should be.

Also, apart from this one issue, I’ve been loving the macros for every other use-case, and my hat’s off to the devs for including it. :slight_smile:

Just out of curiosity, the slider(s) look like a cubic curve is applied i.e.

Attachment 7154 not found.

So you could (as oops points out) probably use that info to keep the Attack and Decay values to sum to 1 beat via a doofer input. I thought this example:

Attachment 7155 not found.