Csound Csound-dev Csound-tekno Search About

[Csnd] distributing applications using the CSound API

Date2012-12-21 14:54
FromAlex AB
Subject[Csnd] distributing applications using the CSound API
Hello list,
I am working on a small program that will be using the csound C API.
The program is a small game, and is currently being written on a linux system with no intention of porting it to other platforms.
The idea is to:
a- have sounds illustrate different game phases.
b- use a log of every move in a game to generate a score which would be compiled as a .wav file, once the game has ended.

How would I proceed to distribute it without having the recipient build csound himself?

Is there a standard procedure to do this?

Should I locally build csound in a directory in the program's source code?
When my code will be compiled on an other computer, gcc would then find the API in the program's include directory.
If I do this, how can I be sure that csound will indeed work?

As a side question, is it possible to run csound without anything getting printed on the terminal, ie having csound run "silently" in the background?
I am writing the program in C, with an ncurses terminal interface that will be running in full screen on one of the tty terminals.

Thanks

Alexandre


Date2012-12-21 18:15
FromJustin Smith
SubjectRe: [Csnd] distributing applications using the CSound API
there is a message callback in the api that will be called instead of printing to the stderr if you assign it properly (I have been able to make this work in the past when I I was working on a still incomplete porting of the csound libs to guile scheme)


On Fri, Dec 21, 2012 at 6:54 AM, Alex AB <mecagonoisician@gmail.com> wrote:
Hello list,
I am working on a small program that will be using the csound C API.
The program is a small game, and is currently being written on a linux system with no intention of porting it to other platforms.
The idea is to:
a- have sounds illustrate different game phases.
b- use a log of every move in a game to generate a score which would be compiled as a .wav file, once the game has ended.

How would I proceed to distribute it without having the recipient build csound himself?

Is there a standard procedure to do this?

Should I locally build csound in a directory in the program's source code?
When my code will be compiled on an other computer, gcc would then find the API in the program's include directory.
If I do this, how can I be sure that csound will indeed work?

As a side question, is it possible to run csound without anything getting printed on the terminal, ie having csound run "silently" in the background?
I am writing the program in C, with an ncurses terminal interface that will be running in full screen on one of the tty terminals.

Thanks

Alexandre



Date2012-12-22 15:06
FromAndres Cabrera
SubjectRe: [Csnd] distributing applications using the CSound API

If you are on linux, the simplest thing I'd to get csound from the repos.

Cheers,
Andres

On Dec 21, 2012 6:55 AM, "Alex AB" <mecagonoisician@gmail.com> wrote:
Hello list,
I am working on a small program that will be using the csound C API.
The program is a small game, and is currently being written on a linux system with no intention of porting it to other platforms.
The idea is to:
a- have sounds illustrate different game phases.
b- use a log of every move in a game to generate a score which would be compiled as a .wav file, once the game has ended.

How would I proceed to distribute it without having the recipient build csound himself?

Is there a standard procedure to do this?

Should I locally build csound in a directory in the program's source code?
When my code will be compiled on an other computer, gcc would then find the API in the program's include directory.
If I do this, how can I be sure that csound will indeed work?

As a side question, is it possible to run csound without anything getting printed on the terminal, ie having csound run "silently" in the background?
I am writing the program in C, with an ncurses terminal interface that will be running in full screen on one of the tty terminals.

Thanks

Alexandre


Date2012-12-22 15:30
FromAlex AB
SubjectRe: [Csnd] distributing applications using the CSound API
Yes, that would indeed be the simplest way ...for me.
Ideally, I'd want the recipients not to bother about anything and run a bash script included with the code that would take care of everything for them.

A couple of them are using ArchLinux, like me, and the csound package is deprecated, has been moved to the AUR and won't build on my computer, so I'm assuming it won't build on an other.
While that's not an issue for me, I am keen enough about csound to figure out how to get the various dependencies, and build it myself, but I know it will be a hassle for the people I want to share this with.

I was browsing the csound source code and build scripts yesterday and it occurred to me that csound as it is called when compiling a .csd IS in fact the C API.
If I am right in thinking this, then it would be just a matter of including libsndfile and portaudio. The target system should already have ALSA at least. Even asking people to install libsndfile and portaudio should be OK.
I could then modify the SConstruct file for a minimal build (no MIDI, no Jack, no C++-Python-Lua-Java API, no STK, no image opcodes and such are needed anyway, I will just be using a few simple subtractive, additive and FM synths) and have a bash script build csound as well as calling the Makefile for the program.
The script could copy csound.h and libcsound.so in the include directory for the program and everything should work fine without having people install software just to make that small program run.
Does that sound right? Or am I completely off target?

Alexandre




On 22 December 2012 16:06, Andres Cabrera <mantaraya36@gmail.com> wrote:

If you are on linux, the simplest thing I'd to get csound from the repos.

Cheers,
Andres

On Dec 21, 2012 6:55 AM, "Alex AB" <mecagonoisician@gmail.com> wrote:
Hello list,
I am working on a small program that will be using the csound C API.
The program is a small game, and is currently being written on a linux system with no intention of porting it to other platforms.
The idea is to:
a- have sounds illustrate different game phases.
b- use a log of every move in a game to generate a score which would be compiled as a .wav file, once the game has ended.

How would I proceed to distribute it without having the recipient build csound himself?

Is there a standard procedure to do this?

Should I locally build csound in a directory in the program's source code?
When my code will be compiled on an other computer, gcc would then find the API in the program's include directory.
If I do this, how can I be sure that csound will indeed work?

As a side question, is it possible to run csound without anything getting printed on the terminal, ie having csound run "silently" in the background?
I am writing the program in C, with an ncurses terminal interface that will be running in full screen on one of the tty terminals.

Thanks

Alexandre



Date2012-12-22 15:51
FromAndres Cabrera
SubjectRe: [Csnd] distributing applications using the CSound API

You would also need the alsa development packages. For the current version any opcodes that don't have dependencies are bundled inside the main library, if you need other opcodes, you will have to ship the dynamic library for it.

Cheers,
Andres

On Dec 22, 2012 7:30 AM, "Alex AB" <mecagonoisician@gmail.com> wrote:
Yes, that would indeed be the simplest way ...for me.
Ideally, I'd want the recipients not to bother about anything and run a bash script included with the code that would take care of everything for them.

A couple of them are using ArchLinux, like me, and the csound package is deprecated, has been moved to the AUR and won't build on my computer, so I'm assuming it won't build on an other.
While that's not an issue for me, I am keen enough about csound to figure out how to get the various dependencies, and build it myself, but I know it will be a hassle for the people I want to share this with.

I was browsing the csound source code and build scripts yesterday and it occurred to me that csound as it is called when compiling a .csd IS in fact the C API.
If I am right in thinking this, then it would be just a matter of including libsndfile and portaudio. The target system should already have ALSA at least. Even asking people to install libsndfile and portaudio should be OK.
I could then modify the SConstruct file for a minimal build (no MIDI, no Jack, no C++-Python-Lua-Java API, no STK, no image opcodes and such are needed anyway, I will just be using a few simple subtractive, additive and FM synths) and have a bash script build csound as well as calling the Makefile for the program.
The script could copy csound.h and libcsound.so in the include directory for the program and everything should work fine without having people install software just to make that small program run.
Does that sound right? Or am I completely off target?

Alexandre




On 22 December 2012 16:06, Andres Cabrera <mantaraya36@gmail.com> wrote:

If you are on linux, the simplest thing I'd to get csound from the repos.

Cheers,
Andres

On Dec 21, 2012 6:55 AM, "Alex AB" <mecagonoisician@gmail.com> wrote:
Hello list,
I am working on a small program that will be using the csound C API.
The program is a small game, and is currently being written on a linux system with no intention of porting it to other platforms.
The idea is to:
a- have sounds illustrate different game phases.
b- use a log of every move in a game to generate a score which would be compiled as a .wav file, once the game has ended.

How would I proceed to distribute it without having the recipient build csound himself?

Is there a standard procedure to do this?

Should I locally build csound in a directory in the program's source code?
When my code will be compiled on an other computer, gcc would then find the API in the program's include directory.
If I do this, how can I be sure that csound will indeed work?

As a side question, is it possible to run csound without anything getting printed on the terminal, ie having csound run "silently" in the background?
I am writing the program in C, with an ncurses terminal interface that will be running in full screen on one of the tty terminals.

Thanks

Alexandre