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
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.