Making music with Csound
Sound Design

© Lead Image © David Sandonato, 123RF.com
The powerful Csound software provides an impressive set of features for audio production and processing. We walk you through the entire system.
Csound is a software system designed for digital audio synthesis, signal processing, and music composition. As a production environment, Csound [1] is fully mature, with a well-tended development track extending from the 1970s to the present day. Csound runs on all major platforms, including iOS and Android systems, with support for a broad range of hardware. Csound is free software as defined by the FSF and is licensed under the LGPL.
The System
Csound's system is an organization of agreeable parts. The Csound binary, which is typically found at /usr/bin/csound
or /usr/local/bin/csound
, is the engine that processes your code and sends the output on its way, either as a sound file or as real-time sound. Csound's native user interface is a domain-specific programming language with built-in elements for audio production and processing. These elements, called opcodes, are the fundamental building blocks for all your Csound designs. The system further includes a language for scoring a composition, a multifarious set of utilities, and a variety of interface extensions that ally Csound's powers with the general capabilities of C/C++, Java, and Python.
Incidentally, the C in Csound refers to the language of the internal code. No prior knowledge of C or any other programming language is required to use Csound effectively, however, and with one of its excellent front ends, you may find that you have no need at all to program directly in native Csound.
What Can It Do ?
A proprietary synthesizer is usually built around a specific synthesis method. Thus, Yamaha's DX line of synthesizers were built on principles of FM synthesis, whereas Roland's Juno and Jupiter synths are based on classic subtractive synthesis methods, and Modartt's Pianoteq instruments are constructed by physical modeling synthesis. Csound imposes no such specific restriction. You can freely mix additive, FM, subtractive, granular, physical modeling, and other synthesis technologies, allowing you to design synthesizers with greater complexity than any hardware on the market. For example, you can build banks of identical or varied filters and effects, specify parameter envelopes with any number of breakpoints, and project your sounds in spatialization formats from simple stereo to multichannel speaker arrays.
Those "other" technologies referred to above include some recently developed methods, such as scanned synthesis (an offshoot of physical modeling), hyper-vectorial synthesis (a method for smooth cross-fading between waveforms), and wave terrain synthesis (which determines a waveform by scanning a 3D surface) and are all new worlds to me – areas of sound production waiting for further exploration.
Csound can function as a powerful sampler/rompler. Real-time audio and sound file I/O is supported by various opcodes, including some that allow permutation of pitch and time. Looping opcodes are available, again with pitch and time shifting. SoundFont playback is handled by a set of opcodes based on FluidSynth, a well-known, open source playback engine for sounds in the SoundFont SF2 format.
Csound's DSP capabilities are impressive. Opcodes are available for various reverb types, delay lines, chorusing units, flangers, and other commonly encountered effects. For those who like to have greater control, various filter types can be employed for designing your own equalizers, delay lines, and reverb units. Of course, a full complement of opcodes can be invoked for mixing, balancing, gating, compressing, and limiting the signals in your mix.
Personally, I find it odd that someone might want to use plugins with Csound, but why not? Linux users can employ their favorite LADSPA signal processing plugins through the dssi4cs
opcodes. Alas, DSSI plugins aren't supported yet, but it is on the to-do list. I hope to see it develop; I can imagine great possibilities with the amSynth and Hexter DSSI synthesizers wired into Csound's awesome capabilities.
Csound also supplies a set of utility programs designed for audio analysis, the results of which can be processed by associated resynthesis opcodes. For example, a file created by the hetro utility can be processed by adsyn
, its target opcode. The hetro analysis separates the original sound's frequency and temporal characteristics, thus permitting independent control of pitch and duration when resynthesized by the adsyn
opcode. Similar arrangements exist for the phase vocoder, LPC, ATSA, and convolution analysis utilities. Each is associated with an opcode or set of opcodes designed to process the utility's output file format. Time-stretching, pitch-shifting, and reverberation are some common applications of these tools.
The Test Bench
I'll look at Csound version 6.00, built and installed on a dual-core machine running Ubuntu 12.04 in 32-bit mode. My 64-bit box is currently under reconstruction, but I can testify that Csound runs perfectly well on 64-bit Debian and Arch systems. My Ubuntu boxes are always customized with KXStudio, an overlay that provides an audio-optimized system and a complete set of tools for getting right to work with music and sound on Linux.
Csound can be installed from the normal Ubuntu repos, but I've been rolling my own for so long I can't stop now. I compile Csound with activated options for OSC support, the Java and Python language interfaces, integrated FLTK graphics, and a few other personal preferences. However, the examples I'll present here require only a plain vanilla Csound.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
News
-
Danielle Foré Has an Update for elementary OS 7
Now that Ubuntu 22.04 has been released, the team behind elementary OS is preparing for the upcoming 7.0 release.
-
Linux New Media Launches Open Source JobHub
New job website focuses on connecting technical and non-technical professionals with organizations in open source.
-
Ubuntu Cinnamon 22.04 Now Available
Ubuntu Cinnamon 22.04 has been released with all the additions from upstream as well as other features and improvements.
-
Pop!_OS 22.04 Has Officially Been Released
From the makers of some of the finest Linux-powered desktop and laptop computers on the market comes the latest version of their Ubuntu-based distribution, Pop!_OS 22.04.
-
Star Labs Unveils a New Small Format Linux PC
The Byte Mk I is an AMD-powered mini Linux PC with Coreboot support and plenty of power.
-
MX Linux Verison 21.1 “Wildflower” Now Available
The latest release of the systemd-less MX Linux is now ready for public consumption.
-
Microsoft Expands Their Windows Subsystem for Linux Offerings With AlmaLinux
Anyone who works with Windows Subsystem for Linux (WSL) will now find a new addition to the available distributions, one that’s become the front-runner replacement for CentOS.
-
Debian 11.3 Released wIth Numerous Bug and Security Fixes
The latest point release for Debian Bullseye is now available with some very important updates.
-
The First Alpha of Asahi Linux is Available
Asahi Linux is the first distribution to fully support Apple Silicon and is now available for testing.
-
Zorin OS 16.1 Released with a New Kernel For Better Hardware Compatibility
The developers of Zorin OS have released the latest version of their beautiful desktop Linux OS.