Give a fader curve to Midi data

Feb 8, 2011 at 9:08pm

Give a fader curve to Midi data

Give a fader curve to Midi data

Hello,
I controll samplitude ( DAW ) with touchosc on ipad, samplitude doesn’t work with osc yet so I convert OSC to MIDI with Max.
When I controll a fader on ipad I want a feedback of the decibel value and not midi value.
Samplitude’s fader works between -100 to 6db so I realize this :

[ctlin 14 1]( from samplitude )
|
[>numberbox]
|
[scale 0 127 0.00001 1.995262] ( -100 to 6db )
|
[atodb]
|
[>numberbox]
|
TO Touch OSC Fader Label

It works but it’s linear and samplitude’s fader isn’t linear ( like all sound mixer ) so when samplitude says 0dB,
touchOSc says 3.9dB…
How can I give a curve to my patch to follow samplitude.

Thank you very much.

Greg

#54866
Feb 10, 2011 at 11:41pm

I am using custom fader curves for a long time.
Put this in a coll and you’re done. Its modeled after common curves in mixing desks… Since I use that, I am happy with the Midi resolution of 128 steps…

0, 0.;
1, 0.000032;
2, 0.000063;
3, 0.000126;
4, 0.000251;
5, 0.000501;
6, 0.001;
7, 0.001413;
8, 0.001995;
9, 0.002818;
10, 0.003981;
11, 0.005012;
12, 0.00631;
13, 0.007943;
14, 0.008913;
15, 0.01;
16, 0.01122;
17, 0.012589;
18, 0.014125;
19, 0.015849;
20, 0.016788;
21, 0.017783;
22, 0.018836;
23, 0.019953;
24, 0.021135;
25, 0.022387;
26, 0.023714;
27, 0.025119;
28, 0.026607;
29, 0.028184;
30, 0.029854;
31, 0.031623;
32, 0.033497;
33, 0.035481;
34, 0.037584;
35, 0.039811;
36, 0.04217;
37, 0.044668;
38, 0.047315;
39, 0.050119;
40, 0.053088;
41, 0.056234;
42, 0.059566;
43, 0.063096;
44, 0.065564;
45, 0.068129;
46, 0.070795;
47, 0.073564;
48, 0.076442;
49, 0.079433;
50, 0.08254;
51, 0.08577;
52, 0.089125;
53, 0.092612;
54, 0.096235;
55, 0.1;
56, 0.103912;
57, 0.107978;
58, 0.112202;
59, 0.116591;
60, 0.121153;
61, 0.125893;
62, 0.130818;
63, 0.135936;
64, 0.141254;
65, 0.14678;
66, 0.152522;
67, 0.158489;
68, 0.16469;
69, 0.171133;
70, 0.177828;
71, 0.184785;
72, 0.192014;
73, 0.199526;
74, 0.207332;
75, 0.215443;
76, 0.223872;
77, 0.232631;
78, 0.241732;
79, 0.251189;
80, 0.258523;
81, 0.266073;
82, 0.273842;
83, 0.281838;
84, 0.290068;
85, 0.298538;
86, 0.307256;
87, 0.316228;
88, 0.325462;
89, 0.334965;
90, 0.344747;
91, 0.354813;
92, 0.365174;
93, 0.375837;
94, 0.386812;
95, 0.398107;
96, 0.409732;
97, 0.421697;
98, 0.43401;
99, 0.446684;
100, 0.459727;
101, 0.473151;
102, 0.486968;
103, 0.501187;
104, 0.515822;
105, 0.530884;
106, 0.546387;
107, 0.562341;
108, 0.578762;
109, 0.595662;
110, 0.613056;
111, 0.630957;
112, 0.649382;
113, 0.668344;
114, 0.68786;
115, 0.707946;
116, 0.728618;
117, 0.749894;
118, 0.771792;
119, 0.794328;
120, 0.817523;
121, 0.841395;
122, 0.865964;
123, 0.891251;
124, 0.917276;
125, 0.944061;
126, 0.971628;
127, 1.;
128, 1.035142;
129, 1.071519;
130, 1.109175;
131, 1.148154;
132, 1.188502;
133, 1.230269;
134, 1.273503;
135, 1.318257;
136, 1.364583;
137, 1.412538;
138, 1.462177;
139, 1.513561;
140, 1.566751;
141, 1.62181;
142, 1.678804;
143, 1.737801;
144, 1.798871;
145, 1.862087;
146, 1.927525;
147, 1.995262;
148, 2.06538;
149, 2.137962;
150, 2.213095;
151, 2.290868;
152, 2.371374;
153, 2.454709;
154, 2.540973;
155, 2.630268;
156, 2.722701;
157, 2.818383;
158, 2.917427;
159, 3.02;
160, 3.12608;
161, 3.235936;
162, 3.349654;
163, 3.467369;
164, 3.589219;
165, 3.715353;
166, 3.845918;
167, 3.981072;
168, 4.;

#197583
Feb 11, 2011 at 7:54am

In a way there is no need to use atodb conversion, as the amplitude values are the result of a scaling inside samplitude which you need to replicate. What Stefans list expresses is that a linear range of db steps (in terms of midi ctl values) should first be given some curvature before eventually doing a dbtoa conversion. And I agree with him that values for an amplitude fader are so important that it is appropriate to define them yourself (although that is not really the issue here). My curve, which I also took from comparison with a(nother) mixing desk, is a little less steep. The conversion I used might be of help. There’s few things to study in the patch below. According to what you describe, there might be a solution there.

– Pasted Max Patch, click to expand. –
#197584
Feb 11, 2011 at 9:13am

I want the Midi value of 0 arrive at 0. -100 dB isn’t close enough…;-)
When I started to look for a formula, there was always the problem with the zero point. To translate the limited number of Midi values into levels, the coll is the most efficient way to do it. For the reverse, this is different. As you would like to keep the resolution within the environment.
I just made a reverse:

– Pasted Max Patch, click to expand. –
#197585
Feb 18, 2011 at 3:42pm

Thank You !!!
It’s good, look at files ” fadercurve “…

#197586
Feb 18, 2011 at 8:47pm

stefan:

max(log10($f1)*20),-90)

(pow(10.$f1*0.05)) * ($f1 != -90.)
 
 
-110

#197587

You must be logged in to reply to this topic.