and came up with something like the below.. i don't fully understand what everyting is doing yet, so i absolutely need to look at some docs
but, same result.. works in qtractor, didn't test in ardour, doesn't work in carla..
the little led/light on the plugin in the carla rack view lights up when i press a midi key.. does that mean carla is sending the midi to the plugin?
kode_debug.ttl:
Code: Select all
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix midi: <http://lv2plug.in/ns/ext/midi#> .
@prefix urid: <http://lv2plug.in/ns/ext/urid#> .
<urn:skei.audio/kode_debug>
a lv2:Plugin , lv2:InstrumentPlugin ;
doap:name "kode_debug" ;
lv2:optionalFeature lv2:hardRTCapable ;
lv2:requiredFeature urid:map ;
lv2:port [
...
...
] , [
a lv2:InputPort , atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports midi:MidiEvent ;
lv2:designation lv2:control ;
lv2:index 6 ;
lv2:symbol "midi_in" ;
lv2:name "Midi in"
] .
Code: Select all
#define KODE_PLUGIN_LV2_MAX_URIS 16
plugin instance class:
const LV2_Atom_Sequence* MLV2AtomSequence = KODE_NULL;
LV2_URID_Map* MLV2Map = KODE_NULL;
KODE_uint32 MMidiEventType = 0;
LV2_URID* MLV2URIS = KODE_NULL;
plugin class.
// for some reason, i thought it could be smart to prepare for multiple uri's..
LV2_URID MLV2URIS[KODE_PLUGIN_LV2_MAX_URIS] = {0};
instantiate()
LV2_URID_Map* map = NULL;
for (int i=0; features[i]; ++i) {
if (!strcmp(features[i]->URI, LV2_URID__map)) {
map = (LV2_URID_Map*)features[i]->data;
break;
}
}
if (!map) return KODE_NULL;
MLV2URIS[0] = map->map(map->handle, LV2_MIDI__MidiEvent);
...
instance->MLV2URIS = MLV2URIS;
connect()
MLV2AtomSequence = (const LV2_Atom_Sequence*)data_location;
run()
uint32_t offset = 0;
LV2_ATOM_SEQUENCE_FOREACH(MLV2AtomSequence, ev) {
if (ev->body.type == MLV2URIS[0]) {
const uint8_t* const msg = (const uint8_t*)(ev + 1);
offset = (uint32_t)ev->time.frames;
on_instance_midiEvent(offset,msg[0],msg[1],msg[2]);
}
}