Csound Csound-dev Csound-tekno Search About

[Csnd] Vocoder

Date2024-09-26 10:53
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] Vocoder
Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.

Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE

The full CSD:



-M0 -odac 



// MIDI vocoder
// instr 1 - channel dispatcher, input receiver
// instr 2 - MIDI-controlled synth source
// instr 3 - channel bands and output

massign 0, 2
instr 1 // dispatch
 cf:i = p4
 band:i = 3
 while cf < p5 do
  schedule(band, 0, -1, cf, p6)
  band, cf = band + 0.001, cf*2^(p7/12)
 od
 chnset(diskin:a("fox.wav",1,0,1), "input")
 chnclear("excite") 
endin
schedule(1, 0, -1, 80, 8000, 8, 4)

instr 2 // MIDI synth
 fo:k cpsmidib 2
 chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
        (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
endin

instr 3  // vocoder band
 out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
     rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
endin





========================
Prof. Victor Lazzarini
Maynooth University
Ireland


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

Date2024-09-26 11:31
FromTarmo Johannes
SubjectRe: [Csnd] Vocoder
Thanks also for the nice Csound7 language demo!
tarmo


Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 26. september 2024 kell 12:53:
Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.

Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE

The full CSD:

<CsoundSynthesizer>
<CsOptions>
-M0 -odac
</CsOptions>
<CsInstruments>

// MIDI vocoder
// instr 1 - channel dispatcher, input receiver
// instr 2 - MIDI-controlled synth source
// instr 3 - channel bands and output

massign 0, 2
instr 1 // dispatch
 cf:i = p4
 band:i = 3
 while cf < p5 do
  schedule(band, 0, -1, cf, p6)
  band, cf = band + 0.001, cf*2^(p7/12)
 od
 chnset(diskin:a("fox.wav",1,0,1), "input")
 chnclear("excite")
endin
schedule(1, 0, -1, 80, 8000, 8, 4)

instr 2 // MIDI synth
 fo:k cpsmidib 2
 chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
        (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
endin

instr 3  // vocoder band
 out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
     rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
endin

</CsInstruments>
</CsoundSynthesizer>


========================
Prof. Victor Lazzarini
Maynooth University
Ireland


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
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

Date2024-09-26 13:09
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] Vocoder
Lovely sounding and...

it is cool to see the functional syntax for variables  cf:i = 

Thanks!

- Dr.B


Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division



On Thu, Sep 26, 2024 at 6:32 AM Tarmo Johannes <trmjhnns@gmail.com> wrote:
Thanks also for the nice Csound7 language demo!
tarmo


Kontakt Victor Lazzarini (<000010b17ddd988e-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval N, 26. september 2024 kell 12:53:
Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.

Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE

The full CSD:

<CsoundSynthesizer>
<CsOptions>
-M0 -odac
</CsOptions>
<CsInstruments>

// MIDI vocoder
// instr 1 - channel dispatcher, input receiver
// instr 2 - MIDI-controlled synth source
// instr 3 - channel bands and output

massign 0, 2
instr 1 // dispatch
 cf:i = p4
 band:i = 3
 while cf < p5 do
  schedule(band, 0, -1, cf, p6)
  band, cf = band + 0.001, cf*2^(p7/12)
 od
 chnset(diskin:a("fox.wav",1,0,1), "input")
 chnclear("excite")
endin
schedule(1, 0, -1, 80, 8000, 8, 4)

instr 2 // MIDI synth
 fo:k cpsmidib 2
 chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
        (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
endin

instr 3  // vocoder band
 out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
     rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
endin

</CsInstruments>
</CsoundSynthesizer>


========================
Prof. Victor Lazzarini
Maynooth University
Ireland


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
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
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

Date2024-09-26 13:17
Fromjoachim heintz
SubjectRe: [Csnd] Vocoder
wow --- thanks for the great example victor!  very instructive and also 
easy to modify for live input.

this is the kind of examples i would like to see at 
https://csound.com/examples running live with WASM csound.  do you know 
whether MIDI and live input would be possible then?

On 26/09/2024 11:53, Victor Lazzarini wrote:
> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
> 
> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
> 
> The full CSD:
> 
> 
> 
> -M0 -odac
> 
> 
> 
> // MIDI vocoder
> // instr 1 - channel dispatcher, input receiver
> // instr 2 - MIDI-controlled synth source
> // instr 3 - channel bands and output
> 
> massign 0, 2
> instr 1 // dispatch
>   cf:i = p4
>   band:i = 3
>   while cf < p5 do
>    schedule(band, 0, -1, cf, p6)
>    band, cf = band + 0.001, cf*2^(p7/12)
>   od
>   chnset(diskin:a("fox.wav",1,0,1), "input")
>   chnclear("excite")
> endin
> schedule(1, 0, -1, 80, 8000, 8, 4)
> 
> instr 2 // MIDI synth
>   fo:k cpsmidib 2
>   chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>          (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
> endin
> 
> instr 3  // vocoder band
>   out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>       rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
> endin
> 
> 
> 
> 
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> 
> 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

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

Date2024-09-26 13:27
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
I have used MIDI and live input with Csound WASM without a problem.

I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a  section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Sep 2024, at 13:17, joachim heintz  wrote:
>
> *Warning*
>
> This 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.
>
> wow --- thanks for the great example victor!  very instructive and also
> easy to modify for live input.
>
> this is the kind of examples i would like to see at
> https://csound.com/examples running live with WASM csound.  do you know
> whether MIDI and live input would be possible then?
>
> On 26/09/2024 11:53, Victor Lazzarini wrote:
>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>
>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>
>> The full CSD:
>>
>> 
>> 
>> -M0 -odac
>> 
>> 
>>
>> // MIDI vocoder
>> // instr 1 - channel dispatcher, input receiver
>> // instr 2 - MIDI-controlled synth source
>> // instr 3 - channel bands and output
>>
>> massign 0, 2
>> instr 1 // dispatch
>>  cf:i = p4
>>  band:i = 3
>>  while cf < p5 do
>>   schedule(band, 0, -1, cf, p6)
>>   band, cf = band + 0.001, cf*2^(p7/12)
>>  od
>>  chnset(diskin:a("fox.wav",1,0,1), "input")
>>  chnclear("excite")
>> endin
>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>
>> instr 2 // MIDI synth
>>  fo:k cpsmidib 2
>>  chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>         (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>> endin
>>
>> instr 3  // vocoder band
>>  out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>> endin
>>
>> 
>> 
>>
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>
>> 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
>
> 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


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

Date2024-09-26 13:38
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
Works great with inch(1) too!

My students are going to love this when we get to the channel vocoder in DSP class.

THANKS!

- Dr.B


Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division



On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
I have used MIDI and live input with Csound WASM without a problem.

I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a <CsScore> section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Sep 2024, at 13:17, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:
>
> *Warning*
>
> This 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.
>
> wow --- thanks for the great example victor!  very instructive and also
> easy to modify for live input.
>
> this is the kind of examples i would like to see at
> https://csound.com/examples running live with WASM csound.  do you know
> whether MIDI and live input would be possible then?
>
> On 26/09/2024 11:53, Victor Lazzarini wrote:
>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>
>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>
>> The full CSD:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -M0 -odac
>> </CsOptions>
>> <CsInstruments>
>>
>> // MIDI vocoder
>> // instr 1 - channel dispatcher, input receiver
>> // instr 2 - MIDI-controlled synth source
>> // instr 3 - channel bands and output
>>
>> massign 0, 2
>> instr 1 // dispatch
>>  cf:i = p4
>>  band:i = 3
>>  while cf < p5 do
>>   schedule(band, 0, -1, cf, p6)
>>   band, cf = band + 0.001, cf*2^(p7/12)
>>  od
>>  chnset(diskin:a("fox.wav",1,0,1), "input")
>>  chnclear("excite")
>> endin
>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>
>> instr 2 // MIDI synth
>>  fo:k cpsmidib 2
>>  chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>         (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>> endin
>>
>> instr 3  // vocoder band
>>  out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>> endin
>>
>> </CsInstruments>
>> </CsoundSynthesizer>
>>
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>
>> 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
>
> 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


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
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

Date2024-09-26 14:11
FromRory Walsh
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
Would a recursive UDO be even more succinct? 

On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
Works great with inch(1) too!

My students are going to love this when we get to the channel vocoder in DSP class.

THANKS!

- Dr.B


Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division



On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
I have used MIDI and live input with Csound WASM without a problem.

I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a <CsScore> section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Sep 2024, at 13:17, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:
>
> *Warning*
>
> This 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.
>
> wow --- thanks for the great example victor!  very instructive and also
> easy to modify for live input.
>
> this is the kind of examples i would like to see at
> https://csound.com/examples running live with WASM csound.  do you know
> whether MIDI and live input would be possible then?
>
> On 26/09/2024 11:53, Victor Lazzarini wrote:
>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>
>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>
>> The full CSD:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -M0 -odac
>> </CsOptions>
>> <CsInstruments>
>>
>> // MIDI vocoder
>> // instr 1 - channel dispatcher, input receiver
>> // instr 2 - MIDI-controlled synth source
>> // instr 3 - channel bands and output
>>
>> massign 0, 2
>> instr 1 // dispatch
>>  cf:i = p4
>>  band:i = 3
>>  while cf < p5 do
>>   schedule(band, 0, -1, cf, p6)
>>   band, cf = band + 0.001, cf*2^(p7/12)
>>  od
>>  chnset(diskin:a("fox.wav",1,0,1), "input")
>>  chnclear("excite")
>> endin
>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>
>> instr 2 // MIDI synth
>>  fo:k cpsmidib 2
>>  chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>         (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>> endin
>>
>> instr 3  // vocoder band
>>  out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>> endin
>>
>> </CsInstruments>
>> </CsoundSynthesizer>
>>
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>
>> 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
>
> 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


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
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
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

Date2024-09-26 14:26
From"Jeanette C."
SubjectRe: [Csnd] Vocoder
Hi Victor!
Sep 26 2024, Victor Lazzarini has written:
...
> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
...
Thank you for sharing this code. It is good to read the new syntax and
the quality of that vocoder is really good and clear.

Best wishes and thanks again,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

They say, break away - I'm missing out on the fun and games <3
(Britney Spears)

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

Date2024-09-26 14:37
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
yes, we could do that, but as far as I can see, using instruments in this case is more efficient as there is less copying of
data. With pass-by-reference, a UDO would be as efficient.

Note that we can also do recursion in this code to make it slightly shorter (I quite like this kind of thing):

instr 1 // dispatch
 schedule(3, 0, -1, p4, p5, p6, p7)
 chnset(diskin:a("fox.wav",1,0,1), "input")
 chnclear("excite")
endin
schedule(1, 0, -1, 80, 8000, 8, 4)

instr 3  // recursive vocoder bands
 out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
     rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4, p4/p6)))
 nxt:i = p4*2^(p7/12)
 if nxt < p5 then
  schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
 endif
endin

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Sep 2024, at 13:17, joachim heintz  wrote:
>
> *Warning*
>
> This 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.
>
> wow --- thanks for the great example victor!  very instructive and also
> easy to modify for live input.
>
> this is the kind of examples i would like to see at
> https://csound.com/examples running live with WASM csound.  do you know
> whether MIDI and live input would be possible then?
>
> On 26/09/2024 11:53, Victor Lazzarini wrote:
>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>
>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>
>> The full CSD:
>>
>> 
>> 
>> -M0 -odac
>> 
>> 
>>
>> // MIDI vocoder
>> // instr 1 - channel dispatcher, input receiver
>> // instr 2 - MIDI-controlled synth source
>> // instr 3 - channel bands and output
>>
>> massign 0, 2
>> instr 1 // dispatch
>>  cf:i = p4
>>  band:i = 3
>>  while cf < p5 do
>>   schedule(band, 0, -1, cf, p6)
>>   band, cf = band + 0.001, cf*2^(p7/12)
>>  od
>>  chnset(diskin:a("fox.wav",1,0,1), "input")
>>  chnclear("excite")
>> endin
>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>
>> instr 2 // MIDI synth
>>  fo:k cpsmidib 2
>>  chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>         (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>> endin
>>
>> instr 3  // vocoder band
>>  out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>> endin
>>
>> 
>> 
>>
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>
>> 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
>
> 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


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

Date2024-09-26 15:06
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
yes, we could do that, but as far as I can see, using instruments in this case is more efficient as there is less copying of
data. With pass-by-reference, a UDO would be as efficient.

Note that we can also do recursion in this code to make it slightly shorter (I quite like this kind of thing):

instr 1 // dispatch
schedule(3, 0, -1, p4, p5, p6, p7)
chnset(diskin:a("fox.wav",1,0,1), "input")
chnclear("excite")
endin
schedule(1, 0, -1, 80, 8000, 8, 4)

instr 3  // recursive vocoder bands
out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
    rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4, p4/p6)))
nxt:i = p4*2^(p7/12)
if nxt < p5 then
 schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
endif
endin
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Sep 2024, at 14:11, Rory Walsh  wrote:
> 
> Would a recursive UDO be even more succinct? 
> 
> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger  wrote:
> Works great with inch(1) too!
> 
> My students are going to love this when we get to the channel vocoder in DSP class.
> 
> THANKS!
> 
> - Dr.B
> 
> Dr. Richard Boulanger
> Professor
> Electronic Production and Design
> Berklee College of Music
> Professional Writing & Technology Division
> 
> 
> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
> I have used MIDI and live input with Csound WASM without a problem.
> 
> I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a  section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.
> 
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 26 Sep 2024, at 13:17, joachim heintz  wrote:
> >
> > *Warning*
> >
> > This 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.
> >
> > wow --- thanks for the great example victor!  very instructive and also
> > easy to modify for live input.
> >
> > this is the kind of examples i would like to see at
> > https://csound.com/examples running live with WASM csound.  do you know
> > whether MIDI and live input would be possible then?
> >
> > On 26/09/2024 11:53, Victor Lazzarini wrote:
> >> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
> >>
> >> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
> >> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
> >>
> >> The full CSD:
> >>
> >> 
> >> 
> >> -M0 -odac
> >> 
> >> 
> >>
> >> // MIDI vocoder
> >> // instr 1 - channel dispatcher, input receiver
> >> // instr 2 - MIDI-controlled synth source
> >> // instr 3 - channel bands and output
> >>
> >> massign 0, 2
> >> instr 1 // dispatch
> >>  cf:i = p4
> >>  band:i = 3
> >>  while cf < p5 do
> >>   schedule(band, 0, -1, cf, p6)
> >>   band, cf = band + 0.001, cf*2^(p7/12)
> >>  od
> >>  chnset(diskin:a("fox.wav",1,0,1), "input")
> >>  chnclear("excite")
> >> endin
> >> schedule(1, 0, -1, 80, 8000, 8, 4)
> >>
> >> instr 2 // MIDI synth
> >>  fo:k cpsmidib 2
> >>  chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
> >>         (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
> >> endin
> >>
> >> instr 3  // vocoder band
> >>  out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
> >>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
> >> endin
> >>
> >> 
> >> 
> >>
> >>
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >>
> >>
> >> 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
> >
> > 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
> 
> 
> 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
> 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 
> 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



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

Date2024-10-02 04:36
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
victor, could you again look at this code?
i get a division by zero detected when i run it (and no output).
the first code ran perfectly.
thanks -
	joachim

On 26/09/2024 16:06, Victor Lazzarini wrote:
> yes, we could do that, but as far as I can see, using instruments in this case is more efficient as there is less copying of
> data. With pass-by-reference, a UDO would be as efficient.
> 
> Note that we can also do recursion in this code to make it slightly shorter (I quite like this kind of thing):
> 
> instr 1 // dispatch
> schedule(3, 0, -1, p4, p5, p6, p7)
> chnset(diskin:a("fox.wav",1,0,1), "input")
> chnclear("excite")
> endin
> schedule(1, 0, -1, 80, 8000, 8, 4)
> 
> instr 3  // recursive vocoder bands
> out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4, p4/p6)))
> nxt:i = p4*2^(p7/12)
> if nxt < p5 then
>   schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
> endif
> endin
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 26 Sep 2024, at 14:11, Rory Walsh  wrote:
>>
>> Would a recursive UDO be even more succinct?
>>
>> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger  wrote:
>> Works great with inch(1) too!
>>
>> My students are going to love this when we get to the channel vocoder in DSP class.
>>
>> THANKS!
>>
>> - Dr.B
>>
>> Dr. Richard Boulanger
>> Professor
>> Electronic Production and Design
>> Berklee College of Music
>> Professional Writing & Technology Division
>>
>>
>> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>> My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
>> I have used MIDI and live input with Csound WASM without a problem.
>>
>> I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a  section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.
>>
>> best
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>> On 26 Sep 2024, at 13:17, joachim heintz  wrote:
>>>
>>> *Warning*
>>>
>>> This 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.
>>>
>>> wow --- thanks for the great example victor!  very instructive and also
>>> easy to modify for live input.
>>>
>>> this is the kind of examples i would like to see at
>>> https://csound.com/examples running live with WASM csound.  do you know
>>> whether MIDI and live input would be possible then?
>>>
>>> On 26/09/2024 11:53, Victor Lazzarini wrote:
>>>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>>>
>>>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>>>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>>>
>>>> The full CSD:
>>>>
>>>> 
>>>> 
>>>> -M0 -odac
>>>> 
>>>> 
>>>>
>>>> // MIDI vocoder
>>>> // instr 1 - channel dispatcher, input receiver
>>>> // instr 2 - MIDI-controlled synth source
>>>> // instr 3 - channel bands and output
>>>>
>>>> massign 0, 2
>>>> instr 1 // dispatch
>>>>   cf:i = p4
>>>>   band:i = 3
>>>>   while cf < p5 do
>>>>    schedule(band, 0, -1, cf, p6)
>>>>    band, cf = band + 0.001, cf*2^(p7/12)
>>>>   od
>>>>   chnset(diskin:a("fox.wav",1,0,1), "input")
>>>>   chnclear("excite")
>>>> endin
>>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>>>
>>>> instr 2 // MIDI synth
>>>>   fo:k cpsmidib 2
>>>>   chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>>>          (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>>>> endin
>>>>
>>>> instr 3  // vocoder band
>>>>   out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>>>       rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>>>> endin
>>>>
>>>> 
>>>> 
>>>>
>>>>
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>
>>>> 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
>>>
>>> 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
>>
>>
>> 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
>> 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
>> 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
> 
> 
> 
> 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

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

Date2024-10-02 06:45
Fromvlz
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
Did you add instr 2 to this? It doesn't show it but of course it's dependent on that.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 2 Oct 2024, at 04:37, joachim heintz  wrote:
> 
> victor, could you again look at this code?
> i get a division by zero detected when i run it (and no output).
> the first code ran perfectly.
> thanks -
>    joachim
> 
>> On 26/09/2024 16:06, Victor Lazzarini wrote:
>> yes, we could do that, but as far as I can see, using instruments in this case is more efficient as there is less copying of
>> data. With pass-by-reference, a UDO would be as efficient.
>> Note that we can also do recursion in this code to make it slightly shorter (I quite like this kind of thing):
>> instr 1 // dispatch
>> schedule(3, 0, -1, p4, p5, p6, p7)
>> chnset(diskin:a("fox.wav",1,0,1), "input")
>> chnclear("excite")
>> endin
>> schedule(1, 0, -1, 80, 8000, 8, 4)
>> instr 3  // recursive vocoder bands
>> out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
>>     rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4, p4/p6)))
>> nxt:i = p4*2^(p7/12)
>> if nxt < p5 then
>>  schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
>> endif
>> endin
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>>> On 26 Sep 2024, at 14:11, Rory Walsh  wrote:
>>> 
>>> Would a recursive UDO be even more succinct?
>>> 
>>>> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger  wrote:
>>> Works great with inch(1) too!
>>> 
>>> My students are going to love this when we get to the channel vocoder in DSP class.
>>> 
>>> THANKS!
>>> 
>>> - Dr.B
>>> 
>>> Dr. Richard Boulanger
>>> Professor
>>> Electronic Production and Design
>>> Berklee College of Music
>>> Professional Writing & Technology Division
>>> 
>>> 
>>>> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>> My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
>>> I have used MIDI and live input with Csound WASM without a problem.
>>> 
>>> I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a  section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.
>>> 
>>> best
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>> 
>>>> On 26 Sep 2024, at 13:17, joachim heintz  wrote:
>>>> 
>>>> *Warning*
>>>> 
>>>> This 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.
>>>> 
>>>> wow --- thanks for the great example victor!  very instructive and also
>>>> easy to modify for live input.
>>>> 
>>>> this is the kind of examples i would like to see at
>>>> https://csound.com/examples running live with WASM csound.  do you know
>>>> whether MIDI and live input would be possible then?
>>>> 
>>>> On 26/09/2024 11:53, Victor Lazzarini wrote:
>>>>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>>>> 
>>>>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>>>>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>>>> 
>>>>> The full CSD:
>>>>> 
>>>>> 
>>>>> 
>>>>> -M0 -odac
>>>>> 
>>>>> 
>>>>> 
>>>>> // MIDI vocoder
>>>>> // instr 1 - channel dispatcher, input receiver
>>>>> // instr 2 - MIDI-controlled synth source
>>>>> // instr 3 - channel bands and output
>>>>> 
>>>>> massign 0, 2
>>>>> instr 1 // dispatch
>>>>>  cf:i = p4
>>>>>  band:i = 3
>>>>>  while cf < p5 do
>>>>>   schedule(band, 0, -1, cf, p6)
>>>>>   band, cf = band + 0.001, cf*2^(p7/12)
>>>>>  od
>>>>>  chnset(diskin:a("fox.wav",1,0,1), "input")
>>>>>  chnclear("excite")
>>>>> endin
>>>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>>>> 
>>>>> instr 2 // MIDI synth
>>>>>  fo:k cpsmidib 2
>>>>>  chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>>>>         (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>>>>> endin
>>>>> 
>>>>> instr 3  // vocoder band
>>>>>  out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>>>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>>>>> endin
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>> 
>>>>> 
>>>>> 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
>>>> 
>>>> 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
>>> 
>>> 
>>> 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
>>> 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
>>> 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
>> 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
> 
> 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

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

Date2024-10-02 08:01
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
ah ok i get it.  yes adding this instrument and also the massign does 
the trick =)
thanks -
	j

On 02/10/2024 07:45, vlz wrote:
> Did you add instr 2 to this? It doesn't show it but of course it's dependent on that.
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 2 Oct 2024, at 04:37, joachim heintz  wrote:
>>
>> victor, could you again look at this code?
>> i get a division by zero detected when i run it (and no output).
>> the first code ran perfectly.
>> thanks -
>>     joachim
>>
>>> On 26/09/2024 16:06, Victor Lazzarini wrote:
>>> yes, we could do that, but as far as I can see, using instruments in this case is more efficient as there is less copying of
>>> data. With pass-by-reference, a UDO would be as efficient.
>>> Note that we can also do recursion in this code to make it slightly shorter (I quite like this kind of thing):
>>> instr 1 // dispatch
>>> schedule(3, 0, -1, p4, p5, p6, p7)
>>> chnset(diskin:a("fox.wav",1,0,1), "input")
>>> chnclear("excite")
>>> endin
>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>> instr 3  // recursive vocoder bands
>>> out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
>>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4, p4/p6)))
>>> nxt:i = p4*2^(p7/12)
>>> if nxt < p5 then
>>>   schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
>>> endif
>>> endin
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 26 Sep 2024, at 14:11, Rory Walsh  wrote:
>>>>
>>>> Would a recursive UDO be even more succinct?
>>>>
>>>>> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger  wrote:
>>>> Works great with inch(1) too!
>>>>
>>>> My students are going to love this when we get to the channel vocoder in DSP class.
>>>>
>>>> THANKS!
>>>>
>>>> - Dr.B
>>>>
>>>> Dr. Richard Boulanger
>>>> Professor
>>>> Electronic Production and Design
>>>> Berklee College of Music
>>>> Professional Writing & Technology Division
>>>>
>>>>
>>>>> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>> My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
>>>> I have used MIDI and live input with Csound WASM without a problem.
>>>>
>>>> I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a  section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.
>>>>
>>>> best
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 26 Sep 2024, at 13:17, joachim heintz  wrote:
>>>>>
>>>>> *Warning*
>>>>>
>>>>> This 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.
>>>>>
>>>>> wow --- thanks for the great example victor!  very instructive and also
>>>>> easy to modify for live input.
>>>>>
>>>>> this is the kind of examples i would like to see at
>>>>> https://csound.com/examples running live with WASM csound.  do you know
>>>>> whether MIDI and live input would be possible then?
>>>>>
>>>>> On 26/09/2024 11:53, Victor Lazzarini wrote:
>>>>>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>>>>>
>>>>>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>>>>>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>>>>>
>>>>>> The full CSD:
>>>>>>
>>>>>> 
>>>>>> 
>>>>>> -M0 -odac
>>>>>> 
>>>>>> 
>>>>>>
>>>>>> // MIDI vocoder
>>>>>> // instr 1 - channel dispatcher, input receiver
>>>>>> // instr 2 - MIDI-controlled synth source
>>>>>> // instr 3 - channel bands and output
>>>>>>
>>>>>> massign 0, 2
>>>>>> instr 1 // dispatch
>>>>>>   cf:i = p4
>>>>>>   band:i = 3
>>>>>>   while cf < p5 do
>>>>>>    schedule(band, 0, -1, cf, p6)
>>>>>>    band, cf = band + 0.001, cf*2^(p7/12)
>>>>>>   od
>>>>>>   chnset(diskin:a("fox.wav",1,0,1), "input")
>>>>>>   chnclear("excite")
>>>>>> endin
>>>>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>>>>>
>>>>>> instr 2 // MIDI synth
>>>>>>   fo:k cpsmidib 2
>>>>>>   chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>>>>>          (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>>>>>> endin
>>>>>>
>>>>>> instr 3  // vocoder band
>>>>>>   out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>>>>>       rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>>>>>> endin
>>>>>>
>>>>>> 
>>>>>> 
>>>>>>
>>>>>>
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>
>>>>>> 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
>>>>>
>>>>> 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
>>>>
>>>>
>>>> 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
>>>> 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
>>>> 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
>>> 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
>>
>> 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
> 
> 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

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

Date2024-10-05 21:16
Froma_strappa
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
Hi to all,
Happy to write to you again after such a long time!
How could I run Victor's vocoder?
This error message appears in Csound 6.16.
(Funcional syntax error? Why?)

i>csound -odac vocoder.csd
0dBFS level = 32768.0
--Csound version 6.16 (double samples) Jul 17 2021
[commit: fb5bdb3681e15f56c216b4e4487b45848aa6b9f4]
libsndfile-1.0.31
UnifiedCSD:  vocoder.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
scoreless operation
rtaudio: PortAudio module enabled ...
using callback interface
rtmidi: PortMIDI module enabled

error: syntax error, unexpected ':'  (token ":") from file vocoder.csd (1)
line 14:
>>>cf:  <<<
Unexpected untyped word cf when expecting a variable
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra


Il 2 ott 2024 09:01, joachim heintz <jh@JOACHIMHEINTZ.DE> ha scritto:

ah ok i get it.  yes adding this instrument and also the massign does
the trick =)
thanks -
j

On 02/10/2024 07:45, vlz wrote:
> Did you add instr 2 to this? It doesn't show it but of course it's dependent on that.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 2 Oct 2024, at 04:37, joachim heintz <jh@joachimheintz.de> wrote:
>>
>> victor, could you again look at this code?
>> i get a division by zero detected when i run it (and no output).
>> the first code ran perfectly.
>> thanks -
>>     joachim
>>
>>> On 26/09/2024 16:06, Victor Lazzarini wrote:
>>> yes, we could do that, but as far as I can see, using instruments in this case is more efficient as there is less copying of
>>> data. With pass-by-reference, a UDO would be as efficient.
>>> Note that we can also do recursion in this code to make it slightly shorter (I quite like this kind of thing):
>>> instr 1 // dispatch
>>> schedule(3, 0, -1, p4, p5, p6, p7)
>>> chnset(diskin:a("fox.wav",1,0,1), "input")
>>> chnclear("excite")
>>> endin
>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>> instr 3  // recursive vocoder bands
>>> out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
>>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4, p4/p6)))
>>> nxt:i = p4*2^(p7/12)
>>> if nxt < p5 then
>>>   schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
>>> endif
>>> endin
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>>> On 26 Sep 2024, at 14:11, Rory Walsh <rorywalsh@ear.ie> wrote:
>>>>
>>>> Would a recursive UDO be even more succinct?
>>>>
>>>>> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
>>>> Works great with inch(1) too!
>>>>
>>>> My students are going to love this when we get to the channel vocoder in DSP class.
>>>>
>>>> THANKS!
>>>>
>>>> - Dr.B
>>>>
>>>> Dr. Richard Boulanger
>>>> Professor
>>>> Electronic Production and Design
>>>> Berklee College of Music
>>>> Professional Writing & Technology Division
>>>>
>>>>
>>>>> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>> My original code used “inch(1)” instead of diskin:a(), so the idea was to emulate a vocoder like the VP340 with a mic input. I did not have a mic input to do the demo, so I used fox.wav.
>>>> I have used MIDI and live input with Csound WASM without a problem.
>>>>
>>>> I remember having an issue with Csound 6 where the Web IDE did not like CSDs without a <CsScore> section for some reason, that’s the only thing I guess it needs to be checked for the code I posted.
>>>>
>>>> best
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 26 Sep 2024, at 13:17, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:
>>>>>
>>>>> *Warning*
>>>>>
>>>>> This 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.
>>>>>
>>>>> wow --- thanks for the great example victor!  very instructive and also
>>>>> easy to modify for live input.
>>>>>
>>>>> this is the kind of examples i would like to see at
>>>>> https://csound.com/examples running live with WASM csound.  do you know
>>>>> whether MIDI and live input would be possible then?
>>>>>
>>>>> On 26/09/2024 11:53, Victor Lazzarini wrote:
>>>>>> Chatting with Rory over a beer last Thursday in Vienna and he mentioned that a large Csound example for the vocoder had been shown earlier in the day as an example of how Csound was verbose.
>>>>>>
>>>>>> Well, I don’t need many lines to write a vocoder. I wrote an example on the flight back home, 20 lines of Csound code (18 if you don’t care about 80-column format).
>>>>>> Here it is in action: https://www.youtube.com/watch?v=jjFjRJmYdpE
>>>>>>
>>>>>> The full CSD:
>>>>>>
>>>>>> <CsoundSynthesizer>
>>>>>> <CsOptions>
>>>>>> -M0 -odac
>>>>>> </CsOptions>
>>>>>> <CsInstruments>
>>>>>>
>>>>>> // MIDI vocoder
>>>>>> // instr 1 - channel dispatcher, input receiver
>>>>>> // instr 2 - MIDI-controlled synth source
>>>>>> // instr 3 - channel bands and output
>>>>>>
>>>>>> massign 0, 2
>>>>>> instr 1 // dispatch
>>>>>>   cf:i = p4
>>>>>>   band:i = 3
>>>>>>   while cf < p5 do
>>>>>>    schedule(band, 0, -1, cf, p6)
>>>>>>    band, cf = band + 0.001, cf*2^(p7/12)
>>>>>>   od
>>>>>>   chnset(diskin:a("fox.wav",1,0,1), "input")
>>>>>>   chnclear("excite")
>>>>>> endin
>>>>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>>>>>>
>>>>>> instr 2 // MIDI synth
>>>>>>   fo:k cpsmidib 2
>>>>>>   chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>>>>>>          (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>>>>>> endin
>>>>>>
>>>>>> instr 3  // vocoder band
>>>>>>   out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4, p4/p5) *
>>>>>>       rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5), p4, p4/p5)))
>>>>>> endin
>>>>>>
>>>>>> </CsInstruments>
>>>>>> </CsoundSynthesizer>
>>>>>>
>>>>>>
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>
>>>>>> 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
>>>>>
>>>>> 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
>>>>
>>>>
>>>> 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
>>>> 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
>>>> 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
>>> 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
>>
>> 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
>
> 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

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


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

Date2024-10-06 00:39
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
because victor already used csound7 code.
in csound7 you can define the type of a variable (i/k/a) in the way you 
see in victor's example.  no need any more to start a variable name with 
i or k or a.

you can change the example to csound6 code like this:
rather than
	cf:i = p4
you write:
	icf = p4
and the same with k-variables:
	kfo cpsmidib 2

best -
	joachim


On 05/10/2024 22:16, a_strappa wrote:
> Hi to all,
> Happy to write to you again after such a long time!
> How could I run Victor's vocoder?
> This error message appears in Csound 6.16.
> (Funcional syntax error? Why?)
> 
> i>csound -odac vocoder.csd
> 0dBFS level = 32768.0
> --Csound version 6.16 (double samples) Jul 17 2021
> [commit: fb5bdb3681e15f56c216b4e4487b45848aa6b9f4]
> libsndfile-1.0.31
> UnifiedCSD:  vocoder.csd
> STARTING FILE
> Creating options
> Creating orchestra
> closing tag
> scoreless operation
> rtaudio: PortAudio module enabled ...
> using callback interface
> rtmidi: PortMIDI module enabled
> 
> error: syntax error, unexpected ':'  (token ":") from file vocoder.csd (1)
> line 14:
>  >>>cf:  <<<
> Unexpected untyped word cf when expecting a variable
> Parsing failed due to invalid input!
> Stopping on parser failure
> cannot compile orchestra
> 
> 
> Il 2 ott 2024 09:01, joachim heintz  ha scritto:
> 
>     ah ok i get it.  yes adding this instrument and also the massign does
>     the trick =)
>     thanks -
>     j
> 
>     On 02/10/2024 07:45, vlz wrote:
>      > Did you add instr 2 to this? It doesn't show it but of course
>     it's dependent on that.
>      >
>      > Prof. Victor Lazzarini
>      > Maynooth University
>      > Ireland
>      >
>      >> On 2 Oct 2024, at 04:37, joachim heintz 
>     wrote:
>      >>
>      >> victor, could you again look at this code?
>      >> i get a division by zero detected when i run it (and no output).
>      >> the first code ran perfectly.
>      >> thanks -
>      >>     joachim
>      >>
>      >>> On 26/09/2024 16:06, Victor Lazzarini wrote:
>      >>> yes, we could do that, but as far as I can see, using
>     instruments in this case is more efficient as there is less copying of
>      >>> data. With pass-by-reference, a UDO would be as efficient.
>      >>> Note that we can also do recursion in this code to make it
>     slightly shorter (I quite like this kind of thing):
>      >>> instr 1 // dispatch
>      >>> schedule(3, 0, -1, p4, p5, p6, p7)
>      >>> chnset(diskin:a("fox.wav",1,0,1), "input")
>      >>> chnclear("excite")
>      >>> endin
>      >>> schedule(1, 0, -1, 80, 8000, 8, 4)
>      >>> instr 3  // recursive vocoder bands
>      >>> out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
>      >>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4,
>     p4/p6)))
>      >>> nxt:i = p4*2^(p7/12)
>      >>> if nxt < p5 then
>      >>>   schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
>      >>> endif
>      >>> endin
>      >>> ========================
>      >>> Prof. Victor Lazzarini
>      >>> Maynooth University
>      >>> Ireland
>      >>>>> On 26 Sep 2024, at 14:11, Rory Walsh  wrote:
>      >>>>
>      >>>> Would a recursive UDO be even more succinct?
>      >>>>
>      >>>>> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger
>      wrote:
>      >>>> Works great with inch(1) too!
>      >>>>
>      >>>> My students are going to love this when we get to the channel
>     vocoder in DSP class.
>      >>>>
>      >>>> THANKS!
>      >>>>
>      >>>> - Dr.B
>      >>>>
>      >>>> Dr. Richard Boulanger
>      >>>> Professor
>      >>>> Electronic Production and Design
>      >>>> Berklee College of Music
>      >>>> Professional Writing & Technology Division
>      >>>>
>      >>>>
>      >>>>> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini
>     <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>      >>>> My original code used “inch(1)” instead of diskin:a(), so the
>     idea was to emulate a vocoder like the VP340 with a mic input. I did
>     not have a mic input to do the demo, so I used fox.wav.
>      >>>> I have used MIDI and live input with Csound WASM without a
>     problem.
>      >>>>
>      >>>> I remember having an issue with Csound 6 where the Web IDE did
>     not like CSDs without a  section for some reason, that’s
>     the only thing I guess it needs to be checked for the code I posted.
>      >>>>
>      >>>> best
>      >>>> ========================
>      >>>> Prof. Victor Lazzarini
>      >>>> Maynooth University
>      >>>> Ireland
>      >>>>
>      >>>>> On 26 Sep 2024, at 13:17, joachim heintz
>      wrote:
>      >>>>>
>      >>>>> *Warning*
>      >>>>>
>      >>>>> This 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.
>      >>>>>
>      >>>>> wow --- thanks for the great example victor!  very
>     instructive and also
>      >>>>> easy to modify for live input.
>      >>>>>
>      >>>>> this is the kind of examples i would like to see at
>      >>>>> https://csound.com/examples running live with WASM csound. 
>     do you know
>      >>>>> whether MIDI and live input would be possible then?
>      >>>>>
>      >>>>> On 26/09/2024 11:53, Victor Lazzarini wrote:
>      >>>>>> Chatting with Rory over a beer last Thursday in Vienna and
>     he mentioned that a large Csound example for the vocoder had been
>     shown earlier in the day as an example of how Csound was verbose.
>      >>>>>>
>      >>>>>> Well, I don’t need many lines to write a vocoder. I wrote an
>     example on the flight back home, 20 lines of Csound code (18 if you
>     don’t care about 80-column format).
>      >>>>>> Here it is in action:
>     https://www.youtube.com/watch?v=jjFjRJmYdpE
>      >>>>>>
>      >>>>>> The full CSD:
>      >>>>>>
>      >>>>>> 
>      >>>>>> 
>      >>>>>> -M0 -odac
>      >>>>>> 
>      >>>>>> 
>      >>>>>>
>      >>>>>> // MIDI vocoder
>      >>>>>> // instr 1 - channel dispatcher, input receiver
>      >>>>>> // instr 2 - MIDI-controlled synth source
>      >>>>>> // instr 3 - channel bands and output
>      >>>>>>
>      >>>>>> massign 0, 2
>      >>>>>> instr 1 // dispatch
>      >>>>>>   cf:i = p4
>      >>>>>>   band:i = 3
>      >>>>>>   while cf < p5 do
>      >>>>>>    schedule(band, 0, -1, cf, p6)
>      >>>>>>    band, cf = band + 0.001, cf*2^(p7/12)
>      >>>>>>   od
>      >>>>>>   chnset(diskin:a("fox.wav",1,0,1), "input")
>      >>>>>>   chnclear("excite")
>      >>>>>> endin
>      >>>>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>      >>>>>>
>      >>>>>> instr 2 // MIDI synth
>      >>>>>>   fo:k cpsmidib 2
>      >>>>>>   chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>      >>>>>>          (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>      >>>>>> endin
>      >>>>>>
>      >>>>>> instr 3  // vocoder band
>      >>>>>>   out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4,
>     p4/p5) *
>      >>>>>>       rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5),
>     p4, p4/p5)))
>      >>>>>> endin
>      >>>>>>
>      >>>>>> 
>      >>>>>> 
>      >>>>>>
>      >>>>>>
>      >>>>>> ========================
>      >>>>>> Prof. Victor Lazzarini
>      >>>>>> Maynooth University
>      >>>>>> Ireland
>      >>>>>>
>      >>>>>>
>      >>>>>> 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
>      >>>>>
>      >>>>> 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
>      >>>>
>      >>>>
>      >>>> 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
>      >>>> 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
>      >>>> 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
>      >>> 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
>      >>
>      >> 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
>      >
>      > 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
> 
>     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
> 
> 
> 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

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

Date2024-10-06 09:25
Froma_strappa
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
Thank you very much! Csound plays.
Nice, congratulations!

Il 6 ott 2024 01:39, joachim heintz <jh@JOACHIMHEINTZ.DE> ha scritto:

because victor already used csound7 code.
in csound7 you can define the type of a variable (i/k/a) in the way you
see in victor's example.  no need any more to start a variable name with
i or k or a.

you can change the example to csound6 code like this:
rather than
cf:i = p4
you write:
icf = p4
and the same with k-variables:
kfo cpsmidib 2

best -
joachim


On 05/10/2024 22:16, a_strappa wrote:
> Hi to all,
> Happy to write to you again after such a long time!
> How could I run Victor's vocoder?
> This error message appears in Csound 6.16.
> (Funcional syntax error? Why?)
>
> i>csound -odac vocoder.csd
> 0dBFS level = 32768.0
> --Csound version 6.16 (double samples) Jul 17 2021
> [commit: fb5bdb3681e15f56c216b4e4487b45848aa6b9f4]
> libsndfile-1.0.31
> UnifiedCSD:  vocoder.csd
> STARTING FILE
> Creating options
> Creating orchestra
> closing tag
> scoreless operation
> rtaudio: PortAudio module enabled ...
> using callback interface
> rtmidi: PortMIDI module enabled
>
> error: syntax error, unexpected ':'  (token ":") from file vocoder.csd (1)
> line 14:
>  >>>cf:  <<<
> Unexpected untyped word cf when expecting a variable
> Parsing failed due to invalid input!
> Stopping on parser failure
> cannot compile orchestra
>
>
> Il 2 ott 2024 09:01, joachim heintz <jh@JOACHIMHEINTZ.DE> ha scritto:
>
>     ah ok i get it.  yes adding this instrument and also the massign does
>     the trick =)
>     thanks -
>     j
>
>     On 02/10/2024 07:45, vlz wrote:
>      > Did you add instr 2 to this? It doesn't show it but of course
>     it's dependent on that.
>      >
>      > Prof. Victor Lazzarini
>      > Maynooth University
>      > Ireland
>      >
>      >> On 2 Oct 2024, at 04:37, joachim heintz <jh@joachimheintz.de>
>     wrote:
>      >>
>      >> victor, could you again look at this code?
>      >> i get a division by zero detected when i run it (and no output).
>      >> the first code ran perfectly.
>      >> thanks -
>      >>     joachim
>      >>
>      >>> On 26/09/2024 16:06, Victor Lazzarini wrote:
>      >>> yes, we could do that, but as far as I can see, using
>     instruments in this case is more efficient as there is less copying of
>      >>> data. With pass-by-reference, a UDO would be as efficient.
>      >>> Note that we can also do recursion in this code to make it
>     slightly shorter (I quite like this kind of thing):
>      >>> instr 1 // dispatch
>      >>> schedule(3, 0, -1, p4, p5, p6, p7)
>      >>> chnset(diskin:a("fox.wav",1,0,1), "input")
>      >>> chnclear("excite")
>      >>> endin
>      >>> schedule(1, 0, -1, 80, 8000, 8, 4)
>      >>> instr 3  // recursive vocoder bands
>      >>> out(butterbp(butterbp(chnget:a("excite"), p4, p4/p6), p4, p4/p6) *
>      >>>      rms(butterbp(butterbp(chnget:a("input"), p4, p4/p6), p4,
>     p4/p6)))
>      >>> nxt:i = p4*2^(p7/12)
>      >>> if nxt < p5 then
>      >>>   schedule(p1+0.001, 0, -1, nxt, p5, p6, p7)
>      >>> endif
>      >>> endin
>      >>> ========================
>      >>> Prof. Victor Lazzarini
>      >>> Maynooth University
>      >>> Ireland
>      >>>>> On 26 Sep 2024, at 14:11, Rory Walsh <rorywalsh@ear.ie> wrote:
>      >>>>
>      >>>> Would a recursive UDO be even more succinct?
>      >>>>
>      >>>>> On Thu, 26 Sept 2024 at 13:39, Dr. Richard Boulanger
>     <rboulanger@berklee.edu> wrote:
>      >>>> Works great with inch(1) too!
>      >>>>
>      >>>> My students are going to love this when we get to the channel
>     vocoder in DSP class.
>      >>>>
>      >>>> THANKS!
>      >>>>
>      >>>> - Dr.B
>      >>>>
>      >>>> Dr. Richard Boulanger
>      >>>> Professor
>      >>>> Electronic Production and Design
>      >>>> Berklee College of Music
>      >>>> Professional Writing & Technology Division
>      >>>>
>      >>>>
>      >>>>> On Thu, Sep 26, 2024 at 8:28 AM Victor Lazzarini
>     <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>      >>>> My original code used “inch(1)” instead of diskin:a(), so the
>     idea was to emulate a vocoder like the VP340 with a mic input. I did
>     not have a mic input to do the demo, so I used fox.wav.
>      >>>> I have used MIDI and live input with Csound WASM without a
>     problem.
>      >>>>
>      >>>> I remember having an issue with Csound 6 where the Web IDE did
>     not like CSDs without a <CsScore> section for some reason, that’s
>     the only thing I guess it needs to be checked for the code I posted.
>      >>>>
>      >>>> best
>      >>>> ========================
>      >>>> Prof. Victor Lazzarini
>      >>>> Maynooth University
>      >>>> Ireland
>      >>>>
>      >>>>> On 26 Sep 2024, at 13:17, joachim heintz
>     <jh@JOACHIMHEINTZ.DE> wrote:
>      >>>>>
>      >>>>> *Warning*
>      >>>>>
>      >>>>> This 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.
>      >>>>>
>      >>>>> wow --- thanks for the great example victor!  very
>     instructive and also
>      >>>>> easy to modify for live input.
>      >>>>>
>      >>>>> this is the kind of examples i would like to see at
>      >>>>> https://csound.com/examples running live with WASM csound.
>     do you know
>      >>>>> whether MIDI and live input would be possible then?
>      >>>>>
>      >>>>> On 26/09/2024 11:53, Victor Lazzarini wrote:
>      >>>>>> Chatting with Rory over a beer last Thursday in Vienna and
>     he mentioned that a large Csound example for the vocoder had been
>     shown earlier in the day as an example of how Csound was verbose.
>      >>>>>>
>      >>>>>> Well, I don’t need many lines to write a vocoder. I wrote an
>     example on the flight back home, 20 lines of Csound code (18 if you
>     don’t care about 80-column format).
>      >>>>>> Here it is in action:
>     https://www.youtube.com/watch?v=jjFjRJmYdpE
>      >>>>>>
>      >>>>>> The full CSD:
>      >>>>>>
>      >>>>>> <CsoundSynthesizer>
>      >>>>>> <CsOptions>
>      >>>>>> -M0 -odac
>      >>>>>> </CsOptions>
>      >>>>>> <CsInstruments>
>      >>>>>>
>      >>>>>> // MIDI vocoder
>      >>>>>> // instr 1 - channel dispatcher, input receiver
>      >>>>>> // instr 2 - MIDI-controlled synth source
>      >>>>>> // instr 3 - channel bands and output
>      >>>>>>
>      >>>>>> massign 0, 2
>      >>>>>> instr 1 // dispatch
>      >>>>>>   cf:i = p4
>      >>>>>>   band:i = 3
>      >>>>>>   while cf < p5 do
>      >>>>>>    schedule(band, 0, -1, cf, p6)
>      >>>>>>    band, cf = band + 0.001, cf*2^(p7/12)
>      >>>>>>   od
>      >>>>>>   chnset(diskin:a("fox.wav",1,0,1), "input")
>      >>>>>>   chnclear("excite")
>      >>>>>> endin
>      >>>>>> schedule(1, 0, -1, 80, 8000, 8, 4)
>      >>>>>>
>      >>>>>> instr 2 // MIDI synth
>      >>>>>>   fo:k cpsmidib 2
>      >>>>>>   chnmix(linenr:a(ampmidi(8), 0.01, 0.1, 0.01)*
>      >>>>>>          (vco2(1, fo*0.99) + vco2(1, fo*1.01)), "excite")
>      >>>>>> endin
>      >>>>>>
>      >>>>>> instr 3  // vocoder band
>      >>>>>>   out(butterbp(butterbp(chnget:a("excite"), p4, p4/p5), p4,
>     p4/p5) *
>      >>>>>>       rms(butterbp(butterbp(chnget:a("input"), p4, p4/p5),
>     p4, p4/p5)))
>      >>>>>> endin
>      >>>>>>
>      >>>>>> </CsInstruments>
>      >>>>>> </CsoundSynthesizer>
>      >>>>>>
>      >>>>>>
>      >>>>>> ========================
>      >>>>>> Prof. Victor Lazzarini
>      >>>>>> Maynooth University
>      >>>>>> Ireland
>      >>>>>>
>      >>>>>>
>      >>>>>> 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
>      >>>>>
>      >>>>> 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
>      >>>>
>      >>>>
>      >>>> 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
>      >>>> 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
>      >>>> 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
>      >>> 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
>      >>
>      >> 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
>      >
>      > 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
>
>     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
>
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie>
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs reports to
> https://github.com/csound/csound/issues
> <https://github.com/csound/csound/issues> Discussions of bugs and
> features can be posted here

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


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

Date2024-10-06 14:13
FromPhilipp von Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
BTW: when will there be the official csound 7 release?

> Am 06.10.2024 um 01:40 schrieb joachim heintz :
> 
> because victor already used csound7 code

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

Date2024-10-06 14:27
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
We don’t know yet, it’s about 80% done, but it’s only Steven and myself actively writing code now.
So it will be there when we get there.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 6 Oct 2024, at 14:13, Philipp von Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE> wrote:
>
> BTW: when will there be the official csound 7 release?
>
>> Am 06.10.2024 um 01:40 schrieb joachim heintz :
>>
>> because victor already used csound7 code
>
> 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


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

Date2024-10-06 14:42
FromPhilipp von Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Vocoder
👍 thanks a lot for your work! Looking forward to the release!


> Am 06.10.2024 um 15:27 schrieb Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie>:
> 
> We don’t know yet, it’s about 80% done, but it’s only Steven and myself actively writing code now.
> So it will be there when we get there.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 6 Oct 2024, at 14:13, Philipp von Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE> wrote:
>> 
>> BTW: when will there be the official csound 7 release?
>> 
>>>> Am 06.10.2024 um 01:40 schrieb joachim heintz :
>>> 
>>> because victor already used csound7 code
>> 
>> 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
> 
> 
> 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

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