Carla API Guide?
Moderators: MattKingUSA, khz
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Carla API Guide?
Has anyone used the Carla (the plugin host by falkTX) source as an API to include plugin host capability in their own app?
I'm looking for a quick basic guide to get started. It doesn't make sense spending a lot of time figuring this out from the source when someone has already done it .
For instance, fluidsynth has a nice guide at http://fluidsynth.sourceforge.net/api/index.html to get started. A similar one for Carla would be useful (or even just some pointers to get started quickly).
I'm looking for a quick basic guide to get started. It doesn't make sense spending a lot of time figuring this out from the source when someone has already done it .
For instance, fluidsynth has a nice guide at http://fluidsynth.sourceforge.net/api/index.html to get started. A similar one for Carla would be useful (or even just some pointers to get started quickly).
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Awesome, thanks for the help!
Please bare with me though; we might have to start quite basic.
Is there a Carla source package I need to install, or do I extract the source code and use it from there?
Please bare with me though; we might have to start quite basic.
Is there a Carla source package I need to install, or do I extract the source code and use it from there?
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Building and installing Carla (stable) doesn't produce any .pc files for pkg-config, so
pkg-config --cflags carla-standalone
and
pkg-config --libs carla-standalone
doesn't work.
pkg-config --cflags carla-standalone
and
pkg-config --libs carla-standalone
doesn't work.
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Roundup thus far:
The includes are
I use to be in the right namespace.
Funny thing: when building, I get a "cannot find rpath=/usr/lib/carla: No such file or directory" error. If I edit the makefile line from
to
(added the dash before rpath)
it stops complaining. Any idea why this is? I use qmake (QtCreator) to build.
Anyway. After a successfull build, should I be hearing the audio file being played back? (Yes I replaced the filename with an existing one on my system and connected the new client to System in QJackCtl.)
Secondly, can you briefly explain the arguments of the carla_add_plugin function? For instance, if I were to load the Hexter DSSI plugin, the arguments would be:
btype: BINARY_NATIVE
ptype: PLUGIN_DSSI
filename: /usr/lib/dssi/hexter.so
name: any string
label: ?
uniqueID: Does this matter?
extraPtr: ?
The includes are
Code: Select all
#include <carla/CarlaBackend.h>
#include <carla/CarlaEngine.hpp>
#include <carla/CarlaHost.h>
#include <carla/includes/CarlaDefines.h>
#include <carla/CarlaPlugin.hpp>
#include <carla/CarlaNative.h>
Code: Select all
CARLA_BACKEND_USE_NAMESPACE
Funny thing: when building, I get a "cannot find rpath=/usr/lib/carla: No such file or directory" error. If I edit the makefile line from
Code: Select all
LIBS = ... -WL,rpath=/usr/lib/carla ...
Code: Select all
LIBS = ... -WL,-rpath=/usr/lib/carla ...
it stops complaining. Any idea why this is? I use qmake (QtCreator) to build.
Anyway. After a successfull build, should I be hearing the audio file being played back? (Yes I replaced the filename with an existing one on my system and connected the new client to System in QJackCtl.)
Secondly, can you briefly explain the arguments of the carla_add_plugin function? For instance, if I were to load the Hexter DSSI plugin, the arguments would be:
btype: BINARY_NATIVE
ptype: PLUGIN_DSSI
filename: /usr/lib/dssi/hexter.so
name: any string
label: ?
uniqueID: Does this matter?
extraPtr: ?
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
I have trouble getting the app to produce sound. It builds ok and runs; jack clients appear and I can assign it to the system audio output and assign midi to its input. However, no audio. Both for the audio file example you provided, as well as for loading other plugins. I can even show the plugin's gui with carla_show_custom_ui. But just no sound.
Is there something else I should initialise in the code?
Is there something else I should initialise in the code?
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Ok I can now produce sound from plugins, by activating them:
(0 being the id of the plugin.)
The internal audio file player still doesn't work though.
Code: Select all
carla_set_active(0,true);
The internal audio file player still doesn't work though.
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Is there some trick to loading a plugin state? I can save a state using carla_save_plugin_state, but using carla_load_plugin_state on the same file returns false.
Does the api provide a way to have for instance one midi input port and one audio output port, and then route the midi and audio internally between the plugins? i.e. Every plugin does not appear as a client to Jack, only the main application does.
Does the api provide a way to have for instance one midi input port and one audio output port, and then route the midi and audio internally between the plugins? i.e. Every plugin does not appear as a client to Jack, only the main application does.
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Big sfz sample packs take a while to load. Is there any way one can get the loading progress from the carla host api when using the native sfz plugin?
How do I set the backend mode (i.e. Rack mode / single client mode / multi client mode)?
The patchbay port connect function takes groupID and portID. What are these? Also, is there a way to get port names for a given plugin?
How do I set the backend mode (i.e. Rack mode / single client mode / multi client mode)?
The patchbay port connect function takes groupID and portID. What are these? Also, is there a way to get port names for a given plugin?
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
Does the way the Carla backend uses Fluidsynth prevent one from implementing it elsewhere in the same program?
I use the Fluidsynth library in an app. However, when building with the appropriate libraries in order to also use Carla, I get the message
on standard output when running, and no Fluidsynth clients are registered in Jack. When removing the Carla libraries from my build, Fluidsynth works fine again.
Any thoughts?
I use the Fluidsynth library in an app. However, when building with the appropriate libraries in order to also use Carla, I get the message
Code: Select all
fluidsynth: error: Couldn't find the requested audio driver jack. Valid drivers are: .
Any thoughts?
- noedig
- Established Member
- Posts: 233
- Joined: Wed Feb 12, 2014 4:39 am
- Location: South Africa
- Has thanked: 9 times
- Been thanked: 52 times
Re: Carla API Guide?
falkTX,
What exactly does the carla_engine_idle() function do and how important is it to call it often? I just realized that I kind of forgot to ever call it, and everything seems to be working fine.
What exactly does the carla_engine_idle() function do and how important is it to call it often? I just realized that I kind of forgot to ever call it, and everything seems to be working fine.