[Csnd] Popping sound in vocoder
Date | 2020-12-02 01:06 |
From | Jason Hallen |
Subject | [Csnd] Popping sound in vocoder |
Attachments | popping_test.wav |
Hi everyone,
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
I'm working on a vocoder, but it's creating a lot of popping sounds. The design is from the Csound book from Springer 2016 with some modifications (i.e. 12.2.4 Design Example 2: Channel Vocoder). I'm attaching a wav file so you can hear for yourselves, and you can see the code below. Some of the p3 values are very short, but that doesn't make any of the more traditional instruments (e.g. organ, marimba, string pluck) pop. Only this vocoder pops. Any ideas how to reduce the pops? Thanks! Jason _________________________________________ opcode VocBand,a,aakk as,an,kf,kbw xin xout(balance(butterbp(butterbp(as,kf,kbw),kf,kbw),butterbp(butterbp(an,kf,kbw),kf,kbw))) endop opcode Vocoder,a,aakkkpp as,an,kmin,kmax,kq,ibnd,icnt xin if kmax < kmin then ktemp = kmin kmin = kmax kmax = ktemp endif if kmin == 0 then kmin = 1 endif if (icnt >= ibnd) goto bank abnd Vocoder as,an,kmin,kmax,kq,ibnd,icnt+1 bank: kfreq = kmin*(kmax/kmin)^((icnt-1)/(ibnd-1)) kbw = kfreq/kq ao VocBand as,an,kfreq,kbw amix = ao + abnd xout amix endop instr 108 ; VOCODER seed 0 S1 = "test.wav" imin = 100 imax = 10000 iskip = random(0,9) kenv madsr 0.01,0.1,0.7,0.1 asig diskin2 S1,1,iskip,1 krms port rms(asig),0.01 anoi vco krms,cpspch(p5),1,0,-1 aout Vocoder anoi,asig*kenv,imin,imax,25,50 chnmix aout*p4*4, "mixl" chnmix aout*p4*4, "mixr" endin |
Date | 2020-12-02 01:26 |
From | Jason Hallen |
Subject | Re: [Csnd] Popping sound in vocoder |
The problem might be related to where I put the kenv envelope. I'm not sure where to put it so that it smooths out the popping. Adding kenv to the chnmix (i.e. chnmix aout*p4*kenv*4, "mixl") helps, but I can still hear the popping occasionally. Is this related to the use of filters and resonance peaks? I'm not very familiar with filters, and they frankly scare me because I've nearly blown my ears out experimenting with them in the past. Jason On Tue, Dec 1, 2020 at 7:06 PM Jason Hallen <hallenj@gmail.com> wrote:
|
Date | 2020-12-02 08:59 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
Check your CPU usage, maybe the pops are dropouts. Do they happen when you are rendering to disk (not realtime audio)? ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 2 Dec 2020, at 01:26, Jason Hallen |
Date | 2020-12-02 14:14 |
From | Jason Hallen |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
The pops happen when I render to DAC and to wav file. My CPU usage looks reasonable, but then again I'm not sure what to look for in my CPU usage that would indicate Csound strain. However, ksmps was set to 10. When I up it to 100 the popping goes away. That suggests the pops are dropouts, right? Since this piece only samples from a single wav file, maybe there's a more efficient opcode than diskin2? I can try loading the wav file into a table and reading it with an oscillator to see if that'll help. Thanks for the help! Jason On Wed, Dec 2, 2020 at 2:59 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: Check your CPU usage, maybe the pops are dropouts. Do they happen when you are |
Date | 2020-12-02 14:34 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
If you are rendering exclusively to file (no RT audio at all), then dropouts should not be the reason.
diskin2 is efficient OK. Try lowering ksmps until you get dropouts and find what the limit is.
Prof. Victor Lazzarini
Maynooth University
Ireland
On Dec 2, 2020, at 2:15 PM, Jason Hallen <hallenj@gmail.com> wrote:
|
Date | 2020-12-02 16:50 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
If you have the poly opcode installed, this is the adapted version of your code. Runs with no noises here. With 50 bands I get a cpu usage of less than 15% when running in realtime. It goes up to 200 bands, but at that many bands it ceases to sound like a vocoder sr = 44100 ksmps = 64 nchnls = 2 0dbfs = 1 opcode Vocoder, a, aakkki as, an, imin, imax, kq, inumbands xin ibandindexes[] genarray 0, inumbands-1, 1 ifreqs[] init inumbands ifactor = imax/imin itmp[] = ibandindexes / inumbands ifactors[] = (imax/imin) ^ (ibandindexes/inumbands) ifreqs[] = imin * ifactors kbws[] = ifreqs / kq abands_as[] poly inumbands, "butterbp", as, ifreqs, kbws abands_as poly inumbands, "butterbp", abands_as, ifreqs, kbws ; abands_as poly inumbands, "butterbp", abands_as, ifreqs, kbws abands_an[] poly inumbands, "butterbp", an, ifreqs, kbws abands_an poly inumbands, "butterbp", abands_an, ifreqs, kbws ; abands_an poly inumbands, "butterbp", abands_an, ifreqs, kbws abands[] poly inumbands, "balance", abands_as, abands_an aout sumarray abands xout aout endop instr 108 ; VOCODER seed 0 ; S1 = "/mnt/data/Lib/snd/samples/test/bourre-fragment-monofonic-16.wav" S1 = "test.wav" imin = 50 imax = 10000 iskip = 0 aenv madsr 0.01,0.1,0.7,0.1 asig, asig2 diskin2 S1, 1, iskip, 1, 0, 2 krms port rms(asig),0.01 anoi vco2 krms, 180, 0 aout Vocoder anoi,asig*aenv, imin, imax, 25, 50 outch 1, aout outch 2, aout endin schedule 108, 0, 100 On 02.12.20 15:14, Jason Hallen wrote:
|
Date | 2020-12-02 17:09 |
From | Jason Hallen |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
Hi Eduardo, Thanks very much for adapting my code for the poly opcode. I'd like to try this out, but I can't find how to install poly online. There's this thread from the listserv, but the Github links are broken. Can you point me to installation instructions? Thanks! Jason On Wed, Dec 2, 2020 at 10:50 AM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
|
Date | 2020-12-02 22:42 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
https://github.com/csound-plugins/csound-plugins/releases Download the version for your OS and place the binaries in your
plugins folder. You can also install them via risset
(https://github.com/csound-plugins/risset) On 02.12.20 18:09, Jason Hallen wrote:
|
Date | 2020-12-03 00:23 |
From | Jason Hallen |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
I'm sorry to be the clueless newbie, but where is the Csound plugins folder? I'm on Mac Catalina and installed Csound with the standard installer from the Csound website. Looking through the Csound framework and my local usr folders I don't see a plugins folder. I did a bunch of Googling to find info on the Csound plugins folder, but I couldn't find any documentation. Jason On Wed, Dec 2, 2020 at 4:42 PM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
|
Date | 2020-12-03 00:40 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
If you installed via the standard installer, your plugins should
be in /Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64 On 03.12.20 01:23, Jason Hallen wrote:
|
Date | 2020-12-03 01:02 |
From | Jason Hallen |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder |
Ah, thank you! And now I see that you gave that exact instruction in the readme.txt file from your Github. Jason On Wed, Dec 2, 2020 at 6:40 PM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
|