int32 offset in the table
int32 startcc
bool32.rising redraw
bool32 active
None
bool32.tgl enable ctrl feedback
int32 offset
objref table
combo device
combo blocksize
spinner channel
spinner startcc
spinner length
int i;
int32_t v[128];
int32_t prev[128];
int ntrig[128];
int rtrig;
int32_t offset;
{
int i;
for (i = 0; i < attr_length; i++)
prev[i] = -666;
}
offset = inlet_offset + param_offset;
if (inlet_active || param_active) {
{
i += 1;
if (i == attr_length)
i = 0;
v[i] = attr_table.array[__USAT(((i << attr_blocksize) + offset),
attr_table.LENGTHPOW)]
<< attr_table.GAIN;
if ((v[i] != prev[i]) && !ntrig[i]) {
MidiSend3((midi_device_t)attr_device,
MIDI_CONTROL_CHANGE + (attr_channel - 1),
i + attr_startcc + inlet_startcc, (v[i] >> 20));
prev[i] = v[i];
ntrig[i] = 1;
}
if (v[i] == prev[i])
ntrig[i] = 0;
}
}
// re-init
if ((inlet_redraw > 0) && !rtrig) {
rtrig = 1;
{
int ii;
for (ii = 0; ii < attr_length; ii++)
prev[ii] = -666;
}
}
if (!(inlet_redraw > 0))
rtrig = 0;