Csound Csound-dev Csound-tekno Search About

[Csnd] Rendering multiple instrument calls into one file / interative rendering

Date2023-03-05 08:11
FromPhilipp Neumann
Subject[Csnd] Rendering multiple instrument calls into one file / interative rendering
Hello Everybody!

I was wondering if there is a better solution to render audio, then muting instruments and do another run of my csound-code.

For example:
I have a csound-code, which is based on multiple calls of different instruments (100 instances of instr 20 and 20 instances of instr 30).
Now i want all calls from instr 20 in one .wav file to be rendered and all calls of instr 30 in another .wav file.
I thought about collecting the output of each instrument into a global audio variable and render them i another instrument, which only exists for rendering, via ‚fout‘. But i can’t get it working.
How i know Csound by now there must be an easy solution for this.

Also i was wondering if there is a solution for another problem.
For example i’m working with an instrument, which should create variations of one sound-event. And every variation should be rendered in a seperate .wav file.
I can call the instrument via ‚event‘ and have an ‚fout‘ opcode inside the called instrument. But i want to find a way to iterative go through numbers which makes the created .wav file unique and doesn’t get replace, like „Super-Sound-001.wav“, „Super-Sound-002.wav“ and so on.
How can i solve this?

Maybe you have some tipps für me.
All the best,
Philipp
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

Date2023-03-05 08:29
FromST Music
SubjectRe: [Csnd] Rendering multiple instrument calls into one file / interative rendering
I'm lost on the question - is it that you can't get fout to work? Why the need for a seperate recording instrument as you can use fout from inside the instrument. 

For what it's worth, it's easy to set up fout from either inside the instr or using a seperate rendering instr by passing the audio using a global audio variable, I've done both. 

If you can explain a little better that would help. 

Scott 

On Sun, Mar 5, 2023, 3:12 AM Philipp Neumann, <kontakt@philippneumann.eu> wrote:
Hello Everybody!

I was wondering if there is a better solution to render audio, then muting instruments and do another run of my csound-code.

For example:
I have a csound-code, which is based on multiple calls of different instruments (100 instances of instr 20 and 20 instances of instr 30).
Now i want all calls from instr 20 in one .wav file to be rendered and all calls of instr 30 in another .wav file.
I thought about collecting the output of each instrument into a global audio variable and render them i another instrument, which only exists for rendering, via ‚fout‘. But i can’t get it working.
How i know Csound by now there must be an easy solution for this.

Also i was wondering if there is a solution for another problem.
For example i’m working with an instrument, which should create variations of one sound-event. And every variation should be rendered in a seperate .wav file.
I can call the instrument via ‚event‘ and have an ‚fout‘ opcode inside the called instrument. But i want to find a way to iterative go through numbers which makes the created .wav file unique and doesn’t get replace, like „Super-Sound-001.wav“, „Super-Sound-002.wav“ and so on.
How can i solve this?

Maybe you have some tipps für me.
All the best,
Philipp
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

Date2023-03-05 09:13
FromST Music
SubjectRe: [Csnd] Rendering multiple instrument calls into one file / interative rendering
This is a simple example, 2 instr sent via global audio to record instruments. Uncomment fout lines and set your own variables.

<CsoundSynthesizer>
<CsOptions>
-odac
;-o/sdcard/*******.wav
</CsOptions>
;================================
<CsInstruments>

sr = 48000
ksmps = 32
nchnls = 2
0dbfs  = 1

gaAud1L init
gaAud1R init 
gaAud2L init
gaAud2R init 

    instr 1
iFreq ftgen 1, 0, 0, 2, 220, 440, 880
aSig  = oscil:a(line:k(.4,p3,0),tab:k(lfo(randomh:k(0,2.9,4),4,3),1))
;outs(aSig, aSig)
gaAud1L += aSig
gaAud1R += aSig
    endin

    instr 2
aSig  =  vco2:a(line:k(.2,p3,0),110)
;outs(aSig, aSig)
gaAud2L += aSig
gaAud2R += aSig
endin

    instr 3, Record_1
outs(gaAud1L, gaAud1R)
; 14 = wav, 16 bit (p2)
; 16 = wav, 32 bit float
;fout "/sdcard/instr1.wav", 16, gaAud1L, gaAud1R
clear gaAud1L, gaAud1R
    endin

    instr 4, Record_2
outs gaAud2L, gaAud2R
;fout "/sdcard/instr2.wav", 16, gaAud2L, gaAud2R
clear gaAud2L, gaAud2R
    endin

</CsInstruments>
;================================
<CsScore>

i1 0 4
i. + .
i. + .
i. + .

i2 0 4
i. + .
i. + .
i. + .

i3 0 16

i4 0 16

</CsScore>
</CsoundSynthesizer>

Scott

On Sun, Mar 5, 2023, 3:29 AM ST Music, <stunes6556@gmail.com> wrote:
I'm lost on the question - is it that you can't get fout to work? Why the need for a seperate recording instrument as you can use fout from inside the instrument. 

For what it's worth, it's easy to set up fout from either inside the instr or using a seperate rendering instr by passing the audio using a global audio variable, I've done both. 

If you can explain a little better that would help. 

Scott 

On Sun, Mar 5, 2023, 3:12 AM Philipp Neumann, <kontakt@philippneumann.eu> wrote:
Hello Everybody!

I was wondering if there is a better solution to render audio, then muting instruments and do another run of my csound-code.

For example:
I have a csound-code, which is based on multiple calls of different instruments (100 instances of instr 20 and 20 instances of instr 30).
Now i want all calls from instr 20 in one .wav file to be rendered and all calls of instr 30 in another .wav file.
I thought about collecting the output of each instrument into a global audio variable and render them i another instrument, which only exists for rendering, via ‚fout‘. But i can’t get it working.
How i know Csound by now there must be an easy solution for this.

Also i was wondering if there is a solution for another problem.
For example i’m working with an instrument, which should create variations of one sound-event. And every variation should be rendered in a seperate .wav file.
I can call the instrument via ‚event‘ and have an ‚fout‘ opcode inside the called instrument. But i want to find a way to iterative go through numbers which makes the created .wav file unique and doesn’t get replace, like „Super-Sound-001.wav“, „Super-Sound-002.wav“ and so on.
How can i solve this?

Maybe you have some tipps für me.
All the best,
Philipp
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

Date2023-03-05 10:52
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Rendering multiple instrument calls into one file / interative rendering
Attachmentsfavicon.ico  
The answer to your second question is to use sprintf to generate a unique name



Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Mar 2023, at 08:12, Philipp Neumann <kontakt@philippneumann.eu> 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.

Hello Everybody!

I was wondering if there is a better solution to render audio, then muting instruments and do another run of my csound-code.

For example:
I have a csound-code, which is based on multiple calls of different instruments (100 instances of instr 20 and 20 instances of instr 30).
Now i want all calls from instr 20 in one .wav file to be rendered and all calls of instr 30 in another .wav file.
I thought about collecting the output of each instrument into a global audio variable and render them i another instrument, which only exists for rendering, via ‚fout‘. But i can’t get it working.
How i know Csound by now there must be an easy solution for this.

Also i was wondering if there is a solution for another problem.
For example i’m working with an instrument, which should create variations of one sound-event. And every variation should be rendered in a seperate .wav file.
I can call the instrument via ‚event‘ and have an ‚fout‘ opcode inside the called instrument. But i want to find a way to iterative go through numbers which makes the created .wav file unique and doesn’t get replace, like „Super-Sound-001.wav“, „Super-Sound-002.wav“ and so on.
How can i solve this?

Maybe you have some tipps für me.
All the best,
Philipp
Csound mailing list
Csound@listserv.heanet.ie
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C9e7617609f214189eab908db1d515a1b%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638136007486407158%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Hkl47TubgZqKrIDhkd9yeFixsgLP28sTWfdec2MbgDI%3D&reserved=0
Send bugs reports to
       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C9e7617609f214189eab908db1d515a1b%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638136007486407158%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=b%2Fz%2BKSrKzjb3BNxRH5mtzZjqnELAaOnMZUe7P3wC0Qw%3D&reserved=0
Discussions of bugs and features can be posted here

Date2023-03-05 11:18
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Rendering multiple instrument calls into one file / interative rendering
Attachmentsfavicon.ico  
this is the correct link to the latest released manual btw



Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Mar 2023, at 10:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

 The answer to your second question is to use sprintf to generate a unique name



Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Mar 2023, at 08:12, Philipp Neumann <kontakt@philippneumann.eu> 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.

Hello Everybody!

I was wondering if there is a better solution to render audio, then muting instruments and do another run of my csound-code.

For example:
I have a csound-code, which is based on multiple calls of different instruments (100 instances of instr 20 and 20 instances of instr 30).
Now i want all calls from instr 20 in one .wav file to be rendered and all calls of instr 30 in another .wav file.
I thought about collecting the output of each instrument into a global audio variable and render them i another instrument, which only exists for rendering, via ‚fout‘. But i can’t get it working.
How i know Csound by now there must be an easy solution for this.

Also i was wondering if there is a solution for another problem.
For example i’m working with an instrument, which should create variations of one sound-event. And every variation should be rendered in a seperate .wav file.
I can call the instrument via ‚event‘ and have an ‚fout‘ opcode inside the called instrument. But i want to find a way to iterative go through numbers which makes the created .wav file unique and doesn’t get replace, like „Super-Sound-001.wav“, „Super-Sound-002.wav“ and so on.
How can i solve this?

Maybe you have some tipps für me.
All the best,
Philipp
Csound mailing list
Csound@listserv.heanet.ie
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C9e7617609f214189eab908db1d515a1b%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638136007486407158%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Hkl47TubgZqKrIDhkd9yeFixsgLP28sTWfdec2MbgDI%3D&reserved=0
Send bugs reports to
       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C9e7617609f214189eab908db1d515a1b%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638136007486407158%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=b%2Fz%2BKSrKzjb3BNxRH5mtzZjqnELAaOnMZUe7P3wC0Qw%3D&reserved=0
Discussions of bugs and features can be posted here
<favicon.ico>

Date2023-03-06 14:59
FromPhilipp Neumann
SubjectRe: [Csnd] Rendering multiple instrument calls into one file / interative rendering
Thanks, Scott! This works perfectly fine. I don’t know what i did wrong in my tests.

> Am 05.03.2023 um 10:13 schrieb ST Music :
> 
> This is a simple example, 2 instr sent via global audio to record instruments. Uncomment fout lines and set your own variables.
> 
> 
> 
> -odac
> ;-o/sdcard/*******.wav
> 
> ;================================
> 
> 
> sr = 48000
> ksmps = 32
> nchnls = 2
> 0dbfs  = 1
> 
> gaAud1L init
> gaAud1R init 
> gaAud2L init
> gaAud2R init 
> 
>     instr 1
> iFreq ftgen 1, 0, 0, 2, 220, 440, 880
> aSig  = oscil:a(line:k(.4,p3,0),tab:k(lfo(randomh:k(0,2.9,4),4,3),1))
> ;outs(aSig, aSig)
> gaAud1L += aSig
> gaAud1R += aSig
>     endin
> 
>     instr 2
> aSig  =  vco2:a(line:k(.2,p3,0),110)
> ;outs(aSig, aSig)
> gaAud2L += aSig
> gaAud2R += aSig
> endin
> 
>     instr 3, Record_1
> outs(gaAud1L, gaAud1R)
> ; 14 = wav, 16 bit (p2)
> ; 16 = wav, 32 bit float
> ;fout "/sdcard/instr1.wav", 16, gaAud1L, gaAud1R
> clear gaAud1L, gaAud1R
>     endin
> 
>     instr 4, Record_2
> outs gaAud2L, gaAud2R
> ;fout "/sdcard/instr2.wav", 16, gaAud2L, gaAud2R
> clear gaAud2L, gaAud2R
>     endin
> 
> 
> ;================================
> 
> 
> i1 0 4
> i. + .
> i. + .
> i. + .
> 
> i2 0 4
> i. + .
> i. + .
> i. + .
> 
> i3 0 16
> 
> i4 0 16
> 
> 
> 
> 
> Scott
> 
> On Sun, Mar 5, 2023, 3:29 AM ST Music,  wrote:
> I'm lost on the question - is it that you can't get fout to work? Why the need for a seperate recording instrument as you can use fout from inside the instrument. 
> 
> For what it's worth, it's easy to set up fout from either inside the instr or using a seperate rendering instr by passing the audio using a global audio variable, I've done both. 
> 
> If you can explain a little better that would help. 
> 
> Scott 
> 
> On Sun, Mar 5, 2023, 3:12 AM Philipp Neumann,  wrote:
> Hello Everybody!
> 
> I was wondering if there is a better solution to render audio, then muting instruments and do another run of my csound-code.
> 
> For example:
> I have a csound-code, which is based on multiple calls of different instruments (100 instances of instr 20 and 20 instances of instr 30).
> Now i want all calls from instr 20 in one .wav file to be rendered and all calls of instr 30 in another .wav file.
> I thought about collecting the output of each instrument into a global audio variable and render them i another instrument, which only exists for rendering, via ‚fout‘. But i can’t get it working.
> How i know Csound by now there must be an easy solution for this.
> 
> Also i was wondering if there is a solution for another problem.
> For example i’m working with an instrument, which should create variations of one sound-event. And every variation should be rendered in a seperate .wav file.
> I can call the instrument via ‚event‘ and have an ‚fout‘ opcode inside the called instrument. But i want to find a way to iterative go through numbers which makes the created .wav file unique and doesn’t get replace, like „Super-Sound-001.wav“, „Super-Sound-002.wav“ and so on.
> How can i solve this?
> 
> Maybe you have some tipps für me.
> All the best,
> Philipp
> 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