[LV2] midi out example

Alex Norman alex at x37v.info
Mon Mar 28 08:05:34 PDT 2016


On  0, Robin Gareus <robin at gareus.org> wrote:
> On 03/28/2016 02:57 AM, Alex Norman wrote:
> > Does someone have a simple example plugin that demonstrates how to send midi
> > from LV2?
> 
> 
> http://lv2plug.in/book/  - The Fifths plugin for example
> 
> > I've been looking into this:
> > https://github.com/x42/midifilter.lv2/blob/master/midifilter.c
> > 
> > But honestly I find the 'atom forge', event and atom documentation to be
> > relatively confusing.
> > 
> 
> A less computer-sciencey way to describe it:
> 
> "LV2 Atom" is a "Word".
> 
> A "LV2 Atom Message" is a "meaningful sentence" (subject + predicate +
> object) constructed of words.
> 
> To construct a LV2 sentence one uses the "Atom Forge". (The forge can do
> this realtime safe and ensure proper formatting)
> 
> An "Event" is a "sentence" with a timestamp. e.g.
> 
>  1:47 Train leaves for Brooklyn
> 
> Last but not least, a "LV2 Event Sequence" is a sequence of Events: e.g.
> 
> 
>  1:47 Train leaves to Brooklyn
>  2:12 Last train [leaves] to Clarksville
> 
> 
> LV2 provides some convenient macros and functions to handle LV2
> sequences (both host and client). The two most common are:
> 
>   LV2_ATOM_SEQUENCE_FOREACH()
>   lv2_atom_sequence_append_event()
> 
> 
> 
> For completeness:
> LV2-Atoms are URIs which can be cumbersome to handle in C/C++ and long
> strings can waste precious resources in realtime code.
> So every URI is mapped to an integer. That's what the LV2 URI-MAP does
> (the forge abstracts that part.
> 
> 
> Just like a real language this can evolve. You could tell a LV2 host
>     http://example.org/cool  http://example.org/ey!
> but currently most LV2 Hosts will just frown at that message :)

Fantastic description, thanks a ton!

-Alex

> 
> ciao,
> robin
> _______________________________________________
> Devel mailing list
> Devel at lists.lv2plug.in
> http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20160328/af0dfd77/attachment.pgp>


More information about the Devel mailing list