File: compiling.html

package info (click to toggle)
csound-doc 3.47b2-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,492 kB
  • ctags: 272
  • sloc: makefile: 36
file content (73 lines) | stat: -rw-r--r-- 3,235 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<HTML>
<TITLE>COMPILING</TITLE>
<CENTER><A NAME="compiling"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <A HREF="CSCORE.html">Top of this section</A> - <A HREF="./advanced.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./modules.html">Next</A>
<HR></CENTER>

<H2>
<U>Compiling a Cscore program</U></H2>
A Cscore program can be&nbsp; invoked either as a Standalone program or
as part of Csound:
<BR>&nbsp;
<UL><TT>&nbsp;cscore&nbsp; scorename > outfilename</TT>
<BR><TT>or&nbsp;<BR>
&nbsp;csound -C [otherflags] orchname scorename</TT></UL>


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


<P>Else set an environment variable to a <B>Csound</B> directory containing
the already compiled modules, and invoke them explicitly:
<BR>&nbsp;
<UL>&nbsp;&nbsp; <TT>setenv&nbsp; CSOUND&nbsp; /ti/u/bv/csound</TT>
<BR><TT>&nbsp;cc -o cscore&nbsp; cscore.c&nbsp; $CSOUND/cscoremain.o&nbsp;
$CSOUND/cscorefns.o \</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; $CSOUND/rdscor.o&nbsp; $CSOUND/memalloc.o</TT></UL>


<P>The resulting executable can be applied to an input scorefilein by typing:
<BR>&nbsp;
<UL>&nbsp;<TT>cscore&nbsp; scorefilein&nbsp; > scorefileout</TT></UL>


<P>To operate from csound, first proceed as above then link your program
to a complete set of <B>Csound </B>modules.&nbsp; If your <B>Csound</B>
installation has created a <I>libcsound.a</I>, you can do this by typing
<BR>&nbsp;
<UL>&nbsp;<TT>cc -o mycsound&nbsp; cscore.c&nbsp; -lcsound&nbsp; -lX11
-lm (X11 if your installation included it)</TT></UL>


<P>Else copy <I>*.c, *.h</I> and <I>Makefile</I> from the <B>Csound </B>source
directory, replace <I>cscore.c </I>by your own, then run '<I>make csound</I>'.&nbsp;
The resulting executable is your own special <B>csound</B>, usable as above.&nbsp;
The <I>-C</I> flag will invoke your <B>cscore </B>program after the input
score is sorted into '<I>score.srt</I>'.&nbsp; With no lplay, the subsequent
stages of processing can be seen in the files '<I>cscore.out</I>' and '<I>cscore.srt</I>'.<BR>
<BR>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <A HREF="CSCORE.html">Top of this section</A> - <A HREF="./advanced.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="./modules.html">Next</A>
<HR></CENTER>


<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>&copy;
Jean Pich&eacute; &amp; Peter J. Nix, 1994-97</FONT></FONT></I></B>&nbsp;
</CENTER>
</HTML>