bool32.rising load
bool32 output
bool32 load
bool32 extraload
bool32 play
frac32.positive fadein
bool32.mom save
bool32.mom load
bool32.mom sure
frac32.u.map rate
bool32 save
bool32 load
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;
fadein = 0;
play = 0;
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;