Debian Codegraph @

preface/gettingstartedXO.xml

raw symbols SCIP
1 <section id="PrefaceGettingStarted">
2 <title>Getting Started with Csound</title>
3 <bridgehead>What you need</bridgehead>
4 <para>
5 Csound comes preinstalled in the XO and it is used internally by other activities like TamTam, so the XO comes ready to use all the material in this manual. This manual can be browsed online <ulink url="http://csounds.com/manualOLPC"><citetitle>here</citetitle></ulink>, but it might be a good idea to download it as a content bundle <ulink url="http://wiki.laptop.org/go/Csound#OLPCsound_Manual"><citetitle>here</citetitle></ulink>, because it will be accessible fast and offline from the Web Activity under the "Media" category in the initial page. <!--You can get the content bundle by downloading <ulink url="http://csounds.com/csound5.08_manual_xo.xol"><citetitle>csound5.08_manual_xo.xol</citetitle></ulink> and then resuming it from the <emphasis>Journal</emphasis>. The manual for OLPCsound will be available in the library in the Media category.-->
6 </para>
7 <bridgehead>Running</bridgehead>
8 <para>
9 When Csound runs, it reads a Csound file and produces audio according to the instructions provided by that file. Csound can be run in different ways. It can be called from a terminal, or from a graphical front-end. A front-end is a graphical program that assists running Csound and can usually help edit csound files, like <!--<ulink url="http://wiki.laptop.org/go/Pippy"><citetitle>Pippy</citetitle></ulink> or--> the <ulink url="http://wiki.laptop.org/go/Csound:Csound_Editor"><citetitle>Csound Editor Activity</citetitle></ulink> .
10 </para>
11 <bridgehead>Using the Csound Editor Activity</bridgehead>
12 <para>
13 <mediaobject>
14 <imageobject>
15 <imagedata fileref="imagesXO/editorXO.jpg" format="JPG"/>
16 </imageobject>
17 <textobject>
18 <phrase>[The Csound Editor Activity]</phrase>
19 </textobject>
20 <caption>
21 <para>The Csound Editor Activity</para>
22 </caption>
23 </mediaobject>
24 </para>
25 <para>
26 The Csound Editor Activity provides an easy way of editing and playing Csound files.
27 <orderedlist>
28 <listitem>
29 <para>
30 You can load and save Csound files using this panel. When you select load from this menu, you will find the directory containing the Csound Examples. There are several directories there that contain various example files. Valid files are the ones that end in <emphasis>.csd</emphasis>.
31 </para>
32 <para>
33 You can also navigate to this manual's examples directory which is located (by default) in the directory /home/olpc/Library/csound5.08_manual_xo/examples.
34 </para>
35 </listitem>
36 <listitem>
37 <para>
38 The time and transport bar shows the current time of the file playing and provides buttons for starting, pausing or stopping a performance. After you have loaded a Csound file, you will want to try the Play button (the one with the triangle).
39 </para>
40 </listitem>
41 <listitem>
42 <para>
43 The upper text panel of the editor shows the orchestra section of the Csound file. This is where instruments and sound processes are defined.
44 </para>
45 </listitem>
46 <listitem>
47 <para>
48 The lower text panel contains the score. The score lists a set of events which trigger the instruments defined in the orchestra section. This are the "notes" the intruments play.
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 The buttons select what is displayed in the lower panel. The lower panel can show the Score section, the Csound console output (a report of the internal processes of Csound) and a MIDI keyboard for realtime generation of note events.
54 </para>
55 </listitem>
56 </orderedlist>
57 </para>
58
59 <bridgehead>Using OLPCsound from the Terminal Activity</bridgehead>
60 <para>
61 To use Csound from the command line, open the <ulink url="http://wiki.laptop.org/go/Terminal"><citetitle>Terminal Activity</citetitle></ulink>. You can try the example files included with this manual line by moving to the examples directory of the manual like this:
62 <screen>
63 cd /home/olpc/Library/csound5.08_manual_xo/examples</screen>
64 and then typing:
65 <screen>
66 csound oscils.csd</screen>
67 This will make csound play the file "oscils.csd". You can see the long list of examples available by typing:
68 <screen>
69 ls</screen>
70 or:
71 <screen>
72 ls|more</screen>
73 which lists all the contents in the current directory.
74 </para>
75
76 <!-- <para>
77 Both in the case of front-ends as well as execution from the command line, Csound needs two things:
78 <itemizedlist>
79 <listitem>
80 <simpara>A Csound file ('.csd' or possibly an '.orc' and a '.sco' file)</simpara>
81 </listitem>
82 <listitem>
83 <simpara>A list of command line flags (or configuration options) that configure execution. They determine things like output filename and format, whether real-time audio and MIDI are enabled, which soundcard to use, the buffer size, the amount of messages printed, etc. These options can be included in the '.csd' file itself, so for the examples included in this manual <emphasis>you shouldn't need to worry about them</emphasis>. The complete and very long list of available command flags can be found <link linkend="CommandFlags"><citetitle>here</citetitle></link>, but you might want to have a look there later...</simpara>
84 </listitem>
85 </itemizedlist>-->
86 <!--See the section <link linkend="Configuring"><citetitle>Configuring</citetitle></link> if Csound is giving you trouble.-->
87 <!-- </para> -->
88 <!-- <para>
89
90 </para>-->
91 <!-- <para>
92 The example files are configured to run in realtime by default, so you should have heard a 2 second sine wave.
93 </para>-->
94 <bridgehead>Editing and writing your own csd files</bridgehead>
95 <!-- <para>A <emphasis>.csd</emphasis> file looks like this (this file is <ulink url="examples/oscils.csd"><citetitle>oscils.csd</citetitle></ulink>):</para>
96 <xi:include href="examples-xml/oscils.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>-->
97 <para>
98 Csound reads text files which contain instructions for producing sound. These files usually have the extension ".csd" and are called <emphasis>csd</emphasis> files. They can be created and edited using simple text editors like <ulink url="http://wiki.laptop.org/go/Pippy"><citetitle>Pippy</citetitle></ulink> or the <ulink url="http://wiki.laptop.org/go/Csound:Csound_Editor"><citetitle>Csound Editor Activity</citetitle></ulink>.
99 </para>
100 <para>
101 Csound's <link linkend="CommandUnifile"><citetitle>.csd</citetitle></link> files contain 3 main sections contained within <emphasis>&lt;CsSynthesizer&gt;</emphasis> and <emphasis>&lt;/CsSynthesizer&gt;</emphasis> tags:
102 <itemizedlist>
103 <listitem>
104 <simpara><emphasis>&lt;CsOptions&gt;</emphasis> - Includes the <link linkend="CommandFlagsCategory"><citetitle>Command Line flags</citetitle></link> specific to this particular file. These options can also be set using the <link linkend="CommandUnifileParFile"><citetitle>.csoundrc</citetitle></link> file or directly in the <link linkend="CommandDesc"><citetitle>command line</citetitle></link>. Some frontends also provide ways to specify global or local options.
105 </simpara>
106 </listitem>
107 <listitem>
108 <simpara>
109 <emphasis>&lt;CsInstruments&gt;</emphasis> - Contains the instruments or processes available in the file. Instruments are defined using the <link linkend="instr"><citetitle>instr</citetitle></link> and <link linkend="endin"><citetitle>endin</citetitle></link> opcodes. The <emphasis>CsInstruments</emphasis> section also contains the <link linkend="OrchHeader"><citetitle>Orchestra Header</citetitle></link> which defines things like <link linkend="sr"><citetitle>sample rate</citetitle></link>, the <link linkend="ksmps"><citetitle>number of samples in a control period</citetitle></link> and the <link linkend="nchnls"><citetitle>number of output channels</citetitle></link>.
110 </simpara>
111 </listitem>
112 <listitem>
113 <simpara>
114 <emphasis>&lt;CsScore&gt;</emphasis> - Contains the 'notes' to be played optionally the definition of f-tables. Notes are created using the <link linkend="i"><citetitle>i statement</citetitle></link>, and f-tables are created using the <link linkend="f"><citetitle>f statement</citetitle></link>. There are several other <link linkend="ScoreStatements"><citetitle>score statements</citetitle></link> available.
115 </simpara>
116 </listitem>
117 </itemizedlist>
118 Note that anything after a semicolon (;) until the end of the line is a comment, and is ignored by Csound.
119 </para>
120 <tip>
121 <para>
122 When you use the <ulink url="http://wiki.laptop.org/go/Csound:Csound_Editor"><citetitle>Csound Editor Activity</citetitle></ulink>, you will not see the tags mentioned above, as it hides them for easier editing. You will only see two panels containing the Orchestra and Score sections of the csd file. In other words, if you are using the <ulink url="http://wiki.laptop.org/go/Csound:Csound_Editor"><citetitle>Csound Editor Activity</citetitle></ulink>, you don't need to worry about these tags and the structure of the file, as the activity will take care of that for you.
123 </para>
124 <para>
125 To use the csound examples in this manual, you can open them directly from the Csound Editor Activity, or you can copy (CTRL-C) and paste (CTRL-V) directly from the page. When you copy and paste, remember you must copy/paste the Orchestra (<emphasis>&lt;CsInstruments&gt;</emphasis>) and Score (<emphasis>&lt;CsScore&gt;</emphasis>) sections separately. Remember to exclude the tags (e.g. <emphasis>&lt;CsInstruments&gt;</emphasis>) in the Csound Editor Activity.
126 </para>
127 </tip>
128 </section>