bool32.rising trigger
frac32.bipolar delay
frac32.bipolar t
frac32.positive v
None
frac32.s.map Transpose
frac32.u.map Velocity
int32 channel
bool32.mom Trigger
frac32.s.map.klineartime.exp Length
combo d
int32_t val;
int ntrig;
// drj/midi/note_tx
int ntrigmidi;
int lastnote;
val = 0;
ntrig = 0;
ntrigmidi = 0;
bool Trigger = inlet_tr || param_Trigger;
bool Gate;
if ((Trigger > 0) && !ntrig) {
val = 1 << 30;
ntrig = 1;
Gate = 1;
} else {
if (!(Trigger > 0))
ntrig = 0;
if (val > 0) {
int32_t t;
MTOF(-param_Length - inlet_l, t);
val -= t >> 3;
if (val <= 0)
Gate = 0;
else
Gate = 1;
} else
Gate = 0;
}
int32_t Transpose = inlet_t + param_Transpose;
int32_t Velocity = inlet_v + param_Velocity;
if ((Gate > 0) && !ntrigmidi) {
lastnote = (64 + (Transpose >> 21)) & 0x7F;
MidiSend3((midi_device_t)attr_d, MIDI_NOTE_ON + (param_channel - 1), lastnote,
Velocity >> 20);
ntrigmidi = 1;
}
if (!(Gate > 0) && ntrigmidi) {
MidiSend3((midi_device_t)attr_d, MIDI_NOTE_OFF + (param_channel - 1),
lastnote, __USAT(Velocity >> 20, 7));
ntrigmidi = 0;
}