Closed atsushieno closed 1 year ago
It is a more fine-grained task list compared to #80.
Here is a draft documentation for: AAP V2 Protocol changes
AAP is going to support decent parameter changes with unified MIDI2 input events. It is a paradigm shift from traditional LV2 port to LV2 Atom or CLAP unified events.
There are handful of reasons to make this change, but namely:
AAP uses MIDI 2.0 UMPs, it reuses the standard technology, compared to other technology like LV2 Atom or CLAP events. Parameter changs are sent as MIDI 2.0 Assignable Controllers.
This change leads to the new V2 protocol because it breaks plugin compatibility. AAPs that implement V1 is fundamentally incompatible with V2, and therefore they are not returns for V2 plugin queries (and vice versa).
The details:
process
function part to translate UMPs to MIDI1 events (already done).<port>
s anymore. They are instead mapped to <parameter>
s.<port>
element. Control port is mapped to a <parameter>
element..ttl
defines, aap-import-lv2-metadata
will ALWAYS generate midi2
<port>
elements, one for input, another for output.midi
or LV2 patch
will receive inputs from midi2
input port, and those ports that send midi
or patch
Atom messages will redirect the outputs from midi2
output port.aap-import-lv2-metadata
iterates all ports in the order by index
, then occurrence order in the .ttl
, and generates those XML elements described above. There will be no implicit port that are not declared in AAP-LV2 world. androidaudioplugin-lv2
populates ports instances.patch
event if an atom
input port that accepts it exists, or (2) the input to those control ports (already done, but unverified).midi
event if an atom
input port that accept it exists. Otherwise, ignored.AudioProcessor
may extend support to UMPs in the future), so it has to translate UMPs to MIDI1 events.aap-lv2 depends on #118 (need to retrieve ports).
A fundamental problem was raised - Assignable Controllers are used for parameter changes, but when we convert MIDI1 bytes to UMPs, they are also used to achieve NRPN (and DTE) replacement, and it is kind of mandatory as the UMP specification states those MIDI1 messages SHOULD be translated to ACs. And mixing MIDI1 channel voice messages and MIDI2 channel voice messages is not MIDI2 compliant.
The alternative method is to use universal sysex8 for those parameter changes. It is actually what atsushieno/augene-ng does for audio plugin parameter changes within UMPs.
Some issues I found during migration from ACC to Sysex8:
clap_event_param_value_t
provides key
(and noteId
) which fulfills this feature. Sysex8 of course does not have the corresponding field, so we will need another field.It seems aap-lv2 had regressed in main branch, aap-ayumi is not generating any output.
^ is fixed. aap-fluidsynth works now. But aap-sfizz MidiDevice crashes. aap-string-machine plays well as a plugin, but MidiDevice generates super simple tone, which likely means that it does not set correct parameters.
The latest status: aap-juce-obxd and aap-juce-dexed seem to work with aap-juce-plugin-host. aap-juce-hera seems broken, even on aaphostsample.
processReplacing()
: the existing code does not seem to work with it, most likely due to buffer pointer assignments.We have aap-juce-frequalizer working. aap-juce-simple-reverb still does not reflect parameter changes on AudioPluginHost, maybe neither frequalizer (APH too crashy to connect multiple plugins and test outputs and parameter changes) though. We can investigate after the final 0.7.4 release work.
With the latest 0.7.4 release I'm finally closing this issue. Those remaining tasks are logged as ^.
On
main
branch, aapinstrumentsample is implemented to work as MIDI 1 synth. Other plugins are either not updated or cause runtime crashes. They have to be either fixed or rewritten to work as V2 plugin.Though, it kinda requires updating to the new scheme for parameter changes i.e. interpret MIDI2 inputs in realtime manner. That brings in unified event processing model with MIDI1 based inputs, and not everything is ready for that yet.
There are couple of sub-tasks:
PluginPreview
(and thus samples-host-engine and aaphostsample) to work with the new scheme if (1) there is a MIDI2 in port and (2) there are "parameters" (it was only partially implemented).PluginPreview
gets fixed and starts working fine, then it should also support (send) unified MIDI2 inputs to the instantiated plugin.