autopreset

apply preset, preset zero = init, and will reset ALL parameters, not just the presets with integrated change
Author: Johannes Taelman
License: BSD
Github: phi/patch/autopreset.axo

Inlets

int32 preset number

Outlets

None

Displays

int32.label p

Declaration
int ptrig;
int32_t pval;
int ntrig;
Init
ptrig = 0;
pval = 0;
ntrig = 0;
Control Rate
if ((pval != inlet_preset) & (!ptrig)) {
  // outlet_trig = 1;
  pval = inlet_preset;
  ptrig = 1;
} else {
  ptrig = 0;
  // outlet_trig = 0;
}
if ((ptrig > 0) && !ntrig) {
  parent->ApplyPreset(inlet_preset);
  ntrig = 1;
} else if (!(ptrig > 0))
  ntrig = 0;

disp_p = inlet_preset;

Privacy

© 2024 Zrna Research