bend hr

Midi pitch bend input hi res
Author: Mark Harris
License: BSD
Github: midi/in/bend hr.axo

Inlets

None

Outlets

frac32.bipolar pitch bend, -64..64

bool32.pulse trigger output

Attributes

spinner ccl

Declaration
int32_t _bend, bendl;
int32_t ntrig;
Init
_bend = 0;
bendl = 0;
ntrig = 0;
Control Rate
outlet_bend = _bend;
outlet_trig = ntrig;
ntrig = 0;
Midi Handler
if (status == MIDI_PITCH_BEND + attr_midichannel) {
  _bend = (((int)((data2 << 7) + data1) - 0x2000) << 14) + bendl;
  ntrig = 1;
} else if ((status == attr_midichannel + MIDI_CONTROL_CHANGE) &&
           (data1 == attr_ccl)) {
  bendl = data2 << 7;
}

Privacy

© 2024 Zrna Research