Csound tutorials: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Creating a small tutorial/guide for using Csound in the Terminal Activity.)
m (Reverted edits by 91.201.66.76 (Talk) to last revision by Thumbuki)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
These Csound tutorials are designed to showcase various aspects of using Csound on an XO computer.
These [[Csound]] tutorials are designed to showcase various aspects of using Csound on an XO computer.

== Tutorials and Resources ==

* [http://wiki.laptop.org/go/Csndsugui Writing an Csound-based activity with csndsugui]
* [http://wiki.laptop.org/go/Csound#Updating_Csound_with_RPM Updating Csound with RPM on a XO]
* [[Csound TOOTS]] An Instrument Design TOOTorial by Dr. Richard Boulanger
* [http://www.csounds.com/tootsother/vercoetut/Vercoe.html A Beginning Tutorial] by Barry Vercoe.
* [http://www.csounds.com/chapter1/index.html Chapter 1 from The Csound Book] The complete first chapter from The Csound Book, by Dr. Richard Boulanger
* [http://www.csounds.com/cascone/index.html Recontextualizing Ambient Music in Csound] by Kim Cascone
* [http://www.csounds.com/tutorials cSounds.com Tutorials Directory]
* [http://www.csounds.com/journal/articleIndex.html The Csound Journal and Magazine]
* [http://www.thumbuki.com/csound/blog/ The Csound Blog]


== Exploring Csound from the XO Terminal ==
== Exploring Csound from the XO Terminal ==

=== Downloading with wget ===

The terminal utility <tt>wget</tt> downloads files directly from the internet. The following example downloads [http://csounds.com/4csEditor.zip 4csEditor.zip], a library of approximately 500 Csound csd files:

wget http://csounds.com/4csEditor.zip

=== Unpack Files ===

Downloaded files usually come in one of three archival formats: tar, tar.gz and zip.

* <tt>tar xvpf file.tar</tt> Unpacks a tar file
* <tt>tar xvpfz file.tar.gz</tt> Unpacks a tar.gz file
* <tt>unzip file.zip</tt> Unpacks a zip file


=== Flags ===
=== Flags ===


Flags change the behavior of Csound, and can be set either in a Csound csd file or by specifying them at the command prompt. The following is a list of the most common used flags in both Csound-based activities and the Terminal activity:
For a list of flags, enter <tt>csound</tt> at the command-line, or <tt>csound --help</tt> for a complete list.


* <tt>--help</tt> A full list supported command-line flags for Csound.
* <tt>--help</tt> A complete list of supported command-line flags for Csound.
* <tt>-odac</tt> Output audio stream to the [http://en.wikipedia.org/wiki/Digital-to-analog_converter Digital-to-analog_converter], sound card
* <tt>-odac</tt> Output audio stream to the [http://en.wikipedia.org/wiki/Digital-to-analog_converter Digital-to-analog_converter], sound card
* <tt>-iadc</tt> Read audio from the [http://en.wikipedia.org/wiki/Analog_to_digital_converter Analog_to_digital_converter], built-in microphone
* <tt>-iadc</tt> Read audio from the [http://en.wikipedia.org/wiki/Analog_to_digital_converter Analog_to_digital_converter], built-in microphone
Line 14: Line 40:
* <tt>-b2048</tt> Set sample frames per software sound I/O buffer to 2048
* <tt>-b2048</tt> Set sample frames per software sound I/O buffer to 2048
* <tt>-B4096</tt> Set samples per hardware sound I/O buffer 20 4096
* <tt>-B4096</tt> Set samples per hardware sound I/O buffer 20 4096
* <tt>-+rtaudio=alsa</tt> Sets real time audio to the device alsa
* <tt>-+rtaudio=alsa</tt> Set real time audio to the device alsa
* <tt>-+rtmidi=alsa</tt> Sets real time MIDI to device alsa
* <tt>-+rtmidi=alsa</tt> Set real time MIDI to device alsa

The following line shows one possible example of rendering a Csound csd file named foo.csd in real time.:

csound -odac -d -m0 -b2048 -B4096 -+rtaudio=alsa foo.csd

Users can hardcode flags directly in a Csound csd between the markup tags <tt>&lt;CsOptions&gt;</tt> and <tt>&lt;/CsOptions&gt;</tt> with a text editor such as vi:

<CsOptions>
-odac -d -m0 -b2048 -B4096 -+rtaudio=alsa
</CsOptions>

Latest revision as of 13:36, 24 May 2011

These Csound tutorials are designed to showcase various aspects of using Csound on an XO computer.

Tutorials and Resources

Exploring Csound from the XO Terminal

Downloading with wget

The terminal utility wget downloads files directly from the internet. The following example downloads 4csEditor.zip, a library of approximately 500 Csound csd files:

 wget http://csounds.com/4csEditor.zip

Unpack Files

Downloaded files usually come in one of three archival formats: tar, tar.gz and zip.

  • tar xvpf file.tar Unpacks a tar file
  • tar xvpfz file.tar.gz Unpacks a tar.gz file
  • unzip file.zip Unpacks a zip file

Flags

Flags change the behavior of Csound, and can be set either in a Csound csd file or by specifying them at the command prompt. The following is a list of the most common used flags in both Csound-based activities and the Terminal activity:

  • --help A complete list of supported command-line flags for Csound.
  • -odac Output audio stream to the Digital-to-analog_converter, sound card
  • -iadc Read audio from the Analog_to_digital_converter, built-in microphone
  • -d Suppress all displays
  • -m0 Set message level to 0
  • -b2048 Set sample frames per software sound I/O buffer to 2048
  • -B4096 Set samples per hardware sound I/O buffer 20 4096
  • -+rtaudio=alsa Set real time audio to the device alsa
  • -+rtmidi=alsa Set real time MIDI to device alsa

The following line shows one possible example of rendering a Csound csd file named foo.csd in real time.:

 csound -odac -d -m0 -b2048 -B4096 -+rtaudio=alsa foo.csd

Users can hardcode flags directly in a Csound csd between the markup tags <CsOptions> and </CsOptions> with a text editor such as vi:

 <CsOptions>
 -odac -d -m0 -b2048 -B4096 -+rtaudio=alsa
 </CsOptions>