[LV2] Killing the event extension
Filipe Coelho
falktx at gmail.com
Sat Feb 1 00:00:32 PST 2014
On 02/01/2014 07:03 AM, hermann meyer wrote:
> Okay.
> Just as a side note, the plug checks anyway if the event extension is
> supported, otherwise, it will simply disable the midi out.
> But, . .
>
> With the event extension I could write midi events comparable to
> jack_midi_events.
> What I do is the following
> void Gxtuner::send_midi_data(int count, uint8_t controller,
> uint8_t note, uint8_t velocity)
> {
> midi_data[0] = controller; // note on/off
> midi_data[1] = note; // note
> midi_data[2] = velocity; // velocity
> if(! MidiOut) return;
> if(!lv2_event_write(&out_iter, count, 0, midi_event, 3, midi_data)) {
> printf("Error! midi event fail!\n");
> }
> }
>
> Could I and How, set up a atom message, to use it in a comparable
> manner?
I use this when I want to output MIDI events:
struct LV2_Atom_MidiEvent {
LV2_Atom_Event event;
uint8_t data[4];
};
Then I guess you can use:
LV2_Atom_MidiEvent midiEv;
midiEv.event.time.frames = 0;
midiEv.event.body.type = uris.midiEvent;
midiEv.event.body.size = 3;
midiEv.data[0] = controller;
midiEv.data[1] = note;
midiEv.data[2] = velocity;
More information about the Devel
mailing list