Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Csound
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Csound code == Csound takes two specially formatted [[text file]]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]] tags (a CSD file with [[filename extension]] .csd). Here is a very simple example of a unified Csound data file which produces a [[wave file]] containing a one-second [[sine wave]] tone of 1 [[Kilohertz|kHz]] at a [[Sampling frequency|sample rate]] of 96 kHz: <syntaxhighlight lang="csound-csd"> <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> </syntaxhighlight> As with many other programming languages, writing long programs in Csound can be eased by using an [[integrated development environment]] for editing, previewing, testing, and [[debugging]]. 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)