Take and join in musical programming - languages ​​that will help to do this

In one of the previous materials, we wrote about Sporth, developed for conducting live music sessions. Today we’ll talk about another tool for “musical programming” - the Csound language . And let's talk about its counterparts - SuperCollider and Pure Data .


Photo Escape Artiste / Unsplash

How Csound appeared


This language allows you to solve the problems of processing audio signals and is a popular tool for " musical programming ." This term refers to the process of writing tracks using electronic devices: sequencers, synthesizers and software.

The history of Csound dates back to the middle of the last century. He is the direct descendant of the MUSIC-N language family , the first version of which in 1957 was introduced by engineer Max Mathews of Bell Labs. MUSIC is considered one of the first solutions for the generation of digital sound waves. With his help, the compositions “ The Silver Scale ” and “ The Pitch Variations ” were written . Both works belong to acoustic engineer and linguist Newman Guttman, who was the first music programmer in history.


Over time, the possibilities of MUSIC expanded: new versions of the language appeared, and the user base increased. In the mid-80s, the capabilities of the system attracted Barry Vercoe, a specialist from MIT Media Labs. Using the achievements of colleagues from Bell Labs, he realized his language and named it Csound . He wrote the compiler in C and decided to distribute everything under the GNU LGPL license. The system is still supported and expanded by modules for signal processing.

Language Features


To generate sound , special opcodes are used here . These codes are needed to identify instruments in a digital orchestra file . For example, to include an oscillator in an orchestra, just write the following command:

a1 oscil 10000, 440, 1

Three arguments are amplitude, frequency and waveform, respectively.

The list of notes to be played is placed in a separate score file , created in a regular text editor. Next, the compiler arranges the score by time, calculates the values ​​for the wave tables, and plays the music.

If desired, the orchestra and score files can be combined into one with special tags. The wiki provides an example of the contents of such a document - it generates a sine wave lasting one second with a frequency of 1 kHz.

<CsoundSynthesizer>

  <CsOptions>
    csound -W -d -o tone.wav
  </CsOptions>

  <CsInstruments>
    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
  </CsInstruments>

  <CsScore>
    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
  </CsScore>

</CsoundSynthesizer>

If you want to get to know this language more closely, then, according to residents of Hacker News, doing this is quite easy. You can start with detailed official documentation or refer to the subject literature .

Who uses


American DJ Brian Transeau works with Csound , who wrote music for Need for Speed: Underground and the films Blade 2, The Fast and the Furious. With the help of this PL, he wrote the track “ All That Makes Us Human Continues ” from the album “This Binary Universe”.


This PL was also used by the Swedish composer Tobias Enhus, whose work can be heard in the movie Black Hawk. Using this system, he wrote the track " Electric Priest ".

The language was also useful for the implementation of scientific and research projects. Specialists from the Norwegian University of Life Sciences and Engineering have developed custom effects to discover new methods of writing music.

Alternative solutions


The MUSIC family of PLs has become the progenitor not only for Csound, but also for other sound generation systems. Among them are SuperCollider and Pure Data .

SuperCollider is a virtual environment for real-time audio synthesis. In 1996, it was developed by James McCartney (James McCartney) and posted in the public domain . Over time, several more engineers joined the project, who still support it - on GitHub, SuperCollider has more than 3 thousand stars .

SuperCollider has ample opportunities for self-expression, so it is used by a fairly large number of composers . For example, American musician Jeremy van Buskirk (Jeremy Van Buskirk ) wrote “ A Sigh Felt Across The Earth ” on SuperCollider , and Mark Ballora, professor of the music school at the University of Pennsylvania, introduced the track “ Singularity ”.

It is believed that the full development of SuperCollider will take a lot of time. Although the official video tutorials on YouTube and other guides will definitely help with this task .


Photo Escape Artiste / Unsplash

RegardingPure Data, it is a visual programming language for implementing interactive multimedia works. This is an open analogue of theMax / MSPutility. It is based on data flows passing through objects and the connections between them. For this reason, a program on Pure Data is called a patch, similar to modular synthesizers, where the connections were made with patch cords.

Examples of works sold using Pure Data can be found on YouTube. For example, the work of Rino Petrozziello (Rino Petrozziello), which is called "Algorithmic Music". More examples areon the official website.



« Hi-Fi»:

Sporth — live-
:
—
:
:



:




All Articles