Cantabile Real-time VST Host

Started by germanicus, April 27, 2013, 01:50:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

germanicus

Update:

Im trying out a trial version of Cantabile Performer.
It gives you the option of configuring numerous midi filters at different points in the program signal chain:
-Globally (as it enters the program)
-Session (this seems to be the winner for Midi guitarists using alternate tuning)
-Per Rack (you can have multiple racks of VST/VSTi's each running one or more plugins)

The program works by saving sessions and subsessions of different setups. You can easily configure a session to transpose each string of your midi guitar input however you please, and that signal is then sent to your racks of synths/samplers.

I just need to see how easy it is to switch sessions on the fly using a midi controller (Ideally maybe even using the highest frets on each string to trigger program changes).

My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

guitarnstuff

You might want to check out Brainspawn Forte as well.

Sent from my mind using a telepathically enabled smartphone and Tapatalk 2

sixeight

Also xheck out Niall Moody's pedalboard 2. Free. Works on both Mac and Windows. Have used it for years. Really like it.

germanicus

Update:

Very pleased so far with Cantabile.

I've ended up using just one preset on the FC300 to control everything.

Using my FC-300 in 'Control' mode I have it so that:

The CTL1 and CTL2 footswitches toggle Cantabile up/down through different Cantabile sessions. Pedal 1 controls overall Master volume, and Pedal 2 modulation (great for B3 leslie effects).
I have the different 1/6, 2/7, 3/8, 4/9, and 5/10 selection footswitches on the FC300 assigned to various functions, and these functions can be mapped however you want inside of a Cantabile Session, so for one song you can have them all doing different things (sustain, muting certain sounds, activating rotary fx, transposing an octave, etc) specific to THAT session. Having Cantabile determine what each of these footswitches do means ALOT more control at your feet.

Each 'session' can have several different racks, and each rack holds different VSTi synths and samplers.  Its also possible to record all the incoming midi input and the audio output by the program, to separate files as you play. Each rack also will 'passthrough' all midi if desired.

For those wanting alternate tunings, each session can have its own alternate tuning settings.

You can set up a 'Set list' which includes different sessions (as well as sub-sessions), so as you go from song to song live, you just toggle to the next session and get all your custom tunings, synths/patches, and midi assignment/filter settings.

Midi Assignments and Filters can be Global or by session, and Filters can be placed anywhere, at the initial input stage, or before and between different racks.
You can really tweak.
My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

Elantric

Good reading for Cantabile users here
Forte OR Cantabile??
http://www.kvraudio.com/forum/viewtopic.php?t=271248

Reports are that while Cantabile includes many features, a similar product "Forte" has a lower CPU overhead and can run more VSTi's

Elantric

#5
Its true the old Cantabile reviews might be stale by now

An active Cantabile Forum exists at KVR here
http://www.kvraudio.com/forum/viewforum.php?f=136

and recent update news is here
http://www.kvraudio.com/forum/viewtopic.php?t=381891

and an old review for Cantabile Performer  2.0  here
http://www.musicradar.com/gear/tech/computers-software/digital-audio-workstations-daws/catabile-2-0-performer-215473



Topten Software Catabile 2.0 Performer

Computer MusicAugust 19, 2009, 10:30 GMT

Many gigging and touring pros have taken to using notebooks or even desktop computers on-stage, and why not? With all of the brilliant soft synths, samplers and effects, a laptop can replace racks full of gear and, in theory, reduce the stress that goes with managing a live rig.

However, a live software setup must also be manageable, to withstand life on the road. With the Windows-only Cantabile, Topten Software seeks to give you everything a performing musician might need in a plug-in host, with none of the studio-centric bloat that weighs down most DAWs.

More than that, the developer has provided tools aimed at maximising integration between your MIDI hardware and plug-ins.
Overview

Cantabile isn't a traditional plug-in host, so don't expect it to do any DAW-like editing or arranging. What's more, there isn't a single synth or effect in the package, as Topten is leaving the VST-stockpiling to you.

What Cantabile does is provide a thoroughly customisable workplace, with racks for your VST instruments and effects, and a means by which they can be routed to your hardware MIDI and audio interfaces, as well as each other. It gives you quick and easy access to the most important mixing parameters that you might need at a gig, such as each plug-in's gain and pan settings, presets and wet/dry levels.
"What Cantabile does is provide a thoroughly customisable workplace, with racks for your VST instruments and effects."

These functions are provided in 'racks' rather than in a familiar mixer setting, and you can stack up rack upon rack as you need to.

Instruments and effects are loaded into racks, and the racks themselves can be soloed, muted, bypassed and record armed – you can also use them to process incoming audio signals.

This method is flexible enough for just about any plug-in combo that you can imagine, though it's not as freely patchable as a fully modular plug-in host, such as energyXT2.5 or Plogue Bidule.
In detail

As you'd expect from a product aimed at live performance, Cantabile's MIDI implementation is very flexible. Just about any parameter on show can be assigned to virtually any MIDI controller.

For example, plug-ins can be bypassed with a single key tap via the Note to Controller Assignment, or multiple racks can be spread across the key range to create complex splits and transpositions. In fact, you can filter any incoming MIDI data or reroute it as needed.

'Triggers' can be defined, to control external devices whenever you perform certain actions, such as loading a new session. VST parameters can be controlled via MIDI, too, and you can switch sub-sessions via MIDI program changes.
"Though we've stressed that Cantabile is not a DAW, it can record and play back audio and MIDI, making it a good sketchpad for generating ideas."

So what's a sub-session? Well, Cantabile's settings are stored as sessions, and a sub-session is a named variation within a session. For instance, a session might contain a selection of racks with their own instruments, effects and routings – a variation of that session using the same plug-ins but different mutes, program banks, MIDI triggers, routing entries and sync options could be saved as a sub-session for fast recall.

This is assuming that your plug-ins don't have long patch-load times, which is beyond Cantabile's control.

Though we've stressed that Cantabile is not a DAW, it can record and play back audio and MIDI, making it a good sketchpad for generating ideas that can be tweaked in a separate editor. Performances can be saved, too, as it can record the output of plug-ins, as well as incoming audio.

As for recording, this can be engaged manually or set up to start automatically when Cantabile receives MIDI data or audio above a predetermined threshold. Recordings can run in sync to the master clock or be triggered individually. WAV, MP3 and MIDI files are supported, too, although there's no timestretching of any kind.
Studio tools

Although Cantabile is intended for live performance, it has a few features that are more at home in the studio than on the stage. Some of the most inspiring aspects of these are the morphing and randomisation tools located at the top of the individual plug-in editors. They aren't unique, but they are to-the-point.

There are three such tools, including Randomize, Randomize Between and Morph, with a masking feature that enables you to choose which plug-in parameters are to be affected and which should be left alone. Randomising is accomplished simply by clicking on a dice icon, and there's a slider to adjust the percentage of variation that should occur.
"Although Cantabile is intended for live performance, it has a few features that are more at home in the studio than on the stage."

You can also automate the process via the Animate button – activating this will cause Cantabile to randomise a plug-in's parameters at set intervals, so that you can sit back and wait for something to take your fancy.

You can exert some control over the randomisation process with the Randomize Between mode, whereupon the program will generate random presets that lie somewhere between two selected patches.

Lastly, Morphing is a variation of this, but without the random aspect – instead, you select two patches and simply use a slider to blend between the two.
Summary

Cantabile is a powerful and deeply flexible program. In practice, it performs well, and though we did crash it once during the review period, it wasn't a repeatable problem. Multicore support means that it went easy on our machine, and 64-bit Windows users will be glad to know that there's a version for them.

It's true that there are a handful of dedicated plug-in chainers and modular hosts out there, and some of them make fine live performance tools. However, Cantabile was designed from the ground up for live performance, and it shows. Frankly, we'd be hard pressed to conceive of a live scenario that Cantabile couldn't enhance.

It's not for everyone, but if you're a performing musician looking to maximise the live experience, you really should try it out. Note that there's a cut-down version, Cantabile Solo, which lacks sub-sessions, triggers and the MIDI routing table.
MusicRadar Rating
4.5 / 5 stars
Pros

Bloat-free. Awesome for live work. Excellent morph and randomising tools. Sub-sessions are a good idea. Masses of MIDI control. 9/10
Cons

Less flexible than other hosts.
Verdict

For live work, jamming and using as a musical sketchpad, Cantabile 2.0 Performer is indeed in our top ten.

Elantric

While there are several we found, one that really fit the bill nicely is called "Console Sound Modular Studio" or simply "Console." This is an inexpensive shareware program ($54) from a Japanese developer named Art Teknica that has all we were looking for -- and much more.

Another VSTi Host app
Art Teknica's Console
http://www.console.jp/en/
Using Console as an effector for guitars
http://www.console.jp/en/library/example/guitar/index.html


germanicus

Quote from:  Elantric on May 15, 2013, 09:07:15 AM
Good reading for Cantabile users here
Forte OR Cantabile??
http://www.kvraudio.com/forum/viewtopic.php?t=271248

Reports are that while Cantabile includes many features, a similar product "Forte" has a lower CPU overhead and can run more VSTi's

Yeah I think the issue about overhead was dealt with (they were referring to an older release in 2009) by the programmer within the thread.

I tried a demo of forte and found it crashed twice. I'll try it again, but I haven't had any CPU problems with Cantabile. I'm able to run an EZkeys piano, M-tron Pro (loaded with two sounds simultaneously), and a Symphobia Multi in Kontakt 5 all concurrently without any problems.

FWIW im running mainly softsamplers (the 3 above are all sample based with real time fx running), so a softsynth may have a different outcome.


My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

germanicus

For some reason the Forte trial version wouldn't see my 'Focusrite Forte' interface (Ironic no?) in Asio mode, only WDM.

I've just gone ahead and purchased Cantabile Solo. $49 seems extremely reasonable. The performer version (90 bucks more) adds more extensive midi routing, custom trigger events and sub sessions. I don't think I need any of those, but can always upgrade if needed.


My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

Elantric

I agree - Cantabile looks like an awesome product!

I will use the trial and see how it works.

Elantric

#10
Just an update - I went ahead and purchased Cantabile Performer
http://www.cantabilesoftware.com/

As time permits I hope to share my experiences using this to integrate FTP and VSTi's for live gig use.

Cantabile Forum
http://www.kvraudio.com/forum/viewforum.php?f=136

   

germanicus

Gonna try it out at rehearsal tonight.

Using the FC-300 in control mode. Set up some global functions in cantabile such as master volume, All notes off (panic), sustain.

Tip: Make sure under Set List settings, you turn off the Save inquiry when changing sessions.
My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

Charles5150

I tried a lot of VST hosts some time ago, and ended using Cantabile, it's very configurable and robust. Indeed, I did a pair of gigs using only my guitar through sound card through pc through FRFR monitors using FCB1010 as midi controller and THD Overloud as amp/effects.

But can't stand the unpredictability of Windows, it's a PITA seeing every five minutes a pop-up telling you to update the antivirus, or java, or whatever.

I began to try music-oriented linux distributions. They usually are build on top of a real-time kernel, which is the one used in time-critical industry processes and telecomunications.

Believe me, that's another league every musician should try. There's nothing you can't do, using Jack you can assing any possible input to any possible output, any kind of strange signal routing or midi assigment, it's like owning a huge and complex studio at your fingertips only limited by the CPU power available.

There's a lot of amazing effects and amp simulators nowadays out there. Even some freeware ones, for example the Poulin Hybrit is and impressive old Marshall emulator. There's a lot of high quality cab Impulse Responses out there, and you can go beyond and make your own IRs, or even copy exactly your favorite guitar tone using an espectrum analyzer and a deconvolver.

I ended using Kxstudio, a very powerful multimedia linux distribution, with a real time kernel. My latency is 1.3ms ( I never could go bellow 15ms in Windows). I can use any kind of linux native plugin but I can use VSTs too, and manage complex routing through Claudia ( kind of a VST host ), all in real time. I've almost stop using VG99


jassy

#13
Quote from: Charles5150 on May 19, 2013, 05:37:42 PM

I ended using Kxstudio, a very powerful multimedia linux distribution, with a real time kernel. My latency is 1.3ms ( I never could go bellow 15ms in Windows). I can use any kind of linux native plugin but I can use VSTs too, and manage complex routing through Claudia ( kind of a VST host ), all in real time. I've almost stop using VG99

You can run vst effects and vstis in linux? really is it possible?

About the topic, I researched also what vst host o use, tried forte, kore 2 (I liked it very much has vst host and big synth concept, but now is abandoned) and Cantabile was the one, at least for me, very powerful. But Im not really confident with a laptop and windows live...


germanicus

Windows is really only unpredictable if you let it be. You can turn off all the problem areas in windows.

You shouldn't be running an antivirus when doing audio stuff. Ideally you really should only do audio on that particular laptop.

Now a stripped down O.S. that's specifically made for audio (remember BeOS?) would be nice, and im sure there is bloatware running in windows, but if you spend even a little time tweaking win 7 and 8 you can get it stable/reliable.

I would certainly be open to using a Linux based O.S. if the programs I want to use will run on it.
Will VSTi's such as Kontakt, EZKeys, and M-tron pro run?


My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

admin




Cantabile 3 is coming...

For the last 10 months I've been working on a complete rewrite of Cantabile. It's a big job so rather than waiting until it's finished I've decided to release it in stages - the first of which is available now.

This first stage has fairly limited functionality but it's a major step because it includes Cantabile's new faster, leaner audio engine and a minimalistic new user-interface.  Here's what's included:
ASIO (in/out) and WASAPI (out only) driver support
Virtual MIDI and Audio ports,
VST plugin hosting,
Audio and MIDI routing,
MIDI Filters,
MIDI Monitoring

Cantabile 3 Preview is available now to licensed users of Cantabile 2 Solo and Performer.  You can install it side by side with version 2, but it won't use your existing session files yet.
Download Now
Since some of the basic concepts have changed I've written some guides on how to use it.  You might also like to read about why I've decided to rebuild it.

Please note that although this early release is free for existing users, the finished product will be a paid upgrade.

Of course the whole point of releasing early is to gather feedback and let Cantabile's users have some say in its future direction.  Please get in touch if you have ideas, suggestions or comments.

Regards
Brad Robinson
Topten Software

shawnb

Quote from: germanicus on May 19, 2013, 08:38:53 PM
Windows is really only unpredictable if you let it be. You can turn off all the problem areas in windows.

You shouldn't be running an antivirus when doing audio stuff. Ideally you really should only do audio on that particular laptop.

Yes.   Ideally.

I use a slightly different approach, and it works just fine.  If I were pro or gigged a lot, I'd have a dedicated PC.  But I'm a hobbyist/jammer. 

My main "mothership" Win7 PC has everything - internet, antivirus, etc.   It has all the storage & I/O & access I need.  My teenage sons play all kinds of horrific internet games on it (RIOT based games, like League of Legends....) while Skyping with friends & streaming audio...  I'm fairly routinely un-hijacking our primary PC.   I'm also into photography, so it has a lot of Adobe software on it also.  I demand a lot from my poor PCs.

Even in this overloaded configuration, I get acceptable performance, by just spending a few minutes turning some things off before diving into audio.   

My second PC is a little Win7 Asus Ultrabook, extremely compact (almost iPad Mini size).  This is used for taking my gear on the road. 

Priorities for turning off are
  -  Antivirus (when disconnected from internet)
  -  Wireless (MAJOR issue, pointed out by running LatencyMon, my new favorite latency checker)
  -  Any "live update" software (ASUS Live Update) that checks for updates.

Essentially I go thru the system tray & EXIT any software I don't want at the moment. 

Shawn


BTW - what puts this latency monitor above the rest is that it IDs your problem software:
http://www.resplendence.com/latencymon
(Though their website appears to be down this am...)

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

bbob

According to the FTP user manual controlling the Triple Play software with a midi foot controller (FC300 in my case) is limited to:

1. Hold / Loop. Send CC 66 value 127, 0 on release, for hold/loop
2. Patch up. CC 68 value 128, 0 on release for patch up
3. Patch down. CC 67 value 127, 0 on release for patch down
4. Program change. A MIDI program change will change to a user patch number which is one greater (depending
on the pedal brand – some pedals will correct for this automatically, and the numbers will correspond)
than the program change number. Program change commands will only work if you have currently or previously
opened the user patch list and currently have a user patch selected. It will not work within the default
patch list. So, for example, if you send program change 5 on midi channel 1, and you have the user patch list
engaged in our software, TriplePlay will go straight to user patch #6.
5. Volume expression. CC 80, controlled via expression pedal. Use this command for control of TriplePlay
volume post Master fader (for this to work, the final volume dialog in the Preferences menu must be toggled to
on


I need to be able to control the volume of the Synth 1 and Synth 2 sounds individually using FC300 expression pedal 1 for Synth 1 and expression pedal 2 for Synth 2.

From what I have read it sounds like Cantabile Solo can do this.

When you are using Cantabile and the FTP is the Fishman TP software hosted and running in Cantabile or just running Cantabile without the FTP software?

Thanks.

Bob

germanicus

You can run the FTP software inside of Cantabile if you wish.
My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

bbob

#19
I'm just getting my feet wet with Cantabile Solo but it is amazing what you can do and really pretty simple.  Using a Michael Kelly hybrid stereo guitar and Roland Duo-Capture I can run the mag pickups to one Cantabile rack and apply Guitar Rig LE (came with the FTP) amp and effects, run the Fishman bridge pickup to another rack and open a second instance of Guitar Rig LE and have totally different effects, then have a third rack, using the FTP signal, have a Sampletank organ sound, then have a fourth rack using the FTP signal and have a Sampletank finger bass guitar sound.  The third and fourth racks have different guitar string frequency ranges applied in Cantabile to the top four guitar strings for the organ sound, the bottom two strings the finger bass.  And all of this is controlled with a battery powered FC-300.  Cantabile has a simple midi learn feature for almost any parameter.  And no need to use the Fishman Triple Play software.

Thanks Germanicus for all of your Cantabile forum posts, they were very helpful.

Bob

germanicus

No problem!

The midi learn function is really fantastic. It made configuring my fc-300 foot pedal a breeze.
My albums done with modeling/guitar synth at http://music.steamtheory.com

JTV69/59P/Godin LGXT/Multiac ACS/Variax 700 AC
Helix/FTP/GP10/VG99/SY1000
Traynor k4

Elantric

#21

It's been a while coming, but the next preview of Cantabile 3 is here. 
http://www.cantabilesoftware.com/
Preview 4 introduces the following new features:
MIDI Controller Assignments
Session Wide and Per-Song Transpose
New "Dark" Color Theme and improved "Light" theme
Keyboard Hot Key Customization
Panic Button (All Notes Off)
Also, I've fixed a few bugs and made a couple of subtle performance improvements. Preview 4 is available for download now!
Download
If you have comments or feedback there's the Cantabile Trello board where you can also vote on features that are important to you.

And finally, don't forget to follow @CantabileApp on Twitter for tips, development updates and other things of interest.

Brad

admin

Lots of new things happening with Cantabile - they are prepping a Release 3 soon with many new features

Read the Blog here:

http://www.cantabilesoftware.com/blog/






Elantric

#23
http://www.musicradar.com/news/tech/why-are-we-seeing-more-plugin-racks-shells-chainers-and-non-daw-hosts-622155?utm_source=Adestra&utm_medium=email&utm_campaign=11945&utm_term=1248369&utm_content=31379

Computer Music June 02, 2015, 10:30 UTC
Why are we seeing more plugin racks, shells, chainers and non-DAW hosts?
You can now call up your effects and instruments in more places than ever before


When you need a plugin host but you don't actually intend to record or sequence anything, there are now more options on the market than ever before. It all comes down to stability in a live context and resource usage, reckon our five industry insiders...

Cantabile Software
http://www.cantabilesoftware.com/
"I think this all comes down to virtual instruments and live performance. We've reached the point where even a modest PC can handle incredible-sounding plugins well enough to be played in real time. The ability to load up a notebook with hundreds of great sounds gives musicians a lot of room for creativity and a lot less gear to take on the road. However, for this to work effectively, you're far better off with a nimble host designed specifically for live performance"

Brad Robinson



DDMF
http://www.ddmf.eu/
"I think there are two main reasons for this recent trend: one has to do with the fact that Avid seems to be more willing now to allow VST-AAX or AU-AAX wrappers than they used to be. Then, the use of JUCE as a development framework is now more widespread, offering, to the experienced developer, a relatively comfortable way to write plugins that host other plugin formats."

Christian Siedschlag



eaReckon
http://www.eareckon.com/en/products/bloxpander-vst-host-for-live-performance.html

"Using a computer as a musical instrument has always been a real dilemma. On one hand, a computer is now unanimously recognised as a powerful tool that ably replaces a large set of bulky, sometimes unaffordable or even nonexistent musical devices. On the other, it retains the image of a studio tool, which is not conducive to a direct and physical relationship.

"Non-DAW hosts probably attempt to resolve this dilemma by providing a different workflow that suits the logic of musicians (keyboardists, especially) or technicians in live situations, who just want to forget their computer while taking advantage of its immeasurable power/price ratio."

Philippe Decuyper



Soundtoys
http://www.soundtoys.com/
"Our plugins were designed to work as a complete system, and an effect rack was part of the first design spec. It's taken us this long to design a complete-enough set of effects to make the idea useful, and for increased CPU power to make it viable. I think the popularity of 500 series rack modules, the new wave of modular hardware synths, along with higher-resolution displays, and artists getting more comfortable with using computers outside the studio – for live performance – has helped push this idea into the mainstream."

Ken Bogdanowicz



Blue Cat Audio
http://www.bluecataudio.com/Main/Home/
"It's much more convenient to launch a light host application to play a virtual instrument with effects than having to load a full-featured DAW. With such a host, you can use a laptop as an instrument on stage. Also, we're all using several DAWs nowadays, and when available as a plugin, a third-party chainer lets you share configurations between DAWs."

Guillaume Jeulin

Elantric


A quick little demo of Cantabile 3 on a Surface Pro 3 with touch screen support.

http://www.cantabilesoftware.com/blog/posts/46/multi-core-performance-improvements
Multi-core Performance Improvements
Monday, May 18th, 2015     #general #everything

For the last few weeks things might have appeared quiet with Cantabile 3, but in fact I've been really busy. Mostly with GUI work for the OS-X port (which I'll write about later), but also I've been performance tuning the audio engine for multi-core processors.

THE CHALLENGE

Getting Cantabile's audio engine to run efficiently on multi-core machines is a challenging problem. At its heart the audio engine is a connected object graph - a giant tree of components wired together to produce whatever it is that the user has configured in the session. These components include things like audio mixers, midi muxers, peak level readers, media players, plugin hosting components and many others.

Each object in the graph has a set of precedent objects - objects that must be executed before the dependant object can be executed. For example the audio input mixer for a plugin must be executed before the plugin itself can be processed.

Up until now, Cantabile 3's approach to executing this graph was to put all objects with no precedents into a queue, wake up all the worker threads which would then:

Pull one object from the queue
Execute that item
Put any dependants that had no futher pending precedents onto the end of the queue
Repeat if there was something else in the queue
Otherwise, sleep for a bit, wake up, and check again for something to do
It's a very simple algorithm and it works, but it suffers from two significant problems - excessive locking and busy sleeping.

EXCESSIVE LOCKING AND LOCK CONTENTION

In previous posts I've said that Cantabile's audio engine is completely lock free - which in terms of interactions with code outside the audio engine it is. Internally however there's one lock that used to manage access to the above mentioned queue when processing in multi-threaded mode. (When multi-core mode is disabled no lock is used).

The problem with the above algorithm is that each access to the queue or any of the elements in the queue requires taking the lock. For small object graphs this doesn't really present a problem, but as the object graph grows (a session with 64 plugins has about 500 objects in the graph) the locks start to consume a reasonable percentage of the audio cycle time.

Worse, lock contention issues start to arise - where multiple threads are fighting for the lock and end up stalling each other.

BUSY WAITING

The other problem with the old approach is that in order to get the worker threads to respond quickly to new work placed in the queue they would "busy" wait.

That is, rather than properly sleeping and letting the operating system re-awaken it later, it would simply spin in a loop waiting for work to become available. It wasn't a tight loop, was only while the audio cycle was being processed and it regularly yielded the time slice back to the OS - but less than ideal.

The problem with this busy waiting is that it consumes CPU resources that could be used by multi-core plugins or other software running on the machine.

THE SOLUTION

After spending a couple of days trying (and failing) to tune these issues away it became apparent it needed a new strategy. The biggest problem is that every object in the graph requires taking the lock at least once just to remove it from the queue.

I toyed with the idea of using lock-free ring buffers but these generally impose single-reader/single-writer constraints - which doesn't fit this scenario. I also experimented with grouping parts of the object graph into sections that could be executed as a set, but this imposes and additional burden on the code that builds the object graph - a burden I'd prefer live without. I even tried automatically generating these groupings but this was too slow.

Finally, I came up with a new strategy that so far seems to be working:

Each object in the graph is given a "weight" - a number that represents the approximate load to execute the item. Currently plugins are given a load of 100 while everything else gets 1.
A maximum queue weight is calculated by dividing the total graph weight by the number of CPU cores.
Each worker thread then:

Takes the lock
Pulls as many objects from the queue as it can without exceeding the maximum queue weight and places them into a local queue
Releases the lock
Executes the next object in the local queue
Releases any dependants objects whose pending precedent count have reached zero.
If a released dependant can fit in the current local queue without exceeding the maximium queue weight it's appended to the local queue and will be executed by this thread soon - possibly without ever retaking the lock.
Otherwise, the lock is taken and it's put back in the master queue and another worker thread is awoken.
Repeat from 4 until there's nothing left to do.
Busy wait for a little bit, then properly sleep until woken.
Repeat from 1 until the entire object graph has been executed.
In other words, each worker thread tries to pull as much work as it can from the master queue with just one lock but not so much that there's nothing for other worker threads to help with. This approach can also process long chains of objects without having to retake the lock - a reasonably common pattern in Cantabile's object graphs.

The other part of the solution was to replace the busy waiting with a less aggressive algorithm that busy waits for a short period but then fairly quickly gives up and yields back to the OS. Since each awakening performs more work anyway, the cost of a full sleep/wake become proportionally lower.

Of course the actual implementation is more complex but that's the general idea.

SO HOW DOES IT PERFORM?

My benchmark for this has been a session with 64 plugin instances (an object graph of just under 500 objects).

Before these improvements each thread was taking about 70-80 locks per audio cycle - way too many. After these changes it's a much lower 7-10 for the primary audio thread and maybe 10-15 for the other five threads. It tends to total around 60 per audio cycle which tracks nicely with the number of plugins.

In practice this translates to a drop from about 12% to 3% when idle and 40% down to about 25% when playing. Also, the load seems more stable. Not bad!

AVAILABLE NOW - IF YOU'RE KEEN!

These changes are all available now in build 3062 - but, as you can see this was not a trivial change and I'm still testing it. If you do find any issues, please let me know.