Quantcast
Channel: KVR Audio
Viewing all articles
Browse latest Browse all 4902

Bitwig • Bitwig Key Filter Shifts Incorrectly when Mode Shift is Negative

$
0
0
Bitwig’s Key Filter device has an error. When Mode Shift is negative, Key Filter plays notes that are shifted incorrectly.

It's easy enough to avoid the problem: If you want to shift down to some mode, shift up to that mode instead, and transpose either the input or the output down by however many octaves you need.

I’ve analyzed the error with dozens of combinations of Scale/Mode and Mode Shift, and I think there’s an off-by-1 error.

Here is a scenario that clearly demonstrates the error. Set up Key Filter like this:
kf-config.png

And feed it this input:
kf-input-notes.png

With this setup, Key Filter should shift each input note down by one scale tone, essentially playing the B Locrian mode, like this (input in blue, expected output in green):
kf-expected-output.png

Instead, it plays this (input in blue, actual output in red):
kf-actual-output.png

This is incorrect in several ways:
  1. Some input notes map to A♯ or D♯, neither of which appears in C Major (or B Locrian).
  2. Both E3 and F3 map to the same output note (D♯3).
  3. Both C3 and B3 map to the same output pitch class (A♯).
I’ve analyzed the output of dozens of combinations of Scale/Mode with negative Mode Shift, and I think I know exactly how the output is incorrect. I’ll explain by continuing the example.

I’ve annotated the expected and actual outputs to show the difference between input and output.

Key Filter should shift the notes this far:
kf-expected-output-annotated.png

Instead, it shifts the notes this far:
kf-actual-output-annotated.png

After much analysis, I noticed that the shifts are off by a predictable amount: Each note gets shifted by the amount that should apply to the following scale tone. That is, C gets shifted by the amount that should apply do D, D gets shifted by the amount that should apply to E, and so on up to B, which gets shifted by the amount that should apply to C.

If we combine all of this information, we can see the off-by-1 error:
kf-off-by-1-error.png

The same pattern applies to every combination of Scale/Mode and Mode Shift that I’ve tried, and I’ve tried dozens of combinations, including modes of the not-strictly-diatonic Harmonic and Melodic Minor. With every combination, if Mode Shift is negative, the input note is shifted by an amount that should apply to the following scale tone.

I’m guessing that the code builds some table that specifies how far to shift each scale tone, based on the Scale/Mode and Mode Shift parameters. But when it builds that table, or when it applies the table, the code accesses the table using an index that is off by 1.

I've reported this to Bitwig. Only an automated reply so far (reasonable on Christmas Eve). We'll see what happens.

Statistics: Posted by dhemery — Tue Dec 24, 2024 11:32 pm



Viewing all articles
Browse latest Browse all 4902

Trending Articles