note send 2

sends 2 notes with velocities defined by 'velon' and 'veloff',starting frim 'startnote'.
Author: robert schirmer
License: who cares
Github: rbrt/midi/out/note send 2.axo

Inlets

bool32.risingfalling g0

bool32.risingfalling g1

frac32.positive velon

frac32.positive veloff

int32 startnote

Outlets

None

Parameters

int32 startnote

Attributes

combo device

spinner channel

spinner velon

spinner veloff

Declaration
uint8_t prev0;
uint8_t prev1;
uint8_t prev2;
uint8_t prev3;

uint8_t vel;
uint8_t velon;
uint8_t veloff;

uint8_t startnote;
Control Rate
velon = attr_velon + (inlet_velon >> 20);
veloff = attr_veloff + (inlet_veloff >> 20);
startnote = param_startnote + inlet_startnote;

if (inlet_g0 != prev0) {
  vel = inlet_g0 ? velon : veloff;
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
            startnote, vel);
  prev0 = inlet_g0;
}

if (inlet_g1 != prev1) {
  vel = inlet_g1 ? velon : veloff;
  MidiSend3((midi_device_t)attr_device, MIDI_NOTE_ON + (attr_channel - 1),
            startnote + 1, vel);
  prev1 = inlet_g1;
}

Privacy

© 2024 Zrna Research