COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 02-12-2018, 09:57 AM   #1
jan hase
Human being with feelings
 
Join Date: Jul 2017
Posts: 13
Default IKnobMultiControl MiddlePosition/StartValue

Hey everyone,

I recognized that in IPlugEffect the Gain initial Value is set to 50. (max Value = 100, min Val = 0) so i expect the GainKnob to point 12 oclock, but it points somewhere at 2 oclock

http://www.martin-finke.de/blog/arti...rst-plugin.jpg

so that from 0 t0 50 it turns around 120° but from 50 to 100 only 70°, so the values from 0 to 100 are note equally (linearly) spread across the Knobs circumference.
so i want, that when the defaultval is set to 50 and the maxval is set to 100 and minVal to 0, that the knob points 12 oclock(north), i mean that all values are spaced linearly across the circumference of the knob.
oh boy, i hope you get what i mean ^^
jan hase is offline   Reply With Quote
Old 02-12-2018, 11:02 AM   #2
Qrchack
Human being with feelings
 
Qrchack's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 4
Default

Have a look inside IPlugEffect.cpp

Code:
  GetParam(kGain)->InitDouble("Gain", 50., 0., 100.0, 0.01, "%");
  GetParam(kGain)->SetShape(2.);
We're initializing at 50 with a range of 0-100, however straight away we're calling SetShape() to achieve a logarithmic response. The reason for that is a few lines later:

Code:
  double* in1 = inputs[0];
  double* in2 = inputs[1];
  double* out1 = outputs[0];
  double* out2 = outputs[1];

  for (int s = 0; s < nFrames; ++s, ++in1, ++in2, ++out1, ++out2)
  {
    *out1 = *in1 * mGain;
    *out2 = *in2 * mGain;
  }
The value of mGain is taken as-is, and we're using the linear to logarithmic conversion built right into parameters in IPlug.

SetShape() isn't yet documented on the live documentation (I have it almost done on my local machine), but I talked with Oli about it and the response is y = x^(1/shape), with a default value of 1. so it just passes through. No wonder you got about 2 oclock, a value of 0.5 (50/100) gives 0.5^(1/2)=0.7

Here's a graph of what we're doing:

Qrchack is offline   Reply With Quote
Old 02-13-2018, 04:01 AM   #3
jan hase
Human being with feelings
 
Join Date: Jul 2017
Posts: 13
Default

Hey QrChack,

Thank you for detailed awesome answer!

i just set "setshape(2.)" to GetParam(kGain)->SetShape(1); then y = x^(1/1) which is y = x. et voila! works just fine
jan hase is offline   Reply With Quote
Old 02-14-2018, 01:44 PM   #4
Qrchack
Human being with feelings
 
Qrchack's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 4
Default

You can get rid of SetShape(1), it's the default value anyway
Qrchack is offline   Reply With Quote
Old 02-18-2018, 01:13 PM   #5
jan hase
Human being with feelings
 
Join Date: Jul 2017
Posts: 13
Default

even better, ty
jan hase is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.