Wanna make pedal curve linear.

Sacco

2015-09-11 10:13:02

Hi.

I have this Ernie Ball Pedal I wanted for Strings dynamic control (CC11). Unfortunately it doesn't have a linear curve, but a rather exponential curve.

Is there a way to translate that and make the response curve linear in MT using some kind of rules?

florian

2015-09-11 10:56:36

Can you post the MIDI log for a steady movement from minimum to maximum? See the Log Window (from the View menu) in MIDI Translator and only activate MIDI IN. Then I may find matching Rules for undoing the exponential curve.
Thanks,
Florian

Sacco

2015-09-11 17:40:45

Here you go, is just 0 to 127 (CC7)..thanks Florian :)

Code: Select all

42421: MIDI IN [Keystation 88]: B0 07 00
42422: MIDI IN [Keystation 88]: B0 07 01
42423: MIDI IN [Keystation 88]: B0 07 02
42424: MIDI IN [Keystation 88]: B0 07 03
42425: MIDI IN [Keystation 88]: B0 07 04
42426: MIDI IN [Keystation 88]: B0 07 05
42427: MIDI IN [Keystation 88]: B0 07 06
42428: MIDI IN [Keystation 88]: B0 07 07
42429: MIDI IN [Keystation 88]: B0 07 08
42430: MIDI IN [Keystation 88]: B0 07 09
42431: MIDI IN [Keystation 88]: B0 07 0A
42432: MIDI IN [Keystation 88]: B0 07 0B
42433: MIDI IN [Keystation 88]: B0 07 0C
42434: MIDI IN [Keystation 88]: B0 07 0D
42435: MIDI IN [Keystation 88]: B0 07 0E
42436: MIDI IN [Keystation 88]: B0 07 0F
42437: MIDI IN [Keystation 88]: B0 07 10
42438: MIDI IN [Keystation 88]: B0 07 11
42439: MIDI IN [Keystation 88]: B0 07 12
42440: MIDI IN [Keystation 88]: B0 07 13
42441: MIDI IN [Keystation 88]: B0 07 14
42442: MIDI IN [Keystation 88]: B0 07 15
42443: MIDI IN [Keystation 88]: B0 07 16
42444: MIDI IN [Keystation 88]: B0 07 17
42445: MIDI IN [Keystation 88]: B0 07 18
42446: MIDI IN [Keystation 88]: B0 07 19
42447: MIDI IN [Keystation 88]: B0 07 1A
42448: MIDI IN [Keystation 88]: B0 07 1B
42449: MIDI IN [Keystation 88]: B0 07 1C
42450: MIDI IN [Keystation 88]: B0 07 1D
42451: MIDI IN [Keystation 88]: B0 07 1E
42452: MIDI IN [Keystation 88]: B0 07 1F
42453: MIDI IN [Keystation 88]: B0 07 21
42454: MIDI IN [Keystation 88]: B0 07 22
42455: MIDI IN [Keystation 88]: B0 07 23
42456: MIDI IN [Keystation 88]: B0 07 25
42457: MIDI IN [Keystation 88]: B0 07 26
42458: MIDI IN [Keystation 88]: B0 07 28
42459: MIDI IN [Keystation 88]: B0 07 2A
42460: MIDI IN [Keystation 88]: B0 07 2B
42461: MIDI IN [Keystation 88]: B0 07 2D
42462: MIDI IN [Keystation 88]: B0 07 2F
42463: MIDI IN [Keystation 88]: B0 07 31
42464: MIDI IN [Keystation 88]: B0 07 33
42465: MIDI IN [Keystation 88]: B0 07 35
42466: MIDI IN [Keystation 88]: B0 07 37
42467: MIDI IN [Keystation 88]: B0 07 39
42468: MIDI IN [Keystation 88]: B0 07 3B
42469: MIDI IN [Keystation 88]: B0 07 3D
42470: MIDI IN [Keystation 88]: B0 07 3F
42471: MIDI IN [Keystation 88]: B0 07 41
42472: MIDI IN [Keystation 88]: B0 07 42
42473: MIDI IN [Keystation 88]: B0 07 44
42474: MIDI IN [Keystation 88]: B0 07 46
42475: MIDI IN [Keystation 88]: B0 07 48
42476: MIDI IN [Keystation 88]: B0 07 49
42477: MIDI IN [Keystation 88]: B0 07 4B
42478: MIDI IN [Keystation 88]: B0 07 4C
42479: MIDI IN [Keystation 88]: B0 07 4E
42480: MIDI IN [Keystation 88]: B0 07 4F
42481: MIDI IN [Keystation 88]: B0 07 51
42482: MIDI IN [Keystation 88]: B0 07 52
42483: MIDI IN [Keystation 88]: B0 07 54
42484: MIDI IN [Keystation 88]: B0 07 55
42485: MIDI IN [Keystation 88]: B0 07 56
42486: MIDI IN [Keystation 88]: B0 07 58
42487: MIDI IN [Keystation 88]: B0 07 59
42488: MIDI IN [Keystation 88]: B0 07 5A
42489: MIDI IN [Keystation 88]: B0 07 5B
42490: MIDI IN [Keystation 88]: B0 07 5C
42491: MIDI IN [Keystation 88]: B0 07 5D
42492: MIDI IN [Keystation 88]: B0 07 5F
42493: MIDI IN [Keystation 88]: B0 07 60
42494: MIDI IN [Keystation 88]: B0 07 61
42495: MIDI IN [Keystation 88]: B0 07 62
42496: MIDI IN [Keystation 88]: B0 07 63
42497: MIDI IN [Keystation 88]: B0 07 64
42498: MIDI IN [Keystation 88]: B0 07 65
42499: MIDI IN [Keystation 88]: B0 07 66
42500: MIDI IN [Keystation 88]: B0 07 67
42501: MIDI IN [Keystation 88]: B0 07 68
42502: MIDI IN [Keystation 88]: B0 07 69
42503: MIDI IN [Keystation 88]: B0 07 6A
42504: MIDI IN [Keystation 88]: B0 07 6B
42505: MIDI IN [Keystation 88]: B0 07 6C
42506: MIDI IN [Keystation 88]: B0 07 6D
42507: MIDI IN [Keystation 88]: B0 07 6E
42508: MIDI IN [Keystation 88]: B0 07 6F
42509: MIDI IN [Keystation 88]: B0 07 70
42510: MIDI IN [Keystation 88]: B0 07 71
42511: MIDI IN [Keystation 88]: B0 07 72
42512: MIDI IN [Keystation 88]: B0 07 73
42513: MIDI IN [Keystation 88]: B0 07 74
42514: MIDI IN [Keystation 88]: B0 07 75
42515: MIDI IN [Keystation 88]: B0 07 76
42516: MIDI IN [Keystation 88]: B0 07 77
42517: MIDI IN [Keystation 88]: B0 07 78
42518: MIDI IN [Keystation 88]: B0 07 79
42519: MIDI IN [Keystation 88]: B0 07 7A
42520: MIDI IN [Keystation 88]: B0 07 7B
42521: MIDI IN [Keystation 88]: B0 07 7C
42522: MIDI IN [Keystation 88]: B0 07 7D
42523: MIDI IN [Keystation 88]: B0 07 7E
42524: MIDI IN [Keystation 88]: B0 07 7F

florian

2015-09-11 18:09:59

Hi Sacco. Thanks, but I cannot see an exponential curve! Could you activate timestamps in the Log Window and then repeat the test? Important is that you move the fader very steadily with the same speed from bottom to top.
Thanks!
Florian

Sacco

2015-09-11 18:26:20

Aha I suspected you needed the timestamps.

Here's a sweep, as accurate as I could possibly do:

Code: Select all

30411721 - MIDI IN [Keystation 88]: B0 07 01
30411758 - MIDI IN [Keystation 88]: B0 07 02
30411802 - MIDI IN [Keystation 88]: B0 07 03
30411843 - MIDI IN [Keystation 88]: B0 07 04
30411876 - MIDI IN [Keystation 88]: B0 07 05
30411908 - MIDI IN [Keystation 88]: B0 07 06
30411953 - MIDI IN [Keystation 88]: B0 07 07
30411994 - MIDI IN [Keystation 88]: B0 07 08
30412035 - MIDI IN [Keystation 88]: B0 07 09
30412084 - MIDI IN [Keystation 88]: B0 07 0A
30412124 - MIDI IN [Keystation 88]: B0 07 0B
30412157 - MIDI IN [Keystation 88]: B0 07 0C
30412189 - MIDI IN [Keystation 88]: B0 07 0D
30412222 - MIDI IN [Keystation 88]: B0 07 0E
30412255 - MIDI IN [Keystation 88]: B0 07 0F
30412287 - MIDI IN [Keystation 88]: B0 07 10
30412357 - MIDI IN [Keystation 88]: B0 07 11
30412426 - MIDI IN [Keystation 88]: B0 07 12
30412491 - MIDI IN [Keystation 88]: B0 07 13
30412544 - MIDI IN [Keystation 88]: B0 07 14
30412609 - MIDI IN [Keystation 88]: B0 07 15
30412683 - MIDI IN [Keystation 88]: B0 07 16
30412756 - MIDI IN [Keystation 88]: B0 07 17
30412821 - MIDI IN [Keystation 88]: B0 07 18
30412870 - MIDI IN [Keystation 88]: B0 07 19
30412931 - MIDI IN [Keystation 88]: B0 07 1A
30412980 - MIDI IN [Keystation 88]: B0 07 1B
30413009 - MIDI IN [Keystation 88]: B0 07 1C
30413033 - MIDI IN [Keystation 88]: B0 07 1D
30413058 - MIDI IN [Keystation 88]: B0 07 1E
30413078 - MIDI IN [Keystation 88]: B0 07 1F
30413102 - MIDI IN [Keystation 88]: B0 07 20
30413123 - MIDI IN [Keystation 88]: B0 07 21
30413135 - MIDI IN [Keystation 88]: B0 07 22
30413147 - MIDI IN [Keystation 88]: B0 07 23
30413159 - MIDI IN [Keystation 88]: B0 07 24
30413176 - MIDI IN [Keystation 88]: B0 07 25
30413184 - MIDI IN [Keystation 88]: B0 07 26
30413196 - MIDI IN [Keystation 88]: B0 07 27
30413208 - MIDI IN [Keystation 88]: B0 07 28
30413220 - MIDI IN [Keystation 88]: B0 07 29
30413229 - MIDI IN [Keystation 88]: B0 07 2A
30413241 - MIDI IN [Keystation 88]: B0 07 2B
30413249 - MIDI IN [Keystation 88]: B0 07 2C
30413262 - MIDI IN [Keystation 88]: B0 07 2D
30413270 - MIDI IN [Keystation 88]: B0 07 2E
30413282 - MIDI IN [Keystation 88]: B0 07 2F
30413290 - MIDI IN [Keystation 88]: B0 07 30
30413302 - MIDI IN [Keystation 88]: B0 07 31
30413315 - MIDI IN [Keystation 88]: B0 07 32
30413327 - MIDI IN [Keystation 88]: B0 07 33
30413339 - MIDI IN [Keystation 88]: B0 07 34
30413347 - MIDI IN [Keystation 88]: B0 07 35
30413359 - MIDI IN [Keystation 88]: B0 07 36
30413367 - MIDI IN [Keystation 88]: B0 07 37
30413380 - MIDI IN [Keystation 88]: B0 07 38
30413392 - MIDI IN [Keystation 88]: B0 07 39
30413400 - MIDI IN [Keystation 88]: B0 07 3A
30413408 - MIDI IN [Keystation 88]: B0 07 3B
30413417 - MIDI IN [Keystation 88]: B0 07 3C
30413429 - MIDI IN [Keystation 88]: B0 07 3D
30413437 - MIDI IN [Keystation 88]: B0 07 3E
30413445 - MIDI IN [Keystation 88]: B0 07 3F
30413453 - MIDI IN [Keystation 88]: B0 07 40
30413461 - MIDI IN [Keystation 88]: B0 07 41
30413474 - MIDI IN [Keystation 88]: B0 07 42
30413482 - MIDI IN [Keystation 88]: B0 07 43
30413489 - MIDI IN [Keystation 88]: B0 07 44
30413502 - MIDI IN [Keystation 88]: B0 07 45
30413510 - MIDI IN [Keystation 88]: B0 07 46
30413518 - MIDI IN [Keystation 88]: B0 07 47
30413530 - MIDI IN [Keystation 88]: B0 07 48
30413539 - MIDI IN [Keystation 88]: B0 07 49
30413551 - MIDI IN [Keystation 88]: B0 07 4A
30413559 - MIDI IN [Keystation 88]: B0 07 4B
30413571 - MIDI IN [Keystation 88]: B0 07 4C
30413584 - MIDI IN [Keystation 88]: B0 07 4D
30413595 - MIDI IN [Keystation 88]: B0 07 4E
30413607 - MIDI IN [Keystation 88]: B0 07 4F
30413624 - MIDI IN [Keystation 88]: B0 07 50
30413637 - MIDI IN [Keystation 88]: B0 07 51
30413649 - MIDI IN [Keystation 88]: B0 07 52
30413665 - MIDI IN [Keystation 88]: B0 07 53
30413681 - MIDI IN [Keystation 88]: B0 07 54
30413702 - MIDI IN [Keystation 88]: B0 07 55
30413718 - MIDI IN [Keystation 88]: B0 07 56
30413734 - MIDI IN [Keystation 88]: B0 07 57
30413751 - MIDI IN [Keystation 88]: B0 07 58
30413763 - MIDI IN [Keystation 88]: B0 07 59
30413779 - MIDI IN [Keystation 88]: B0 07 5A
30413795 - MIDI IN [Keystation 88]: B0 07 5B
30413812 - MIDI IN [Keystation 88]: B0 07 5C
30413824 - MIDI IN [Keystation 88]: B0 07 5D
30413836 - MIDI IN [Keystation 88]: B0 07 5E
30413852 - MIDI IN [Keystation 88]: B0 07 5F
30413864 - MIDI IN [Keystation 88]: B0 07 60
30413881 - MIDI IN [Keystation 88]: B0 07 61
30413893 - MIDI IN [Keystation 88]: B0 07 62
30413905 - MIDI IN [Keystation 88]: B0 07 63
30413918 - MIDI IN [Keystation 88]: B0 07 64
30413926 - MIDI IN [Keystation 88]: B0 07 65
30413938 - MIDI IN [Keystation 88]: B0 07 66
30413946 - MIDI IN [Keystation 88]: B0 07 67
30413958 - MIDI IN [Keystation 88]: B0 07 68
30413970 - MIDI IN [Keystation 88]: B0 07 69
30413978 - MIDI IN [Keystation 88]: B0 07 6A
30413986 - MIDI IN [Keystation 88]: B0 07 6B
30413995 - MIDI IN [Keystation 88]: B0 07 6C
30414003 - MIDI IN [Keystation 88]: B0 07 6D
30414011 - MIDI IN [Keystation 88]: B0 07 6E
30414019 - MIDI IN [Keystation 88]: B0 07 6F
30414027 - MIDI IN [Keystation 88]: B0 07 70
30414035 - MIDI IN [Keystation 88]: B0 07 71
30414043 - MIDI IN [Keystation 88]: B0 07 72
30414052 - MIDI IN [Keystation 88]: B0 07 73
30414060 - MIDI IN [Keystation 88]: B0 07 74
30414068 - MIDI IN [Keystation 88]: B0 07 75
30414072 - MIDI IN [Keystation 88]: B0 07 76
30414080 - MIDI IN [Keystation 88]: B0 07 77
30414089 - MIDI IN [Keystation 88]: B0 07 78
30414093 - MIDI IN [Keystation 88]: B0 07 79
30414100 - MIDI IN [Keystation 88]: B0 07 7A
30414109 - MIDI IN [Keystation 88]: B0 07 7B
30414113 - MIDI IN [Keystation 88]: B0 07 7C
30414121 - MIDI IN [Keystation 88]: B0 07 7D
30414130 - MIDI IN [Keystation 88]: B0 07 7E
30414138 - MIDI IN [Keystation 88]: B0 07 7F

florian

2015-09-12 12:34:35

Hi,
thanks. It's always difficult to guess the formula of a controller response. Here it is visualized:
ControllerResponse_Original.jpg
ControllerResponse_Original.jpg (35.92 KiB) Viewed 9861 times
It almost seems like it is composed of 2 linear lines. So to simplify matters, I correct the curve in two steps: the first part of the response is made steeper, and the second part less steep.

First part:
I found that the point of change is CC value 33, occurring after 1402ms. Now with a linear curve, given that the total time from 0 to 127 took 2417ms, the linear point at time 1402 would be 73.7. So now we need to expand the range from 0...33 to 0..74. This is done with 2 rules like that:

Code: Select all

// calculate pp/33*73.7
pp=pp*737
pp=pp/330
Note: because MT Pro's rules do not support decimal numbers, we need to first multiply and then divide. Otherwise, we would have big rounding errors. Also, in order to have a bit more resolution, I multiply with 737 (for 73.7) and then divide by 330 instead of 33. This is the same as multiplying by 73.7 and dividing by 33.

Second part:
For the range from 34 and above, the next mapped value from the first part would be 76. So here, we need to map the range from 34..127 to 76..127:

Code: Select all

// calculate ((pp-34) / (127-34) * (127-76)) + 76
pp=pp-34
pp=pp*51
pp=pp/93
pp=pp+76
Now the mapped curve looks like this:
ControllerResponse_Fixed.jpg
ControllerResponse_Fixed.jpg (36.19 KiB) Viewed 9861 times
Not 100% linear, but much better :)

Putting it all together

Code: Select all

[x] Translator: Map Controller Response Curve
Incoming: Control Change on channel 1 with CC#:7 (0x07) set 'pp' to value
Rules:
  if pp>33 then Goto "SecondPart"
  // calculate pp/33*73.7
  pp=pp*737
  pp=pp/330
  exit rules, execute Outgoing Action
  Label "SecondPart"
  // calculate ((pp-34) / (127-34) * (127-76)) + 76
  pp=pp-34
  pp=pp*51
  pp=pp/93
  pp=pp+76
Outgoing: Control Change on channel 1 with CC#:7 (0x07) and value:pp
Attached is the MT Pro project file.
Attachments
MapControllerResponse.bmtp
(1.21 KiB) Downloaded 105 times

Sacco

2015-09-12 16:12:39

Hi Florian. Thanks a lot for all that :)

One question, how did you plot the graphs?

I wanna try with a perfectly exponential curve (assuming I made tiny errors while moving the pedal) and flatten to linear.

florian

2015-09-12 16:34:58

I honestly don't think that your controller generates a true exponential response. It would look much more like a curve and not like two straight lines. It's also likely that the Rules of my previous post will feel like a linear response. MIDI's resolution is low, so that the small errors are not likely to be noticed.

But of course you can give it a try. Attached is the LibreOffice/OpenOffice spreadsheet I used for plotting the graphs (and for testing the mapping). A is original timestamp, B is original hex CC value, C is shifted timestamp, D is is decimal CC value, E is mapped linear CC value.

Be aware, however, that MT Pro does not have logarithmic functions (for undoing an exponential function). For arbitrary mappings for which you cannot find a mathematical representation, the last resort is to use a series of IF statements to manually convert each controller value to the mapped value:

Code: Select all

Incoming: Control Change on channel 1 with CC#:7 (0x07) set 'pp' to value
Rules:
  if pp=0 then qq=0
  if pp=1 then qq=2
  if pp=2 then qq=4
  if pp=3 then qq=7
  (...)
Outgoing: Control Change on channel 1 with CC#:7 (0x07) and value:qq
Be aware to use different local variables here, because otherwise rule 2 would set pp to 2, causing line 3 to match, too, setting pp to 4, etc.

Regards,
Florian
Attachments
Controller_Response_Curve.ods
(40.48 KiB) Downloaded 101 times

Sacco

2015-09-12 16:40:34

I honestly don't think that your controller generates a true exponential response. It would look much more like a curve and not like two straight lines.
is hard to tell.. Is also very hard to move the pedal without varying the speed. I tried with both my hands and tried to keep the speed as accurate as possible but is still hard. :)

I'm gonna try your results first and see if the pedal is now more comfortable.

Sacco

2015-09-12 18:27:44

Awesome, I can see how the values differ and how things gets calculated in the log :)

I saw your spreadsheet. I see this order:

system Timestamp/Hex Values/Time(ms)/IN Value/OUT Value...am I right?

Did you have to enter those numbers manually? :O

I wanna try myself here trying to move the pedal until I get an accurate read.

What should I do with the log data? can I copy and paste that somehow in the spreadsheet?

You can answer later, is now weekend :)

I think I can see why you say is two lines. Seems like even with my inaccurate bit of "wobble" there are two lines, hmmm!!. Can a potentiometer do that? This is a 25K Ohm VP Junior Ernie Ball Pedal.

http://www.ernieball.com/products/guita ... lectronics

http://www.ernieball.com/faq?category=529

Q: What are the values of the potentiometers that you use in your pedals, and are they audio or linear taper?

A: VP line potentiometers: 25K Stereo Audio (log) taper, 250K Mono Audio (log) taper, 500K Stereo Linear taper; VPJR line potentiometers: 25K Mono Audio (log) taper, 250K Mono Audio (log) taper

florian

2015-09-13 10:51:12

Hi Sacco,
have you worked with spreadsheets before? except for the first two columns (which I pasted from the data you posted), everything else is calculated using formulas in the cells. Check the cell formula field at the top of the program window under the toolbutton area. Anyway, your derived order is right (what I meant with A...B...C... etc. in my previous post).

About the potentiometers, I guess physically it's definitely possible that it delivers two linear ranges (the point of change might even be exactly at the center). But I am not an electronics engineer! Anyway, keep in mind that there is also the part where your keyboard(?) converts the pedal's voltage to MIDI CC. That digitizing process could be non-linear, too (or, logarithmic, to somewhat undo the assumed exponential curve of the pedal).

Regards,
Florian