audio unit

loading un official components from qc plug-in.

dust's picture

so this is a general question in regards to the qc runtime environment. so i have lost a lot of sleep trying to get a QC plugin to load an external audio unit plugin from a component bundle. all is not at a loss because the journey down this road has enabled me to learn a lot more about audio unit programing than i originally intended while trying to make a simple AU Host.

what is happening is during the qc runtime of the plugin qc apparently only loads up and registers only "apple" core audio units. which are located in directory /System/Library/Components/

the audio units i am trying to load are located in the /Library/Audio/Plug-Ins/Components directory.

what is strange to me is that if i run my plugin as an application in the console everything works, but once i run the code using qc to with the same code qc will only find apple components. it seems the issue is with the quartz runtime environment.

does anybody know what the trick is to circumnavigate this issue making it possible to load external components ? i find it hard to believe that this would not be possible. i know QC is intended for motion graphics but given that context i would also like to be able to load my camera component bundle up as well so QC will recognize my camera but i'm reluctant to even try that given the headaches i'm getting trying to load up a simple AU graph.

i have implemented various methods in an attempt to load up components that normally are automatically loaded.

some methods i have tried. load NSbundle from path. load NSPlugin from path. load Component from FSPath load Component from CFURL load Component from resource etc...

i have wrote a script that dynamically registers all the components in a given path. I have used instruments file activity to verify that quartz composer does in-fact find the directory and not only does it find the directory but registers all the components in that path dynamically all in one shot. this is the call Instruments verifies.

"CFURLCreateDataAndPropertiesFromResources" /Library/Audio/Plug-ins/

So i know my code is working one because it works in the console standalone and 2 because Instruments verifies that qc is actually doing what i asked it do.

All is not at a loss i have figured out how to make an official and un official plugin. i have made an AU factory to instantiate Audio unit parameters, i also have learned how to load the views into a qc patch settings nib, which is cool because 1 you get parameters to automate and 2 you also get the GUI made by the manufacturer of the audio unit.

it is great an all that this works in the context of an application bundle but that really defeats the purpose of me making an AU Host plugin for QC. I mean Garage Band and Au Lab come for free as it is which are easy enough to integrate into the multi task environment with qc but still....

so given all that the system core audio components and effects that qc recognizes are very powerful but i don't find a plugin of this type to be very effective if i can't load my own component up in qc let alone someone else's component. given that everybody uses the core audio unit component manager and CA API this is pretty standard stuff for the desktop and iphone. i am not using any external libs or frameworks its all apple API so I am confident that this is entirely possible.

any suggestions from anybody that knows c, c++, obj c, obj c++, qc etc...

i feel that people would find this type of plugin very useful and most defiantly will share it.

DLSSynth AU Component QC Plug-In

dust's picture

this is a Roland DLS synthesizer plugin for quartz composer. DLS stands for "downloadable sound font" this plugin loads apples default DLS component and runs it through a spatial reverb unit. more of these to come soon.

i'm working on a component host plugin for qc as well, that eventually will let you host audio units, record audio, add effect units plus do 3d spatial mix downs.

the next step for me is to make some core audio unit node plugins that can be strung together as well as make some basic components for sine waves, square waves, etc....

so this is just the basic initial exploration into using quartz composer with core audio units. it seems to work good, but be careful of overloading the plugin or you will get bad frame rates. i suggest using the pulse patch. check out the example....hit the space bar to make music.

i built this plugin for my computer in 10.6 x86_64 but audio components are much older than QC so you will be able to build the source to what ever machine your running.

V2..... custom path.

your bank path looks like this.

/Folder/AnyPlace/Any/File.dls

make sure to include the file and extension.

kDLSSynth AU Component Player. So this version is more of a generic AU DLSSynth player. The bank path is fully working and tested with a .dls file. The synth still loads up system with the original Roland DLS System Synth. Enter a path to your custom DLS or SoundFont bank and viola you got a QC Sampler. In order to load your custom DLSSynth you need to stop the viewer and start it again in order for the Plugin to load a new DLS.

try my custom DLS Scratch kit. i would make lots more of these DLS Synths but I want to add more features to the plugin. Like component loading from a path and multiple configurable Effect Units.