| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
</CsOptions> |
| 4 |
<CsInstruments> |
| 5 |
|
| 6 |
sr = 44100 |
| 7 |
ksmps = 128 |
| 8 |
nchnls = 2 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
instr 1 |
| 12 |
kfreq line 300, abs(p3), 1000 |
| 13 |
aout oscil 0.2, kfreq, 1 |
| 14 |
outs aout, aout |
| 15 |
endin |
| 16 |
|
| 17 |
instr 2 ; Same as above but with envelope |
| 18 |
kfreq line 300, abs(p3), 1000 |
| 19 |
kenv linenr 0.2, 1, 1, 0.01 |
| 20 |
aout oscil kenv, kfreq, 1 |
| 21 |
outs aout, aout |
| 22 |
endin |
| 23 |
|
| 24 |
</CsInstruments> |
| 25 |
<CsScore> |
| 26 |
f 1 0 1024 10 1 |
| 27 |
|
| 28 |
i 1 0 -30 ; Turn on held note |
| 29 |
|
| 30 |
i -1 ^+1 1 ;Turn it off |
| 31 |
|
| 32 |
i 1.1 ^+1 -20 ;Turn on note 1.1 |
| 33 |
i 1.2 ^+2 -20 ;Turn on note 1.2 |
| 34 |
|
| 35 |
i -1.2 ^+0.5 1 ;Turn off 1.2 |
| 36 |
i -1.1 ^+1 1 ;Turn off 1.1 |
| 37 |
|
| 38 |
i 2 ^+1 -20 ;Turn on instr 2 |
| 39 |
i -2 ^+3 1 ;Turn off instr 2 |
| 40 |
|
| 41 |
; For information on Score processing (e.g the ^character |
| 42 |
; stand on the i character and press Shift+F1 |
| 43 |
; or stand on the i and go to Help->Show Opcode Entry |
| 44 |
e |
| 45 |
</CsScore> |
| 46 |
</CsoundSynthesizer> |
| 47 |
<MacOptions> |
| 48 |
Version: 3 |
| 49 |
Render: Real |
| 50 |
Ask: Yes |
| 51 |
Functions: ioObject |
| 52 |
Listing: Window |
| 53 |
WindowBounds: 457 242 286 426 |
| 54 |
CurrentView: io |
| 55 |
IOViewEdit: On |
| 56 |
Options: -b128 -A -s -m167 -R |
| 57 |
</MacOptions> |
| 58 |
<MacGUI> |
| 59 |
ioView background {0, 0, 0} |
| 60 |
ioButton {8, 306} {249, 66} value 1.000000 "_Play" "Play" "/" |
| 61 |
ioText {8, 12} {249, 290} label 0.000000 0.00100 "" center "DejaVu Sans" 12 {0, 65280, 0} {65280, 65280, 65280} nobackground border You can turn off an instrument with a negative number in an i statement in the score.¬To create a held use a negative number in the duration. Notice that you'll have to use abs() to get the line opcode to work.¬To an instrument, turning off a note from the score is equivalent to a noteoff event so all "r" opcodes like linenr will start the release phase when the note is turned off. |
| 62 |
</MacGUI> |
| 63 |
|
| 64 |
<EventPanel name="" tempo="60.00000000" loop="8.00000000" name="" x="0" y="0" width="596" height="322"> |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
</EventPanel> |