~ubuntu-branches/ubuntu/trusty/csound-manual/trusty-proposed

« back to all changes in this revision

Viewing changes to beats/top.xml

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Sateler
  • Date: 2011-08-01 22:21:58 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110801222158-90kslkp5ujci2f5d
Tags: 1:5.13~dfsg-1
* New upstream release
 - Add Menno Knevel to the copyright file
 - Refresh patch 2000-stripped-opcodes.diff
 - Update copyright hints file
* Update Vcs-* headers
* Bump Standards-Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<chapter id="BeatsTop">
 
2
  <title>Beats</title>
 
3
 
 
4
  <para>
 
5
    <indexterm id="IndexBeats"><primary>Beats</primary></indexterm>
 
6
    <emphasis>Beats</emphasis> is an alternative score language that is aimed at 
 
7
     specifying simple scores in standard western tunings and
 
8
     rhythms.  <emphasis>Beats</emphasis> can be invoked via the
 
9
     CsScore component of a standard .csd score with
 
10
     <emphasis>bin="beats"</emphasis> or as stand-alone
 
11
     program which generates a standard numeric score.
 
12
  </para>
 
13
 
 
14
  <para>
 
15
    As a stand-alone the program reads standard input and writes to
 
16
    standard output.
 
17
  </para>
 
18
 
 
19
  <section id="Syntax">
 
20
 
 
21
    <para>
 
22
      The <emphasis>beats</emphasis> language is very simple, having
 
23
      only 5  kinds of statement, and only one of them has any
 
24
      complexity.  In general the introductory word for each statement
 
25
      type is case insensitive, so "QUIT", "quit", "QuIt"... are all
 
26
      the same.  Comments can be introduced in either ANSI C89 format
 
27
      or C++ (that is either /* ... */ or // to the end of line) or
 
28
      Csound's semicolo.
 
29
    </para>
 
30
    <itemizedlist>
 
31
      <listitem><emphasis>QUIT</emphasis>
 
32
      <para>
 
33
        Causes beats to exit.  For
 
34
        flexibility the command <emphasis>END</emphasis> is also
 
35
        accepted for the identical action.
 
36
      </para>
 
37
      </listitem>
 
38
      <listitem><emphasis>BEATS</emphasis>=integer
 
39
      <para>
 
40
        Sets the number of beats
 
41
        per minute for the following score until the end or until it is
 
42
        reset.  The default value is 60bpm.  The token
 
43
        <emphasis>BPS</emphasis> is also acceptable instead of BEATS.  
 
44
      </para>
 
45
      </listitem>
 
46
      <listitem><emphasis>PERMEASURE</emphasis>=integer
 
47
      <para>
 
48
        Sets the number of
 
49
        beats in a bar.  The default value is 4.
 
50
      </para>
 
51
      </listitem>
 
52
      <listitem><emphasis>BAR</emphasis>
 
53
      <para>
 
54
        Start a new bar.
 
55
      </para>
 
56
      </listitem>
 
57
      <listitem><emphasis>BAR</emphasis> integer
 
58
      <para>
 
59
        Start the bar whose number is
 
60
        given.
 
61
      </para>
 
62
      </listitem>
 
63
      <listitem>
 
64
        <emphasis>i</emphasis> integer attributes
 
65
        <para>
 
66
          Specified a note event for the numbered instrument.  The
 
67
          attributes may be any of a pitch, duration or dynamic, or a
 
68
          positioning of the note to a beat or measure, and can be in
 
69
          any order.
 
70
        </para>
 
71
        <para>
 
72
          Pitches are specified with a conventional note name (English
 
73
          form) in upper case optionally followed by a #, x (for
 
74
          double sharp), b (for flat) or bb (for double flat). 
 
75
          A note of Z is a rest (think zzzz).  All notes except rests
 
76
          must be followed by an octave number, with A4 being
 
77
          international A (440Hz).  Pitches are passed to Csound in
 
78
          Hertz in the parameter p4, and are twelve tone equal temprament.
 
79
        </para>
 
80
        <para>
 
81
          Durations are coded in lower case with the initial letter of the
 
82
          name.
 
83
          <itemizedlist>
 
84
            <listitem>
 
85
              <emphasis>ed</emphasis> Dotted eighth note (three
 
86
              quarters of a beat) 
 
87
            </listitem>
 
88
            <listitem>
 
89
              <emphasis>et</emphasis> Triplet eighth note (third of a beat)
 
90
            </listitem>
 
91
            <listitem>
 
92
              <emphasis>e</emphasis> Eighth note (half a beat)
 
93
            </listitem>
 
94
            <listitem>
 
95
              <emphasis>hd</emphasis> Dotted half note (three beats)
 
96
            </listitem>
 
97
            <listitem>
 
98
              <emphasis>ht</emphasis> Triplet half note (one and a third beats)
 
99
            </listitem>
 
100
            <listitem>
 
101
              <emphasis>h</emphasis> Half note (two beats)
 
102
            </listitem>
 
103
            <listitem>
 
104
              <emphasis>qd</emphasis> Dotted quarter note (one and a half beats)
 
105
            </listitem>
 
106
            <listitem>
 
107
              <emphasis>qt</emphasis> Triplet quarter note (two thirds of a
 
108
              beat)
 
109
            </listitem>
 
110
            <listitem>
 
111
              <emphasis>q</emphasis> Quarter note (one beat)
 
112
            </listitem>
 
113
            <listitem>
 
114
          <emphasis>sd</emphasis> Dotted sixteenth note (Three eighths
 
115
          of a beat)
 
116
        </listitem>
 
117
        <listitem>
 
118
          <emphasis>st</emphasis> Triplet sixteenth note (sixth
 
119
          of a beat)
 
120
        </listitem>
 
121
        <listitem>
 
122
          <emphasis>s</emphasis> Sixteenth note (quarter of a beat)
 
123
        </listitem>
 
124
        <listitem>
 
125
          <emphasis>th</emphasis> Thirty-second note (an eighth of a beat)
 
126
        </listitem>
 
127
        <listitem>
 
128
          <emphasis>w</emphasis> Whole note (four beats)
 
129
        </listitem>
 
130
      </itemizedlist>
 
131
      Durations can be added together by giving more that one
 
132
      duration.  To make this more intuitive a + sign can be used
 
133
      instead of white space.
 
134
    </para>
 
135
    <para>
 
136
      The dynamics are written in conventional notation, that is fff,
 
137
      ff, f, mf, mp, p, pp, ppp.  These are passed to the instrument
 
138
      as p5 as 0 for fff, and one less dB for each step below.  The
 
139
      default dynamic is fortissimo.
 
140
    </para>
 
141
    <para>
 
142
      If any of these attributes is missing it carried forward from the
 
143
      previous note, with beat position being incremented to the end
 
144
      of the previous note.
 
145
    </para>
 
146
    <para>
 
147
      In addition an event can be directed to a particular measure with
 
148
      an m attribute or a particular beat with a b.
 
149
    </para>
 
150
      </listitem>
 
151
    </itemizedlist>
 
152
   </section>
 
153
 
 
154
  <section id="Example">
 
155
    <para>
 
156
      The opening of Bach's Goldberg variation number 3 can be coded
 
157
      as:
 
158
      <programlisting>
 
159
; Bach - Goldberg Variations - Variato 3
 
160
; by Brian Baughn 3-14-05
 
161
; bbaughn@berklee.net
 
162
beats = 120
 
163
permeasure = 6
 
164
 
 
165
i101    m1 b1 B4 mp qd+s
 
166
i101          C5    s
 
167
i101          D5
 
168
i101          C5
 
169
i101          D5
 
170
i101          E5
 
171
i101          A4    qd+s
 
172
i101          B4    s
 
173
i101          C5
 
174
i101          B4
 
175
i101          C5
 
176
i101          D5
 
177
 
 
178
i101    m2 b1 G4    qd
 
179
i101          G5    qd+e
 
180
i101          A5    s
 
181
i101          G5
 
182
i101          F#5
 
183
i101          G5
 
184
i101          A5    e
 
185
 
 
186
i101  m3 b1.5 D5    s
 
187
i101          C5
 
188
i101          B4
 
189
i101          A4
 
190
i101          B4    e
 
191
i101          C5    s
 
192
i101          B4
 
193
i101          A4
 
194
i101          B4
 
195
i101          G4    e
 
196
i101          E5
 
197
i101          D5
 
198
i101          C5
 
199
i101          F#5
 
200
i101          A5
 
201
 
 
202
i101  m4 b1   B4    q
 
203
i101          G5    e
 
204
i101          G5    q
 
205
i101          F#5   e
 
206
i101          Z     e   // Z is a rest (zzzzz..)
 
207
i101                e
 
208
i101          B5    e
 
209
i101          A5    q
 
210
i101          D5    e
 
211
 
 
212
quit
 
213
 
 
214
      </programlisting>
 
215
This produces output
 
216
      <programlisting>
 
217
;;;setting bpm=120.000000
 
218
;;;setting permeasure=6
 
219
i101 0.000000 0.875000 493.883621 -4
 
220
i101 0.875000 0.125000 523.251131 -4
 
221
i101 1.000000 0.125000 587.329536 -4
 
222
i101 1.125000 0.125000 523.251131 -4
 
223
i101 1.250000 0.125000 587.329536 -4
 
224
i101 1.375000 0.125000 659.255114 -4
 
225
i101 1.500000 0.875000 440.000000 -4
 
226
i101 2.375000 0.125000 493.883621 -4
 
227
i101 2.500000 0.125000 523.251131 -4
 
228
i101 2.625000 0.125000 493.883621 -4
 
229
i101 2.750000 0.125000 523.251131 -4
 
230
i101 2.875000 0.125000 587.329536 -4
 
231
i101 3.000000 0.750000 391.995436 -4
 
232
i101 3.750000 1.000000 783.990872 -4
 
233
i101 4.750000 0.125000 880.000000 -4
 
234
i101 4.875000 0.125000 783.990872 -4
 
235
i101 5.000000 0.125000 739.988845 -4
 
236
i101 5.125000 0.125000 783.990872 -4
 
237
i101 5.250000 0.250000 880.000000 -4
 
238
i101 6.250000 0.125000 587.329536 -4
 
239
i101 6.375000 0.125000 523.251131 -4
 
240
i101 6.500000 0.125000 493.883621 -4
 
241
i101 6.625000 0.125000 440.000000 -4
 
242
i101 6.750000 0.250000 493.883621 -4
 
243
i101 7.000000 0.125000 523.251131 -4
 
244
i101 7.125000 0.125000 493.883621 -4
 
245
i101 7.250000 0.125000 440.000000 -4
 
246
i101 7.375000 0.125000 493.883621 -4
 
247
i101 7.500000 0.250000 391.995436 -4
 
248
i101 7.750000 0.250000 659.255114 -4
 
249
i101 8.000000 0.250000 587.329536 -4
 
250
i101 8.250000 0.250000 523.251131 -4
 
251
i101 8.500000 0.250000 739.988845 -4
 
252
i101 8.750000 0.250000 880.000000 -4
 
253
i101 9.000000 0.500000 493.883621 -4
 
254
i101 9.500000 0.250000 783.990872 -4
 
255
i101 9.750000 0.500000 783.990872 -4
 
256
i101 10.250000 0.250000 739.988845 -4
 
257
;;rest at 10.500000 for 0.250000
 
258
;;rest at 10.750000 for 0.250000
 
259
i101 11.000000 0.250000 987.767243 -4
 
260
i101 11.250000 0.500000 880.000000 -4
 
261
i101 11.750000 0.250000 587.329536 -4
 
262
e
 
263
      </programlisting>
 
264
    </para>
 
265
    </section>
 
266
 
 
267
 
 
268
 
 
269
 
 
270
 
 
271
 
 
272
</chapter>