note

Midi note output. Sends to midi/in/* objects only.
Author: Johannes Taelman
License: BSD
Github: midi/intern/note.axo

Inlets

bool32.rising trigger

frac32.bipolar note (-64..63)

frac32.positive velocity

Outlets

None

Attributes

spinner channel

Declaration
int ntrig;
int lastnote;
Init
ntrig = 0;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  lastnote = (64 + (inlet_note >> 21)) & 0x7F;
  PatchMidiInHandler(MIDI_DEVICE_INTERNAL, 0, MIDI_NOTE_ON + (attr_channel - 1),
                     lastnote, inlet_velo >> 20);
  ntrig = 1;
}
if (!(inlet_trig > 0) && ntrig) {
  PatchMidiInHandler((midi_device_t)0, 0, MIDI_NOTE_OFF + (attr_channel - 1),
                     lastnote, __USAT(inlet_velo >> 20, 7));
  ntrig = 0;
}

Privacy

© 2024 Zrna Research