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

« back to all changes in this revision

Viewing changes to examples/atone.csd

  • 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
1
<CsoundSynthesizer>
2
2
<CsOptions>
3
3
; Select audio/midi flags here according to platform
4
 
; Audio out   Audio in    No messages
5
 
-odac           -iadc     -d     ;;;RT audio I/O
 
4
-odac     ;;;RT audio out
 
5
;-iadc    ;;;uncomment -iadc if RT audio input is needed too
6
6
; For Non-realtime ouput leave only the line below:
7
7
; -o atone.wav -W ;;; for file output any platform
8
8
</CsOptions>
9
9
<CsInstruments>
10
10
 
11
 
; Initialize the global variables.
12
 
sr = 22050
13
 
kr = 2205
14
 
ksmps = 10
15
 
nchnls = 1
16
 
 
17
 
; Instrument #1 - an unfiltered noise waveform.
18
 
instr 1
19
 
  ; Generate a white noise signal.
20
 
  asig rand 20000
21
 
 
22
 
  out asig
23
 
endin
24
 
 
25
 
 
26
 
; Instrument #2 - a filtered noise waveform.
27
 
instr 2
28
 
  ; Generate a white noise signal.
29
 
  asig rand 20000
30
 
 
31
 
  ; Filter it using the atone opcode.
32
 
  khp init 2000
33
 
  afilt atone asig, khp
34
 
 
35
 
  ; Clip the filtered signal's amplitude to 85 dB.
36
 
  a1 clip afilt, 2, ampdb(85)
37
 
  out a1
38
 
endin
39
 
 
 
11
sr = 44100
 
12
ksmps = 32
 
13
nchnls = 2
 
14
0dbfs = 1
 
15
 
 
16
instr 1 ;white noise
 
17
 
 
18
asig    rand 1
 
19
        outs asig, asig
 
20
 
 
21
endin
 
22
 
 
23
 
 
24
instr 2 ;filtered noise
 
25
 
 
26
asig    rand 1
 
27
khp     init 4000
 
28
asig    atone asig, khp
 
29
        outs asig, asig
 
30
 
 
31
endin
40
32
 
41
33
</CsInstruments>
42
34
<CsScore>
43
35
 
44
 
; Play Instrument #1 for two seconds.
45
36
i 1 0 2
46
 
; Play Instrument #2 for two seconds.
47
37
i 2 2 2
48
38
e
49
39
 
50
 
 
51
40
</CsScore>
52
41
</CsoundSynthesizer>