atsushieno / aap-core

an Audio Plugin Format/Framework for Android
MIT License
90 stars 3 forks source link

update plugins to work as AudioPluginService.V2 plugins #116

Closed atsushieno closed 1 year ago

atsushieno commented 1 year ago

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:

atsushieno commented 1 year ago

It is a more fine-grained task list compared to #80.

atsushieno commented 1 year ago

Here is a draft documentation for: AAP V2 Protocol changes

Rationale

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.

Breaking Changes

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:

AAP-LV2 implementation

aap_metadata mappings

ports and events mappings on instance

AAP-JUCE implementation

atsushieno commented 1 year ago

aap-lv2 depends on #118 (need to retrieve ports).

atsushieno commented 1 year ago

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.

atsushieno commented 1 year ago

Some issues I found during migration from ACC to Sysex8:

atsushieno commented 1 year ago

It seems aap-lv2 had regressed in main branch, aap-ayumi is not generating any output.

atsushieno commented 1 year ago

^ 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.

atsushieno commented 1 year ago

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.

atsushieno commented 1 year ago
atsushieno commented 1 year ago
atsushieno commented 1 year ago

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.

atsushieno commented 1 year ago

With the latest 0.7.4 release I'm finally closing this issue. Those remaining tasks are logged as ^.