Jump to content

DESIGN BUG: Gain knob on MIDI tracks


JohnK

Recommended Posts

All midi VSTi's are not created the same!  I was using Trillion last night MIDI volume has no effect on it.  Velocity changes between 4  sample sets no variation. It just jumps to the next set.  CC11 has volume change. The only volume control is in the audio out. and CC11 

What will you use to play your sound fonts through?

 

EDIT->

Did you read about CSMultiCompander?

Also Cakewalk MIDI Velocity has volume scale %  (like add 10%)

https://viramor.com/

 

Edited by Max Arwood
Link to comment
Share on other sites

2 hours ago, Max Arwood said:

All midi VSTi's are not created the same!  I was using Trillion last night MIDI volume has no effect on it.  Velocity changes between 4  sample sets no variation. It just jumps to the next set.  CC11 has volume change. The only volume control is in the audio out. and CC11 

What will you use to play your sound fonts through?

EDIT->

Did you read about CSMultiCompander?

Also Cakewalk MIDI Velocity has volume scale %  (like add 10%)

https://viramor.com/

We can not expect Cakewalk to work with VSTi that break the rules or are broken. i.e. do not listen/respond to CC7.

As for CSMultiCompander, I responded to that in the very post just before before yours! And when I get around to expanding on my concept, it will be much clearer why this control will not do the same.

Link to comment
Share on other sites

oops... forgot to answer your question regarding what I use to play soundfonts through, I use BassMIDIVsti. See my other post:

I am not sure if the dev has updated the public release version to fix an issue with it working specifically with Cakewalk (a sample rate dif), but I have a version the dev gave me to test, and it works 100%.  

Link to comment
Share on other sites

Here are the details I have been promising.

The concept is to mimic gain on audio as closely as possible using MIDI. That gives us 3 main adjustments. Volume (CC07), Expression (CC11 ignoring fine) and Velocity (Velocity of note on). By turning the gain, a formula can be used to adjust (i.e. scale up or down) each of these, so as to implement a virtual MIDI gain by adjusting the 3 aforementioned parameters.

To mimic audio gain, I have set the markers/limits to be the exact same as audio gain. i.e. -18 to +18.  The following is the MIDI gain at the three different positions. Exactly like Audio gain.

1298153566_gainDial.png.b8b1ca726fd96e36bb555c824276d49e.png

The amount dialed in would scale each parameter in a % type calculation proportional to the amount the dial is turned. There would be break-points in the dial, where different types of adjustments would kick in. NOTE: The break points I chose are pretty arbitrary and there could be thousands of different options that should be investigated during final implementation. The following is simply a “straw man” to be able to talk to something.

The amount they kick in is proportion to how much the dial is turned and the value is based on the actual recorded MIDI value, multiplied by the dial amount (i.e. a scaling factor). The adjustment would be done on the fly, and not show up on the corresponding sliders. e.g. if the dial causes the volume to increase, the volume slider remains wherever you set it, but Cakewalk will send the calculated value to the synth.

For -18 to 0, I think we could use the no-brainer of simply adjusting the volume i.e. CC07.  The other parameters (i.e. Expression and velocity do not need to be altered as volume overrides them. Then, I think that from 0 to say 6, the volume would be increased to a max at a gain of 6. From 6 to 12, the expression is increased. And finally, from 12 to 18, the velocity is increased. All these increases are a % (multiplication) of the original value up to the max value  i.e.127).

This next picture/graph shows one example of the dial being turned up (the X axis), and the effects on the values of the  three parameters (Y Axis). n this example all the input values are at 64 (as can be seen by the values at Gain=0), and the MIDI Gain dial is turned up from left (-18) to right (+18)

335114006_dialturninggraph.png.d35595e9018d23db059ba426503e7ae6.png

An interesting thing I realised, when the dial is at the extreme max, the velocity goes to 127, which on many patches changes the timbre, possibly in a similar sounding way to clipping/distortion on audio gain behaves when its too high.

 

Now the calcs

The BIG thing to remember here is that ALL the following complexity is hidden from the user.

In my formulae below, a “v” at the end denotes the current recorded value. And an “n” denotes the new calculated value that is sent to the device.

Note, the break points I chose are kind of arbitrary and these would be adjusted to make the knob act in a more natural sounding manner. For example, the break-points would probably sound smoother if there was overlap.

Also note that the values used are at the exact point in time. So if an envelope is on expression, then the envelope would be scaled as per the formulae.

CC07v = VOLUMEv = Current Volume slider value (min of 0 to max of 127) Could be set by an envelope

CC11v = EXPRESSIONv = Current value of expression (usually set by an envelope), 127 used if no expression is set.

VELOCITYv =Velocity of the current MIDI note on

KNOBv = Gain knob value [-18 to 0 to +18.0. Which matches the track audio gain  knob]

 

The following image simply shows the Gain ranges used below in the calcs.

594406463_knobpositions.thumb.png.82835e9dcdc30c7257b8290caa489f54.png

Knob Range of -18.0 to 0.0

CC07n=((18 + KNOBv) / 18) x VOLUMEv [for 0.0 it goes to 1.0 * VOLUMEv = VOLUMEv = CC07v)s

CC11 = CC11

VELOCITYn = VELOCITYv

 

Knob Range of 0.0 to +6.0

CC07n = (KNOBv / 6) x (127-VOLUMEv)

CC11n = CC11v

VELOCITYn = VELOCITYv

 

Knob Range of +6.0 to +12.0

CC07n =127

CC11n = EXPRESSIONv + (KNOBv -6) / 6 x (127  - EXPRESSIONv)

VELOCITYn = VELOCITYv

 

Knob Range of +12.0 to +18.0

CC07 = 127

CC11 = 127

VELOCITYn = VELOCITYv + (KNOBv -12) / 6 x (127  - VELOCITYv)

 

The Results:

For clarity, from the above formulae, I have created a spreadsheet showing some randomly selected values. And made it pretty with colours. I didn’t bother showing -18 to 0 as it is simply Volume that changes from 0 to the current value set by the volume slider, and all others stay unchanged. The 3 columns on the left are the MIDI values , while the top row 0 to +18 is the gain knob value.

190564347_colouredspreadsheet.png.1b4dcc6c909d0dd8980d485b7b28198a.png

Hopefully all the above is clear, and I didn't make too many typos.

Edited by John Kalabric
spelling, add image
  • Like 1
Link to comment
Share on other sites

1 hour ago, JoseC said:

Interesting work. Why didn´t you use -127 to +127? I do not really get why use the scale used for audio,, that is logarithmic, instead of midi values, that are a linear scale. 

if you are talking about the gain knob, then that is to duplicate Audio gain. i explained that in the text. By keeping the interface the same, people may feel more comfortable with the familiar, and less confused. Having "gain" on a MIDI track is the real start of the issue. i.e. consistency in the interface design. And -127 to +127 doesn't really mean as much, when in reality I am crossing 3 parameters, each of which is adjustable by -127 to +127, so if you wish to talk MIDI ranges, we are heading into MSB & LSB territory, and a range somewhere between -384 and +384.

The actual values of the scale are completely irrelevant. Its simply a label, and I used the values of that label as placeholders to show what I mean. If its -18 to +18 or -127 to +127 is irrelevant to the central concept. i.e. mapping & scaling multiple MIDI controls, off of a single knob. I am fine with whatever scale. Its a detail that could be finalised at anytime.

Simply replace -127 where you see -18 (and also the fractional breakpoints, and the +ve's versions) and all the math's stays the same. The real contentious issue would be the breakpoints & over lapping the breakpoints etc etc. For example, I know I personally only use expression in a very limited way, so, overlapping volume and Velocity over the Expression part would have more of a predictable effect, in most of my own projects.

I was going to do another drawing of the breakpoints graph (with overlapping), but then I realised that would simply add more confusion and distract from the simple idea of combining the three values, into one end result, controlled by one value (i.e. the gain knob).

PS: that logarithmic scale of audio gain, provided me the markers I presented above. i.e. -18, -12, -6, 0 etc etc in what I think are an angular linear delta. The interface is the important part of duplicating Audio gain. Currently its using velocity alone, which could even be negative.

Link to comment
Share on other sites

Obviously you put a lot of time into developing and writing up the details. Maybe I missed it before, but for the first time in this thread I see that you want the knob to be non-linear (I think). Also, the explanation helps get at a question I wondered about--what does your proposed knob do to handle bumping up against the upper and lower limits (127 and 0).

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...