| Hello all,
i was testing filescal. The realtime output is ok but
the audio file created by fout has a distorted and pitch shifted
second note (a low frequency note).
What i'm doing wrong?
i try to attach a mp3 file with original sample, recorded samples,
rtout from filescal and fout output. Near 1.10 you will hear the
distorted note.
for testing you will need a sample. sorry.
(ubuntu 16.04, csound builded today)
Thanks,
ciao,
francesco
-odac -+rtaudio=jack -m0 -d
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1
gaudio init 0
giNoteDur init 2.972
giTableLen init 131072
gkNoteNumber init 0
opcode Trigger, kk, a
ainput xin
iThresh = 0.1
iWait = kr*giNoteDur
kTimer init (kr*giNoteDur) + 1
kRms rms ainput, 20
iSampTim = 0.01
kRmsPrev delayk kRms, iSampTim
kChange = kRms - kRmsPrev
if(kTimer>iWait) then
if kChange > iThresh then
kTrig = 1
gkNoteNumber += 1
else
kTrig = 0
endif
kTimer = kTrig == 1 ? 0 : kTimer
else
kTimer += 1
kTrig = 0
endif
xout kTrig, gkNoteNumber
endop
instr 1
gaudio diskin2 "guitar_C.wav", p4
endin
schedule(1, 0, 5, 1)
schedule(1, 14, 5, 0.5)
instr 11
ktrig, knote Trigger gaudio
schedkwhen ktrig, 0, 0, 12, 0, giNoteDur, knote
endin
instr 12
iTableNum = p4
Sfile sprintf "sample%03d.wav", iTableNum
fout Sfile, 6, gaudio
event_i "i", 200, giNoteDur, 60, iTableNum
endin
instr 200
itable = p4
iamp = 1
ipitch = 1
itimescal = giNoteDur/p3
ilock = 0
ifftsize = 2048
idecim = 4 ; default
Sfile sprintf "sample%03d.wav", itable
aout filescal itimescal, iamp, ipitch, Sfile, ilock, ifftsize, idecim
outs aout, aout
fout "filescalTest.wav", 6, aout, aout
endin
i 11 0 90
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|