notehold_fixed

Midi note hold.if 'gate' is true,'velon' is held on 'trig'.if 'gate' is false,'veloff' is held on 'trig'.
Author: robert schirmer
License: who cares
Github: rbrt/old/notehold_fixed.axo

Inlets

bool32.risingfalling gate

bool32.rising trigger

Outlets

None

Parameters

int32 note

int32 velon

int32 veloff

Attributes

combo device

spinner channel

Declaration
int ntrig;
int lastnote;
Init
ntrig = 0;
Control Rate
if (inlet_gate && ((inlet_trig > 0) && !ntrig)) {
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
            param_note, param_velon);
  ntrig = 1;
}

if (!inlet_gate && ((inlet_trig > 0) && !ntrig)) {
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
            param_note, param_veloff);
  ntrig = 1;
}

if (!(inlet_trig > 0) && ntrig) {
  ntrig = 0;
}

Privacy

© 2024 Zrna Research