Forums > MaxMSP

dBtoVel

December 7, 2006 | 3:17 pm

Does anyone have a good formula for translating db to MIDI
velocities. The one I use is linear and scales -75 – 0 dB to vel 0 –
127.

Georg


December 7, 2006 | 6:07 pm


December 7, 2006 | 6:57 pm


December 7, 2006 | 8:27 pm

is this what your lookin for?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 176 206 86 196617 -75 dB thru 0 dB;
#P newex 186 69 71 196617 loadmess -75;
#P newex 122 162 79 196617 scale 0. 1 0 1;
#P number 121 225 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 121 196 41 196617 * 127.;
#P flonum 119 57 35 9 -127. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 157 89 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 159 110 34 196617 dbtoa;
#P newex 122 111 34 196617 dbtoa;
#P comment 193 90 63 196617 minimum db;
#P connect 1 0 7 0;
#P connect 8 0 3 0;
#P connect 7 0 5 0;
#P connect 2 0 7 1;
#P connect 5 0 6 0;
#P connect 4 0 1 0;
#P connect 3 0 2 0;
#P window clipboard copycount 10;


December 7, 2006 | 8:59 pm

Hi,

try this

Cheers

Lorenzo

max v2;
#N vpatcher 10 59 576 428;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 278 127 121 196617 from MIDI velocity to dB;
#P number 123 210 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 123 140 41 9 0 0. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 123 175 127 196617 expr int($f1 / 0.6) + 127;
#P flonum 278 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 278 140 35 9 0 0 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 278 174 113 196617 expr (127-$i1) * -0.6;
#P comment 123 127 121 196617 from dB to MIDI velocity;
#P connect 5 0 4 0;
#P connect 4 0 6 0;
#P connect 2 0 1 0;
#P connect 1 0 3 0;
#P pop;

Il giorno 07/dic/06, alle ore 16:17, Georg Hajdu ha scritto:

> Does anyone have a good formula for translating db to MIDI
> velocities. The one I use is linear and scales -75 – 0 dB to vel 0
> – 127.
>
> Georg
>
>
>


December 7, 2006 | 10:53 pm


December 8, 2006 | 12:05 am


December 8, 2006 | 7:04 am

Georg Hajdu wrote:
> Does anyone have a good formula for translating db to MIDI velocities.
> The one I use is linear and scales -75 – 0 dB to vel 0 – 127.

That means it linear according to dB and logarithmic according to amplitude?

I am using a hand trimmed coll for faders. But my experience for Midi
playing amplitudes, that it seems a simple Midi/127. sounds reasonable.
That would assume the other way around should be fine as well. It seems
that the synths do the scaling internaly. -75 dB seems just too low.
1/127. is -42. dB. I’d try just multiply amplitude with 127…

(I know that you know how to do log scaling and alike, you wanted some
aesthetical comments… ;-)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


December 8, 2006 | 8:57 am



f.e
December 8, 2006 | 11:21 am


Viewing 10 posts - 1 through 10 (of 10 total)