UAPMD v0.6 and v0.7

In the previous post, I mentioned UAPMD v0.5.0 release as it was about comprehensive AAP support. The v0.5.0 release was actually more of that. UAPMD started going forward to design platform and implementation-neutral music project data. At the same time, UAPMD had been expanding its capabilities and feature set a lot, which required comprehensive restructuring of the modules. It started between 0.4.0 and 0.5.0 and was quite incomplete (it is still not really "done"), so I'd expand the releases range "up to 0.7.0" here, which means 0.5.1, 0.5.2, 0.5,5, , 0.5.6, 0.6.0, and 0.7.0.

The overall UI/UX has vastly improved a lot, with cleaner separation of concerns.

module restructuring and the addin architecture

As of UAPMD v0.5, I was mostly caring about the plugin hosting part (which still is the primary purpose of this library) and not much about others. The virtual MIDI device integration was tightly integrated into the sequencer engine, with tightly integrated project data model (because UAPMD was primarily for read-only playback engine, not for editing).

However, UAPMD has been slowly becoming more like a foundation for editable audio engine for AAP, it is increasingly getting important to organize everything with appropriate separation of concerns. Therefore, there had been a big module splits and reorganizations until v0.6.0, and there were further moving of the relevant classes and features across the modules.

I also figured that there are many sequencer features that should be regarded as uapmd-app specific, which is not going to be appropriate as we plan to build app (DAW)-agnostic sequencer library. They should be "add-in" in any sense. There are various levels of "add-ins" though, and I ended up building our own addin foundation for UAPMD.

It is not comprehensive but similar to addins of IDEs' or Web browsers'. We define some named extensibility paths. UAPMD modules can look up addins that are bound to some symbols, either within the standalone app executable itself, or loadable from external libraries. Since we cannot do that on Android and iOS, the applicable dynamic loader cases should be quite limited though.

After those attempts, we have reorganized UAPMD library modules as:

  • uapmd-addin-core: the addin framework needs its own module
  • uapmd-plugin-hosting: the interface-based plugin hosting abstraction layer. My initial idea was to get multiple plugin hosting API working (like remidy implementation, JUCE implementation, etc.) but UAPMD's primary focus is MIDI 2.0 ready plugin hosting which only applies to remidy, so the abstraction is kind of superficial.
  • uapmd-graph: the audio graph abstraction (interface) and default set of nodes (discussed later)
  • uapmd-data: project document model, along with editor data model with undo/redo, grouping, copy/pastes, and playback data model (currently)
  • uapmd-engine: the audio playback and rendering engine
  • uapmd-midi-service: the virtual MIDI 2.0 device manager (discussed later)
  • uapmd-ara: ARA support, based on our project document model
  • uapmd-mir: various MIR support, such as Demucs, basic-pitch, BS-RoFormer, and librosa
  • uapmd-augene2: private MML compiler integration
  • uapmd-format-jsfx: Reaper JSFX as a (pseudo) plugin format (using ysfx library)

...along with midicci and remidy (the plugin hosting implementation).

The modular re-architecture also made it possible to divide and conqueror the huge sequencer engine implementation. For example, we had to work with audio graphs within the sequencer engine (which handled all realtime-safe playback), but through the restructure work it is extracted into its own module, with minimum interactions with other parts such as event I/O streaming. Edits on the song project data now lives in its own module, and sequencer could listen to the change events. The primary purpose of UAPMD was to turn any audio plugin into a virtual MIDI 2.0 device, but even that feature became an addin and not enabled by default anymore (as we will be registering 50 devices for projects that contain 50 plugin instances).

Apart from modular restructuring, the addin-based model brought in structured extensibility. Instead of adding every editor feature set in the sequencer engine for the piano roll, MIDI event list editor, and step sequencer, we now have a unified editor extensibility point and all those editors become addins. We could also add a lot of MIR-based features such as pitch/notes detection (create MIDI clips from audio clips), project importers from externals (I have my own MML compiler integrated into it), and stem separation tools integrated as audio tracks importer. We had Demucs-based importer, but we could easily add BS-RoFormer implementation too.

UAPMD addins in v0.7.0

uapmd-kmp: the Kotlin Multiplatform bindings

I also figured that UAPMD should provide Kotlin Multiplatform bindings, which provides truly native user experience on Android (lack of native experience is a big frustration in the AAP community).

It requires decent API bindings at C API level ( for Kotlin-Native cinterop) which I was hesitant to work on because it 's a lot of boilerplate work. I was also hesitant about building another model library just for the app until then (because again it's a lot of boilerplate work), but now we need it to build almost complete feature parity with uapmd-app, in Compose Multiplatform. Both points are though, human specific and I could leave those tasks to AI in almost no hesitate.

uapmd-kmp is "AI slop" in that I do not give basic API review and approval except for feature parity check in uapmd-kmp (which did not happen in early stage either). Such "AI slop" API bindings and CMP implementation are usually not great for ABI compatibility and maintainability, but the original API (UAPMD) keeps breaking anyway. Expecting binding ABI compatibility at this moment is not appropriate.

Interfaces should be defined in higher levels, and we audio engine ecosystem people are not still at that stage beyond MIDI 2.0. There should also be some document model interface (ARA is not designed to be generic enough).

uapmd-cmp v0.7.0

uapmd-graph

UAPMD aims to provide a cross-product music project data format, as well as product design agnostic and modularized DAW engine as much as we can build. The way how we design and implement audio graph is highly DAW dependent, and we want to make it customizable, while offering some default implementations. To make it cusomizable, we need some sort of API and/or data representation of a graph so that they can be saved as part of a portable music project.

In UAPMD, an audio graph is built for each track (anything that involves "cross-track" graph connections should be logically regarded as one single track in UAPMD), and there can be any number of plugin nodes in a graph. The connections of the buses can be flexible enough as long as it composes a DAG (directional acyclic graph).

The audio graph in a DAW is not only about how connections are made. They also involve some builtin nodes such as gain, panners, and analyzer. There are some needs to retrieve audio and/or inputs, or manipulate audio and/or event outputs. We could treat them as out of scope of the standardized graph API, but then we will lose ways to express complicated node graph connections that potentially involves stereo mixers, channel splitters, panners etc. in the middle of the graph.

To avoid providing very UAPMD-specific builtin nodes, I created a set of builtin nodes that basically replicates AudioWorklet nodes in WebAudio. It is actually not very successful attempt - for example, StereoPannerNode in Web Audio API takes mono input and emits stereo outputs, which does not match typical audio plugin formats where stereo channels result in stereo inputs. The plan to imitate Web Audio nodes still remains, but it is still tentative.

The graph implementation also affects the project data serialization, in that what to save and load. Since uapmd-graph modules does not depend on uapmd-data which handles serialization, we do not provide highly integrated serialization API for the project document model. Instead, every property of a node graph is represented as a simple string (like plugin identifier, the plugin format, and a state binary blob).

On the other hand, it is currently impossible to design any host-agnostic GUI integration i.e. a custom graph developer cannot provide GUI integration implementation by their own. The DAW GUI developers will have to implement support for all the graph extensions by themselves. The same goes for addins like PianoRoll, StepSequencer, and so on. Both uapmd-app (in ImGui) and uapmd-cmp (in CMP) implement them for each, and they are still hacky.

the document model and ARA

When I started UAPMD project, I never intended to build a DAW. When I figured that I am going to have to implement multitrack sequencer which is already like some sort of DAW, I still didn't intend to implement complicated editor model. However, the more I implement plugin features exposed as their API, it is getting more like a real DAW with somewhat proper document model. For example, when I implement Vst::IComponentHandler2::setDirty(), it implies the document records some dirty state (which may be probably pointless on some editor model after all, but anyway).

And what made it to support an editable document model definitely was my attempt to support ARA. ARA is not another plugin format but rather an extension to existing plugin formats, and I was going to implement ARA support in AAP (as I have written in another post, we have aap-ara now). It provides access to document model, and document mutation events that can be dispatched to the other party (host to plugin, and vice versa).

AAP ARA Example on UAPMD

This requires appropriately designed project document model, so it started to take shape as kind of solid structure in code. I had always paid attention to the serialized project data format (as I save everything in SMF2-Container-like structure), but the document model was not that solid yet, especially with events.

ARA(2) is actually still kind of emerging technology in DAW products. Some DAWs started supporting it in 2026, and there is an ongoing work for ARA3. It is going to add support for lyrics etc. - I have to say, I rather find it behind the tech trend as we can simply transfer all the master track information as in UMP in 2026. So, if a document event model supports mutation events for its audio clips and "UMP clips", it will automatically support the "new features" that ARA3 is going to support.

Therefore, uapmd-data defines the project document model in more generic way, and ARA support is implemented only as an addin that hooks into those generic events to shoot the actual ARA events, using ARA_SDK API.

This solid document model also helped implementing features like undo/redo actions, grouping of tracks and/or clips, and selection of those. ARA also defines document selection API.

offline rendering, tail, and latency compensation

One of the improvements I made in uapmd 0.7.0 is the revamped track freezing. It is an important feature because things would miss deadline on Android pretty quickly. Freezing tracks should reduce the workload.

Until 0.7.0, it was still freezing tracks and when they were frozen they were used, but the freezer was not really doing good job. It was rendering everything even though we were actually just rendering one track (bug), and we did not really support offline rendering mode in uapmd-plugin-hosting API. When I added offline-rendering extension in AAP, I have revamped everything in UAPMD that also fixed desktop offline rendering. It should be fast enough now. We were also rendering frozen tracks on memory, which caused Android OOM. They are now rendered on disk and loaded in streaming manner.

Freezing of tracks is strongly tied to new sequencer engine events such as playback started, paused, stopped, etc. Since we cannot freeze a track when there is an ongoing playback without creating a clone of the plugin instance (because the state can be different at playhead and at freezing), we process track freezing only when the playback is stopped.

Offline rendering is now used in "Render To File" feature, which actually hits another important feature: support for tail length. It was another missing piece in AAP, so it was similarly implemented in this timeframe. Latency reporting was the last bit on the same plate, and it is similarly implemented. We already had support for latency reporting in our uapmd-graph API, it was just a matter of AAP support.

JSFX (ysfx) format integration

After I added an addin extension point for plugin formats, I have created JSFX format addin to prove that UAPMD user developers can add their own plugin formats. AAP would have never happened if juce_audio_plugin_client did not provide such an adaptable API, so I wanted to do the same.

The actual JSFX engine is called ysfx, and it had some roadblocks. Basically it was a JUCE plugin, and UAPMD is not a JUCE application, so we only took non-JUCE part (which is under Apache V2 license). Its DSP was fine, but the GUI part needed to be implemented in ImGui. There is some trick - the JSFX UI implementation only provides the frame buffer, and uapmd-plugin-hosting handles it as PluginFramebufferUIExtension which requires framebuffer rendering. On uapmd-cmp we don't implement per-format GUI support - we detect the extension and do the same, but with Compose Multiplatform API.

JSFX in uapmd-cmp

Another tricky thing was support for the compiled audio engine - when I tried it on wasm, the performance was horrible. It was because everything was interpreted. On other platforms they were compiled to native CPU instructions. After some consultation with Claude we decided to implement the compiled EEL engine for wasm, but only for instructions that are used on the audio thread (because otherwise it's going to be huge). Now it should perform well.

The JSFX integration somehow brought in an interesting aspect of the custom format. Somehow it is the only "common" format that is shared across platforms i.e. projects that use only JSFX as plugins are portable. It actually replicates a custom plugin format that is specific to the DAW product.