summaryrefslogtreecommitdiff
path: root/examples-xml/vibr.csd.xml
blob: e821d2014c1a8c17fd98ab1832c008a4b33f2e60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<programlisting>
<emphasis role="csdtag">&lt;CsoundSynthesizer&gt;</emphasis>
<emphasis role="csdtag">&lt;CsOptions&gt;</emphasis>
<emphasis role="comment">; Select audio/midi flags here according to platform</emphasis>
<emphasis role="comment">; Audio out   Audio in    No messages</emphasis>
-odac           -iadc     -d     <emphasis role="comment">;;;RT audio I/O</emphasis>
<emphasis role="comment">; For Non-realtime ouput leave only the line below:</emphasis>
<emphasis role="comment">; -o vibr.wav -W ;;; for file output any platform</emphasis>
<emphasis role="csdtag">&lt;/CsOptions&gt;</emphasis>
<emphasis role="csdtag">&lt;CsInstruments&gt;</emphasis>

<emphasis role="comment">; Initialize the global variables.</emphasis>
<emphasis role="ohdr">sr</emphasis> <emphasis role="op">=</emphasis> 44100
<emphasis role="ohdr">kr</emphasis> <emphasis role="op">=</emphasis> 4410
<emphasis role="ohdr">ksmps</emphasis> <emphasis role="op">=</emphasis> 10
<emphasis role="ohdr">nchnls</emphasis> <emphasis role="op">=</emphasis> 1

<emphasis role="comment">; Instrument #1.</emphasis>
<emphasis role="oblock">instr</emphasis> 1
  <emphasis role="comment">; Create a vibrato waveform.</emphasis>
  kaverageamp <emphasis role="opc">init</emphasis> 7500
  kaveragefreq <emphasis role="opc">init</emphasis> 5
  ifn <emphasis role="op">=</emphasis> 1
  kvamp <emphasis role="opc">vibr</emphasis> kaverageamp, kaveragefreq, ifn

  <emphasis role="comment">; Generate a tone including the vibrato.</emphasis>
  a1 <emphasis role="opc">oscili</emphasis> 10000<emphasis role="op">+</emphasis>kvamp, 440, 2

  <emphasis role="opc">out</emphasis> a1
<emphasis role="oblock">endin</emphasis>


<emphasis role="csdtag">&lt;/CsInstruments&gt;</emphasis>
<emphasis role="csdtag">&lt;CsScore&gt;</emphasis>

<emphasis role="comment">; Table #1, a sine wave for the vibrato.</emphasis>
<emphasis role="stamnt">f</emphasis> 1 0 256 10 1
<emphasis role="comment">; Table #1, a sine wave for the oscillator.</emphasis>
<emphasis role="stamnt">f</emphasis> 2 0 16384 10 1

<emphasis role="comment">; Play Instrument #1 for 2 seconds.</emphasis>
<emphasis role="stamnt">i</emphasis> 1 0 2
<emphasis role="stamnt">e</emphasis>


<emphasis role="csdtag">&lt;/CsScore&gt;</emphasis>
<emphasis role="csdtag">&lt;/CsoundSynthesizer&gt;</emphasis>
</programlisting>