| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac ;;;realtime audio out |
| 5 |
;-iadc ;;;uncomment -iadc if realtime audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o loscil.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
; by Menno Knevel 20222 |
| 12 |
|
| 13 |
sr = 44100 |
| 14 |
ksmps = 32 |
| 15 |
nchnls = 2 |
| 16 |
0dbfs = 1 |
| 17 |
|
| 18 |
instr 1 ; loscil makes use of embedded loop points in wav |
| 19 |
|
| 20 |
ichnls = ftchnls(p4) |
| 21 |
prints "\nnumber of channels = %d\n\n", ichnls |
| 22 |
|
| 23 |
if (ichnls == 1) then ; sample is played 2 x faster |
| 24 |
asigL loscil .8, 1.5, p4, 1 ; sample loops between 1 and end loop point at 2 secs. in sample |
| 25 |
asigR = asigL |
| 26 |
elseif (ichnls == 2) then ; sample is played at half speed |
| 27 |
asigL, asigR loscil .8, .5, p4, 1 ; sample loops between 2 and end loop point at 3 secs. in sample |
| 28 |
else ; safety precaution if not mono or stereo |
| 29 |
asigL = 0 |
| 30 |
asigR = 0 |
| 31 |
endif |
| 32 |
outs asigL, asigR |
| 33 |
|
| 34 |
endin |
| 35 |
</CsInstruments> |
| 36 |
<CsScore> |
| 37 |
f 1 0 0 1 "drumsMlp.wav" 0 0 0 |
| 38 |
f 2 0 0 1 "drumsSlp.wav" 0 0 0 |
| 39 |
|
| 40 |
i 1 0 7 1 ;mono file |
| 41 |
i 1 7 12 2 ;stereo file |
| 42 |
e |
| 43 |
</CsScore> |
| 44 |
</CsoundSynthesizer> |