There are two versions of Csound available for Linux users. The official version is maintained by John Fitch and is available from the primary Csound repository at Bath UK. The unofficial version is maintained by Nicola Bernardini. The primary download site for that version is at Maurizio Umberto Puxeddu's site in Italy.
Note: The instructions here are specific to Linux on x86 systems. They may or may not apply to building and installing Csound on PPC, Alpha, or any other Linux-friendly platform. Users of Csound on other Linux platforms are invited to append that information to this document. Please send your additions and corrections to me at dlphilp@bright.net.
Building and Installing the Official Version
Building the official version requires the Csound.tar.gz package from the Bath site. Before retrieving that file, create a directory for it in your $HOME directory (something like Official_Csound will do). Download the package into your new $HOME/Official_Csound directory, and unpack the tarball with this command:
tar xzvf Csound.tar.gz
Now you should edit the top-level Makefile (or the example Makefile.lnx file) for build options such as support for X and realtime audio. You can also set the destination directories for installing the binaries (though I suggest leaving them at the defaults).
When you have configured the Makefile to your specifications simply run make and the compiler will build the Csound binary and all utilities. Next, run make install as root and you're finished. You should now have a static Csound binary sitting in /usr/local/bin and the csound.txt file located in /usr/local/lib.
Note: Despite its extension, csound.txt is not a text file. It is a binary file containing all the text strings used throughout Csound, it can not be edited in a text editor or word processor, and it must be present for Csound to run.
Type csound at a prompt and you should see a stream of messages (shortened here for clarity) like these :
[dlphilp@localhost Official_CS]$ ./csound
Using csound.txt
Csound Version 4.10 (Jan 20 2001)
Csound Command ERROR: insufficient arguments
Usage: csound [-flags] orchfile scorefile
Legal flags are:
-U unam run utility program unam
-C use Cscore processing of scorefile
-I I-time only orch run
-n no sound onto disk
-i fnam sound input filename
-o fnam sound output filename
-b N sample frames (or -kprds) per software sound I/O buffer
-B N samples per hardware sound I/O buffer
-A create an AIFF format output soundfile
-W create a WAV format output soundfile
-J create an IRCAM format output soundfile
.....
.....
.....
These flags are compile-time options to determine audio and MIDI I/O requirements, output file format, error message levels, and so forth. The entire list is fully explained in the excellent Csound manual maintained by David Boothe.
Installing the Binaries
You may have noticed this selection of binaries in the pub/dream/newest/ directory at Bath:
Building and Installing the Unofficial Version
Download the latest package from Maurizio Puxeddu's site to your $HOME directory and unpack the bzipped tarball with this command:
tar xIvf unofficial-csound-latest-linux.src.tar.bz2
(where latest is the current version number).
Note: Most mainstream Linux distributions include the bzip2 archiving utility, but you can find it here if it isn't already in your system.
Now enter your new Csound directory (the unofficial version will create a $HOME/csound directory for you). The unofficial version utilizes the configure utility to define and create the Makefiles used in the build, and you can run ./configure --help for a list of configuration options. As an example, I build my versions with the following options enabled:
./configure --enable-rtaudio=oss --enable-OSC-opcodes --enable-sliders=tk --enable-suid
The first option enables realtime audio I/O using the kernel sound driver (also called OSS/Free), the OSS/Linux driver (available from 4Front Technologies), or the ALSA driver in OSS emulation mode. The next two options work together: OSC is the Open Sound Control, an advanced sound server protocol that lets Csound run as a remote server controlled locally by a set of Tk sliders. Finally, I set the build to create a binary with root permissions (necessary for using the --sched flag described below).
Building with X window support is the default, but it can be disabled simply by adding the --without-x option.
After configuring the Makefile options, run make depend; make. When the build is complete, run make install as root and you're ready to use your new latest version of Csound. As with the official version, the binary will be placed in /usr/local/bin and csound.txt will be located in /usr/local/lib. The shared library (libcsound.so) will also be placed in /usr/local/lib.
The unofficial version presents a number of Linux-specific options, including the following amenities:
This version of Csound for Linux supports the same compile-time flags as the Bath sources and adds a few new ones:
--help ................................ This help screen
--incard=N ............................ Specify audio card used for input
samples (ALSA only)
--outcard=N ........................... Specify audio card used for output
samples (ALSA only)
-Q N or --midihardware=N .............. Select MIDI interface hardware (0 to N)
-K[port] or --midiport[=port] ........ Assign a MIDI input port
-z[N] or --opcodes[=N] ............... List opcodes in this version. If N is
present and is > 0, list params too.
--ossin=device ........................ Specify soundin device (OSS only)
--ossout=device ....................... Specify soundout device (OSS only)
--sched ............................... Enable High Priority Task Scheduling.
Only valid during real-time output
-V N or --volume=N .................... Set real-time audio output volume to N
(1 to 100) (Not with ALSA driver)
The unofficial version also has a CVS (concurrent versions system) repository for developers (and users who like to live on the cutting-edge). See Nicola Bernardini's AIMI Csound page for details on accessing the repository.
In all other respects the unofficial version is identical with the official version. It is packaged from the code base at Bath, and all orc/sco and csd files written for official Csound should run without problems under the unofficial version.
Miscellaneous
Csound's realtime MIDI and audio I/O performance can be greatly improved by running a Linux kernel patched for low-latency. See Benno Sennoner's Linux Audio Page for more details.
For more information regarding Linux Csound please see my Csound Resources: Csound for Linux Web site. See also my Linux Sound & Music Applications site for links to a variety of Csound helpers.