Csound
   HOME

TheInfoList



OR:

Csound is a
domain-specific Domain specificity is a theoretical position in cognitive science (especially modern cognitive development) that argues that many aspects of cognition are supported by specialized, presumably evolutionarily specified, learning devices. The posit ...
computer
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
for audio programming. It is named Csound because it is written in the language C, in contrast to some of its predecessors. It is
free and open-source software Free and open-source software (FOSS) is software available under a license that grants users the right to use, modify, and distribute the software modified or not to everyone free of charge. FOSS is an inclusive umbrella term encompassing free ...
, released under the
GNU Lesser General Public License The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
(LGPL) 2.1 or later.


History

Csound was originally developed by Barry Vercoe at the
MIT Media Lab The MIT Media Lab is a research laboratory at the Massachusetts Institute of Technology, growing out of MIT's Architecture Machine Group in the MIT School of Architecture and Planning, School of Architecture. Its research does not restrict to fi ...
in 1985, based on his earlier system called Music 11, which in its turn followed the MUSIC-N model initiated by
Max Mathews Max Vernon Mathews (November 13, 1926 – April 21, 2011) was an American pioneer of computer music. Biography Max Vernon Mathews was born in Columbus, Nebraska, to two science schoolteachers. His father in particular taught physics, chemistry ...
at
Bell Labs Nokia Bell Labs, commonly referred to as ''Bell Labs'', is an American industrial research and development company owned by Finnish technology company Nokia. With headquarters located in Murray Hill, New Jersey, Murray Hill, New Jersey, the compa ...
. Csound development continued throughout the 1990s and 2000s, led by John Fitch at the University of Bath. Many developers have contributed to Csound, most notably Istvan Varga, Gabriel Maldonado, Robin Whittle, Richard Karpen, Iain McCurdy, Michael Gogins, Matt Ingalls, Steven Yi, Richard Boulanger, Victor Lazzarini and Joachim Heintz. Developed over many years, , it has nearly 1,700
unit generator Unit generators (or ''ugens'') are the basic formal units in many MUSIC-N-style computer music programming languages. They are sometimes called opcodes (particularly in Csound), though this expression is not considered accurate in that these are ...
s. One of its greatest strengths is that it is completely modular and extensible, by the user. Csound is closely related to the underlying language for the Structured Audio extensions to
MPEG-4 MPEG-4 is a group of international standards for the compression of digital audio and visual data, multimedia systems, and file storage formats. It was originally introduced in late 1998 as a group of audio and video coding formats and related ...
, Structured Audio Orchestra Language (SAOL).


Csound code

Csound takes two specially formatted
text file A text file (sometimes spelled textfile; an old alternative name is flat file) is a kind of computer file that is structured as a sequence of lines of electronic text. A text file exists stored as data within a computer file system. In ope ...
s as input. The ''orchestra'' describes the nature of the instruments and the ''score'' describes notes and other parameters along a timeline. Csound processes the instructions in these files and renders an audio file or real-time audio stream as output. The ''orchestra'' and ''score'' files may be unified into a single structured file using
markup language A markup language is a Encoding, text-encoding system which specifies the structure and formatting of a document and potentially the relationships among its parts. Markup can control the display of a document or enrich its content to facilitate au ...
tags (a CSD file with
filename extension A filename extension, file name extension or file extension is a suffix to the name of a computer file (for example, .txt, .mp3, .exe) that indicates a characteristic of the file contents or its intended use. A filename extension is typically d ...
.csd). Here is a very simple example of a unified Csound data file which produces a
wave file Waveform Audio File Format (WAVE, or WAV due to its filename extension; pronounced or ) is an audio file format standard for storing an audio bitstream on personal computers. The format was developed and published for the first time in 1991 ...
containing a one-second
sine wave A sine wave, sinusoidal wave, or sinusoid (symbol: ∿) is a periodic function, periodic wave whose waveform (shape) is the trigonometric function, trigonometric sine, sine function. In mechanics, as a linear motion over time, this is ''simple ...
tone of 1 kHz at a
sample rate In signal processing, sampling is the reduction of a continuous-time signal to a discrete-time signal. A common example is the conversion of a sound wave to a sequence of "samples". A sample is a value of the signal at a point in time and/or ...
of 96 kHz: csound -W -d -o tone.wav sr = 96000 ; Sample rate. kr = 9600 ; Control signal rate. ksmps = 10 ; Samples per control signal. nchnls = 1 ; Number of output channels. instr 1 a1 oscil p4, p5, 1 ; Oscillator: p4 and p5 are the arguments from the score, 1 is the table number. out a1 ; Output. endin f1 0 8192 10 1 ; Table containing a sine wave. Built-in generator 10 produces a sum of sinusoids, here only one. i1 0 1 20000 1000 ; Play one second of one kHz at amplitude 20000. e As with many other programming languages, writing long programs in Csound can be eased by using an
integrated development environment An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
for editing, previewing, testing, and
debugging In engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs. For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
. The one now officially supported is CsoundQt. It has many features, such as automatic code insertion, integrated documentation browser, integrated widgets for graphically controlling parameters in realtime, plus a button for playing the code.


Csound 5

Version 5.01 was released on March 18, 2006, 20 years after Csound's first release. Csound 5 is available in binary and
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
for
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
, and
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
from the
SourceForge SourceForge is a web service founded by Geoffrey B. Jeffery, Tim Perdue, and Drew Streib in November 1999. SourceForge provides a centralized software discovery platform, including an online platform for managing and hosting open-source soft ...
Csound project. It is much improved and expanded compared to the original software, effectively made into a
software library In computing, a library is a collection of resources that can be leveraged during software development to implement a computer program. Commonly, a library consists of executable code such as compiled functions and classes, or a library can ...
with an application programming interface (
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
). A variety of frontends have been developed for it. Beyond the basic C API, there are also C++,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
, Python,
Lisp Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation. Originally specified in the late 1950s, ...
, and
Tcl TCL or Tcl or TCLs may refer to: Business * TCL Technology, a Chinese consumer electronics and appliance company ** TCL Electronics, a subsidiary of TCL Technology * Texas Collegiate League, a collegiate baseball league * Trade Centre Limited ...
, among other bindings, like one from
Haskell Haskell () is a general-purpose, statically typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell pioneered several programming language ...
which allows control of Csound from a purely
functional programming In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarat ...
environment. The use of plug-ins allows added abilities without modifying the Csound code, as there is the possibility to write user-defined opcodes as extensions to the original language. Linux Audio Developer's Simple Plugin API ( LADSPA) and Disposable Soft Synth Interface (DSSI) are supported, but
Virtual Studio Technology Virtual Studio Technology (VST) is an audio plug-in software interface that integrates software synthesizers and effects units into digital audio workstations. VST and similar technologies use digital signal processing to simulate traditional rec ...
(VST) support has been removed. In the 1990s was added real-time performance via Musical Instrument Digital Interface (
MIDI Musical Instrument Digital Interface (; MIDI) is an American-Japanese technical standard that describes a communication protocol, digital interface, and electrical connectors that connect a wide variety of electronic musical instruments, ...
), and support of Fast Light Toolkit ( FLTK) widgets (
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
components with sliders, knobs, etc.) to control real-time audio, and integrating custom graphical interfaces written in Python.


Csound 6

The development of Csound 6 was led by John Fitch, Steven Yi and Victor Lazzarini. After its features were hashed out at the Csound Conference held in 2011 in Hanover, Csound 6 was released in July 2013 and made available on
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
. Csound 6 is also available for Android. The major new features of Csound 6 include: * A
bison A bison (: bison) is a large bovine in the genus ''Bison'' (from Greek, meaning 'wild ox') within the tribe Bovini. Two extant taxon, extant and numerous extinction, extinct species are recognised. Of the two surviving species, the American ...
/ flex based
parser Parsing, syntax analysis, or syntactic analysis is a process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar by breaking it into parts. The term '' ...
for the Csound language is now standard. It generates an
abstract syntax tree An abstract syntax tree (AST) is a data structure used in computer science to represent the structure of a program or code snippet. It is a tree representation of the abstract syntactic structure of text (often source code) written in a formal ...
that is accessible via the Csound API. The tree can then be compiled to a Csound performance runtime using the API. Therefore, after the tree has been compiled, it can be manipulated by user code before compiling it to a Csound performance runtime. Alternatively, the user could create the entire abstract syntax tree from another language, then compile the tree to a Csound performance runtime. * There is a new built-in multi-dimensional array type. Arrays can be passed to instruments and opcodes. Arithmetic may be performed directly on arrays. * There is a new type system that enables user-defined types to be used in the Csound language. * The orchestra can be re-compiled at any time, or individual instruments can be compiled at any time, during a running performance. This enables true "live coding" in Csound performances. * The Csound API has been rationalized and simplified. * Csound can take advantage of any number of CPUs for concurrent processing during performance. This occurs without any changes to Csound code. This produces substantial speedups of most Csound processing. For example, a piece that renders in 100 seconds with 1 core should render in about 50 seconds with 4 cores. * Csound can compile orchestras and scores directly from strings of text, enabling the use of Csound in environments where writing to the file system is not permitted. * Score events such as notes can be scheduled to sample accurate times, even if synthesis is processed in blocks of samples. * All opcodes that return a single value may be used as functions in the orchestra language. * Audio analysis file formats can be byte-order independent. * A single score statement can contain multiple string parameters. * Most oscillator opcodes will use an internal sine function table if the table number is omitted. * Command-line options can be set programmatically using the Csound API. * Numerous duplicate areas of code within Csound have been rationalized. * An Android app was built which provides user-defined graphical user interfaces and JavaScript-based algorithmic composition using HTML5.


Csound for live performance

Currently only Csound score or note events can be generated in real time (in contrast to instruments, which are only definable at
compile time In computer science, compile time (or compile-time) describes the time window during which a language's statements are converted into binary instructions for the processor to execute. The term is used as an adjective to describe concepts relat ...
, when csound first starts; in Csound 6 this limit is removed). The set of sound processors is defined and compiled at load time, but the individual processing objects can be spawned or destroyed in real time, input audio processed in real time, and output generated also in real time. Note events can be triggered based on OSC communications within an instrument instance, spawned by MIDI, or entered to stdin (by typing into a terminal or sending textual statements from another program). The use of Csound 5 as a live performance tool can be augmented with a variety of third-party software. Live Event Sheet within CsoundQt can be used to modify the score in real-time. In addition, interfaces to other programming languages can be used to script Csound. A paper detailing the use of Csound with Qt or Pure Data in real-time musical synthesis was presented at the 2012 Linux Audio Conference The Ounk project attempts to integrate Python with Csound while CsoundAC provides a way to do algorithmic composition from Python using Csound as backend. Audivation's Csound for Live packages various opcodes into Max/MSP wrappers suitable for use in Ableton Live. Csound is also available for mobile systems (iOS, Android).


One Laptop per Child (OLPC)

Csound5 was chosen to be the audio/music development system for the One Laptop per Child (OLPC) project on the XO-1 Laptop platform.


See also

*
Audio signal processing Audio signal processing is a subfield of signal processing that is concerned with the electronic manipulation of audio signals. Audio signals are electronic representations of sound waves—longitudinal waves which travel through air, consisting ...
*
Software synthesizer A software synthesizer or softsynth is a computer program that generates digital audio, usually for music. Computer software that can create sounds or music is not new, but advances in processing speed now allow softsynths to accomplish the same t ...
* Computer music * Comparison of audio synthesis environments *
List of music software This is a list of software for creating, performing, learning, analyzing, researching, broadcasting and editing music. This article only includes software, not services. For streaming services such as iHeartRadio, Pandora (service), Pandora, Prime ...


References


Further reading

* * * This is a book mostly about programming sound directly using the C language, but it does have a couple of chapters about programming Csound opcodes. *


External links

* {{Authority control Audio programming languages Free audio software Electronic music software Software synthesizers Articles with example code