saveloadactivate

preset save/load module with "being sure" button (for when you accidentally press the wrong button and might have been overwriting your dear preset table!) also features: -force-load from external trigger -automatic load at patch-start -volume fade-in when play output is high after load. (use play output to activate modules or sync sequencers) -linear fade-in rate control(exponential response of knob on linear fade-in)
Author: Remco van der Most
License: BSD
Github: sss/table/saveloadactivate.axo

Inlets

bool32.rising load

Outlets

bool32 output

bool32 load

bool32 extraload

bool32 play

frac32.positive fadein

Parameters

bool32.mom save

bool32.mom load

bool32.mom sure

frac32.u.map rate

Displays

bool32 save

bool32 load

Declaration
int save;
int load;
int dosave;
int doload;
int extraload;
int trig;
int count;
int caunt;
int32_t play;
int32_t fadein;
int32_t Fadein;
int32_t rate;
Init
fadein = 0;
play = 0;
Control Rate
if (param_save > 0) {
  save = 1;
  load = 0;
}
if (param_load > 0) {
  save = 0;
  load = 1;
}
if (param_sure > 0) {
  dosave = save;
  doload = load;
  save = 0;
  load = 0;
}
if ((inlet_load > 0) && !trig) {
  doload = 1;
  trig = 1;
} else {
  doload = 0;
  if (inlet_load < 1) {
    trig = 1;
  }
}

if (count < 20002) {
  count += 1;
  doload = count == 10000 ? 1 : 0;
  caunt = 0;
}
if (caunt < 4002) {
  caunt += 1;
  extraload = caunt == 4000 ? 1 : 0;
}
if (extraload > 0) {
  play = 1;
}
if (play > 0) {
  if (fadein < (1 << 27)) {
    rate = ___SMMUL(param_rate << 3, param_rate << 2);
    rate = ___SMMUL(rate << 3, rate << 2);
    fadein += rate;
  }
}
Fadein = fadein > (1 << 27) ? (1 << 27) : fadein;

disp_save = save;
disp_load = load;

outlet_save = dosave;
outlet_load = doload;
outlet_extraload = extraload;
outlet_play = play > 0 ? 1 : 0;
outlet_fadein = Fadein;

Privacy

© 2024 Zrna Research