LMMS / LMMS/lmms

Support custom MIDI velocity curve

Open
#2,313 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
10.4k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
7

Description

Hello,

For now velocity for midi input can be raw from keyboard or fixed to a value.
It's ok with some keyboards but for keyboards with fixed velocity curve it does not work well.
A better (simple) approach could be to have 2 values, min and max velocity.
A much better approach should be to have a real 1->127 to 1->127 graphical editor to create a mapping curve.
For now and for my needs (with an Akai LPK25 mini keyboard) I just use the fixed value as a minimum velocity value:

void MidiPort::processInEvent( const MidiEvent& event, const MidiTime& time )
...
if( fixedInputVelocity() >= 0 && inEvent.velocity() < fixedInputVelocity() ) // FIXME GFE now input is not fixed but minimum
{
inEvent.setVelocity( fixedInputVelocity() );
}

With this simple hack velocity is useable (with a value of 50). We absolutly need to limit the range of velocity because it seems most instrument use velocity as a volume (but that is another debate...).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The relevant entry point shown is MidiPort::processInEvent; start there and review how fixedInputVelocity() and inEvent.velocity() currently interact. Before changing it, settle whether the scope is min/max limits or a graphical 1-to-127 mapping; done should mean the agreed velocity curve is applied to MIDI input within the valid range.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.