Csound Csound-dev Csound-tekno Search About

[Csnd] Csound WASM: web worker rendering

Date2022-11-18 08:52
FromVictor Lazzarini
Subject[Csnd] Csound WASM: web worker rendering
I was trying the Web Worker thread to render a CSD,

csound = await Csound({useWorker: true} );

but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
is there anything I need to do for that?

All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
expect.

How is this supposed to be done?
========================
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

Date2022-11-18 14:03
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Csound WASM: web worker rendering
I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,

it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

it will work if window.crossOriginIsolated is set to true.

If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
(especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).

This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!

On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I was trying the Web Worker thread to render a CSD,

csound = await Csound({useWorker: true} );

but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
is there anything I need to do for that?

All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
expect.

How is this supposed to be done?
========================
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

Date2022-11-18 14:28
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.

I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
which I don’t need or want.

Could you outline how I would go about rendering faster than realtime?

The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.

How is this done?
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> 
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> 
> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> 
> Cross-Origin-Opener-Policy: same-origin
> Cross-Origin-Embedder-Policy: require-corp
> 
> it will work if window.crossOriginIsolated is set to true.
> 
> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> 
> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> 
> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> I was trying the Web Worker thread to render a CSD,
> 
> csound = await Csound({useWorker: true} );
> 
> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> is there anything I need to do for that?
> 
> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> expect.
> 
> How is this supposed to be done?
> ========================
> 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

Date2022-11-18 14:36
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
yeh the rendering is all automated, calling perform is done in the library.

I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.

The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
It sounds like you're doing things correctly and the issue is on the js library side.

On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.

I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
which I don’t need or want.

Could you outline how I would go about rendering faster than realtime?

The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.

How is this done?
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>
> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>
> Cross-Origin-Opener-Policy: same-origin
> Cross-Origin-Embedder-Policy: require-corp
>
> it will work if window.crossOriginIsolated is set to true.
>
> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>
> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>
> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> I was trying the Web Worker thread to render a CSD,
>
> csound = await Csound({useWorker: true} );
>
> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> is there anything I need to do for that?
>
> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> expect.
>
> How is this supposed to be done?
> ========================
> 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

Date2022-11-18 14:41
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
So do I need to disable useSAB?
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
> 
> yeh the rendering is all automated, calling perform is done in the library.
> 
> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> 
> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> It sounds like you're doing things correctly and the issue is on the js library side.
> 
> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> 
> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> which I don’t need or want.
> 
> Could you outline how I would go about rendering faster than realtime?
> 
> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> 
> How is this done?
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> > 
> > WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > 
> > it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > 
> > Cross-Origin-Opener-Policy: same-origin
> > Cross-Origin-Embedder-Policy: require-corp
> > 
> > it will work if window.crossOriginIsolated is set to true.
> > 
> > If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > 
> > This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > 
> > On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> > I was trying the Web Worker thread to render a CSD,
> > 
> > csound = await Csound({useWorker: true} );
> > 
> > but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > is there anything I need to do for that?
> > 
> > All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > expect.
> > 
> > How is this supposed to be done?
> > ========================
> > 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

Date2022-11-18 15:04
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
That doesn’t work anyway.

So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
that I need to put on the page?

See the example at

https://vlazzarini.github.io/vanilla/7.Beep/

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

> On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
> 
> So do I need to disable useSAB?
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
>> 
>> yeh the rendering is all automated, calling perform is done in the library.
>> 
>> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>> 
>> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>> It sounds like you're doing things correctly and the issue is on the js library side.
>> 
>> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
>> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>> 
>> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>> which I don’t need or want.
>> 
>> Could you outline how I would go about rendering faster than realtime?
>> 
>> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>> 
>> How is this done?
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
>>> 
>>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>>> 
>>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>>> 
>>> Cross-Origin-Opener-Policy: same-origin
>>> Cross-Origin-Embedder-Policy: require-corp
>>> 
>>> it will work if window.crossOriginIsolated is set to true.
>>> 
>>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>>> 
>>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>>> 
>>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
>>> I was trying the Web Worker thread to render a CSD,
>>> 
>>> csound = await Csound({useWorker: true} );
>>> 
>>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>>> is there anything I need to do for that?
>>> 
>>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>>> expect.
>>> 
>>> How is this supposed to be done?
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>> 
>>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
>>> Discussions of bugs and features can be posted here
>>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
>> 
>> 
>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
>> Discussions of bugs and features can be posted here
>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> 
> 
> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> 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

Date2022-11-22 18:29
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.

On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
That doesn’t work anyway.

So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
that I need to put on the page?

See the example at

https://vlazzarini.github.io/vanilla/7.Beep/

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

> On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>
> So do I need to disable useSAB?
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>
>> yeh the rendering is all automated, calling perform is done in the library.
>>
>> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>>
>> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>> It sounds like you're doing things correctly and the issue is on the js library side.
>>
>> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>>
>> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>> which I don’t need or want.
>>
>> Could you outline how I would go about rendering faster than realtime?
>>
>> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>>
>> How is this done?
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>
>>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>>>
>>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>>>
>>> Cross-Origin-Opener-Policy: same-origin
>>> Cross-Origin-Embedder-Policy: require-corp
>>>
>>> it will work if window.crossOriginIsolated is set to true.
>>>
>>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>>>
>>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>>>
>>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>> I was trying the Web Worker thread to render a CSD,
>>>
>>> csound = await Csound({useWorker: true} );
>>>
>>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>>> is there anything I need to do for that?
>>>
>>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>>> expect.
>>>
>>> How is this supposed to be done?
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>
>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
>>> Send bugs reports to
>>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
>>> Discussions of bugs and features can be posted here
>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>
>>
>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
>> Send bugs reports to
>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>
>
> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> 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

Date2022-11-23 08:15
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
This is with useWorker:true
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
> 
> I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> 
> On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
> That doesn’t work anyway.
> 
> So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> that I need to put on the page?
> 
> See the example at
> 
> https://vlazzarini.github.io/vanilla/7.Beep/
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
> > 
> > So do I need to disable useSAB?
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
> >> 
> >> yeh the rendering is all automated, calling perform is done in the library.
> >> 
> >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> >> 
> >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> >> It sounds like you're doing things correctly and the issue is on the js library side.
> >> 
> >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
> >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> >> 
> >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> >> which I don’t need or want.
> >> 
> >> Could you outline how I would go about rendering faster than realtime?
> >> 
> >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> >> 
> >> How is this done?
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >> 
> >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> >>> 
> >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> >>> 
> >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> >>> 
> >>> Cross-Origin-Opener-Policy: same-origin
> >>> Cross-Origin-Embedder-Policy: require-corp
> >>> 
> >>> it will work if window.crossOriginIsolated is set to true.
> >>> 
> >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> >>> 
> >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> >>> 
> >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> >>> I was trying the Web Worker thread to render a CSD,
> >>> 
> >>> csound = await Csound({useWorker: true} );
> >>> 
> >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> >>> is there anything I need to do for that?
> >>> 
> >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> >>> expect.
> >>> 
> >>> How is this supposed to be done?
> >>> ========================
> >>> Prof. Victor Lazzarini
> >>> Maynooth University
> >>> Ireland
> >>> 
> >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
> >>> Discussions of bugs and features can be posted here
> >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> >> 
> >> 
> >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> >> Discussions of bugs and features can be posted here
> >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > 
> > 
> > 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > 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

Date2022-11-23 10:30
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...

On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
This is with useWorker:true
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>
> On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> That doesn’t work anyway.
>
> So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> that I need to put on the page?
>
> See the example at
>
> https://vlazzarini.github.io/vanilla/7.Beep/
>
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> >
> > So do I need to disable useSAB?
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> >
> >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >>
> >> yeh the rendering is all automated, calling perform is done in the library.
> >>
> >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> >>
> >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> >> It sounds like you're doing things correctly and the issue is on the js library side.
> >>
> >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> >>
> >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> >> which I don’t need or want.
> >>
> >> Could you outline how I would go about rendering faster than realtime?
> >>
> >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> >>
> >> How is this done?
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >>
> >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >>>
> >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> >>>
> >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> >>>
> >>> Cross-Origin-Opener-Policy: same-origin
> >>> Cross-Origin-Embedder-Policy: require-corp
> >>>
> >>> it will work if window.crossOriginIsolated is set to true.
> >>>
> >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> >>>
> >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> >>>
> >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> >>> I was trying the Web Worker thread to render a CSD,
> >>>
> >>> csound = await Csound({useWorker: true} );
> >>>
> >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> >>> is there anything I need to do for that?
> >>>
> >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> >>> expect.
> >>>
> >>> How is this supposed to be done?
> >>> ========================
> >>> Prof. Victor Lazzarini
> >>> Maynooth University
> >>> Ireland
> >>>
> >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
> >>> Send bugs reports to
> >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
> >>> Discussions of bugs and features can be posted here
> >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> >>
> >>
> >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> >> Send bugs reports to
> >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> >> Discussions of bugs and features can be posted here
> >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> >
> >
> > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > Send bugs reports to
> >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > 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

Date2022-11-23 11:38
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
can you try again with 6.18.2?

On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...

On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
This is with useWorker:true
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>
> On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> That doesn’t work anyway.
>
> So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> that I need to put on the page?
>
> See the example at
>
> https://vlazzarini.github.io/vanilla/7.Beep/
>
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> >
> > So do I need to disable useSAB?
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> >
> >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >>
> >> yeh the rendering is all automated, calling perform is done in the library.
> >>
> >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> >>
> >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> >> It sounds like you're doing things correctly and the issue is on the js library side.
> >>
> >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> >>
> >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> >> which I don’t need or want.
> >>
> >> Could you outline how I would go about rendering faster than realtime?
> >>
> >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> >>
> >> How is this done?
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >>
> >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >>>
> >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> >>>
> >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> >>>
> >>> Cross-Origin-Opener-Policy: same-origin
> >>> Cross-Origin-Embedder-Policy: require-corp
> >>>
> >>> it will work if window.crossOriginIsolated is set to true.
> >>>
> >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> >>>
> >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> >>>
> >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> >>> I was trying the Web Worker thread to render a CSD,
> >>>
> >>> csound = await Csound({useWorker: true} );
> >>>
> >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> >>> is there anything I need to do for that?
> >>>
> >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> >>> expect.
> >>>
> >>> How is this supposed to be done?
> >>> ========================
> >>> Prof. Victor Lazzarini
> >>> Maynooth University
> >>> Ireland
> >>>
> >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
> >>> Send bugs reports to
> >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
> >>> Discussions of bugs and features can be posted here
> >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> >>
> >>
> >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> >> Send bugs reports to
> >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> >> Discussions of bugs and features can be posted here
> >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> >
> >
> > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > Send bugs reports to
> >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > 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

Date2022-11-23 11:52
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
yes, it’s much faster with useWorker:false, however the callback set by

await csound.on("renderEnded", finish);

does not get called and I am hanging on ‘Score finished in csoundPerformKsmps() with 2.’
Can you check that?
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Nov 2022, at 10:30, Hlöðver Sigurðsson  wrote:
> 
> Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> 
> On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini  wrote:
> Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> This is with useWorker:true
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
> > 
> > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> > 
> > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
> > That doesn’t work anyway.
> > 
> > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > that I need to put on the page?
> > 
> > See the example at
> > 
> > https://vlazzarini.github.io/vanilla/7.Beep/
> > 
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> > > On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
> > > 
> > > So do I need to disable useSAB?
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > > 
> > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
> > >> 
> > >> yeh the rendering is all automated, calling perform is done in the library.
> > >> 
> > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > >> 
> > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > >> 
> > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
> > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > >> 
> > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > >> which I don’t need or want.
> > >> 
> > >> Could you outline how I would go about rendering faster than realtime?
> > >> 
> > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > >> 
> > >> How is this done?
> > >> ========================
> > >> Prof. Victor Lazzarini
> > >> Maynooth University
> > >> Ireland
> > >> 
> > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> > >>> 
> > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > >>> 
> > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > >>> 
> > >>> Cross-Origin-Opener-Policy: same-origin
> > >>> Cross-Origin-Embedder-Policy: require-corp
> > >>> 
> > >>> it will work if window.crossOriginIsolated is set to true.
> > >>> 
> > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > >>> 
> > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > >>> 
> > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> > >>> I was trying the Web Worker thread to render a CSD,
> > >>> 
> > >>> csound = await Csound({useWorker: true} );
> > >>> 
> > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > >>> is there anything I need to do for that?
> > >>> 
> > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > >>> expect.
> > >>> 
> > >>> How is this supposed to be done?
> > >>> ========================
> > >>> Prof. Victor Lazzarini
> > >>> Maynooth University
> > >>> Ireland
> > >>> 
> > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
> > >>> Discussions of bugs and features can be posted here
> > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > >> 
> > >> 
> > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > >> Discussions of bugs and features can be posted here
> > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > > 
> > > 
> > > 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > > 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

Date2022-11-23 11:55
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson  wrote:
> 
> can you try again with 6.18.2?
> 
> On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson  wrote:
> Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> 
> On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini  wrote:
> Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> This is with useWorker:true
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
> > 
> > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> > 
> > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
> > That doesn’t work anyway.
> > 
> > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > that I need to put on the page?
> > 
> > See the example at
> > 
> > https://vlazzarini.github.io/vanilla/7.Beep/
> > 
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> > > On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
> > > 
> > > So do I need to disable useSAB?
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > > 
> > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
> > >> 
> > >> yeh the rendering is all automated, calling perform is done in the library.
> > >> 
> > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > >> 
> > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > >> 
> > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
> > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > >> 
> > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > >> which I don’t need or want.
> > >> 
> > >> Could you outline how I would go about rendering faster than realtime?
> > >> 
> > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > >> 
> > >> How is this done?
> > >> ========================
> > >> Prof. Victor Lazzarini
> > >> Maynooth University
> > >> Ireland
> > >> 
> > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> > >>> 
> > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > >>> 
> > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > >>> 
> > >>> Cross-Origin-Opener-Policy: same-origin
> > >>> Cross-Origin-Embedder-Policy: require-corp
> > >>> 
> > >>> it will work if window.crossOriginIsolated is set to true.
> > >>> 
> > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > >>> 
> > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > >>> 
> > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> > >>> I was trying the Web Worker thread to render a CSD,
> > >>> 
> > >>> csound = await Csound({useWorker: true} );
> > >>> 
> > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > >>> is there anything I need to do for that?
> > >>> 
> > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > >>> expect.
> > >>> 
> > >>> How is this supposed to be done?
> > >>> ========================
> > >>> Prof. Victor Lazzarini
> > >>> Maynooth University
> > >>> Ireland
> > >>> 
> > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
> > >>> Discussions of bugs and features can be posted here
> > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > >> 
> > >> 
> > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > >> Discussions of bugs and features can be posted here
> > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > > 
> > > 
> > > 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > > 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

Date2022-11-23 13:42
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
renderEnded not called sounds like a real bug, I'll look into it

how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?

On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> can you try again with 6.18.2?
>
> On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
>
> On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> This is with useWorker:true
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >
> > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> >
> > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > That doesn’t work anyway.
> >
> > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > that I need to put on the page?
> >
> > See the example at
> >
> > https://vlazzarini.github.io/vanilla/7.Beep/
> >
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> >
> > > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > >
> > > So do I need to disable useSAB?
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > >
> > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > >>
> > >> yeh the rendering is all automated, calling perform is done in the library.
> > >>
> > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > >>
> > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > >>
> > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > >>
> > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > >> which I don’t need or want.
> > >>
> > >> Could you outline how I would go about rendering faster than realtime?
> > >>
> > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > >>
> > >> How is this done?
> > >> ========================
> > >> Prof. Victor Lazzarini
> > >> Maynooth University
> > >> Ireland
> > >>
> > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > >>>
> > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > >>>
> > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > >>>
> > >>> Cross-Origin-Opener-Policy: same-origin
> > >>> Cross-Origin-Embedder-Policy: require-corp
> > >>>
> > >>> it will work if window.crossOriginIsolated is set to true.
> > >>>
> > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > >>>
> > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > >>>
> > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > >>> I was trying the Web Worker thread to render a CSD,
> > >>>
> > >>> csound = await Csound({useWorker: true} );
> > >>>
> > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > >>> is there anything I need to do for that?
> > >>>
> > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > >>> expect.
> > >>>
> > >>> How is this supposed to be done?
> > >>> ========================
> > >>> Prof. Victor Lazzarini
> > >>> Maynooth University
> > >>> Ireland
> > >>>
> > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
> > >>> Send bugs reports to
> > >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
> > >>> Discussions of bugs and features can be posted here
> > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > >>
> > >>
> > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > >> Send bugs reports to
> > >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > >> Discussions of bugs and features can be posted here
> > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > >
> > >
> > > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > Send bugs reports to
> > >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > 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

Date2022-11-23 13:52
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).

Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).

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

> On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson  wrote:
> 
> renderEnded not called sounds like a real bug, I'll look into it
> 
> how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
> This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
> 
> On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini  wrote:
> Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson  wrote:
> > 
> > can you try again with 6.18.2?
> > 
> > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson  wrote:
> > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> > 
> > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini  wrote:
> > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> > This is with useWorker:true
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
> > > 
> > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> > > 
> > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
> > > That doesn’t work anyway.
> > > 
> > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > > that I need to put on the page?
> > > 
> > > See the example at
> > > 
> > > https://vlazzarini.github.io/vanilla/7.Beep/
> > > 
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > > 
> > > > On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
> > > > 
> > > > So do I need to disable useSAB?
> > > > ========================
> > > > Prof. Victor Lazzarini
> > > > Maynooth University
> > > > Ireland
> > > > 
> > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
> > > >> 
> > > >> yeh the rendering is all automated, calling perform is done in the library.
> > > >> 
> > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > > >> 
> > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > > >> 
> > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
> > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > > >> 
> > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > > >> which I don’t need or want.
> > > >> 
> > > >> Could you outline how I would go about rendering faster than realtime?
> > > >> 
> > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > > >> 
> > > >> How is this done?
> > > >> ========================
> > > >> Prof. Victor Lazzarini
> > > >> Maynooth University
> > > >> Ireland
> > > >> 
> > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> > > >>> 
> > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > > >>> 
> > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > > >>> 
> > > >>> Cross-Origin-Opener-Policy: same-origin
> > > >>> Cross-Origin-Embedder-Policy: require-corp
> > > >>> 
> > > >>> it will work if window.crossOriginIsolated is set to true.
> > > >>> 
> > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > > >>> 
> > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > > >>> 
> > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> > > >>> I was trying the Web Worker thread to render a CSD,
> > > >>> 
> > > >>> csound = await Csound({useWorker: true} );
> > > >>> 
> > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > > >>> is there anything I need to do for that?
> > > >>> 
> > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > > >>> expect.
> > > >>> 
> > > >>> How is this supposed to be done?
> > > >>> ========================
> > > >>> Prof. Victor Lazzarini
> > > >>> Maynooth University
> > > >>> Ireland
> > > >>> 
> > > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
> > > >>> Discussions of bugs and features can be posted here
> > > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > > >> 
> > > >> 
> > > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > > >> Discussions of bugs and features can be posted here
> > > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> > > > 
> > > > 
> > > > 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> > > > 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

Date2022-11-23 13:59
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!

On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).

Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).

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

> On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> renderEnded not called sounds like a real bug, I'll look into it
>
> how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
> This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>
> On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >
> > can you try again with 6.18.2?
> >
> > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> >
> > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> > This is with useWorker:true
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> >
> > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > >
> > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> > >
> > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > That doesn’t work anyway.
> > >
> > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > > that I need to put on the page?
> > >
> > > See the example at
> > >
> > > https://vlazzarini.github.io/vanilla/7.Beep/
> > >
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > >
> > > > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >
> > > > So do I need to disable useSAB?
> > > > ========================
> > > > Prof. Victor Lazzarini
> > > > Maynooth University
> > > > Ireland
> > > >
> > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > > >>
> > > >> yeh the rendering is all automated, calling perform is done in the library.
> > > >>
> > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > > >>
> > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > > >>
> > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > > >>
> > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > > >> which I don’t need or want.
> > > >>
> > > >> Could you outline how I would go about rendering faster than realtime?
> > > >>
> > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > > >>
> > > >> How is this done?
> > > >> ========================
> > > >> Prof. Victor Lazzarini
> > > >> Maynooth University
> > > >> Ireland
> > > >>
> > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > > >>>
> > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > > >>>
> > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > > >>>
> > > >>> Cross-Origin-Opener-Policy: same-origin
> > > >>> Cross-Origin-Embedder-Policy: require-corp
> > > >>>
> > > >>> it will work if window.crossOriginIsolated is set to true.
> > > >>>
> > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > > >>>
> > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > > >>>
> > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >>> I was trying the Web Worker thread to render a CSD,
> > > >>>
> > > >>> csound = await Csound({useWorker: true} );
> > > >>>
> > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > > >>> is there anything I need to do for that?
> > > >>>
> > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > > >>> expect.
> > > >>>
> > > >>> How is this supposed to be done?
> > > >>> ========================
> > > >>> Prof. Victor Lazzarini
> > > >>> Maynooth University
> > > >>> Ireland
> > > >>>
> > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
> > > >>> Send bugs reports to
> > > >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
> > > >>> Discussions of bugs and features can be posted here
> > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > > >>
> > > >>
> > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > >> Send bugs reports to
> > > >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > >> Discussions of bugs and features can be posted here
> > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > > >
> > > >
> > > > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > > Send bugs reports to
> > > >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > > 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

Date2022-11-25 18:07
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.

On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!

On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).

Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).

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

> On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> renderEnded not called sounds like a real bug, I'll look into it
>
> how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
> This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>
> On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >
> > can you try again with 6.18.2?
> >
> > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> >
> > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> > This is with useWorker:true
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> >
> > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > >
> > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> > >
> > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > That doesn’t work anyway.
> > >
> > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > > that I need to put on the page?
> > >
> > > See the example at
> > >
> > > https://vlazzarini.github.io/vanilla/7.Beep/
> > >
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > >
> > > > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >
> > > > So do I need to disable useSAB?
> > > > ========================
> > > > Prof. Victor Lazzarini
> > > > Maynooth University
> > > > Ireland
> > > >
> > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > > >>
> > > >> yeh the rendering is all automated, calling perform is done in the library.
> > > >>
> > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > > >>
> > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > > >>
> > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > > >>
> > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > > >> which I don’t need or want.
> > > >>
> > > >> Could you outline how I would go about rendering faster than realtime?
> > > >>
> > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > > >>
> > > >> How is this done?
> > > >> ========================
> > > >> Prof. Victor Lazzarini
> > > >> Maynooth University
> > > >> Ireland
> > > >>
> > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > > >>>
> > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > > >>>
> > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > > >>>
> > > >>> Cross-Origin-Opener-Policy: same-origin
> > > >>> Cross-Origin-Embedder-Policy: require-corp
> > > >>>
> > > >>> it will work if window.crossOriginIsolated is set to true.
> > > >>>
> > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > > >>>
> > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > > >>>
> > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >>> I was trying the Web Worker thread to render a CSD,
> > > >>>
> > > >>> csound = await Csound({useWorker: true} );
> > > >>>
> > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > > >>> is there anything I need to do for that?
> > > >>>
> > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > > >>> expect.
> > > >>>
> > > >>> How is this supposed to be done?
> > > >>> ========================
> > > >>> Prof. Victor Lazzarini
> > > >>> Maynooth University
> > > >>> Ireland
> > > >>>
> > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
> > > >>> Send bugs reports to
> > > >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
> > > >>> Discussions of bugs and features can be posted here
> > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > > >>
> > > >>
> > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > >> Send bugs reports to
> > > >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > >> Discussions of bugs and features can be posted here
> > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > > >
> > > >
> > > > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > > Send bugs reports to
> > > >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > > 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

Date2022-11-26 08:39
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Thanks, I'll test it and get back to you.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:


the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.

On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!

On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).

Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).

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

> On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>
> renderEnded not called sounds like a real bug, I'll look into it
>
> how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
> This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>
> On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> >
> > can you try again with 6.18.2?
> >
> > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> >
> > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> > This is with useWorker:true
> > ========================
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> >
> > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > >
> > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> > >
> > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > That doesn’t work anyway.
> > >
> > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> > > that I need to put on the page?
> > >
> > > See the example at
> > >
> > > https://vlazzarini.github.io/vanilla/7.Beep/
> > >
> > > ========================
> > > Prof. Victor Lazzarini
> > > Maynooth University
> > > Ireland
> > >
> > > > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >
> > > > So do I need to disable useSAB?
> > > > ========================
> > > > Prof. Victor Lazzarini
> > > > Maynooth University
> > > > Ireland
> > > >
> > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > > >>
> > > >> yeh the rendering is all automated, calling perform is done in the library.
> > > >>
> > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> > > >>
> > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> > > >> It sounds like you're doing things correctly and the issue is on the js library side.
> > > >>
> > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> > > >>
> > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> > > >> which I don’t need or want.
> > > >>
> > > >> Could you outline how I would go about rendering faster than realtime?
> > > >>
> > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> > > >>
> > > >> How is this done?
> > > >> ========================
> > > >> Prof. Victor Lazzarini
> > > >> Maynooth University
> > > >> Ireland
> > > >>
> > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
> > > >>>
> > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> > > >>>
> > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> > > >>>
> > > >>> Cross-Origin-Opener-Policy: same-origin
> > > >>> Cross-Origin-Embedder-Policy: require-corp
> > > >>>
> > > >>> it will work if window.crossOriginIsolated is set to true.
> > > >>>
> > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> > > >>>
> > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> > > >>>
> > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> > > >>> I was trying the Web Worker thread to render a CSD,
> > > >>>
> > > >>> csound = await Csound({useWorker: true} );
> > > >>>
> > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> > > >>> is there anything I need to do for that?
> > > >>>
> > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> > > >>> expect.
> > > >>>
> > > >>> How is this supposed to be done?
> > > >>> ========================
> > > >>> Prof. Victor Lazzarini
> > > >>> Maynooth University
> > > >>> Ireland
> > > >>>
> > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
> > > >>> Send bugs reports to
> > > >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
> > > >>> Discussions of bugs and features can be posted here
> > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > > >>
> > > >>
> > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > >> Send bugs reports to
> > > >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > >> Discussions of bugs and features can be posted here
> > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
> > > >
> > > >
> > > > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
> > > > Send bugs reports to
> > > >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
> > > > 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

Date2022-11-26 11:20
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Ok, I tested it:

1) With useWorker: false, Csound plays it to dac despite being given a filename as output. 

2) With useWorker: true, Csound renders to file and it is much faster now (about 4s for a 60s sinewave).

So even if useWorker: false is faster I can’t tell because it still renders in realtime to dac. 

NB: my code runs on page load, so it does not wait for a user action, it is curious that (at least on
Chrome desktop) the synthesis performance runs to dac without  the need to get the AudioContext 
started by clicking on a button (for instance). Is that expected?

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

> On 26 Nov 2022, at 08:39, Victor Lazzarini  wrote:
> 
> Thanks, I'll test it and get back to you.
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson  wrote:
>> 
>> 
>> the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.
>> 
>> On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson  wrote:
>> ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!
>> 
>> On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini  wrote:
>> In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).
>> 
>> Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
>> I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).
>> 
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>> > On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson  wrote:
>> > 
>> > renderEnded not called sounds like a real bug, I'll look into it
>> > 
>> > how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
>> > This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>> > 
>> > On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini  wrote:
>> > Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> > 
>> > > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson  wrote:
>> > > 
>> > > can you try again with 6.18.2?
>> > > 
>> > > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson  wrote:
>> > > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
>> > > 
>> > > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini  wrote:
>> > > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
>> > > This is with useWorker:true
>> > > ========================
>> > > Prof. Victor Lazzarini
>> > > Maynooth University
>> > > Ireland
>> > > 
>> > > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
>> > > > 
>> > > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>> > > > 
>> > > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
>> > > > That doesn’t work anyway.
>> > > > 
>> > > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
>> > > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
>> > > > that I need to put on the page?
>> > > > 
>> > > > See the example at
>> > > > 
>> > > > https://vlazzarini.github.io/vanilla/7.Beep/
>> > > > 
>> > > > ========================
>> > > > Prof. Victor Lazzarini
>> > > > Maynooth University
>> > > > Ireland
>> > > > 
>> > > > > On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
>> > > > > 
>> > > > > So do I need to disable useSAB?
>> > > > > ========================
>> > > > > Prof. Victor Lazzarini
>> > > > > Maynooth University
>> > > > > Ireland
>> > > > > 
>> > > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
>> > > > >> 
>> > > > >> yeh the rendering is all automated, calling perform is done in the library.
>> > > > >> 
>> > > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>> > > > >> 
>> > > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>> > > > >> It sounds like you're doing things correctly and the issue is on the js library side.
>> > > > >> 
>> > > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
>> > > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>> > > > >> 
>> > > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>> > > > >> which I don’t need or want.
>> > > > >> 
>> > > > >> Could you outline how I would go about rendering faster than realtime?
>> > > > >> 
>> > > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>> > > > >> 
>> > > > >> How is this done?
>> > > > >> ========================
>> > > > >> Prof. Victor Lazzarini
>> > > > >> Maynooth University
>> > > > >> Ireland
>> > > > >> 
>> > > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
>> > > > >>> 
>> > > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> > > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>> > > > >>> 
>> > > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>> > > > >>> 
>> > > > >>> Cross-Origin-Opener-Policy: same-origin
>> > > > >>> Cross-Origin-Embedder-Policy: require-corp
>> > > > >>> 
>> > > > >>> it will work if window.crossOriginIsolated is set to true.
>> > > > >>> 
>> > > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>> > > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>> > > > >>> 
>> > > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>> > > > >>> 
>> > > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
>> > > > >>> I was trying the Web Worker thread to render a CSD,
>> > > > >>> 
>> > > > >>> csound = await Csound({useWorker: true} );
>> > > > >>> 
>> > > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>> > > > >>> is there anything I need to do for that?
>> > > > >>> 
>> > > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>> > > > >>> expect.
>> > > > >>> 
>> > > > >>> How is this supposed to be done?
>> > > > >>> ========================
>> > > > >>> Prof. Victor Lazzarini
>> > > > >>> Maynooth University
>> > > > >>> Ireland
>> > > > >>> 
>> > > > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
>> > > > >>> Discussions of bugs and features can be posted here
>> > > > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
>> > > > >> 
>> > > > >> 
>> > > > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
>> > > > >> Discussions of bugs and features can be posted here
>> > > > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
>> > > > > 
>> > > > > 
>> > > > > 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
>> > > > > 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

Date2022-11-26 14:45
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Sometimes the autoplay policy doesn't kick in. I wouldn't count on it working in all cases, but I've noticed this too that in same cases, the audio can start without any user interaction, only to realize it wasn't cross platform the case.

Great news, there's progress. I'll scout for some implicit -odac configuration in useWorker: false and update!

On Sat, 26 Nov 2022 at 12:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Ok, I tested it:

1) With useWorker: false, Csound plays it to dac despite being given a filename as output.

2) With useWorker: true, Csound renders to file and it is much faster now (about 4s for a 60s sinewave).

So even if useWorker: false is faster I can’t tell because it still renders in realtime to dac.

NB: my code runs on page load, so it does not wait for a user action, it is curious that (at least on
Chrome desktop) the synthesis performance runs to dac without  the need to get the AudioContext
started by clicking on a button (for instance). Is that expected?

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

> On 26 Nov 2022, at 08:39, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>
> Thanks, I'll test it and get back to you.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>
>> 
>> the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.
>>
>> On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>> ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!
>>
>> On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).
>>
>> Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
>> I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> >
>> > renderEnded not called sounds like a real bug, I'll look into it
>> >
>> > how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
>> > This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>> >
>> > On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> > > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > >
>> > > can you try again with 6.18.2?
>> > >
>> > > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>> > > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
>> > >
>> > > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
>> > > This is with useWorker:true
>> > > ========================
>> > > Prof. Victor Lazzarini
>> > > Maynooth University
>> > > Ireland
>> > >
>> > > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > > >
>> > > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>> > > >
>> > > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > That doesn’t work anyway.
>> > > >
>> > > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
>> > > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
>> > > > that I need to put on the page?
>> > > >
>> > > > See the example at
>> > > >
>> > > > https://vlazzarini.github.io/vanilla/7.Beep/
>> > > >
>> > > > ========================
>> > > > Prof. Victor Lazzarini
>> > > > Maynooth University
>> > > > Ireland
>> > > >
>> > > > > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > >
>> > > > > So do I need to disable useSAB?
>> > > > > ========================
>> > > > > Prof. Victor Lazzarini
>> > > > > Maynooth University
>> > > > > Ireland
>> > > > >
>> > > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > > > >>
>> > > > >> yeh the rendering is all automated, calling perform is done in the library.
>> > > > >>
>> > > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>> > > > >>
>> > > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>> > > > >> It sounds like you're doing things correctly and the issue is on the js library side.
>> > > > >>
>> > > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>> > > > >>
>> > > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>> > > > >> which I don’t need or want.
>> > > > >>
>> > > > >> Could you outline how I would go about rendering faster than realtime?
>> > > > >>
>> > > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>> > > > >>
>> > > > >> How is this done?
>> > > > >> ========================
>> > > > >> Prof. Victor Lazzarini
>> > > > >> Maynooth University
>> > > > >> Ireland
>> > > > >>
>> > > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > > > >>>
>> > > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> > > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>> > > > >>>
>> > > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>> > > > >>>
>> > > > >>> Cross-Origin-Opener-Policy: same-origin
>> > > > >>> Cross-Origin-Embedder-Policy: require-corp
>> > > > >>>
>> > > > >>> it will work if window.crossOriginIsolated is set to true.
>> > > > >>>
>> > > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>> > > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>> > > > >>>
>> > > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>> > > > >>>
>> > > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > >>> I was trying the Web Worker thread to render a CSD,
>> > > > >>>
>> > > > >>> csound = await Csound({useWorker: true} );
>> > > > >>>
>> > > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>> > > > >>> is there anything I need to do for that?
>> > > > >>>
>> > > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>> > > > >>> expect.
>> > > > >>>
>> > > > >>> How is this supposed to be done?
>> > > > >>> ========================
>> > > > >>> Prof. Victor Lazzarini
>> > > > >>> Maynooth University
>> > > > >>> Ireland
>> > > > >>>
>> > > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
>> > > > >>> Send bugs reports to
>> > > > >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
>> > > > >>> Discussions of bugs and features can be posted here
>> > > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>> > > > >>
>> > > > >>
>> > > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
>> > > > >> Send bugs reports to
>> > > > >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
>> > > > >> Discussions of bugs and features can be posted here
>> > > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>> > > > >
>> > > > >
>> > > > > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
>> > > > > Send bugs reports to
>> > > > >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
>> > > > > 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
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

Date2022-11-27 18:48
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
I can't see any leftovers of implicit -odac.

> 1) With useWorker: false, Csound plays it to dac despite being given a filename as output.

could you verify this, before calling csound.start, check what the value of
await csound.getOutputName()
is, if it's a filename or -odac. And if it's -odac, is there a chance there's -odac in CsOptions or some csound.setOption call somewhere?

On Sat, 26 Nov 2022 at 15:45, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Sometimes the autoplay policy doesn't kick in. I wouldn't count on it working in all cases, but I've noticed this too that in same cases, the audio can start without any user interaction, only to realize it wasn't cross platform the case.

Great news, there's progress. I'll scout for some implicit -odac configuration in useWorker: false and update!

On Sat, 26 Nov 2022 at 12:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Ok, I tested it:

1) With useWorker: false, Csound plays it to dac despite being given a filename as output.

2) With useWorker: true, Csound renders to file and it is much faster now (about 4s for a 60s sinewave).

So even if useWorker: false is faster I can’t tell because it still renders in realtime to dac.

NB: my code runs on page load, so it does not wait for a user action, it is curious that (at least on
Chrome desktop) the synthesis performance runs to dac without  the need to get the AudioContext
started by clicking on a button (for instance). Is that expected?

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

> On 26 Nov 2022, at 08:39, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>
> Thanks, I'll test it and get back to you.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>
>> 
>> the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.
>>
>> On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>> ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!
>>
>> On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).
>>
>> Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
>> I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> >
>> > renderEnded not called sounds like a real bug, I'll look into it
>> >
>> > how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
>> > This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>> >
>> > On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> > > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > >
>> > > can you try again with 6.18.2?
>> > >
>> > > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>> > > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
>> > >
>> > > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
>> > > This is with useWorker:true
>> > > ========================
>> > > Prof. Victor Lazzarini
>> > > Maynooth University
>> > > Ireland
>> > >
>> > > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > > >
>> > > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>> > > >
>> > > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > That doesn’t work anyway.
>> > > >
>> > > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
>> > > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
>> > > > that I need to put on the page?
>> > > >
>> > > > See the example at
>> > > >
>> > > > https://vlazzarini.github.io/vanilla/7.Beep/
>> > > >
>> > > > ========================
>> > > > Prof. Victor Lazzarini
>> > > > Maynooth University
>> > > > Ireland
>> > > >
>> > > > > On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > >
>> > > > > So do I need to disable useSAB?
>> > > > > ========================
>> > > > > Prof. Victor Lazzarini
>> > > > > Maynooth University
>> > > > > Ireland
>> > > > >
>> > > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > > > >>
>> > > > >> yeh the rendering is all automated, calling perform is done in the library.
>> > > > >>
>> > > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>> > > > >>
>> > > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>> > > > >> It sounds like you're doing things correctly and the issue is on the js library side.
>> > > > >>
>> > > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>> > > > >>
>> > > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>> > > > >> which I don’t need or want.
>> > > > >>
>> > > > >> Could you outline how I would go about rendering faster than realtime?
>> > > > >>
>> > > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>> > > > >>
>> > > > >> How is this done?
>> > > > >> ========================
>> > > > >> Prof. Victor Lazzarini
>> > > > >> Maynooth University
>> > > > >> Ireland
>> > > > >>
>> > > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>> > > > >>>
>> > > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> > > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>> > > > >>>
>> > > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>> > > > >>>
>> > > > >>> Cross-Origin-Opener-Policy: same-origin
>> > > > >>> Cross-Origin-Embedder-Policy: require-corp
>> > > > >>>
>> > > > >>> it will work if window.crossOriginIsolated is set to true.
>> > > > >>>
>> > > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>> > > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>> > > > >>>
>> > > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>> > > > >>>
>> > > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> > > > >>> I was trying the Web Worker thread to render a CSD,
>> > > > >>>
>> > > > >>> csound = await Csound({useWorker: true} );
>> > > > >>>
>> > > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>> > > > >>> is there anything I need to do for that?
>> > > > >>>
>> > > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>> > > > >>> expect.
>> > > > >>>
>> > > > >>> How is this supposed to be done?
>> > > > >>> ========================
>> > > > >>> Prof. Victor Lazzarini
>> > > > >>> Maynooth University
>> > > > >>> Ireland
>> > > > >>>
>> > > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0
>> > > > >>> Send bugs reports to
>> > > > >>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&amp;reserved=0
>> > > > >>> Discussions of bugs and features can be posted here
>> > > > >>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>> > > > >>
>> > > > >>
>> > > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
>> > > > >> Send bugs reports to
>> > > > >>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
>> > > > >> Discussions of bugs and features can be posted here
>> > > > >> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>> > > > >
>> > > > >
>> > > > > 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%3D&amp;reserved=0
>> > > > > Send bugs reports to
>> > > > >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&amp;reserved=0
>> > > > > 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
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

Date2022-11-27 18:57
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
I get

audio.ogg

and not only that, the Csound messages say 

writing 512-byte blks of vorbis encoding to audio.ogg (OGG)

but I am still hearing it through my speakers.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Nov 2022, at 18:48, Hlöðver Sigurðsson  wrote:
> 
> I can't see any leftovers of implicit -odac.
> 
> > 1) With useWorker: false, Csound plays it to dac despite being given a filename as output.
> 
> could you verify this, before calling csound.start, check what the value of
> await csound.getOutputName()
> is, if it's a filename or -odac. And if it's -odac, is there a chance there's -odac in CsOptions or some csound.setOption call somewhere?
> 
> On Sat, 26 Nov 2022 at 15:45, Hlöðver Sigurðsson  wrote:
> Sometimes the autoplay policy doesn't kick in. I wouldn't count on it working in all cases, but I've noticed this too that in same cases, the audio can start without any user interaction, only to realize it wasn't cross platform the case.
> 
> Great news, there's progress. I'll scout for some implicit -odac configuration in useWorker: false and update!
> 
> On Sat, 26 Nov 2022 at 12:20, Victor Lazzarini  wrote:
> Ok, I tested it:
> 
> 1) With useWorker: false, Csound plays it to dac despite being given a filename as output. 
> 
> 2) With useWorker: true, Csound renders to file and it is much faster now (about 4s for a 60s sinewave).
> 
> So even if useWorker: false is faster I can’t tell because it still renders in realtime to dac. 
> 
> NB: my code runs on page load, so it does not wait for a user action, it is curious that (at least on
> Chrome desktop) the synthesis performance runs to dac without  the need to get the AudioContext 
> started by clicking on a button (for instance). Is that expected?
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 26 Nov 2022, at 08:39, Victor Lazzarini  wrote:
> > 
> > Thanks, I'll test it and get back to you.
> > 
> > Prof. Victor Lazzarini
> > Maynooth University
> > Ireland
> > 
> >> On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson  wrote:
> >> 
> >> 
> >> the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.
> >> 
> >> On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson  wrote:
> >> ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!
> >> 
> >> On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini  wrote:
> >> In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).
> >> 
> >> Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
> >> I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).
> >> 
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland
> >> 
> >> > On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson  wrote:
> >> > 
> >> > renderEnded not called sounds like a real bug, I'll look into it
> >> > 
> >> > how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
> >> > This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
> >> > 
> >> > On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini  wrote:
> >> > Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
> >> > ========================
> >> > Prof. Victor Lazzarini
> >> > Maynooth University
> >> > Ireland
> >> > 
> >> > > On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson  wrote:
> >> > > 
> >> > > can you try again with 6.18.2?
> >> > > 
> >> > > On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson  wrote:
> >> > > Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
> >> > > 
> >> > > On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini  wrote:
> >> > > Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
> >> > > This is with useWorker:true
> >> > > ========================
> >> > > Prof. Victor Lazzarini
> >> > > Maynooth University
> >> > > Ireland
> >> > > 
> >> > > > On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
> >> > > > 
> >> > > > I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
> >> > > > 
> >> > > > On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
> >> > > > That doesn’t work anyway.
> >> > > > 
> >> > > > So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
> >> > > > which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
> >> > > > that I need to put on the page?
> >> > > > 
> >> > > > See the example at
> >> > > > 
> >> > > > https://vlazzarini.github.io/vanilla/7.Beep/
> >> > > > 
> >> > > > ========================
> >> > > > Prof. Victor Lazzarini
> >> > > > Maynooth University
> >> > > > Ireland
> >> > > > 
> >> > > > > On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
> >> > > > > 
> >> > > > > So do I need to disable useSAB?
> >> > > > > ========================
> >> > > > > Prof. Victor Lazzarini
> >> > > > > Maynooth University
> >> > > > > Ireland
> >> > > > > 
> >> > > > >> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
> >> > > > >> 
> >> > > > >> yeh the rendering is all automated, calling perform is done in the library.
> >> > > > >> 
> >> > > > >> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
> >> > > > >> 
> >> > > > >> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
> >> > > > >> It sounds like you're doing things correctly and the issue is on the js library side.
> >> > > > >> 
> >> > > > >> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
> >> > > > >> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
> >> > > > >> 
> >> > > > >> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
> >> > > > >> which I don’t need or want.
> >> > > > >> 
> >> > > > >> Could you outline how I would go about rendering faster than realtime?
> >> > > > >> 
> >> > > > >> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
> >> > > > >> 
> >> > > > >> How is this done?
> >> > > > >> ========================
> >> > > > >> Prof. Victor Lazzarini
> >> > > > >> Maynooth University
> >> > > > >> Ireland
> >> > > > >> 
> >> > > > >>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
> >> > > > >>> 
> >> > > > >>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> >> > > > >>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
> >> > > > >>> 
> >> > > > >>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
> >> > > > >>> 
> >> > > > >>> Cross-Origin-Opener-Policy: same-origin
> >> > > > >>> Cross-Origin-Embedder-Policy: require-corp
> >> > > > >>> 
> >> > > > >>> it will work if window.crossOriginIsolated is set to true.
> >> > > > >>> 
> >> > > > >>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
> >> > > > >>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
> >> > > > >>> 
> >> > > > >>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
> >> > > > >>> 
> >> > > > >>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
> >> > > > >>> I was trying the Web Worker thread to render a CSD,
> >> > > > >>> 
> >> > > > >>> csound = await Csound({useWorker: true} );
> >> > > > >>> 
> >> > > > >>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
> >> > > > >>> is there anything I need to do for that?
> >> > > > >>> 
> >> > > > >>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
> >> > > > >>> expect.
> >> > > > >>> 
> >> > > > >>> How is this supposed to be done?
> >> > > > >>> ========================
> >> > > > >>> Prof. Victor Lazzarini
> >> > > > >>> Maynooth University
> >> > > > >>> Ireland
> >> > > > >>> 
> >> > > > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5OMMXiqVeb7puYX1DxVkpY98z2O%2FEaPoY4PLVuyUQfk%3D&reserved=0
> >> > > > >>> Discussions of bugs and features can be posted here
> >> > > > >>> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793437901064%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BNpMAtYxGSi3%2F2g1LcQslloQBdv00M3QTSngT6f6OCk%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> >> > > > >> 
> >> > > > >> 
> >> > > > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> >> > > > >> Discussions of bugs and features can be posted here
> >> > > > >> 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0 Discussions of bugs and features can be posted here
> >> > > > > 
> >> > > > > 
> >> > > > > 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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SzLg3HHsF0i%2F0DPh7lRFgzzI%2BYp28qeErNRCWC5yMmM%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%7C180893f4aaa248f6b0ac08dac97319b3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638043793438057283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uoPSlwiisXOREyJVEPYqtWurw%2FNbbHYp2h9IshGr40M%3D&reserved=0
> >> > > > > 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
> 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

Date2022-11-27 19:05
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
Also the performance ends:

Elapsed time at end of performance: real: 145.135s, CPU: 0.000s
512 512 sample blks of vorbis encoding written to audio.ogg (OGG)

but the ‘onRenderEnded' callback does not get called, but the file is
created correctly. 

If I call the callback, I get download and listen to it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Nov 2022, at 18:57, Victor Lazzarini  wrote:
> 
> I get
> 
> audio.ogg
> 
> and not only that, the Csound messages say 
> 
> writing 512-byte blks of vorbis encoding to audio.ogg (OGG)
> 
> but I am still hearing it through my speakers.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 27 Nov 2022, at 18:48, Hlöðver Sigurðsson  wrote:
>> 
>> I can't see any leftovers of implicit -odac.
>> 
>>> 1) With useWorker: false, Csound plays it to dac despite being given a filename as output.
>> 
>> could you verify this, before calling csound.start, check what the value of
>> await csound.getOutputName()
>> is, if it's a filename or -odac. And if it's -odac, is there a chance there's -odac in CsOptions or some csound.setOption call somewhere?
>> 
>> On Sat, 26 Nov 2022 at 15:45, Hlöðver Sigurðsson  wrote:
>> Sometimes the autoplay policy doesn't kick in. I wouldn't count on it working in all cases, but I've noticed this too that in same cases, the audio can start without any user interaction, only to realize it wasn't cross platform the case.
>> 
>> Great news, there's progress. I'll scout for some implicit -odac configuration in useWorker: false and update!
>> 
>> On Sat, 26 Nov 2022 at 12:20, Victor Lazzarini  wrote:
>> Ok, I tested it:
>> 
>> 1) With useWorker: false, Csound plays it to dac despite being given a filename as output. 
>> 
>> 2) With useWorker: true, Csound renders to file and it is much faster now (about 4s for a 60s sinewave).
>> 
>> So even if useWorker: false is faster I can’t tell because it still renders in realtime to dac. 
>> 
>> NB: my code runs on page load, so it does not wait for a user action, it is curious that (at least on
>> Chrome desktop) the synthesis performance runs to dac without  the need to get the AudioContext 
>> started by clicking on a button (for instance). Is that expected?
>> 
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>>> On 26 Nov 2022, at 08:39, Victor Lazzarini  wrote:
>>> 
>>> Thanks, I'll test it and get back to you.
>>> 
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>> 
>>>> On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson  wrote:
>>>> 
>>>> 
>>>> the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.
>>>> 
>>>> On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson  wrote:
>>>> ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!
>>>> 
>>>> On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini  wrote:
>>>> In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).
>>>> 
>>>> Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
>>>> I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).
>>>> 
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>> 
>>>>> On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson  wrote:
>>>>> 
>>>>> renderEnded not called sounds like a real bug, I'll look into it
>>>>> 
>>>>> how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
>>>>> This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>>>>> 
>>>>> On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini  wrote:
>>>>> Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>> 
>>>>>> On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson  wrote:
>>>>>> 
>>>>>> can you try again with 6.18.2?
>>>>>> 
>>>>>> On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson  wrote:
>>>>>> Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
>>>>>> 
>>>>>> On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini  wrote:
>>>>>> Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
>>>>>> This is with useWorker:true
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>> 
>>>>>>> On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson  wrote:
>>>>>>> 
>>>>>>> I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>>>>>>> 
>>>>>>> On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini  wrote:
>>>>>>> That doesn’t work anyway.
>>>>>>> 
>>>>>>> So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
>>>>>>> which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
>>>>>>> that I need to put on the page?
>>>>>>> 
>>>>>>> See the example at
>>>>>>> 
>>>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvlazzarini.github.io%2Fvanilla%2F7.Beep%2F&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LzTcRN3ctmCCStpIPqkXImwQhyYdGcqeDpgyL0hE%2F00%3D&reserved=0
>>>>>>> 
>>>>>>> ========================
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>> 
>>>>>>>> On 18 Nov 2022, at 14:41, Victor Lazzarini  wrote:
>>>>>>>> 
>>>>>>>> So do I need to disable useSAB?
>>>>>>>> ========================
>>>>>>>> Prof. Victor Lazzarini
>>>>>>>> Maynooth University
>>>>>>>> Ireland
>>>>>>>> 
>>>>>>>>> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson  wrote:
>>>>>>>>> 
>>>>>>>>> yeh the rendering is all automated, calling perform is done in the library.
>>>>>>>>> 
>>>>>>>>> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>>>>>>>>> 
>>>>>>>>> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>>>>>>>>> It sounds like you're doing things correctly and the issue is on the js library side.
>>>>>>>>> 
>>>>>>>>> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini  wrote:
>>>>>>>>> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>>>>>>>>> 
>>>>>>>>> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>>>>>>>>> which I don’t need or want.
>>>>>>>>> 
>>>>>>>>> Could you outline how I would go about rendering faster than realtime?
>>>>>>>>> 
>>>>>>>>> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>>>>>>>>> 
>>>>>>>>> How is this done?
>>>>>>>>> ========================
>>>>>>>>> Prof. Victor Lazzarini
>>>>>>>>> Maynooth University
>>>>>>>>> Ireland
>>>>>>>>> 
>>>>>>>>>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson  wrote:
>>>>>>>>>> 
>>>>>>>>>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>>>>>>>>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>>>>>>>>>> 
>>>>>>>>>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>>>>>>>>>> 
>>>>>>>>>> Cross-Origin-Opener-Policy: same-origin
>>>>>>>>>> Cross-Origin-Embedder-Policy: require-corp
>>>>>>>>>> 
>>>>>>>>>> it will work if window.crossOriginIsolated is set to true.
>>>>>>>>>> 
>>>>>>>>>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>>>>>>>>>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>>>>>>>>>> 
>>>>>>>>>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>>>>>>>>>> 
>>>>>>>>>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini  wrote:
>>>>>>>>>> I was trying the Web Worker thread to render a CSD,
>>>>>>>>>> 
>>>>>>>>>> csound = await Csound({useWorker: true} );
>>>>>>>>>> 
>>>>>>>>>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>>>>>>>>>> is there anything I need to do for that?
>>>>>>>>>> 
>>>>>>>>>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>>>>>>>>>> expect.
>>>>>>>>>> 
>>>>>>>>>> How is this supposed to be done?
>>>>>>>>>> ========================
>>>>>>>>>> Prof. Victor Lazzarini
>>>>>>>>>> Maynooth University
>>>>>>>>>> Ireland
>>>>>>>>>> 
>>>>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&reserved=0
>>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&reserved=0 Discussions of bugs and features can be posted here
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&reserved=0
>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&reserved=0 Discussions of bugs and features can be posted here
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> 
>>>>>>> 
>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0 Discussions of bugs and features can be posted here
>>>>>> 
>>>>>> 
>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
>>>>>> Discussions of bugs and features can be posted here
>>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0 Discussions of bugs and features can be posted here
>>>>> 
>>>>> 
>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
>>>>> Discussions of bugs and features can be posted here
>>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0 Discussions of bugs and features can be posted here
>>>> 
>>>> 
>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
>>>> Discussions of bugs and features can be posted here
>>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0 Discussions of bugs and features can be posted here
>>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0 Discussions of bugs and features can be posted here
>> 
>> 
>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
>> Discussions of bugs and features can be posted here
>> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0 Discussions of bugs and features can be posted here
> 
> 
> 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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%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%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&reserved=0
> 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

Date2022-11-29 16:05
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Csound WASM: web worker rendering
It's maybe fixed in @csound/browser 6.18.4

On Sun, 27 Nov 2022 at 20:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Also the performance ends:

Elapsed time at end of performance: real: 145.135s, CPU: 0.000s
512 512 sample blks of vorbis encoding written to audio.ogg (OGG)

but the ‘onRenderEnded' callback does not get called, but the file is
created correctly.

If I call the callback, I get download and listen to it.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Nov 2022, at 18:57, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:
>
> I get
>
> audio.ogg
>
> and not only that, the Csound messages say
>
> writing 512-byte blks of vorbis encoding to audio.ogg (OGG)
>
> but I am still hearing it through my speakers.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 27 Nov 2022, at 18:48, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>
>> I can't see any leftovers of implicit -odac.
>>
>>> 1) With useWorker: false, Csound plays it to dac despite being given a filename as output.
>>
>> could you verify this, before calling csound.start, check what the value of
>> await csound.getOutputName()
>> is, if it's a filename or -odac. And if it's -odac, is there a chance there's -odac in CsOptions or some csound.setOption call somewhere?
>>
>> On Sat, 26 Nov 2022 at 15:45, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>> Sometimes the autoplay policy doesn't kick in. I wouldn't count on it working in all cases, but I've noticed this too that in same cases, the audio can start without any user interaction, only to realize it wasn't cross platform the case.
>>
>> Great news, there's progress. I'll scout for some implicit -odac configuration in useWorker: false and update!
>>
>> On Sat, 26 Nov 2022 at 12:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>> Ok, I tested it:
>>
>> 1) With useWorker: false, Csound plays it to dac despite being given a filename as output.
>>
>> 2) With useWorker: true, Csound renders to file and it is much faster now (about 4s for a 60s sinewave).
>>
>> So even if useWorker: false is faster I can’t tell because it still renders in realtime to dac.
>>
>> NB: my code runs on page load, so it does not wait for a user action, it is curious that (at least on
>> Chrome desktop) the synthesis performance runs to dac without  the need to get the AudioContext
>> started by clicking on a button (for instance). Is that expected?
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>> On 26 Nov 2022, at 08:39, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>
>>> Thanks, I'll test it and get back to you.
>>>
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>
>>>> On 25 Nov 2022, at 18:10, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>>
>>>> 
>>>> the new issues are fixed in 6.18.3 as for the render time, I did some work there, but I'm not sure if it's going to be better with useWorker: true, useWorker: false should be fast in all cases at least.
>>>>
>>>> On Wed, 23 Nov 2022 at 14:59, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>> ah ffs, yes true, I'll fix. I was fixing the detection of it, but I forgot that with useWorker: false, there's an implicit setting of idac. Will fix!
>>>>
>>>> On Wed, 23 Nov 2022 at 14:53, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>> In the latest 6.18.2, I stil get about 80% realtime (e.g. 8secs for a 10secs sine).
>>>>
>>>> Another thing I noticed with the latest code is that the realtime audio seems to be opened by default, even when I don’t request it.
>>>> I am getting the mic permission dialog coming up. In 6.18.0, I think that that did not happen (if I just set -odac as an option and nothing else).
>>>>
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 23 Nov 2022, at 13:42, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>>>
>>>>> renderEnded not called sounds like a real bug, I'll look into it
>>>>>
>>>>> how slow is it with useWorker true. The reason I don't tune it to the maximum performance, is because I try to periodically do a 0 second setTimeout, which helps to pick-up events coming in.
>>>>> This is important for stopping or pausing renders, without it, render without end would render forever. I think I rendered 15 sec sinewave in 1-2 seconds. Maybe you are still 1:1 with realtime and render time?
>>>>>
>>>>> On Wed, 23 Nov 2022 at 12:55, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>> Ok, it’s still slow with the useWorker: true, but the “renderEnded” callback gets called correctly
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 23 Nov 2022, at 11:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>>>>
>>>>>> can you try again with 6.18.2?
>>>>>>
>>>>>> On Wed, 23 Nov 2022 at 11:30, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>>>>>> Ok, will take another look. What I did change was faster rendering with useWorker: false, but I will now go over all the worker setups...
>>>>>>
>>>>>> On Wed, 23 Nov 2022 at 09:16, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>> Not notable difference, I am afraid. Rendering a sinewave for 10 s uses  8.3s time, which is about what was there before.
>>>>>> This is with useWorker:true
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 22 Nov 2022, at 18:29, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>>>>>
>>>>>>> I made a wasm patch release 6.18.1, I'm curious if that makes the rendering experience better.
>>>>>>>
>>>>>>> On Fri, 18 Nov 2022 at 16:05, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>>> That doesn’t work anyway.
>>>>>>>
>>>>>>> So the rendering performance with a worker thread is pretty abysmal: a sine wave with envelope runs in about 87% realtime,
>>>>>>> which is awfully slow. Is it possible to speed it up? I see you mentioned headers but do you have the JS code or whatever
>>>>>>> that I need to put on the page?
>>>>>>>
>>>>>>> See the example at
>>>>>>>
>>>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvlazzarini.github.io%2Fvanilla%2F7.Beep%2F&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=LzTcRN3ctmCCStpIPqkXImwQhyYdGcqeDpgyL0hE%2F00%3D&amp;reserved=0
>>>>>>>
>>>>>>> ========================
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>>
>>>>>>>> On 18 Nov 2022, at 14:41, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>>>>
>>>>>>>> So do I need to disable useSAB?
>>>>>>>> ========================
>>>>>>>> Prof. Victor Lazzarini
>>>>>>>> Maynooth University
>>>>>>>> Ireland
>>>>>>>>
>>>>>>>>> On 18 Nov 2022, at 14:36, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>>>>>>>
>>>>>>>>> yeh the rendering is all automated, calling perform is done in the library.
>>>>>>>>>
>>>>>>>>> I have the correct headers in place in web-ide for sharedArrayBuffer to work, and there is where I fixed it in the past, but not in what I call "vanilla worker", a name I use for MessagePost based communication as opposed to reading from a shared array.
>>>>>>>>>
>>>>>>>>> The fact that useWorker: false rendering isn't working, sounds like a bug. actually after further reading, it seems it's missing :(
>>>>>>>>> It sounds like you're doing things correctly and the issue is on the js library side.
>>>>>>>>>
>>>>>>>>> On Fri, 18 Nov 2022 at 15:28, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>>>>> I was following what I saw in the Web IDE, where you use a worker for rendering. I am supposing this is the vanilla worker, because I have not set up shared arrays.
>>>>>>>>>
>>>>>>>>> I am not quite sure then what is the best way to render, because if I don’t set the useWorker option, I get the realtime audio output from Web Audio,
>>>>>>>>> which I don’t need or want.
>>>>>>>>>
>>>>>>>>> Could you outline how I would go about rendering faster than realtime?
>>>>>>>>>
>>>>>>>>> The problem I have is that I cannot call csound.perform() to do it without calling first csound.start(). But as soon as I call csound.start(), realtime audio starts in an Audio Worklet.
>>>>>>>>>
>>>>>>>>> How is this done?
>>>>>>>>> ========================
>>>>>>>>> Prof. Victor Lazzarini
>>>>>>>>> Maynooth University
>>>>>>>>> Ireland
>>>>>>>>>
>>>>>>>>>> On 18 Nov 2022, at 14:03, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>>>>>>>>
>>>>>>>>>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>>>>>>>>> I will take a look, I assume you are using csound in a worker which is a webworker as opposed to worker with sharedArrayBuffer,
>>>>>>>>>>
>>>>>>>>>> it's a sidenote but if you were want to try the full extent of the performance gains from sharedArrayBuffer, it needs a bit of complexity, which is adding these response headers to the website
>>>>>>>>>>
>>>>>>>>>> Cross-Origin-Opener-Policy: same-origin
>>>>>>>>>> Cross-Origin-Embedder-Policy: require-corp
>>>>>>>>>>
>>>>>>>>>> it will work if window.crossOriginIsolated is set to true.
>>>>>>>>>>
>>>>>>>>>> If you are rendering it doesn't matter much if it's in a worker or not, since the useWorker is mostly beneficial for realtime-audio
>>>>>>>>>> (especially in cases where the main thread is doing some sort of heavy computation and potentially causing buffer underruns in non worker contextes).
>>>>>>>>>>
>>>>>>>>>> This has happened before, that the rendering is slow in a worker, I believe reported by you some months ago, so I think the same thing is at play here. Will report back!
>>>>>>>>>>
>>>>>>>>>> On Fri, 18 Nov 2022 at 09:52, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>>>>>> I was trying the Web Worker thread to render a CSD,
>>>>>>>>>>
>>>>>>>>>> csound = await Csound({useWorker: true} );
>>>>>>>>>>
>>>>>>>>>> but the processing seemed to proceed at realtime pace. I was thinking this should run faster than realtime,
>>>>>>>>>> is there anything I need to do for that?
>>>>>>>>>>
>>>>>>>>>> All I am doing is passing a CSD and setting the the output to a file. It runs but much slower than I would
>>>>>>>>>> expect.
>>>>>>>>>>
>>>>>>>>>> How is this supposed to be done?
>>>>>>>>>> ========================
>>>>>>>>>> Prof. Victor Lazzarini
>>>>>>>>>> Maynooth University
>>>>>>>>>> Ireland
>>>>>>>>>>
>>>>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%3D&amp;reserved=0
>>>>>>>>>> Send bugs reports to
>>>>>>>>>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&amp;reserved=0
>>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%3D&amp;reserved=0
>>>>>>>>> Send bugs reports to
>>>>>>>>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&amp;reserved=0
>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Pkyz%2FL2nFSc19zaK3rN8EICsY2tT9aoC0sR6wovIEqU%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>>>>>>>
>>>>>>>>
>>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880296057%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=sFBH0QzXX1SMWd7bTT0gGbqF7N8PKfQAtDBOPJyoG88%3D&amp;reserved=0
>>>>>>>> Send bugs reports to
>>>>>>>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>>
>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0
>>>>>>> Send bugs reports to
>>>>>>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0
>>>>>> Send bugs reports to
>>>>>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
>>>>>> Discussions of bugs and features can be posted here
>>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>>>>
>>>>>
>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0
>>>>> Send bugs reports to
>>>>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
>>>>> Discussions of bugs and features can be posted here
>>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>>>
>>>>
>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0
>>>> Send bugs reports to
>>>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
>>>> Discussions of bugs and features can be posted here
>>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>>
>>
>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0
>> Send bugs reports to
>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0 Send bugs reports to https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0 Discussions of bugs and features can be posted here
>
>
> 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&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=04UakxPZdvAjA%2Bj87E2FEUee0AgWSKXu6ba1m1bYTdc%3D&amp;reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C4d1a152dd952409e322008dad0a950c3%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638051722880451969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=YfNeTZGf5umEwSAKqqSdYjbJAGjCGH0%2F49ILfMj0ZJg%3D&amp;reserved=0
> 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