| 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 gen17.wav -W ;;; for file output any platform |
| 8 |
; By Stefano Cucchi & Menno Knevel - 2021 |
| 9 |
</CsOptions> |
| 10 |
<CsInstruments> |
| 11 |
|
| 12 |
sr = 44100 |
| 13 |
ksmps = 32 |
| 14 |
nchnls = 2 |
| 15 |
0dbfs = 1 |
| 16 |
|
| 17 |
instr 1 |
| 18 |
gisqre ftgen 2, 0, 16384, 10, 1, 0 , .33, 0, .2 , 0, .14, 0 , .11, 0, .09 ;odd harmonics |
| 19 |
|
| 20 |
knoteleft oscil 1, 0.5, 10 ; index to table 10 - gen 17 - every 2 seconds reads all the values in the table n. 10 |
| 21 |
printks2 "note left = %d\n", knoteleft |
| 22 |
knoteright oscil 1, 1, 10 ; index to table 10 - gen 17 - every second reads all the values in the table n. 10 |
| 23 |
printks2 "note right = %d\n", knoteright |
| 24 |
|
| 25 |
ixmode = 1 |
| 26 |
ixoff = 0 |
| 27 |
iwrap = 1 |
| 28 |
aphasor1 phasor knoteleft ; the values in table 10 become the frequency of the oscillator |
| 29 |
asig1 tablei aphasor1, gisqre, ixmode, ixoff, iwrap ; oscillator generating sound in the left channel (table 10 every 2 seconds) |
| 30 |
aphasor2 phasor knoteright ; the values in table 10 become the frequency of the oscillator |
| 31 |
asig2 tablei aphasor2, gisqre, ixmode, ixoff, iwrap ; oscillator generating sound in the right channel (table 10 every second) |
| 32 |
kgenenv linseg 0, 0.3, 0.4, p3-0.6, 0.4, 0.3, 0 ; envelope |
| 33 |
outs asig1 * kgenenv, asig2 * kgenenv |
| 34 |
endin |
| 35 |
|
| 36 |
</CsInstruments> |
| 37 |
<CsScore> |
| 38 |
; table with gen17 - At point 0 pitch 300 Hz, at point 12 pitch 350 Hz, etc... |
| 39 |
f 10 0 128 -17 0 300 12 350 20 400 41 434 48 563 67 589 72 632 79 678 100 712 120 789 |
| 40 |
|
| 41 |
i1 0 10 |
| 42 |
e |
| 43 |
</CsScore> |
| 44 |
</CsoundSynthesizer> |