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
49
50
51
52
53
54
/* Example 3 - Using our own performance loop
* Author: Steven Yi <stevenyi@gmail.com>
* 2013.10.28
*
* In this example, we use a while loop to perform Csound one audio block at a time.
* This technique is important to know as it will allow us to do further processing
* safely at block boundaries. We will explore the technique further in later examples.
*/
extern crate csound;
use *;
/* Defining our Csound ORC code within a multiline String */
static orc: &str = "sr=44100
ksmps=32
nchnls=2
0dbfs=1
instr 1
aout vco2 0.5, 440
outs aout, aout
endin";
/*Defining our Csound SCO code */
static sco: &str = "i1 0 1";