int32 offset in the table
int32 velocity on modulation
bool32.rising redraw
None
int32.mini map the step to midi notes
int32.mini map the step to midi notes
int32.mini map the step to midi notes
int32.mini map the step to midi notes
int32 note velocity if step > 0
int32 note velocity if step <= 0
objref table
combo device
spinner channel
int ntrig;
int rtrig;
int prev;
int prevon;
int32_t val;
int32_t map[4];
int v;
int i;
int vt;
int trigt;
int prevt[4];
{
int i;
for (i = 0; i < 4; i++)
prevt[i] = -666;
}
map[0] = param_i0;
map[1] = param_i1;
map[2] = param_i2;
map[3] = param_i3;
// re-init
if ((inlet_redraw > 0) && !ntrig) {
ntrig = 1;
{
int ii;
for (ii = 0; ii < 4; ii++)
prevt[ii] = -666;
}
}
if (!(inlet_redraw > 0))
ntrig = 0;
// display steps
{
i += 1;
if (i == 4)
i = 0;
vt = attr_table.array[__USAT((inlet_offset + i), 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 + (attr_channel - 1),
map[i], param_on);
trigt = 1;
}
if ((!vt) && (!trigt)) {
MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
map[i], param_off);
trigt = 1;
}
}