[LV2] Killing the event extension

David Robillard d at drobilla.net
Sat Feb 1 09:39:54 PST 2014


On Sat, 2014-02-01 at 08:00 +0000, Filipe Coelho wrote:
> On 02/01/2014 07:03 AM, hermann meyer wrote:
[...]
> > 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];
> };

I suppose a similar utility function to lv2_event_write should be added
to util.h (and an lv2_atom_sequence_clear or something)

The forge is the swiss army knife of writing, but if you just want to
write MIDI it's a bit overkill.

I will add these and an example plugin that uses them.

-- 
dr





More information about the Devel mailing list