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
-
Endless OS 6 has Arrived
After more than a year since the last update, the latest release of Endless OS is now available for general usage.
-
Fedora Asahi 40 Remix Available for Macs with Apple Silicon
If you've been anticipating KDE's Plasma 6 for your Apple Silicon-powered Mac, then you're in luck.
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.