Csound Csound-dev Csound-tekno Search About

[Csnd] Examples of C++ CsoundAC API?

Date2011-02-24 22:27
FromJack Senechal
Subject[Csnd] Examples of C++ CsoundAC API?
I'm having trouble finding the way into the C++ CsoundAC API. I'd like to begin with following Michael Gogins' CsoundAC tutorial, but with C++ instead of Python. I understand that the APIs will be very similar between the two, but I am challenged to find a way to instantiate a MusicModel, as in the first Python example.

Are there any examples available for Csound and CsoundAC in C++, using CppSound, MusicModel, etc?

Thanks!
Jack Senechal

Date2011-02-25 00:37
FromMichael Gogins
SubjectRe: [Csnd] Examples of C++ CsoundAC API?
Attachmentsmain.cpp  MusicModelExample.cbp  MusicModelExample.workspace  
I have attached a hasty and, no doubt wildly misleading example that
runs. What is misleading is that after pretending to create a music
model, I just give up and load Trapped in Convert and render it.
Follow the Python examples with the objects instantiated here,
however, and things should work.

You will have to set your own library and header file options, mine
are just for my computer. You need to link with libCsoundAC.a,
libcsnd.so, and libcsound64.so, and include Silence.hpp, which
includes other files in other Csound include directories.

Hope this helps,
Mike

On Thu, Feb 24, 2011 at 5:27 PM, Jack Senechal  wrote:
> I'm having trouble finding the way into the C++ CsoundAC API. I'd like to
> begin with following Michael Gogins' CsoundAC tutorial, but with C++ instead
> of Python. I understand that the APIs will be very similar between the two,
> but I am challenged to find a way to instantiate a MusicModel, as in the
> first Python example.
> Are there any examples available for Csound and CsoundAC in C++, using
> CppSound, MusicModel, etc?
> Thanks!
> Jack Senechal



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-02-25 05:20
FromJack Senechal
SubjectRe: [Csnd] Examples of C++ CsoundAC API?
Thanks! I'll take a look at it. I don't have a libCsoundAC.a - is the creation of that conditional on certain scons options when I compile Csound?

On Thu, Feb 24, 2011 at 4:37 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
libCsoundAC.a


Date2011-02-25 11:43
FromMichael Gogins
SubjectRe: [Csnd] Examples of C++ CsoundAC API?

Are you building or installing csound?

On Feb 25, 2011 12:21 AM, "Jack Senechal" <jacksenechal@gmail.com> wrote:
> Thanks! I'll take a look at it. I don't have a libCsoundAC.a - is the
> creation of that conditional on certain scons options when I compile Csound?
>
> On Thu, Feb 24, 2011 at 4:37 PM, Michael Gogins <michael.gogins@gmail.com>wrote:
>
>> libCsoundAC.a
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2011-02-25 21:59
FromJack Senechal
SubjectRe: [Csnd] Examples of C++ CsoundAC API?
I've been building it from the Git source. 

What's odd is that I was building it without any problem last week, but in the last few days I've somehow messed up the build environment. I'm getting numerous errors, such as "Don't know how to build from a source file with suffix .i". 

Any idea what could cause that?

I'm on Ubuntu 10.04. I've purged and reinstalled everything I can think of (gcc, g++, scons, various libraries...). 

When I turn off the building of Python related things I get a little further, but it's still stumbling later on. At the moment it stops on InOut/rtpa.c, with errors about PaXXX names not being declared (port audio?). I've got all of the portaudio dev packages... And it was working a few days ago.

Well, I realize all of this is a bit nebulous, but let me know if you've got any ideas. Hopefully I can avoid an OS reinstall.

Thanks!
Jack

On Fri, Feb 25, 2011 at 3:43 AM, Michael Gogins <michael.gogins@gmail.com> wrote:

Are you building or installing csound?

On Feb 25, 2011 12:21 AM, "Jack Senechal" <jacksenechal@gmail.com> wrote:
> Thanks! I'll take a look at it. I don't have a libCsoundAC.a - is the
> creation of that conditional on certain scons options when I compile Csound?
>
> On Thu, Feb 24, 2011 at 4:37 PM, Michael Gogins <michael.gogins@gmail.com>wrote:
>
>> libCsoundAC.a
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


Date2011-02-26 17:05
FromSamuel Sagan
Subject[Csnd] Re: Examples of C++ CsoundAC API?
As part of the DVD extra chapters in The Audio Programming Book (a must),
there are a few tantalizing chapters that seem to deal with exactly what you
are asking.

The chapters are:
DVD Chap 37 -- Learning C with Csound (Richard Boulanger and Jonathan
Bailey)
DVD Chap 38 – From Csound to Sound in C (Richard Boulanger, Jonathan Bailey,
and Tim Lukens)
DVD Chap 39 – Real-time MIDI Control and Audio Processing in C (Boulanger, 
Lukens, and Max Mathews)

The problem is: these chapters... are not there. There's only one page of
introduction for each, with a link to http://csounds.com/apb, where (as of
today) the chapters are not available.

Has anyone any idea on how to catch hold of these?






-- 
View this message in context: http://csound.1045644.n5.nabble.com/Examples-of-C-CsoundAC-API-tp3399325p3401549.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-02-27 12:34
FromAndres Cabrera
SubjectRe: [Csnd] Re: Examples of C++ CsoundAC API?
Hi,

Yes, very tantalising! I hope we see them soon...

Cheers,
Andres

On Sat, Feb 26, 2011 at 5:05 PM, Samuel Sagan  wrote:
> As part of the DVD extra chapters in The Audio Programming Book (a must),
> there are a few tantalizing chapters that seem to deal with exactly what you
> are asking.
>
> The chapters are:
> DVD Chap 37 -- Learning C with Csound (Richard Boulanger and Jonathan
> Bailey)
> DVD Chap 38 – From Csound to Sound in C (Richard Boulanger, Jonathan Bailey,
> and Tim Lukens)
> DVD Chap 39 – Real-time MIDI Control and Audio Processing in C (Boulanger,
> Lukens, and Max Mathews)
>
> The problem is: these chapters... are not there. There's only one page of
> introduction for each, with a link to http://csounds.com/apb, where (as of
> today) the chapters are not available.
>
> Has anyone any idea on how to catch hold of these?
>
>
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Examples-of-C-CsoundAC-API-tp3399325p3401549.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-03-01 10:13
FromJack Senechal
SubjectRe: [Csnd] Examples of C++ CsoundAC API?
Ok, after I sorted out my build environment and successfully built CsoundAC, I am able to compile this example. It runs without errors, and it prints out the .csd file, but it doesn't make any sound. The same .csd file runs and makes sound when I pass it as the sole parameter to "csound" on the command line.

The only thing which differs in my build environment from the instructions you gave is that I do not have a libcsound64.so. The program builds and runs without it, but I don't know if this could be a source of the silence.

Where should I go from here?

Below is the build command I am using for Csound, and the Scons configuration results.

---------------------------------------------

scons buildCsound5GUI=1 buildLoris=0 buildVirtual=1 usePortAudio=0 buildCsoundAC=1 buildInterfaces=1 useDouble=1

scons: Reading SConscript files ...

      C S O U N D 5

SCons build file for Csound 5:
API library, plugin opcodes, utilities, and front ends.

By Michael Gogins <gogins at pipeline dot com>

For custom options, run 'scons -h'.
For default options, run 'scons -H'.
If headers or libraries are not found, edit 'custom.py'.
For Linux, run in the standard shell
    with standard Python and just run 'scons'.
For MinGW, run in the MSys shell
    and use www.python.org WIN32 Python to run scons.
For Microsoft Visual C++, run in the Platform SDK
    command shell, and use www.python.org WIN32 Python to run scons.

System platform is 'linux'.

scons: warning: The Options class is deprecated; use the Variables class instead.
File "/home/jack/src/csound5/SConstruct", line 74, in <module>
Using options from 'custom.py.'
Build platform is 'linux'.
SCons tools on this platform:  ['default', 'gnulink', 'gcc', 'g++', 'gfortran', 'gas', 'ar', 'CVS', 'filesystem', 'dvipdf', 'dvips', 'gs', 'jar', 'javac', 'javah', 'latex', 'lex', 'm4', 'pdflatex', 'pdftex', 'rmic', 'rpcgen', 'swig', 'tar', 'tex', 'yacc', 'zip', 'rpm']
Checking for C header file libintl.h... (cached) yes
CONFIGURATION DECISION: Using GNU gettext scheme
CONFIGURATION DECISION: Using double-precision floating point for audio samples.
Checking for C header file stdio.h... (cached) yes
Checking for C library sndfile... (cached) yes
Checking for C library pthread... (cached) yes
CONFIGURATION DECISION: No MP3 support
CONFIGURATION DECISION: No Wiimote support
CONFIGURATION DECISION: No P5 Glove support
Checking for pthread_barrier_init(0, 0, 0) in C library pthread... (cached) yes
Checking for int n = omp_get_num_threads() in C++ library gomp... (cached) yes
Checking for __sync_lock_test_and_set((int32_t *)0, 0) in C library m... (cached) yes
found sync lock
Checking for C++ header file frontends/CsoundVST/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.h... (cached) no
Checking for C header file portaudio.h... (cached) yes
Checking for C header file portmidi.h... (cached) yes
Checking for C++ header file FL/Fl.H... (cached) yes
Checking for C++ header file FL/Fl_Spinner.H... (cached) yes
Checking for C++ header file boost/any.hpp... (cached) yes
Checking for C++ header file gmm/gmm.h... (cached) yes
Checking for C library asound... (cached) yes
Checking for C library lo... (cached) yes
Checking for MusicXML2::SXMLFile f = MusicXML2::TXMLFile::create() in C++ library musicxml2... (cached) no
Checking for C header file jack/jack.h... (cached) yes
Checking for C header file pulse/simple.h... (cached) yes
Checking for C++ header file Opcodes/stk/include/Stk.h... (cached) no
Checking for C header file m_pd.h... (cached) no
Checking for C header file tcl.h... (cached) no
Checking for C header file /usr/include/tcl8.4/tcl.h... (cached) no
Checking for C header file /usr/include/tk8.4/tcl.h... (cached) no
Checking for C header file zlib.h... (cached) yes
Checking for C++ header file funknown.h... (cached) no
Checking for C header file lua.h... (cached) no
Checking for SWIG... yes
Python Version: 2.6
Checking for C header file Python.h... (cached) no
Checking for C header file /usr/include/python2.6/Python.h... (cached) yes
Checking for C++ header file jni.h... (cached) no
Checking for C header file io.h... (cached) no
Checking for C header file fcntl.h... (cached) yes
Checking for C header file unistd.h... (cached) yes
Checking for C header file stdint.h... (cached) yes
Checking for C header file sys/time.h... (cached) yes
Checking for C header file sys/types.h... (cached) yes
Checking for C header file termios.h... (cached) yes
Checking for C header file values.h... (cached) yes
Checking for C header file sys/socket.h... (cached) yes
Checking for C header file dirent.h... (cached) yes
Checking for libsndfile version 1.0.16 or later... (cached) yes
CONFIGURATION DECISION: Building with new parser enabled
CONFIGURATION DECISION: Not building with new parser debugging
CONFIGURATION DECISION: Building static Csound library
CONFIGURATION DECISION: Building Csound C++ interface library.
CONFIGURATION DECISION: Not building Lua wrapper to Csound C++ interface library.
CONFIGURATION DECISION: Not building Java wrapper to Csound C++ interface library.
CONFIGURATION DECISION: Not building Python wrapper to Csound C++ interface library.
CONFIGURATION DECISION: Not generating Csound API PDF documentation.
Checking for C library png... (cached) yes
CONFIGURATION DECISION: Building image opcodes
CONFIGURATION DECISION: Building linear algebra opcodes.
CONFIGURATION DECISION: Building Virtual Keyboard plugin.
CONFIGURATION DECISION: Not building CoreAudio plugin.
CONFIGURATION DECISION: Building ALSA plugin.
CONFIGURATION DECISION: Building PulseAudio plugin
CONFIGURATION DECISION: Not building PortAudio module.
CONFIGURATION DECISION: Building JACK plugin.
CONFIGURATION DECISION: Building with PortMIDI.
CONFIGURATION DECISION: Not building OSC plugin.
CONFIGURATION DECISION: Building UDP plugins.
Checking for C header file fluidsynth.h... (cached) no
CONFIGURATION DECISION: Not building fluid opcodes.
CONFIGURATION DECISION: Not building vst4cs opcodes.
Checking for C header file ladspa.h... (cached) yes
Checking for C header file dssi.h... (cached) yes
CONFIGURATION DECISION: Building DSSI plugin host opcodes.
CONFIGURATION DECISION: Not building Loris Python extension and Csound opcodes.
CONFIGURATION DECISION: Not building STK opcodes.
CONFIGURATION DECISION: Not building Python opcodes.
CONFIGURATION DECISION: Building FLTK GUI CSOUND5GUI frontend.
CONFIGURATION DECISION: Not building Csound Text Editor.
CONFIGURATION DECISION: Building CsoundAC extension module for Csound with algorithmic composition.
PATH = /usr/lib/firefox-3.0.11:/usr/lib/firefox-3.0.10:/home/jack/Projects/android/android-sdk-linux_86/tools/:/home/jack/bin/flex4/bin:/home/jack/bin:/home/jack/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PYTHON MODULE CsoundAC...
CONFIGURATION DECISION: Not building CsoundVST plugin and standalone.
CONFIGURATION DECISION: Not building Tclcsound
CONFIGURATION DECISION: Not building Winsound
CONFIGURATION DECISION: Not building OSX GUI frontend
CONFIGURATION DEFAULT:  Building csLadspa.
CONFIGURATION DECISION: Not building beats score frontend.
CONFIGURATION DECISION: Not calling TAGS
scons: done reading SConscript files.


On Thu, Feb 24, 2011 at 4:37 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
I have attached a hasty and, no doubt wildly misleading example that
runs. What is misleading is that after pretending to create a music
model, I just give up and load Trapped in Convert and render it.
Follow the Python examples with the objects instantiated here,
however, and things should work.

You will have to set your own library and header file options, mine
are just for my computer. You need to link with libCsoundAC.a,
libcsnd.so, and libcsound64.so, and include Silence.hpp, which
includes other files in other Csound include directories.

Hope this helps,
Mike

On Thu, Feb 24, 2011 at 5:27 PM, Jack Senechal <jacksenechal@gmail.com> wrote:
> I'm having trouble finding the way into the C++ CsoundAC API. I'd like to
> begin with following Michael Gogins' CsoundAC tutorial, but with C++ instead
> of Python. I understand that the APIs will be very similar between the two,
> but I am challenged to find a way to instantiate a MusicModel, as in the
> first Python example.
> Are there any examples available for Csound and CsoundAC in C++, using
> CppSound, MusicModel, etc?
> Thanks!
> Jack Senechal



--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"