[Csnd] Popping sound in vocoder

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] Popping sound in vocoder

Jason Hallen
Hi everyone,

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
Csound mailing list [hidden email] 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

popping_test.wav (9M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Popping sound in vocoder

Jason Hallen
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 <[hidden email]> wrote:
Hi everyone,

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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

Victor Lazzarini-2
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

Jason Hallen
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

Victor Lazzarini-2
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 <[hidden email]> wrote:


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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

moguillansky
In reply to this post by Jason Hallen
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:
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

Jason Hallen
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 <[hidden email]> wrote:
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:
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

moguillansky

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:
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 <[hidden email]> wrote:
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:
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

Jason Hallen
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 <[hidden email]> wrote:

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:
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 <[hidden email]> wrote:
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:
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

moguillansky

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:
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 <[hidden email]> wrote:

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:
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 <[hidden email]> wrote:
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:
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] [EXTERNAL] [Csnd] Popping sound in vocoder

Jason Hallen
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 <[hidden email]> wrote:

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:
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 <[hidden email]> wrote:

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:
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 <[hidden email]> wrote:
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:
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 <[hidden email]> wrote:
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 <[hidden email]> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 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 <[hidden email]> wrote:
> Hi everyone,
>
> 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
> Csound mailing list [hidden email] 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

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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
Csound mailing list [hidden email] 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