Amplitudes should follow the dB scale and change via the log function.
# ex1C01.py
# dB vs linear
from moduleCsound import *
tags(1)
header(ksmps=32)
add("""
instr 1 ;linear amplitude rise
kamp line 0, p3, 1 ;amp rise 0->1
asig oscils 1, 1000, 0 ;1000 Hz sine
aout = asig * kamp
outs aout, aout
endin
instr 2 ;linear rise of dB
kdb line -80, p3, 0 ;dB rise -80 -> 0
asig oscils 1, 1000, 0 ;1000 Hz sine
kamp = ampdb(kdb) ;transformation db -> amp
aout = asig * kamp
outs aout, aout
endin
""")
tags(2)
add("""
i 1 0 10
i 2 11 10
""")
tags(3)
writeRun(__file__)
No comments:
Post a Comment