Controller object and presets


#1

Hi, using a controller object for patchchange and I thought it would be great to also have preset handling in the controller object, but I can not get it to work, nothing happens, but the same objects work as intended if I put them in the normal patch.
I have a theory about this, I suppose that changing presets in a subpatch, as I suppose the controller object is, doesn't effect the main patch, it just changes them in the controller object.

Is that correct? Is there another way to change presets from a controller object or do I have to put the preset objects in every patch?


#2

sounds likely

however, simple to 'fix'
take the patch/preset object and embedded it into your controller patch... (so you have a 'local copy' to edit)
then edit the object.
you will see in the krate code

   if ((inlet_trig>0) && !ntrig) {parent->ApplyPreset(inlet_preset) ; ntrig=1;}
   else if (!(inlet_trig>0)) ntrig=0;

change this to

   if ((inlet_trig>0) && !ntrig) {parent->parent->ApplyPreset(inlet_preset) ; ntrig=1;}
   else if (!(inlet_trig>0)) ntrig=0;

note: the extra parent-> , telling the object to use the parent of the controller object, i.e the main patch.

extra note: I've not tested as not at my axoloti at the moment, but should be a simple fix :slight_smile:


#3

Thanks! it worked, Great!!