


                             - 81 -





                     7.  The CSOUND Command





     csound is a command for passing an orchestra file and  score
file to Csound to generate a soundfile.  The score file can be in
one of many different  formats,  according  to  user  preference.
Translation,  sorting,  and  formatting  into  orchestra-readable
numeric text is handled by various preprocessors; all or part  of
the  score  is  then sent on to the orchestra.  Orchestra perfor-
mance is influenced by command flags,  which  set  the  level  of
displays  and  console  reports, specify I/O filenames and sample
formats, and declare the nature of realtime sensing and control.

     The format of a command is:
      csound  [-flags]  orchname scorename
where the arguments are of 2  types:  flag  arguments  (beginning
with  a  "-"),  and  name arguments (such as filenames).  Certain
flag arguments take a following name or  numeric  argument.   The
available flags are:
      -I, -n                  sound output inhibitors
      -iName, -oName          sound I/O filenames
      -bNumb, -h        audio buffer & header control
      -c, -a, -u, -s, -l, -f        audio output formats
      -v, -mNumb, -d, -g            message & display levels
      -S, -xName        score formats
      -B, -RName, -MName      realtime event control
Flags may appear anywhere in the command line, either  separately
or bundled together.  A flag taking a Name or Number will find it
in that argument, or in the immediately subsequent one.  The fol-
lowing are thus equivalent commands:
      csound  -nm3 orchname -Sxxfilename scorename
      csound  -n -m 3 orchname -x xfilename -S scorename
All flags and names are optional.   The default values are:
      csound -s -otest -b iobufsamps -m7 orchname scorename

      where iobufsamps is a locally defined value (see below),

      and orchname is a file containing Csound orchestra code,

      and scorename is a file of score data in standard numeric score format;  if omitted,
            csound will use the previously processed score.srt in the current directory.
Csound reports on the various stages of score and orchestra  pro-
cessing  as  it goes, doing various syntax and error checks along
the way.  Once the actual performance has begun, any  error  mes-
sages  will  derive from either the instrument loader or the unit
generators themselves.  A csound command may include any rational
combination of the following flag arguments:

csound -I


                        February 20, 1991





                             - 82 -


I-time only.  Allocate and initialize all instruments as per  the
score, but skip all P-time processing (no k-signals or a-signals,
and thus no amplitudes and no sound).  Provides a  fast  validity
check of the score pfields and orchestra i-variables.

csound -n
Nosound. Do all processing, but bypass writing of sound to  disk.
This flag does not change the execution in any other way.

csound -i isfname
Input soundfile name (interpreted as for  output  names,  below).
The name stdin will cause audio to be read from standard input.

csound -o osfname
Output soundfile name.  Sound is written to the  file  osfame  in
the  user  soundfile  directory  (set by the environment variable
SFDIR).  If no name is given, the default name will be test.   If
osfname  is of the form ./name or /path/name, sound will be writ-
ten into the current or  specified  directory.   If  SFREMOTE  is
enabled  at  Csound  installation,  and  osfname  is  of the form
machine:/path/name, sound will be written to the remote  machine.
The  name  stdout will cause audio to be written to standard out-
put.

csound -b Numb
Number of audio samples per soundio buffer.   Typically  512.   A
larger  number  is  more  efficient, but small numbers reduce the
delay in realtime performances.

csound -h
No header on output soundfile.  Don't write a file  header,  just
binary samples.

csound {-c, -a, -u, -s, -l, -f}
Audio sample format of the output soundfile.  One of:
    c 8-bit signed character
    a 8-bit a-law
    u 8-bit u-law
    s short integer
    l long integer
    f single-precision float (not playable, but can  be  read  by
-i, soundin and GEN01)

csound -v
Verbose translate and run.  Prints details  of  orch  translation
and performance, enabling errors to be more clearly located.

csound -m Numb
Message level for standard (terminal) output.  Takes the sum of 3
print  control flags, turned on by the following values: 1 = note
amplitude messages,  2 = samples out of range message, 4 =  warn-
ing messages.  The default value is m7 (all messages on).

csound -d
Suppress all displays.


                        February 20, 1991





                             - 83 -


csound -g
Recast graphic displays into ascii characters, suitable  for  any
terminal.

csound -S
Interpret scorename as a Scot file and create  a  standard  score
file (named "score") from it, then sort and perform that.

csound -x xfile
Extract a portion of the sorted  score  score.srt,  according  to
xfile (see extract below).

csound -B
Use the uninterpreted Beats of score.srt  for  this  performance.
In  this mode, the beat rate of score performance is controllable
from within the orchestra (see the tempo unit).

csound -R devname
Read Realtime Line-oriented score events from device devname.

csound -M devname
Read MIDI events from device devname.


The EXTRACT feature:

     This feature will extract a  segment  of  a  sorted  numeric
score  file  according to instructions taken from a control file.
The control file contains an instrument list and two time points,
from and to, in the form:
      instruments 1 2   from 1:27.5    to 2:2

     The component labels may be abbreviated as i, f and t.   The
time  points denote the begininng and end of the extract in terms
of:
      [section no.] : [beat no.].
Each of the three parts is also optional.  The default values for
missing i, f or t are:
      all instruments,   begining of score,   end of score.

     extract reads an orchestra-readable score file and  produces
an  orchestra-readable  result.   Comments, tabs and extra spaces
are flushed, w and a statements are added and  an  f0  reflecting
the  extract  length  is  appended  to  the output.  Following an
extract process, the abbreviated score will contain all  function
table  statements,  together with just those note statements that
occur in the from-to interval specified.  Notes lying  completely
in  the  interval will be unmodified;  notes that lie only partly
within will their p3 durations truncated as necessary.


Independent Preprocessing:

     Although the result of all score preprocessing  is  retained
in  the  file score.srt after orchestra performance (it exists as


                        February 20, 1991





                             - 84 -


soon as score preprocessing has completed), the  user  may  some-
times want to run these phases independently.  The command
      scot  filename
will process the Scot formatted filename, and  leave  a  standard
numeric  score  result in a file named score for perusal or later
processing;

      scscort < infile   > outfile
will put a numeric score infile through Carry,  Tempo,  and  Sort
preprocessing, leaving the result in outfile.

Likewise extract, also normally invoked as  part  of  the  csound
command, can be invoked as a standalone program:
      extract xfile < score.sort  > score.extract
This command expects an already sorted score.  An unsorted  score
should  first  be  sent  through scsort then piped to the extract
program:
      scsort < scorefile | extract xfile > score.extract







































                        February 20, 1991


