Source: /cirosantilli/csound

= Csound
{c}
{wiki}

https://www.csounds.com/

https://github.com/csound/csound

<XML> file format (but with 99% of the action of interest in a <domain-specific language> on the `CsInstruments` and `CsScore` elements) that can be played and the reference implementation. Offers complex effects out-of-box apparently.

Allows you to easily define instruments with seemingly arbitrary mathematical functions, and then use them to play notes at given time intervals.

The instrument functions can be parametrized, and each note played can have different parameters.

The instrument definition actually defines a block diagram graph, much like a hardware synthesizer would.

Csound is so not-bloated that it contains an UI system. And it includes an interactive virtual MIDI keyboard that interacts with parameter knobs: http://www.csounds.com/manual/html/MidiTop.html

But hey, it's fun. And like any other good <domain-specific language>, <debugging> it is barbaric of course.

If only it had been written in <Python>... the array manipulation boilerplate would be likely perfect for <NumPy>, and this would have been exactly what <Ciro Santilli> wanted!

CSound states that one of its design goals is backward compatibility, and it shows. Some of the stuff is utterly arcane, e.g. you have to remember what `GEN10`, `GEN11`, etc. mean instead of having named enums.

It just worked on <Ubuntu> 20.04 no questions asked:
``
sudo apt install csound
git clone https://github.com/csound/csound
cd csound
git checkout 92409ecce053d707360a5794f5f4f6bf5ebf5d24
csound examples/xanadu.csd
``
which runs this file: https://github.com/csound/csound/blob/92409ecce053d707360a5794f5f4f6bf5ebf5d24/examples/xanadu.csd and this plays a relly cool sound demo:
\Video[https://www.youtube.com/watch?v=7fXhVMDCfaA]
{title=Xanadu Csound demo}

Save to file instead of playing:
``
csound -o xanadu.wav xanadu.csd
``
or direct ogg output:
``
csound --ogg -o xanadu.ogg xanadu.csd
``
or pipe to stdout to <FFmpeg> TODO: https://stackoverflow.com/questions/64970503/how-to-pipe-csound-output-to-ffmpeg-for-conversion-without-an-intermediate-file

TODO find the most amazing set of songs made with it on GitHub? Some examples:
* http://www.csounds.com/toots/index.html has a good 101 on instrument design
* <Csound FLOSS manual>
* http://iainmccurdy.org/csound.html about 100 <CC BY-SA> examples. Each is a minimal study showing a specific technique, not a full composition, some seem advanced. Dude's a beast.
* https://github.com/csound/csound/tree/f2e70825fb543a6b15011c6984371f61ab2a00dd/tests/soak in-tree minimal examples
* https://github.com/csound/manual/tree/4049b286493d972ff7248b5596e47e7ae97a0cf9/examples contains the examples for the manual which is rendered at: It's insane, but it's fun!  Ah those newbs who separate manuals from main tree.
* http://linuxsynths.com/CsoundPatchesDemos/csound.html on <LinuxSynths>
* https://github.com/csound/examples/tree/ae578159328178142c1055c7f78e28b42eb29774/csd as a few dozen examples
* http://freaknet.org/martin/audio/csound/ 10 pieces with source

Documentation-wise, it's a bit lacking. The only dude who can explain it really well, Dr https://en.wikipedia.org/wiki/Richard_Boulanger[Richard Boulanger], made the "The Csound Book" <closed source>, so, congrats, this will forever hurt the popularity of Csound.

Examples:
* \a[csound/sine.csd]
* \a[csound/amplitude_frequency.csd]
* \a[csound/linen.csd]: simple attack/release <envelope (music)>, documented at: http://www.csounds.com/manual/html/linen.html
* \a[csound/chorus.csd]: <chorus effect>
* \a[csound/bend.csd]: bend using `linseg`
* \a[csound/vibrato.csd]
* \a[csound/crossfade_generators.csd]
* \a[csound/table.csd]
* \a[csound/virtual_keyboard.csd]