The Alternative Csound Reference Manual
Previous | Cscore | Next

# Compiling a Cscore Program

A Cscore program can be invoked either as a Standalone program or as part of Csound:

    cscore -U pvanal scorename outfilename

or

    csound -C [otherflags] orchname scorename

To create a standalone program, write a cscore.c program as shown above and test compile it with 'cc cscore.c'. If the compiler cannot find "cscore.h", try using -I/usr/local/include, or just copy the cscore.h module from the Csound source directory into your own. There will still be unresolved references, so you must now link your program with certain Csound I/O modules. If your Csound installation has created a libcscore.a, you can type

    cc -o cscore.c -lcscore

Else set an environment variable to a Csound directory containing the already compiled modules, and invoke them explicitly:

    setenv CSOUND /ti/u/bv/Csound
      cc -o cscore cscore.c $CSOUND/cscoremain.o $CSOUND/cscorefns.o \
        $CSOUND/rdscore.o $CSOUND/memalloc.o

The resulting executable can be applied to an input scorefilein by typing:

    cscore scorefilein scorefileout

To operate from CSound, first proceed as above then link your program to a complete set of Csound modules. If your Csound installation has created a libcsound.a, you can do this by typing

    cc -o mycsound cscore.o -lcsounc -lX11 -lm (X11 if your installation included it)

Else copy *.c, *.h and Makefile from the Csound source directory, replace cscore.c by your own, then run "`make CSound`". The resulting executable is your own special Csound, usable as above. The -C flag will invoke your Cscore program after the input score is sorted into "score.srt". With no lplay, the subsequent stages of processing can be seen in the files "cscore.out" and "cscore.srt".

Previous | Home | Next
More Advanced Examples | Up | Adding your own Cmodules to Csound