Debian Codegraph @

examples/bitshift.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 ;-odac -iadc ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 -o bitshift.wav -W --nosound ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 128
13 nchnls = 2
14
15 instr 1 ;bit shift right
16 ival = p4>>p5
17 printf_i "%i>>%i = %i\n", 1, p4, p5, ival
18 endin
19
20 instr 2 ;bit shift left
21 ival = p4<<p5
22 printf_i "%i<<%i = %i\n", 1, p4, p5, ival
23 endin
24
25 </CsInstruments>
26 <CsScore>
27 i 1 0 0.1 2 1
28 i 1 + . 3 1
29 i 1 + . 7 2
30 i 1 + . 16 1
31 i 1 + . 16 2
32 i 1 + . 16 3
33
34 i 2 5 0.1 1 1
35 i 2 + . 1 2
36 i 2 + . 1 3
37 i 2 + . 1 4
38 i 2 + . 2 1
39 i 2 + . 2 2
40 i 2 + . 2 3
41 i 2 + . 3 2
42 e
43 </CsScore>
44 </CsoundSynthesizer>