Many flags are generic Csound command-line flags. Various platform implementations may not react the same way to different flags!
The format of a command is either:
csound [-flags] [orchname] [scorename]
or
csound [-flags] [csdfilename]
where the arguments are of 2 types: flags arguments (beginning with a “-”), and name arguments (such as filenames). Certain flag arguments take a following name or numeric argument.
Command-line Flags
Provide an extended command-line in file “FILE”
Use 24-bit audio samples.
Use 8-bit unsigned character audio samples.
Write an AIFF format soundfile. Use with the -c, -s, -l, or -f flags.
Use a-law audio samples.
Number of audio sample-frames held in the DAC hardware buffer. This is a threshold on which software audio I/O (above) will wait before returning. A small number reduces audio I/O delay; but the value is often hardware limited, and small values will risk data lates. The default is 1024.
Number of audio sample-frames per sound i/o software buffer. Large is efficient, but small will reduce audio I/O delay. The default is 1024. In real-time performance, Csound waits on audio I/O on NUM boundaries. It also processes audio (and polls for other input like MIDI) on orchestra ksmps boundaries. The two can be made synchronous. For convenience, if NUM = -NUM (is negative) the effective value is ksmps * NUM (audio synchronous with k-period boundaries). With NUM small (e.g. 1) polling is then frequent and also locked to fixed DAC sample boundaries.
Use Cscore processing of the scorefile.
Use 8-bit signed character audio samples.
Defer GEN01 soundfile loads until performance time.
Suppress all displays.
Mac only. Number of tables in graphics window. (was -G)
Mac only. Rescale floats as shorts to max amplitude.
Since Csound 5. Turns on some optimizations in expressions:
Redundant assignment operations are eliminated whenever possible. This means that for example this line a1 = a2 + a3 will compile as a1 Add a2, a3 instead of #a0 Add a2, a3 a1 = #a0 saving a temporary variable and an opcode call. Less opcode calls result in reduced CPU usage (an average orchestra may compile about 10% faster with --expression-opt, but it depends largely on how many expressions are used, what the control rate is (see also below), etc.; thus, the difference may be less, but also much more).
number of a- and k-rate temporary variables is significantly reduced. This expression
(a1 + a2 + a3 + a4)
will compile as
#a0 Add a1, a2 #a0 Add #a0, a3 #a0 Add #a0, a4 ; (the result is in #a0)
instead of
#a0 Add a1, a2 #a1 Add #a0, a3 #a2 Add #a1, a4 ; (the result is in #a2)
The advantages of less temporary variables are:
Note that this optimization (due to technical reasons) is not performed on i-rate temporary variables.
![]() |
Warning |
---|---|
When --expression-opt is turned on, it is not allowed to use the i() function with an expression argument. |
Read MIDI events from MIDI file FILE. The file should have only one track in Csound versions 4.xx and earlier; this limitation is removed in Csound 5.00.
Use single-precision float audio samples (not playable, but can be read by -i, soundin and GEN01
Suppress graphics, use PostScript displays instead.
Suppress graphics, use ASCII displays instead.
Print a heartbeat after each soundfile buffer write:
no NUM, a rotating bar.
NUM = 1, a rotating bar.
NUM = 2, a dot (.)
NUM = 3, filesize in seconds.
NUM = 4, sound a bell.
No header on output soundfile. Don't write a file header, just binary samples.
Display on-line help message.
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.
Input soundfile name. If not a full pathname, the file will be sought first in the current directory, then in that given by the environment variable SSDIR (if defined), then by SFDIR. The name stdin will cause audio to be read from standard input. If RTAUDIO is enabled, the name devaudio will request sound from the host audio input device.
Write an IRCAM format soundfile.
Currently disabled. Use database FILE for messages to print to console during performance.
Do not generate any PEAK chunks.
Override the control rate (KR) supplied by the orchestra.
Read line-oriented real-time score events from device DEVICE. The name stdin will permit score events to be typed at your terminal, or piped from another process. Each line-event is terminated by a carriage-return. Events are coded just like those in a standard numeric score, except that an event with p2=0 will be performed immediately, and an event with p2=T will be performed T seconds after arrival. Events can arrive at any time, and in any order. The score carry feature is legal here, as are held notes (p3 negative) and string arguments, but ramps and pp or np references are not.
Use long integer audio samples.
Read MIDI events from device DEVICE.
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 = warning messages
The default value is m7 (all messages on).
Notify (ring the bell) when score or MIDI track is done.
No sound. Do all processing, but bypass writing of sound to disk. This flag does not change the execution in any other way.
Log output to file FILE.
Output soundfile name. If not a full pathname, the soundfile will be placed in the directory given by the environment variable SFDIR (if defined), else in the current directory. The name stdout will cause audio to be written to standard output. If no name is given, the default name will be test. If RTAUDIO is enabled, the name devaudio will send to the host audio output device.
Mac only. Poll events every NUM buffer writes.
Mac only. Play after rendering.
Beos and Linux only. Enables MIDI OUT operations and optionally chooses device id DEVICE (if the DEVICE argument is present). This flag allows parallel MIDI OUT and DAC performance. Unfortunately the real-time timing implemented in Csound is completely managed by DAC buffer sample flow. So MIDI OUT operations can present some time irregularities. These irregularities can be fully eliminated when suppressing DAC operations themselves (see -Y flag).
Mac only. Define the analysis (SADIR) directory.
Mac only. Define the sound sample-in (SSDIR) directory.
Continually rewrite the header while writing the soundfile (WAV/AIFF).
Override the sampling rate (SR) supplied by the orchestra.
Use short integer audio samples.
Linux only. Use real-time scheduling and lock memory. (Also requires -d and either -o dac or -o devaudio).
Csound 5. The --strset option allows setting strset string values from the command line, in the format '--strsetN=VALUE'. It is useful for passing parameters to the orchestra (e.g. file names).
Terminate the performance when MIDI track is done.
Prevents Csound from deleting the sorted score file, score.srt, upon exit.
Use the uninterpreted beats of score.srt for this performance, and set the initial tempo at NUM beats per minute. When this flag is set, the tempo of score performance is also controllable from within the orchestra.
Invoke the utility program UTILITY.
Use u-law audio samples.
Linux only. Set real-time audio output volume to NUM (1 to 100).
Mac only. Number of chars in the screen buffer for the output window.
Verbose translate and run. Prints details of orch translation and performance, enabling errors to be more clearly located.
Write a WAV format soundfile.
Mac only. Record and save MIDI input to a file.
Mac only. Define the sound file (SFDIR) directory.
Extract a portion of the sorted score, score.srt, using the extract file FILE (see Extract).
Currently disabled. Mac only. Enables progress display at rate NUM in seconds, or for negative NUM, at -NUM kperiods.
Currently disabled. Mac only. Enables profile display at rate NUM in seconds, or for negative NUM, at -NUM kperiods.
Switch on dithering of audio conversion from internal floating point to 32, 16 and 8-bit formats.
List opcodes in this version:
no NUM, just show names
NUM = 0, just show names
NUM = 1, show arguments to each opcode using the format <opname> <inargs> <outargs>
Csound5 Command-line Flags
Linux only. Same as --sched, but allows specifying a priority value: if N is positive (in the range 1 to 99) the scheduling policy SCHED_RR will be used with a priority of N; otherwise, SCHED_OTHER is used with the nice level set to N.
Enables displays
Disables expression optimization
(max. length = 200 characters) Artist tag in output soundfile (no spaces)
(max. length = 200 characters) Comment tag in output soundfile (no spaces)
(max. length = 200 characters) Copyright tag in output soundfile (no spaces)
(max. length = 200 characters) Date tag in output soundfile (no spaces)
(max. length = 200 characters) Software tag in output soundfile (no spaces)
(max. length = 200 characters) Title tag in output soundfile (no spaces)
(min: 10, max: 10000) Maximum length of string variables + 1; defaults to 256 allowing a length of 255 characters.
Enable message attributes (colors etc.); default: yes.
(max. length = 255 characters) Ignore events (other than tempo changes) in MIDI file tracks defined by pattern (for example, -+mute_tracks=00101 will mute the third and fifth tracks).
Disable special handling of MIDI controllers like sustain pedal, all notes off etc. Default: no.
(max. length = 20 characters) Real time audio module name (default: PortAudio).
(max. length = 20 characters) Real time MIDI module name (default: PortMidi).
(min: 0) Start playback at the specified time (in seconds), skipping earlier events in the score and MIDI file.
Message level for standard (terminal) output. Takes the sum of any of the following values:
1 = note amplitude messages
2 = samples out of range message
4 = warning messages
128 = print benchmark information
And exactly one of these to select note amplitude format:
0 = raw amplitudes
32 = dB, no colors
64 = dB, out of range highlighted with red
96 = dB, all colors
Set orchestra macro XXX to value YYY
Set score macro XXX to value YYY
Set environment variable NAME to VALUE; note: not all environment variables can be set this way, because some are read before parsing the command line. INCDIR, SADIR, SFDIR, and SSDIR are known to work.
Append VALUE to ';' separated list of search paths in environment variable NAME (should be INCDIR, SADIR, SFDIR, or SSDIR). If a file is found in multiple directories, the last will be used.