int32 zoom
frac32.bipolar output
frac32.s.map value
int32.hradio zoom
int32_t value;
int32_t mem1;
int32_t mem2;
int ttrig;
int strig;
int reset;
strig = 1;
reset = 1;
// when either parameter or inlet zoom is 2, sets "zoom" to 2
int32_t zoom = (inlet_zoom) + (param_zoom);
// when zoom goes 2 while it was off at the former sample, puts parameter value
// into memory1 and resets parameter to zero
if ((zoom > 0) && (!(ttrig))) {
ttrig = 1;
mem1 = param_value;
PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_value], 0,
0xFFFD);
}
// when zoom goes "not 2" while it was on at the former sample, sums the two
// memories and resets the parameter to the sum
if ((!(zoom > 0)) && (!(strig))) {
strig = 1;
PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_value],
mem1 + mem2, 0xFFFD);
}
// when zoom is not 2, puts parameter into "value" (also includes updated offset
// when going out of zoom)
if (!(zoom > 0)) {
ttrig = 0;
value = param_value;
}
// when zoom is 1 or 2, scales down parameter, puts it in memory2 and sums it
// with memory1 into "value"
if (zoom == 1) {
strig = 0;
mem2 = param_value >> 8;
value = mem1 + mem2;
}
if (zoom == 2) {
strig = 0;
mem2 = param_value >> 16;
value = mem1 + mem2;
}
// puts "value" into outlet
outlet_out = value;