bool32.rising redraw
int32 offset in the table to read from
int32 display start modulation
int32 display length modulation
int32 color on modulation
int32 color off modulation
bool32.risingfalling active??
int32 offset through
int32 start through
int32 color on through
int32 color off through
int32 blocksize
bool32.tgl active??
int32 length of the area to display
int32 display start on the LP
int32 offset
objref name of the table to display
combo device
combo blocksize
combo coloron
combo coloroff
int ntrig;
int rtrig;
uint8_t map[64];
int i;
int vt;
int trigt;
int prevt[64];
int length;
int plength;
uint8_t coloron;
uint8_t start;
uint8_t coloroff;
uint32_t offset;
{
int i;
for (i = 0; i < 64; i++)
prevt[i] = -666;
}
{
int i;
for (i = 0; i < 64; i++)
map[i] = (((i >> 3) << 3) + i);
}
coloron = inlet_coloron + attr_coloron;
coloroff = inlet_coloroff + attr_coloroff;
offset = param_offset + inlet_offset;
start = inlet_start + param_start;
length = inlet_length + param_length;
// redraw
if ((inlet_redraw > 0) && !ntrig) {
ntrig = 1;
{
int ii;
for (ii = 0; ii < 64; ii++)
prevt[ii] = -666;
}
}
if (!(inlet_redraw > 0))
ntrig = 0;
if (plength != length) {
i = 0;
plength = length;
}
// display steps
if (inlet_active || param_active) {
{
i += 1;
if (i == (length))
i = 0;
vt = attr_table.array[__USAT((offset + (i << attr_blocksize)),
attr_table.LENGTHPOW)]
<< attr_table.GAIN;
if (prevt[i] != vt)
trigt = 0;
prevt[i] = vt;
if (vt && (!trigt)) {
MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON, map[(i + start)],
(coloron));
trigt = 1;
}
if ((!vt) && (!trigt)) {
MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON, map[(i + start)],
(coloroff));
trigt = 1;
}
}
}
outlet_coloron = coloron;
outlet_coloroff = coloroff;
outlet_offset = offset;
outlet_start = start;
outlet_blocksize = attr_blocksize;