Audio Programming Environment 0.3 - x32/x64 on win + mac (vst/au)!

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Mayae wrote:So what, you want to release commercial closed-source scripts, or? It takes two seconds to copy+paste an APE script into a fresh VST/AU project, that can bear any license you want
Ahh. Ok. I was just thinking that given that APE has a generic GUI framework, could have a patcher interface and all, then it'd be similar to Reaktor, which does involve also commercial patches. The benefit is the unified interface for both developers and users.

Btw, why is APE crashing in Reaper?

I do:

Show Editor -> Load some script -> Hide Editor -> Compile (Compile OK!) -> Activate -> APE Fatal Error

It works in Bitwig.

Post

Also,

Have you thought about hosting in Github?

I'd be willing to perhaps provide some code since I can see that I'll be using this. Might even try a WDL-OL port, if that turns the GPL license to something more bearable such as MIT.

Post

Also, what about MIDI?

Post

Also,

Would be helpful to have guides for setting up APE to use C++. Given that loads of libraries are in C++, I don't know why this in C to begin with.

Guide for Python perhaps as well.

Post

When one modifies the config.cfg in APE folder to add a language, how does the APE VST/AU read the changes, if the VST/AU is in some plug-in folder other than the APE folder?

Edit:
NVM, one had to use the config.cfg associated with the plug-in (VST/AU), in OS X this is contained in the package ("Show Package contents"), not the one in APE folder.

Post

Added the following to config.cfg,

Code: Select all

default = "cpp";
default_file = "/examples/bitreducer.c";

cpp:
{
	extensions = ("cpp", "h")

	compiler
	{
		name = "g++"
		path = "/usr/bin/g++"
		arguments = "";
		exports:
		{

		}
	}
}
Now APE says:

[Compiler] : [Generator] : Setting not found!
[Compiler] : [Generator] : languages.c
[GUI] : Error compiling project.

Edit:

I think replacing exports: {} with exports = 0; solved it.

---

Now trying to compile C++ placed in the Editor generates at Compile the following:

[Compiler] : [Generator] : Error while loading compiler!
[Compiler] : [Generator] : Error loading compiler module 'g++' for language 'cpp' at '/Library/Audio/Plug-Ins/VST/Audio Programming Environment.vs/Contentusr/bin/g++'. OS returns -3.
[GUI] : Error compiling project.

How should the path be given?
Last edited by soundmodel on Tue Jan 26, 2016 1:32 am, edited 3 times in total.

Post

BTW,

There seems to be a slight bug in the "Save" -operation in the Editor.

It generates an error if one tries to Save a file that has nothing added to it.

Post

Fluky wrote:
Mayae wrote:So what, you want to release commercial closed-source scripts, or? It takes two seconds to copy+paste an APE script into a fresh VST/AU project, that can bear any license you want
Ahh. Ok. I was just thinking that given that APE has a generic GUI framework, could have a patcher interface and all, then it'd be similar to Reaktor, which does involve also commercial patches. The benefit is the unified interface for both developers and users.

Btw, why is APE crashing in Reaper?

I do:

Show Editor -> Load some script -> Hide Editor -> Compile (Compile OK!) -> Activate -> APE Fatal Error

It works in Bitwig.
Doesn't the error message show something more? I tested it in Reaper, no problems iirc
But yes, I can see your idea. It will mostly likely keep using JUCE, though. I'll have to check how bad it is.
Fluky wrote:Also,

Have you thought about hosting in Github?

I'd be willing to perhaps provide some code since I can see that I'll be using this. Might even try a WDL-OL port, if that turns the GPL license to something more bearable such as MIT.
It's currently on Bitbucket: https://bitbucket.org/Mayae/audio-progr ... nvironment
Fluky wrote:Also, what about MIDI?
Yet to come (includes overhaul of event system, that hopefully brings parameter automation as well).
Fluky wrote:Also,

Would be helpful to have guides for setting up APE to use C++. Given that loads of libraries are in C++, I don't know why this in C to begin with.

Guide for Python perhaps as well.
Page 20 in the manual describes how to do it - note that it only works on Windows (yet). It is in C because an existing crossplatform light compiler existed (TCC). C++ requires a massive compiler, library and so on, thus the choice was made that the user could utilize that instead, if the user has any own compilers installed.

But yes, Python was always something I wanted to do. It may even be possible to circumvent the needed compiler (that takes 30 seconds to create), and write it in pure Python/shell.
Fluky wrote:Added the following to <span class="skimlinks-unlinked">config.cfg</span>,

Code: Select all

default = "cpp";
default_file = "/examples/bitreducer.c";

cpp:
{
	extensions = ("cpp", "h")

	compiler
	{
		name = "g++"
		path = "/usr/bin/g++"
		arguments = "";
		exports:
		{

		}
	}
}
Now APE says:

[Compiler] : [Generator] : Setting not found!
[Compiler] : [Generator] : languages.c
[GUI] : Error compiling project.
As per page 8 in the manual, the path needs to be to a compatible APE compiler. You can either write one yourself (using the info on pages 9 and forward), or help porting the syswrap compiler. Note that compilers, in this instance, is mostly thin wrappers around specific compilers.
Fluky wrote:BTW,

There seems to be a slight bug in the "Save" -operation in the Editor.

It generates an error if one tries to Save a file that has nothing added to it.
Yes, old code. It is harmless though.

Post

Mayae wrote: As per page 8 in the manual, the path needs to be to a compatible APE compiler. You can either write one yourself (using the info on pages 9 and forward), or help porting the syswrap compiler. Note that compilers, in this instance, is mostly thin wrappers around specific compilers.
So syswrap will allow the use of generic compilers?

Might help, after I wrap my head around it. And if it's non-GPL.

---

Btw,

Some are claiming that one could call C++ functions from C. This might be a temporal solution for including C++ libraries into APE scripts.

Post

Yes, syswrap is a wrapper around some shell scripts. If you can get those scripts to produce a valid dynamic lib ape can host, you're good to go.

I use syswrap to invoke visual studio's C++ compiler, for instance (thus, my APE runs C++).

If you insist, the header compiler api ("APESupport.h") doesn't have an associated license.

Post

Fluky wrote: Some are claiming that one could call C++ functions from C. This might be a temporal solution for including C++ libraries into APE scripts.
It seems that I can access variables such as char [] in a header I defined (using info from: http://www.jonathanbeard.io/tutorials/Mixed_C_C++.html), but functions seem to throw:

[Compiler] : tcc: error: undefined symbol 'functionName'

---

And they don't if I implement the function directly in the .h file, rather than in the associated .cpp/.c file.

---

Perhaps I need to tell Tcc4Ape about the .c/.cpp file somehow?

---

What about if the library uses static/dynamic libraries?
How to include those?

Post

Fluky wrote:
Fluky wrote: Some are claiming that one could call C++ functions from C. This might be a temporal solution for including C++ libraries into APE scripts.
It seems that I can access variables such as char [] in a header I defined (using info from: http://www.jonathanbeard.io/tutorials/Mixed_C_C++.html), but functions seem to throw:

[Compiler] : tcc: error: undefined symbol 'functionName'

---

And they don't if I implement the function directly in the .h file, rather than in the associated .cpp/.c file.

---

Perhaps I need to tell Tcc4Ape about the .c/.cpp file somehow?
TCC only eats vanilla C. The first error is probably because you didn't forward declare the function found in another translation unit. Other translation units needs to be passed as object files to TCC. It should work if you write "args = other_translation_unit.o <other args>", in the configuration file.
---

What about if the library uses static/dynamic libraries?
How to include those?
Static and dynamic libraries can be linked using -lxxx switches. Read more here: http://bellard.org/tcc/tcc-doc.html

Post

Mayae wrote:
Fluky wrote:
Fluky wrote: Some are claiming that one could call C++ functions from C. This might be a temporal solution for including C++ libraries into APE scripts.
It seems that I can access variables such as char [] in a header I defined (using info from: http://www.jonathanbeard.io/tutorials/Mixed_C_C++.html), but functions seem to throw:

[Compiler] : tcc: error: undefined symbol 'functionName'

---

And they don't if I implement the function directly in the .h file, rather than in the associated .cpp/.c file.
The first error is probably because you didn't forward declare the function found in another translation unit. Other translation units needs to be passed as object files to TCC. It should work if you write "args = other_translation_unit.o <other args>", in the configuration file.
I have forward declared the functions in the .h file.

This is my ctest.h file:

Code: Select all

#ifndef _CTEST_H
#define _CTEST_H

    #ifdef __cplusplus
    extern "C" {
    #endif 
        char numb[] = "5";
        int getNumber();
    #ifdef __cplusplus
    }
    #endif

#endif
and ctest.c file:

Code: Select all

#include "ctest.h"

int getNumber() {
    return 5;
}
Last edited by soundmodel on Tue Jan 26, 2016 1:29 pm, edited 1 time in total.

Post

I assume you #include the test file in the ape script, then (post it?). As APE doesn't natively support multiple translation units, you either have to pass the .c file as an additional argument to TCC, or compile it to a object file / shared object / dynamic library, and pass it via the args in the config file.

Post

Mayae wrote:I assume you #include the test file in the ape script, then (post it?). As APE doesn't natively support multiple translation units, you either have to pass the .c file as an additional argument to TCC, or compile it to a object file / shared object / dynamic library, and pass it via the args in the config file.
It's included.

I tried adding:

Code: Select all

arguments = "-c ctest.c";
to config.cfg under "compiler:" under "c:" under "languages:".

Problem persists. I don't even see if it generated a ctest.o file. Not at least into the same folder as the .c.

Maybe the path to ctest.c is wrong?

Post Reply

Return to “DSP and Plugin Development”