Csound Csound-dev Csound-tekno Search About

[Csnd] Question about utilizing csound in another project (Windows + VS)

Date2018-01-25 09:36
FromLuyao Tian
Subject[Csnd] Question about utilizing csound in another project (Windows + VS)
Hello there!

I am a new user to csound. Right now I feel a bit lost and need some help from this talented community.

I am currently working on a project about audio processing. My job, for the first step, is to implement a equalizer, and the specific file that needs to be used is eqfil.c. Right now I have both the binary version installed as well as the source files built in VS. What I'm unsure about is how I can use them in my own separate project. I also noticed that in the source code, functions in eqfil.c were never used, except for a little segment in the same file at the very bottom:

static OENTRY eqfil_localops[] = {
  {"eqfil", sizeof(equ), 0, 5,
   "a", "akkko", (SUBR)equ_init, NULL, (SUBR)equ_process},
};

LINKAGE_BUILTIN(eqfil_localops)

And I'm not sure how to use those functions since there is no corresponding header files to include for those functions.

So overall my questions are:
1. How to set up csound and VS so that I could integrate it into my own project in Visual Studio (so that I could just #include whichever header files needed to call corresponding functions in my project)?
2. How could I call functions from eqfil.c in my C++ project?

I'm sure I will have more questions about parameters and others once I start working on the project, but I figured that those 2 questions are the most critical ones to solve before I can actually work on the project. Please let me know if you need any more information or if there's anything unclear. Thanks in advance for all the help!

Best wishes,
Luyao

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-01-25 09:57
FromRory Walsh
SubjectRe: [Csnd] Question about utilizing csound in another project (Windows + VS)
Your best bet is to simply use the Csound Host API. That is, link to the Csound library when building your application. The Csound installer for Windows ships with a .lib for VS. There are lots of API examples here:
https://github.com/csound/csoundAPI_examples
You'll include just csound.h/hpp. Your app then compiles and run Csound instrument/s. You have total control over how they run but you don't call functions from particular source files, that's not possible.

If you only wish to use some code from the Csound source then it's a little trickier. In this case I would just use Paul Batchelor's Soundpipe library. It's very lightweight and has an implementation of eqfil. Finally, take note of the underlying licenses as they might not be compatible with your apps license.  

On 25 January 2018 at 09:36, Luyao Tian <tianluyao795@gmail.com> wrote:
Hello there!

I am a new user to csound. Right now I feel a bit lost and need some help from this talented community.

I am currently working on a project about audio processing. My job, for the first step, is to implement a equalizer, and the specific file that needs to be used is eqfil.c. Right now I have both the binary version installed as well as the source files built in VS. What I'm unsure about is how I can use them in my own separate project. I also noticed that in the source code, functions in eqfil.c were never used, except for a little segment in the same file at the very bottom:

static OENTRY eqfil_localops[] = {
  {"eqfil", sizeof(equ), 0, 5,
   "a", "akkko", (SUBR)equ_init, NULL, (SUBR)equ_process},
};

LINKAGE_BUILTIN(eqfil_localops)

And I'm not sure how to use those functions since there is no corresponding header files to include for those functions.

So overall my questions are:
1. How to set up csound and VS so that I could integrate it into my own project in Visual Studio (so that I could just #include whichever header files needed to call corresponding functions in my project)?
2. How could I call functions from eqfil.c in my C++ project?

I'm sure I will have more questions about parameters and others once I start working on the project, but I figured that those 2 questions are the most critical ones to solve before I can actually work on the project. Please let me know if you need any more information or if there's anything unclear. Thanks in advance for all the help!

Best wishes,
Luyao

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here