fbpx
Skip to main content

MIDI Forum

how do controllers ...
 
Notifications
Clear all

how do controllers calculate velocity?

7 Posts
4 Users
0 Reactions
4,510 Views
Andrea
Posts: 3
Active Member
Topic starter
 

Hi. Does the midi protocol establish how the controllers reduce the key velocity to a value from 0 to 127? or does each controller do it differently?
Thank you

 
Posted : 15/10/2022 9:21 am
Mike Kent
Posts: 85
Trusted Member
 

There are various methods. But the most common method is that under each key are 2 switches at different heights. As the key moves down, the time between the 2 switches closing is used to determine the velocity. This is not defined by MIDI, just a common design solution.
Mike.

Chair of MIDI 2.0 Working Group

 
Posted : 15/10/2022 8:17 pm
Andrea
Posts: 3
Active Member
Topic starter
 

Mike thank you. This information is also important to me, but the thing I wanted to ask is what happens next. That is, what kind of mathematical function brings this potentially unlimited value back to an integer from 0 to 127. Can you help me? thank you

 
Posted : 16/10/2022 2:32 am
Clemens Ladisch
Posts: 321
Reputable Member
 

The General MIDI 2 specification says that "The velocity effect on volume is not defined". But it does define the response to the Channel Volume and Expression controllers as dB = 40 × log₁₀ (127 / velocity). (Many devices allow to select different velocity response curves.)

The DLS specification defines the response to Velocity, Volume, and Expression as dB = 20 × log₁₀ (127² / velocity²):

 
Posted : 16/10/2022 3:01 am
JohnG
Posts: 225
Estimable Member
 

The only thing that the MIDI specifiaction says about Note On velocity is this:

"Preferably, application of velocity to volume should be an exponential function."

Additionally, I should add that, Note On velocity is from 1 to 127, Note On velocity zero is a Note Off command.

 
Posted : 16/10/2022 3:14 am
Andrea
Posts: 3
Active Member
Topic starter
 

Thank you all, but I see that I can't make the point understand: i don't need a velocity to db formula, i need a m / s to velocity formula. If the midi defines it.

 
Posted : 16/10/2022 5:07 am
JohnG
Posts: 225
Estimable Member
 

There is no such information in the MIDI specification.

You can download the specification from the "Specs" section youself, and take a look at the "Complete MIDI 1.0 Detailed Specification" available in .pdf form,

 
Posted : 16/10/2022 9:04 am
Share: