Thursday, July 13, 2017

ex2D02. Live Input

# ex2D02.py
# Live Input

from moduleCsound import *

add(startSyn)

add(startOpt)
add("-iadc -odac -B512 -b128")
add(stopOpt)

add(startIns)

header(ksmps=32)

add("""
instr 1
aIn       inch      1   ;take input from channel 1
kInLev    downsamp  aIn ;convert audio input to control signal
          printk    .2, abs(kInLev)
;make modulator frequency oscillate 200 to 1000 Hz
kModFreq  poscil    400, 1/2
kModFreq  =         kModFreq+600
aMod      poscil    1, kModFreq ;modulator signal
aRM       =         aIn * aMod ;ring modulation
          outch     1, aRM, 2, aRM ;output to channel 1 and 2
endin
""")

tags(2)

add("i 1 0 3600")
tags(3)

writeRun(__file__, False)

No comments:

Post a Comment

ex3A05. Audio Vector