Making music with Csound
Hardware Matters
As noted previously, Csound runs on a wide variety of platforms and processors. Virtually all modern desktop and laptop systems are fully capable of running Csound in real time, and much labor has already gone into making it work on iOS and Android systems. Csound has also found favor with DIY circuit designers, such as Arduino and BeagleBoard.
Regarding your audio hardware, Csound can handle anything from simple mono/stereo output to large multichannel, multispeaker arrays. Ambisonics sound spatialization is supported, and composer Peiman Khosravi has explored some impressive capabilities with an FFT-based panning technique. Multichannel output typically requires specialized hardware, but if you have the gear, Csound can make it sing.
Csound's audio capabilities are limited essentially only by the level of your hardware. If your audio interface is capable of recording and playing 32 channels of audio with a 96kHz sampling rate and 32-bit dynamic resolution, Csound can handle it. On the other hand, if your only sound device is a 16-bit Sound Blaster, you can still use it to its limits with Csound. Audio file I/O is defined by the wonderful libsndfile, which is therefore extensive and provides full support for multichannel formats. With the appropriate libraries, the system can also handle compressed files in MP3 and OGG formats. Incidentally, my Csound productions are always created with a sampling rate of 48kHz and a 32-bit resolution. By default, Csound is configured to output 16-bit sound files at 44.1kHz (i.e., CD quality). Much of my music has a broad dynamic range, and I prefer distributing it on DVD rather than the lower quality CD.
Terminology Alert!
Throughout this article, I'll be using jargon and technical terms from the world of digital audio. A glossary is unwieldy here, but a quick Google search shows many helpful sites with relevant technical glossaries. (I like the one at Sound On Sound [2].) If you find yourself bewildered by terminology, be sure to make use of these sites.
Installing Csound
Most mainstream distributions include Csound in their official software repositories. However, before installing, you should check the build's level of completeness. Csound can be compiled with a variety of optional features, not all of which might be included by the maintainer.
If you want or need to compile it yourself, extensive instructions are contained in the Csound manual [3]. Building Csound isn't difficult – it uses the cmake build system – but you must ensure that the necessary support libraries are installed on your machine. Missing optional items are unlikely to halt the process, but you'll end up with a version of Csound that may not suit your purposes.
The default installation for Linux places the csound
binary in /usr/local/bin
, the libcsound library in /usr/local/lib
, and the internal plugins in /usr/local/lib/csound
. A few other files are located in the /usr/local
hierarchy, and that's it. By the way, if you intend to use Csound with Python or one of its other language bindings, you may need to install the required library manually to its expected location (e.g., /usr/lib/python/site-packages
).
Configuration is largely automatic. A variety of environment variables can be set to indicate paths for sound and analysis files, audio samples for the STK (Perry Cook's Synthesis ToolKit [4]) opcodes, MIDI files, and so forth. To ensure that the variables are set correctly for the locale and the opcode directory, add these lines to your $HOME/.bashrc
file:
export OPCODEDIR64=/usr/local/lib/csound/plugins64-6.0 export CSSTRNGS=/usr/local/share/locale
Now your basic environment is good to go.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.