Debian Codegraph @

src/Examples/FLOSS Manual Examples/02 Quick Start/02D02_LiveInput.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ;CHANGE YOUR INPUT AND OUTPUT DEVICE NUMBER HERE IF NECESSARY!
4 -iadc -odac -B512 -b128
5 </CsOptions>
6 <CsInstruments>
7 sr = 44100 ;set sample rate to 44100 Hz
8 ksmps = 32 ;number of samples per control cycle
9 nchnls = 2 ;use two audio channels
10 0dbfs = 1 ;set maximum level as 1
11
12 instr 1
13 aIn inch 1 ;take input from channel 1
14 kInLev downsamp aIn ;convert audio input to control signal
15 printk .2, abs(kInLev)
16 ;make modulator frequency oscillate 200 to 1000 Hz
17 kModFreq poscil 400, 1/2
18 kModFreq = kModFreq+600
19 aMod poscil 1, kModFreq ;modulator signal
20 aRM = aIn * aMod ;ring modulation
21 outch 1, aRM, 2, aRM ;output to channel 1 and 2
22 endin
23 </CsInstruments>
24 <CsScore>
25 i 1 0 3600
26 </CsScore>
27 </CsoundSynthesizer>
28 ;example by joachim heintz