note send 4

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

Inlets

int32 startnote

bool32.risingfalling g0

bool32.risingfalling g1

bool32.risingfalling g2

bool32.risingfalling g3

frac32.positive velon

frac32.positive veloff

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;
}

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

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

Privacy

© 2024 Zrna Research