COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 11-01-2017, 12:21 AM   #1
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default Parameters stored as readable

Hi all,

I'm thinking to switch a bit the logic of Param within IPlug, working always with normalized values and return (when needed) the converted (readable) value. Now it seems it works mainly with readable.

Also the values stored/serialized in the presets are readable. Is there any reasons why them and not normalized ones? (which mean an additional and probably useless) conversion.
Nowhk is offline   Reply With Quote
Old 11-01-2017, 01:56 PM   #2
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default

Why should normalized values used in the presets? The values in IParam are also readable and when serializing params I see no conversion. At some point you have to convert normalized to readable values anyway: when reporting them to the host.
Andi! is offline   Reply With Quote
Old 11-02-2017, 11:10 AM   #3
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Quote:
Originally Posted by Andi! View Post
Why should normalized values used in the presets?
Why shouldn't?

Quote:
Originally Posted by Andi! View Post
The values in IParam are also readable and when serializing params I see no conversion. At some point you have to convert normalized to readable values anyway: when reporting them to the host.
The problem is that you set normalized value (in both case, via Host or GUI/IControl) and I (personally) use only normalized values within plugin/audio processing.

How do you smooth params if not with normalized values? I dunno you use a 1pole filter IIR on "real values". The same for automations: you always go between 0 and 1, THAN (only in the end) you need to wrap on "real value".

Thus, at the moment, control/host set values as normalized, which are than converted on IParam in real values (1 step of "round error"), than I re-convert on normalized (another step), process it (smooth+automation), and than re-re-convert in real value (another step of quantization error).

Basically I use 90% of the times normalized values, converting them often. Also storing on presets will go back/forth one time from real/normalized (having a loss of data so). That's why I feel logic stay always in normalized domain.

If all was normalized, you only quantize one time (when you need to process audio on calculated parameter, after smooth and automation). No less in store, no less in smooth/automation/set.
Nowhk is offline   Reply With Quote
Old 11-08-2017, 04:56 AM   #4
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Bump?
Nowhk is offline   Reply With Quote
Old 11-08-2017, 07:55 AM   #5
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default

Thanks for the bump. :-) Nobody is complaining, you could try to change the behaviour. For me (and maybe dozens others) I had no problems with the rounding "quantization" errors in the past. Most important thing to me would be a massive test with Win/Mac VST2/3, AU and AAX formats including automation read/write and project saving/loading in "all" DAWs.
Andi! is offline   Reply With Quote
Old 11-10-2017, 07:06 AM   #6
ynohtna
Human being with feelings
 
Join Date: Jan 2014
Location: Brighton, UK
Posts: 21
Default

Worrying about the additional conversion in your use case smells like premature optimization to me, mate.

Parameters change infrequently relative to all the computation performed for each audio sample, at least for non-trivial plugins. (Conversely, trivial plugins don't expose as many parameters for automation.)

The first rule of optimisation is: don't worry unnecessarily. The second rule is: profile!

Last edited by ynohtna; 11-10-2017 at 07:11 AM.
ynohtna is offline   Reply With Quote
Old 11-14-2017, 08:35 AM   #7
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Quote:
Originally Posted by ynohtna View Post
Worrying about the additional conversion in your use case smells like premature optimization to me, mate.

Parameters change infrequently relative to all the computation performed for each audio sample, at least for non-trivial plugins. (Conversely, trivial plugins don't expose as many parameters for automation.)

The first rule of optimisation is: don't worry unnecessarily. The second rule is: profile!
Not really "premature" I do need to retrieve dynamically the param's normalized value at audio rate, applying mod and smooth.

If you GetNormalized() (without cache it, so applying From/ToNormalize functions) on 200 params for 64 voices, well, a bit of CPU will increase, uselessly.

And re-design the whole, caching this calculated (from steppy) normalized value, could introduce some problems; that's why I asked why the whole logic are with "readable" values. But I think to have edited finally the framework, so I can work with cached normalized values at any time
Nowhk is offline   Reply With Quote
Old 11-14-2017, 09:18 AM   #8
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default

Quote:
Originally Posted by Nowhk View Post
If you GetNormalized() (without cache it...
I "automatically" cache the parameters in OnParamChange into an e.g. mGain (and maybe other depending) variables in the format that I need in the audio processing. Why caching it additionally ?
Andi! is offline   Reply With Quote
Old 11-14-2017, 09:51 AM   #9
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Quote:
Originally Posted by Andi! View Post
I "automatically" cache the parameters in OnParamChange into an e.g. mGain (and maybe other depending) variables in the format that I need in the audio processing. Why caching it additionally ?
Set new values request to Param can come from Host or GUI (which is covered by OnParamChange, and you are ok), but if you have internal automation on param (such LFO->Param1->Param2), you would update all of theirs supporting variables constantly, which introduce even more confusion and knots.

Since the origin is unique, I feel better to keep the updated value from the source where it change, its more straightforward...
Nowhk is offline   Reply With Quote
Old 11-14-2017, 10:03 AM   #10
Andi!
Human being with feelings
 
Andi!'s Avatar
 
Join Date: Nov 2015
Location: Germany
Posts: 82
Default

Quote:
Originally Posted by Nowhk View Post
...but if you have internal automation on param (such LFO->Param1->Param2)...
And why are these IParams and not just internal parameters/variables ?
Andi! is offline   Reply With Quote
Old 11-14-2017, 10:50 AM   #11
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Quote:
Originally Posted by Andi! View Post
And why are these IParams and not just internal parameters/variables ?
Because... they are parameters They can be modulare by Host or GUI as well. Mod that go in serial/parallel with internal and external triggers... all linking are n-m.
Nowhk 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 07:03 AM.


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