Debian Codegraph @

src/Examples/FLOSS Manual Examples/04 Sound Synthesis/04D01_Frequency_modulation.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -o dac
4 </CsOptions>
5 <CsInstruments>
6
7 sr = 44100
8 ksmps = 32
9 nchnls = 2
10 0dbfs = 1
11
12 instr FM_vibr ;vibrato as the modulator is in the sub-audio range
13 kModFreq randomi 5, 10, 1
14 kCarAmp linen 0.5, 0.1, p3, 0.5
15 aModulator poscil 20, kModFreq
16 aCarrier poscil kCarAmp, 400 + aModulator
17 out aCarrier, aCarrier
18 endin
19
20 instr FM_timbr ;timbre change as the modulator is in the audio range
21 kModAmp linseg 0, p3/2, 212, p3/2, 50
22 kModFreq line 25, p3, 300
23 kCarAmp linen 0.5, 0.1, p3, 0.5
24 aModulator poscil kModAmp, kModFreq
25 aCarrier poscil kCarAmp, 400 + aModulator
26 out aCarrier, aCarrier
27 endin
28
29 </CsInstruments>
30 <CsScore>
31 i "FM_vibr" 0 10
32 i "FM_timbr" 10 10
33 </CsScore>
34 </CsoundSynthesizer>
35 ;example by marijana janevska