Skip to content

A velocity curve in dB, switched on the velocity row - #112

Merged
benjamindehli merged 1 commit into
release/v1.17.0from
feature/105-a-velocity-curve-in-db-switched-on-the-velocity-row
Nov 3, 2026
Merged

benjamindehli merged 1 commit into
release/v1.17.0from
feature/105-a-velocity-curve-in-db-switched-on-the-velocity-row

Conversation

@benjamindehli

Copy link
Copy Markdown
Owner

When I made presets I ended up setting the VELOCITY row to 0 or to somewhere between 90% and 100%, because the values in between hardly did anything. The row took amount × (1 - velocity) off the fader, which is linear in amplitude. Even at 100% a medium note was only 6 dB below a full one, at 50% it was 2.5 dB, and most of the change fell on the softest notes.

The row can now work in decibels. The loss is amount × (1 - velocity) × 40 dB, so every step of the knob and every step of velocity is the same number of dB. At 100% a medium note is 20 dB down and the softest note 40 dB down, and 50% is half of each. A negative amount mirrors it as before, and STRIKE is unchanged.

The switch

A dB switch sits in the gutter left of the "velocity" caption, the same kind of switch as L and T on glide. Lit is dB, dark is the old curve, now called Classic. It reaches every channel and the noise channel, and it is a parameter, "Velocity Curve", saved with presets and sessions and visible to the host.

Clicking it converts every channel's amount so a medium note keeps its level, and only the soft and loud ends move. Classic 100% becomes about 30% on dB and 70% about 19%. Going back is the inverse, held at 100%. The switch and the 33 amounts are one step in the undo history.

Old patches stay on Classic

  • Every factory preset sets Classic in the shared base, so all 41 sound as they did.
  • A saved session or preset file that does not name the switch loads on Classic. This has to be set on purpose: JUCE leaves a parameter that a restored state does not name where it was, so an old project would otherwise take whatever the last patch left. params::valueInOlderFiles holds that rule, and both setStateInformation and presets::restore use it. For the session it is read before replaceState, which adds the missing entries to the same tree.
  • The VELOCITY row now defaults to 0 on every channel and on noise, in the parameters and in the DSP core's own defaults. The factory presets set their own amounts, so they are not affected.

What changes for users

  • A dB switch beside the velocity caption, with a tooltip, and the velocity row's help text mentions it.
  • The parameter count is 851, and the docs say so.
  • The controls page describes the two curves and the switch, and DESIGN.md describes the rule for older files.
  • The window and strip screenshots show the switch. Only the 16 by 16 pixel square where it sits changed.

How it was checked

DSP suite, a new test:

  • at 100% the softest note is 40 dB down, a medium one 20 and the hardest untouched, and every tenth of velocity is the same 4 dB
  • half the amount is half the dB, a negative amount is the mirror, and zero leaves the fader alone on both curves
  • the conversion keeps a medium note's level both ways with the sign kept, and converting back gives the amount it started from
  • through the engine, a medium note at full amount is struck at half its fader on Classic and a tenth on dB

The existing velocity tests now ask for Classic, the curve they were written against.

Runtime suite, a new test:

  • dB is the default and the VELOCITY row starts at zero
  • all 41 factory presets load on Classic, even with the instance on dB
  • a session and a preset file without the switch load on Classic, and ones that name dB load on dB
  • the switch converts all 33 amounts, keeps zero at zero and negative negative, and one undo puts all of it back, and switching there and back returns the starting amounts
  • the gutter's switch sits in the velocity row and follows the parameter
  • through the processor, a medium note at full amount plays at the ratio the two curves predict, 0.202

I made the older-files rule return nothing to see the session and preset checks fail, and both did. The runtime suite passes with 1536 checks and the DSP suite with 1404, both with no failures, and the DSP core builds on its own with -Werror. clang-format, prettier, build_site.py --check, the counts and structured data checks and the lambda scan pass too.

Closes #105

@benjamindehli benjamindehli self-assigned this Nov 3, 2026
@benjamindehli benjamindehli added this to the v1.17.0 milestone Nov 3, 2026
@benjamindehli benjamindehli linked an issue Nov 3, 2026 that may be closed by this pull request
@benjamindehli benjamindehli added the enhancement New feature or request label Nov 3, 2026
@benjamindehli
benjamindehli merged commit 201eddf into release/v1.17.0 Nov 3, 2026
9 checks passed
@benjamindehli
benjamindehli deleted the feature/105-a-velocity-curve-in-db-switched-on-the-velocity-row branch November 3, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A velocity curve in dB, switched on the velocity row

1 participant