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

« back to all changes in this revision

Viewing changes to examples/lorisplay.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
<CsoundSynthesizer>
 
2
<CsOptions>
 
3
; Select audio/midi flags here according to platform
 
4
; Audio out   Audio in    No messages
 
5
-odac           -iadc     -d     ;;;RT audio I/O
 
6
; For Non-realtime ouput leave only the line below:
 
7
; -o lorisplay.wav -W ;;; for file output any platform
 
8
</CsOptions>
 
9
<CsInstruments>
 
10
 
 
11
sr = 44100
 
12
ksmps = 128
 
13
nchnls = 2
 
14
 
 
15
; Play the partials in clarinet.sdif from 0 to 3 sec with 1 ms fadetime
 
16
; and no frequency , amplitude, or bandwidth modification.
 
17
 
 
18
instr 1
 
19
ktime   linseg  0, p3, 3.0                      ; linear time function from 0 to 3 seconds
 
20
        lorisread       ktime, "clarinet.sdif", 1, 1, 1, 1, .001
 
21
asig    lorisplay       1, 1, 1, 1
 
22
        outs            asig, asig
 
23
endin
 
24
 
 
25
 
 
26
; Play the partials in clarinet.sdif from 0 to 3 sec with 1 ms fadetime
 
27
; adding tuning and vibrato, increasing the "breathiness" (noisiness) and overall
 
28
; amplitude, and adding a highpass filter.
 
29
 
 
30
instr 2
 
31
ktime   linseg  0, p3, 3.0                      ; linear time function from 0 to 3 seconds
 
32
                                                        ; compute frequency scale for tuning
 
33
    
 
34
ifscale =       cpspch(p4)/cpspch(8.08) ; (original pitch was G#4)
 
35
                                                        ; make a vibrato envelope
 
36
kvenv   linseg  0, p3/6, 0, p3/6, .02, p3/3, .02, p3/6, 0, p3/6, 0
 
37
kvib    oscil           kvenv, 4, 1                     ; table 1, sinusoid
 
38
kbwenv  linseg  1, p3/6, 1, p3/6, 100, 2*p3/3, 100      ;lots of noise
 
39
        lorisread       ktime, "clarinet.sdif", 1, 1, 1, 1, .001
 
40
a1      lorisplay       1, ifscale+kvib, 2, kbwenv
 
41
a2      atone           a1, 1000                        ; highpass filter, cutoff 1000 Hz
 
42
        outs            a2, a2
 
43
endin
 
44
 
 
45
</CsInstruments>
 
46
<CsScore>
 
47
; make sinusoid in table 1
 
48
f 1 0 4096 10 1
 
49
; play instr 1
 
50
;     strt   dur
 
51
i 1    0      3
 
52
i 1    +      1
 
53
i 1    +      6
 
54
s
 
55
; play instr 2
 
56
;     strt   dur   ptch
 
57
i 2      1    3    8.08
 
58
i 2      3.5  1    8.04
 
59
i 2      4    6    8.00
 
60
i 2      4    6    8.07
 
61
e
 
62
 
 
63
</CsScore>
 
64
</CsoundSynthesizer>