Engine Rebuild - Phase II and now III

As you may know I’ve been rebuilding Cantabile’s audio engine. Now that the work on the engine itself is pretty much done, I thought I’d start a new topic for the next phase of work.

There’s a long discussion here covering the work done so far, but to summarize:

  • Brand new empty project
  • New execution model with automatic graph node clustering
  • New thread pool implementation for more efficient spreading of load across multiple cores and better awareness of low-power e-cores.
  • New approach to MIDI handling (everything is now “pull” rather than “push”)
  • New real-time heap implementation
  • Simplified and improved internal transport position handling
  • Improved VST 3 plugin hosting - especially around parameter handling
  • Updates to the underlying C++ template classes
  • All internal string handling switched from utf-16 to utf-8
  • Lots of decoupling objects for easier unit testing
  • Some functionality that doesn’t belong in the engine moved out
  • Reworked logging framework
  • Comprehensive set of unit tests (over 1,500 tests in all)
  • Lots of code clean up and other miscellaneous refactoring

This next phase will be mostly integration testing. The first of these tests yesterday was a simple confidence test that the engine could start/run/shutdown.

Today:

  • integrated the engine logging services with the test bench
  • actually got it to produce sounds (metronome ticks) - watch video.

Next: more tests like this.

10 Likes

2 posts were split to a new topic: Creating additional MIDI ports causes increase in CPU load (possibly?)

Sunday side project: updating the test bench to generate D2 node graph diagrams. They look good but highlighted some unpredictability with the node clustering algorithm which I’m going to have to revisit.

Some sample node graphs:



4 Likes

Main job today - rework the node clustering algorithm and it’s working much better now.

Also, tested: AudioMixer, MidiRouter, Vst2PluginHosting, AudioPlayer, MidiPlayer.

Watch video.

7 Likes

Slight change of plan…

I feel the like integration tests weren’t really adding much - basically everything either just worked, or showed obvious bugs that would have shown up eventually anyway.

So I’ve decided to jump straight to phase III - which is updating Cantabile to the new engine. There’s three main layers to this:

  1. Environment - the engine, audio driver, audio and midi port management and other lower level services. This is smallish area, but where the most technically significant changes will be.
  2. Application - the main application level objects.- This is where songs, racks, bindings, plugin objects, media players etc… all live. This should be more mechanical work - just rearranging objects - but there’s lots of it.
  3. User Interface - I bet you can’t guess what this is. This shouldn’t need much work.

Anyway, started on the Environment today and its going ok. It’s a bigger job than I hoped but I’m also deleting a lot of now redundant code thanks for the new engine’s simpler coding model.

Best of all… I’m mostly done with the C++ side of things now.

Onwards!

2 Likes