COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 08-29-2018, 10:49 AM   #1
teatime
Human being with feelings
 
teatime's Avatar
 
Join Date: Aug 2016
Location: South Africa
Posts: 44
Default Multiple sets of identical controls

Good day
Can someone verify for me please that I am understanding IPlug correctly? I'm building a midi sequencer which will allow the creation of 16 midi patterns, with each pattern having identical controls.

If each pattern has x controls, would I need 16x entries in EParams? Typing this now I realise I can maybe do some voodoo with having a different class in charge of remembering all the values, with the on-screen controls only editing the values for the active pattern, but that would then mean automation would not work?
Thanks
-tea

(using wdl-ol)
teatime is offline   Reply With Quote
Old 08-29-2018, 11:24 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

If you need automation, you likely will have to have a separate parameter for each thing. Plugins with hundreds or even thousands of parameters are not rare. But you might want to automate creating the parameters in some manner in those cases using a for loop or similar. I doubt IPlug forces you to manually write out each parameter separately in the code. (But if it actually does, then you probably want to write some script in Python or other scripting language to generate the needed C++ code.)

I don't use IPlug myself, so this is not tested but something like this should work to initialize tons of parameters :

Code:
MyPlug::MyPlug(IPlugInstanceInfo instanceInfo):
  IPLUG_CTOR(1000, 0, instanceInfo)
  
{
  TRACE;
  char parname[100];
  for (int i=0;i<1000;++i)
  {
    sprintf(parname, "Parameter %d",i);
    GetParam(i)->InitDouble(parname, 0.5, 0., 1., 0.001);
  }
You don't really have to use the EParams enum, it's just convenient to have to be easily able to get the relevant parameter indexes if you have a reasonable amount of parameters.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 08-29-2018 at 12:24 PM.
Xenakios is offline   Reply With Quote
Old 08-29-2018, 01:01 PM   #3
teatime
Human being with feelings
 
teatime's Avatar
 
Join Date: Aug 2016
Location: South Africa
Posts: 44
Default

Mmm, good plan, thanks! I forgot I can use code to generate code, that should make life easier. Back of the envelope calculation shows I'm going to need roughly 6400 parameters, so definitely not doing THAT by hand.
teatime is offline   Reply With Quote
Old 08-29-2018, 01:41 PM   #4
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

yep, and if you are using an enum to keep track of param ids, entries don't have to be consecutive.

i regularly do stuff like this...

...
kHarmonicStart,
kOverDrive = kHarmonicStart + NUM_HARMONICS,
kNumParams
}

HOWEVER, I think that if you are about to create a plugin with 6400 parameters you should think twice. How important is it that those parameters for each MIDI pattern are visible as parameters to the DAW? Would someone want to automate one of those or control it from the DAW somehow (i.e. quickcontrols)? If the answer is no, or the answer is "i don't want to give the user that option", use chunks and serialize the state of your patterns without exposing so many parameters to the user.

oli
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 08-30-2018, 09:01 AM   #5
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

If you decide to go with the "tons of parameters" approach, take note that it probably isn't a good idea to create corresponding IControls for each one, if they are not visible to the user at the same time anyway. I am not sure how that's best solved with IPlug, though, because it has the unfortunate design decision to tie the IControls directly into the parameters...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 08-30-2018, 09:36 AM   #6
teatime
Human being with feelings
 
teatime's Avatar
 
Join Date: Aug 2016
Location: South Africa
Posts: 44
Default

Thanks - this is a kinda worst case scenario, just to see what I might have to deal with, but before I go blundering in I'll have a good planning session. Chances are I can get away with much less. Thanks to both of you, this has been very useful.

[If you're interested, a little context]
Patterns are generated algorithmically, but the user has the option to override a generated value for each step, and/or to link it to a different pattern, thus making it possible to create an vast interlocking clusterfuck of midi generators, which could, if properly set up, traverse a wide variety of states with rather few knob turns. Essentially, something which is to sequencer what synthesizer is to sound; a way to explore rich possibilities quickly without having to resort to drawing midi. I don't want to close doors to myself early on and later regret it, but I also don't want to do more work than I have to. Had I infinite money I'd buy a motherfucktron modular synth, but this is the next best thing.
teatime 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 04:50 AM.


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