Csound Csound-dev Csound-tekno Search About

[Csnd] Wasm: yield callback

Date2022-12-17 13:03
FromVictor Lazzarini
Subject[Csnd] Wasm: yield callback
I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener. 

My use case:

- I am working with firing off events in Csound at certain times. For this I am using a combination of
the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to 
go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
pulse going, the rhythm breaks down. In other words, this is unusable

See what I have here:

https://editor.p5js.org/vlazzarini/sketches/b_VAlSWsR

- If I had a callback from Csound, then I could fire the events more or less around the time they should
start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
to just use the yield callback.

Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
actually be even simpler to use.
========================
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-12-17 13:27
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Wasm: yield callback
There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.

On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.

My use case:

- I am working with firing off events in Csound at certain times. For this I am using a combination of
the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
pulse going, the rhythm breaks down. In other words, this is unusable

See what I have here:

https://editor.p5js.org/vlazzarini/sketches/b_VAlSWsR

- If I had a callback from Csound, then I could fire the events more or less around the time they should
start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
to just use the yield callback.

Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
actually be even simpler to use.
========================
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-12-17 13:32
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
As long as the frequency of calls  is better than the JS timer, it should be better.

What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 17 Dec 2022, at 13:28, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.

On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.

My use case:

- I am working with firing off events in Csound at certain times. For this I am using a combination of
the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
pulse going, the rhythm breaks down. In other words, this is unusable

See what I have here:

https://editor.p5js.org/vlazzarini/sketches/b_VAlSWsR

- If I had a callback from Csound, then I could fire the events more or less around the time they should
start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
to just use the yield callback.

Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
actually be even simpler to use.
========================
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-12-17 13:38
FromHlöðver Sigurðsson
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.

Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.

On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
As long as the frequency of calls  is better than the JS timer, it should be better.

What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 17 Dec 2022, at 13:28, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.

On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.

My use case:

- I am working with firing off events in Csound at certain times. For this I am using a combination of
the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
pulse going, the rhythm breaks down. In other words, this is unusable

See what I have here:

https://editor.p5js.org/vlazzarini/sketches/b_VAlSWsR

- If I had a callback from Csound, then I could fire the events more or less around the time they should
start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
to just use the yield callback.

Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
actually be even simpler to use.
========================
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-12-17 14:09
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
yes, I see the limitation. 

Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.

Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
in the future accurately and use the JS timer to call the scheduling function regularly.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
> 
> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
> 
> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
> 
> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
> As long as the frequency of calls  is better than the JS timer, it should be better.
> 
> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 17 Dec 2022, at 13:28, 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.
>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>> 
>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener. 
>> 
>> My use case:
>> 
>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to 
>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>> pulse going, the rhythm breaks down. In other words, this is unusable
>> 
>> See what I have here:
>> 
>> https://editor.p5js.org/vlazzarini/sketches/b_VAlSWsR
>> 
>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>> to just use the yield callback.
>> 
>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>> actually be even simpler to use.
>> ========================
>> 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-12-17 16:29
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
I solved my timing problem by using Csound to schedule ahead and so not relying anymore
on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)

https://editor.p5js.org/vlazzarini/sketches/ifsOSPL7r

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

> On 17 Dec 2022, at 14:09, Victor Lazzarini  wrote:
> 
> yes, I see the limitation. 
> 
> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
> 
> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
> in the future accurately and use the JS timer to call the scheduling function regularly.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
>> 
>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>> 
>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>> 
>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
>> As long as the frequency of calls  is better than the JS timer, it should be better.
>> 
>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>> 
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>>> On 17 Dec 2022, at 13:28, 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.
>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>> 
>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener. 
>>> 
>>> My use case:
>>> 
>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to 
>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>> 
>>> See what I have here:
>>> 
>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=x04qRryxCf5nViMupntLS4Q0RwlDeGquhbAPLlTC%2BX0%3D&reserved=0
>>> 
>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>> to just use the yield callback.
>>> 
>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>> actually be even simpler to use.
>>> ========================
>>> 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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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-12-17 20:58
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
it is so interesting that you use the p5js editor for this!  do you plan 
to start visual elements in parallel?  and what is behind the code, for 
instance how do you start csound?

thanks for sharing -
	joachim


On 17/12/2022 17:29, Victor Lazzarini wrote:
> I solved my timing problem by using Csound to schedule ahead and so not relying anymore
> on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)
> 
> https://editor.p5js.org/vlazzarini/sketches/ifsOSPL7r
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 17 Dec 2022, at 14:09, Victor Lazzarini  wrote:
>>
>> yes, I see the limitation.
>>
>> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
>>
>> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
>> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
>> in the future accurately and use the JS timer to call the scheduling function regularly.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
>>>
>>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>>>
>>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>>>
>>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
>>> As long as the frequency of calls  is better than the JS timer, it should be better.
>>>
>>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>>>
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>
>>>> On 17 Dec 2022, at 13:28, 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.
>>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>>>
>>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.
>>>>
>>>> My use case:
>>>>
>>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
>>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>>>
>>>> See what I have here:
>>>>
>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=x04qRryxCf5nViMupntLS4Q0RwlDeGquhbAPLlTC%2BX0%3D&reserved=0
>>>>
>>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>>> to just use the yield callback.
>>>>
>>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>>> actually be even simpler to use.
>>>> ========================
>>>> 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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oAjOVBa0O4sKwTBTrNX49ggp72GXzey%2FZ74xgHCMxGU%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%7Ca70eb6de261f427a8b1808dae0386fc0%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638068830237466653%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W7WX4zd5wSRZifTn8%2BxxuVb0eVANHXTZrnwoCE529kU%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

Date2022-12-18 00:19
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
I am actually using it as a JS IDE, and it works very well for that. You can even do live coding in it, you can work with or without visuals (but I’m not doing visuals at the moment).
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 17 Dec 2022, at 20:58, joachim heintz  wrote:
> 
> it is so interesting that you use the p5js editor for this!  do you plan to start visual elements in parallel?  and what is behind the code, for instance how do you start csound?
> 
> thanks for sharing -
> 	joachim
> 
> 
> On 17/12/2022 17:29, Victor Lazzarini wrote:
>> I solved my timing problem by using Csound to schedule ahead and so not relying anymore
>> on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2FifsOSPL7r&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GZOn7npg2l4ETf1pCdHvfnrYmdbSJbKMafwfzj7aZig%3D&reserved=0
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>> On 17 Dec 2022, at 14:09, Victor Lazzarini  wrote:
>>> 
>>> yes, I see the limitation.
>>> 
>>> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
>>> 
>>> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
>>> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
>>> in the future accurately and use the JS timer to call the scheduling function regularly.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>> 
>>>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
>>>> 
>>>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>>>> 
>>>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>>>> 
>>>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
>>>> As long as the frequency of calls  is better than the JS timer, it should be better.
>>>> 
>>>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>>>> 
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>> 
>>>>> On 17 Dec 2022, at 13:28, 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.
>>>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>>>> 
>>>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>>>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.
>>>>> 
>>>>> My use case:
>>>>> 
>>>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
>>>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>>>> 
>>>>> See what I have here:
>>>>> 
>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YLbqdjrnvZOhdtk6CrGYs5qMNfSyPzAvGCds6xCsIvY%3D&reserved=0
>>>>> 
>>>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>>>> to just use the yield callback.
>>>>> 
>>>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>>>> actually be even simpler to use.
>>>>> ========================
>>>>> 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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664379148%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OKH5Qn1iRE%2B6XGhYj40FOcEZ0mNTEQTbx0tSVWmcbtU%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-12-18 06:47
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
fascinating.  but how do you load csound?  i don't see anything in your 
code, so i am wondering what is "behind the curtain".  i should describe 
it for he floss manual or the website --- so important ...
thanks -
	j


On 18/12/2022 01:19, Victor Lazzarini wrote:
> I am actually using it as a JS IDE, and it works very well for that. You can even do live coding in it, you can work with or without visuals (but I’m not doing visuals at the moment).
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 17 Dec 2022, at 20:58, joachim heintz  wrote:
>>
>> it is so interesting that you use the p5js editor for this!  do you plan to start visual elements in parallel?  and what is behind the code, for instance how do you start csound?
>>
>> thanks for sharing -
>> 	joachim
>>
>>
>> On 17/12/2022 17:29, Victor Lazzarini wrote:
>>> I solved my timing problem by using Csound to schedule ahead and so not relying anymore
>>> on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)
>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2FifsOSPL7r&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GZOn7npg2l4ETf1pCdHvfnrYmdbSJbKMafwfzj7aZig%3D&reserved=0
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>> On 17 Dec 2022, at 14:09, Victor Lazzarini  wrote:
>>>>
>>>> yes, I see the limitation.
>>>>
>>>> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
>>>>
>>>> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
>>>> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
>>>> in the future accurately and use the JS timer to call the scheduling function regularly.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
>>>>>
>>>>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>>>>>
>>>>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>>>>>
>>>>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
>>>>> As long as the frequency of calls  is better than the JS timer, it should be better.
>>>>>
>>>>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>>>>>
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 17 Dec 2022, at 13:28, 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.
>>>>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>>>>>
>>>>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>>>>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.
>>>>>>
>>>>>> My use case:
>>>>>>
>>>>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>>>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
>>>>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>>>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>>>>>
>>>>>> See what I have here:
>>>>>>
>>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YLbqdjrnvZOhdtk6CrGYs5qMNfSyPzAvGCds6xCsIvY%3D&reserved=0
>>>>>>
>>>>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>>>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>>>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>>>>> to just use the yield callback.
>>>>>>
>>>>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>>>>> actually be even simpler to use.
>>>>>> ========================
>>>>>> 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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ntago9ycTupb0GcL778eVKDrW3QekI31GlmDFxTLql8%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664224396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7gAMgTNq5OxKCDMq7SlfcsDtNsIAyfQfvQPQwMa4%2FUI%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%7C59a96b1a6a504a1a708e08dae071936c%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069075664379148%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OKH5Qn1iRE%2B6XGhYj40FOcEZ0mNTEQTbx0tSVWmcbtU%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

Date2022-12-18 09:41
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
I have Csound loaded by the start() function in the GMPlay.js file which I am preparing to be a module. 
The idea of this particular work is to make a real simple live coding system for absolute beginners (with Csound completely hidden).

But in general, all you need is to load and start Csound as shown in the p5.js editor examples I put in https://vlazzarini.github.io/vanilla
for example, 

https://editor.p5js.org/vlazzarini/sketches/4F4NBQ0Fy

Rory has also been doing some work to facilitate loading Csound by providing the start() function in a p5Csound.js module that you
can just drop in.

In fact, yesterday I was looking at other possible online JS IDEs and to me the p5.js editor was on balance the best one to use with Csound. 
So I would recommend that even if you are not using the graphics side.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Dec 2022, at 06:47, joachim heintz  wrote:
> 
> fascinating.  but how do you load csound?  i don't see anything in your code, so i am wondering what is "behind the curtain".  i should describe it for he floss manual or the website --- so important ...
> thanks -
> 	j
> 
> 
> On 18/12/2022 01:19, Victor Lazzarini wrote:
>> I am actually using it as a JS IDE, and it works very well for that. You can even do live coding in it, you can work with or without visuals (but I’m not doing visuals at the moment).
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>> On 17 Dec 2022, at 20:58, joachim heintz  wrote:
>>> 
>>> it is so interesting that you use the p5js editor for this!  do you plan to start visual elements in parallel?  and what is behind the code, for instance how do you start csound?
>>> 
>>> thanks for sharing -
>>> 	joachim
>>> 
>>> 
>>> On 17/12/2022 17:29, Victor Lazzarini wrote:
>>>> I solved my timing problem by using Csound to schedule ahead and so not relying anymore
>>>> on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)
>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2FifsOSPL7r&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079236763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AJLalvlm0rsKtk%2B5Yu076rtD1U%2BiiXeXoUi57ry21PY%3D&reserved=0
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>> On 17 Dec 2022, at 14:09, Victor Lazzarini  wrote:
>>>>> 
>>>>> yes, I see the limitation.
>>>>> 
>>>>> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
>>>>> 
>>>>> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
>>>>> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
>>>>> in the future accurately and use the JS timer to call the scheduling function regularly.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>> 
>>>>>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
>>>>>> 
>>>>>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>>>>>> 
>>>>>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>>>>>> 
>>>>>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
>>>>>> As long as the frequency of calls  is better than the JS timer, it should be better.
>>>>>> 
>>>>>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>>>>>> 
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>> 
>>>>>>> On 17 Dec 2022, at 13:28, 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.
>>>>>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>>>>>> 
>>>>>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>>>>>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.
>>>>>>> 
>>>>>>> My use case:
>>>>>>> 
>>>>>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>>>>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
>>>>>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>>>>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>>>>>> 
>>>>>>> See what I have here:
>>>>>>> 
>>>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079236763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XQYPNpjfaK40Y1u04XsX%2BJs2kubjOSjluT7VAPg7zWc%3D&reserved=0
>>>>>>> 
>>>>>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>>>>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>>>>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>>>>>> to just use the yield callback.
>>>>>>> 
>>>>>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>>>>>> actually be even simpler to use.
>>>>>>> ========================
>>>>>>> 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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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-12-18 09:54
FromRory Walsh
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
The p5 module I'm writing simplifies creating Csound and kissing assets. But after that it's vanilla Csound. 

Slightly off topic, but has anyone had any success running Csound wasm examples from a git repo using the online VS code editor? That would be a nice setup. Last time I tried I couldn't serve anything, but I probably just messed it up. 

On Sun 18 Dec 2022, 9:42 a.m. Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
I have Csound loaded by the start() function in the GMPlay.js file which I am preparing to be a module.
The idea of this particular work is to make a real simple live coding system for absolute beginners (with Csound completely hidden).

But in general, all you need is to load and start Csound as shown in the p5.js editor examples I put in https://vlazzarini.github.io/vanilla
for example,

https://editor.p5js.org/vlazzarini/sketches/4F4NBQ0Fy

Rory has also been doing some work to facilitate loading Csound by providing the start() function in a p5Csound.js module that you
can just drop in.

In fact, yesterday I was looking at other possible online JS IDEs and to me the p5.js editor was on balance the best one to use with Csound.
So I would recommend that even if you are not using the graphics side.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Dec 2022, at 06:47, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:
>
> fascinating.  but how do you load csound?  i don't see anything in your code, so i am wondering what is "behind the curtain".  i should describe it for he floss manual or the website --- so important ...
> thanks -
>       j
>
>
> On 18/12/2022 01:19, Victor Lazzarini wrote:
>> I am actually using it as a JS IDE, and it works very well for that. You can even do live coding in it, you can work with or without visuals (but I’m not doing visuals at the moment).
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>> On 17 Dec 2022, at 20:58, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:
>>>
>>> it is so interesting that you use the p5js editor for this!  do you plan to start visual elements in parallel?  and what is behind the code, for instance how do you start csound?
>>>
>>> thanks for sharing -
>>>     joachim
>>>
>>>
>>> On 17/12/2022 17:29, Victor Lazzarini wrote:
>>>> I solved my timing problem by using Csound to schedule ahead and so not relying anymore
>>>> on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)
>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2FifsOSPL7r&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079236763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AJLalvlm0rsKtk%2B5Yu076rtD1U%2BiiXeXoUi57ry21PY%3D&reserved=0
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>> On 17 Dec 2022, at 14:09, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>
>>>>> yes, I see the limitation.
>>>>>
>>>>> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
>>>>>
>>>>> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
>>>>> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
>>>>> in the future accurately and use the JS timer to call the scheduling function regularly.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:
>>>>>>
>>>>>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>>>>>>
>>>>>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>>>>>>
>>>>>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>> As long as the frequency of calls  is better than the JS timer, it should be better.
>>>>>>
>>>>>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>>>>>>
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 17 Dec 2022, at 13:28, 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.
>>>>>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>>>>>>
>>>>>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>>>>>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.
>>>>>>>
>>>>>>> My use case:
>>>>>>>
>>>>>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>>>>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
>>>>>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>>>>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>>>>>>
>>>>>>> See what I have here:
>>>>>>>
>>>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079236763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XQYPNpjfaK40Y1u04XsX%2BJs2kubjOSjluT7VAPg7zWc%3D&reserved=0
>>>>>>>
>>>>>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>>>>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>>>>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>>>>>> to just use the yield callback.
>>>>>>>
>>>>>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>>>>>> actually be even simpler to use.
>>>>>>> ========================
>>>>>>> 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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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

Date2022-12-18 12:46
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Wasm: yield callback
wow ---
now i get it, and you already established the connection with the 
processing javascript ...
i have added a post on the csound website for yours and stevens/hlodvers 
tutorial.
looking forward to more, also from rory -
	j


On 18/12/2022 10:41, Victor Lazzarini wrote:
> I have Csound loaded by the start() function in the GMPlay.js file which I am preparing to be a module.
> The idea of this particular work is to make a real simple live coding system for absolute beginners (with Csound completely hidden).
> 
> But in general, all you need is to load and start Csound as shown in the p5.js editor examples I put in https://vlazzarini.github.io/vanilla
> for example,
> 
> https://editor.p5js.org/vlazzarini/sketches/4F4NBQ0Fy
> 
> Rory has also been doing some work to facilitate loading Csound by providing the start() function in a p5Csound.js module that you
> can just drop in.
> 
> In fact, yesterday I was looking at other possible online JS IDEs and to me the p5.js editor was on balance the best one to use with Csound.
> So I would recommend that even if you are not using the graphics side.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 18 Dec 2022, at 06:47, joachim heintz  wrote:
>>
>> fascinating.  but how do you load csound?  i don't see anything in your code, so i am wondering what is "behind the curtain".  i should describe it for he floss manual or the website --- so important ...
>> thanks -
>> 	j
>>
>>
>> On 18/12/2022 01:19, Victor Lazzarini wrote:
>>> I am actually using it as a JS IDE, and it works very well for that. You can even do live coding in it, you can work with or without visuals (but I’m not doing visuals at the moment).
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>> On 17 Dec 2022, at 20:58, joachim heintz  wrote:
>>>>
>>>> it is so interesting that you use the p5js editor for this!  do you plan to start visual elements in parallel?  and what is behind the code, for instance how do you start csound?
>>>>
>>>> thanks for sharing -
>>>> 	joachim
>>>>
>>>>
>>>> On 17/12/2022 17:29, Victor Lazzarini wrote:
>>>>> I solved my timing problem by using Csound to schedule ahead and so not relying anymore
>>>>> on the timing of JS setTimeout calls. It seems solid now (at least for several minutes)
>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2FifsOSPL7r&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079236763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AJLalvlm0rsKtk%2B5Yu076rtD1U%2BiiXeXoUi57ry21PY%3D&reserved=0
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>>> On 17 Dec 2022, at 14:09, Victor Lazzarini  wrote:
>>>>>>
>>>>>> yes, I see the limitation.
>>>>>>
>>>>>> Unless the callback can be passed from the main thread to Csound, none of what I was thinking would work.
>>>>>>
>>>>>> Since it is not possible to fire events (like I am doing with midiMessage) accurately in time with a main thread timer, then I will need
>>>>>> to change this to schedule events instead. Then if I refer to an accurate clock like the one from AudioContext, I can schedule things
>>>>>> in the future accurately and use the JS timer to call the scheduling function regularly.
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 17 Dec 2022, at 13:38, Hlöðver Sigurðsson  wrote:
>>>>>>>
>>>>>>> So the inherent problem is that it's not possible to pass a function pointer from one thread to another. So a setTimeout, which accepts a callback, can't be passed from user to the csound clock directly. There will always need to be some sort of signaling between the worker and the main thread. Even with "singlethread" worklets, since csound runs in that case in a worklet worker.
>>>>>>>
>>>>>>> Perhaps the base of all these callback api functionalities would be that csound sends subscribeable "onKsmps" events and with those events, it's possible to do most things on the main thread, also if it's subscribeable event-listener, then user could do whatever they want with those events.
>>>>>>>
>>>>>>> On Sat, 17 Dec 2022 at 14:32, Victor Lazzarini  wrote:
>>>>>>> As long as the frequency of calls  is better than the JS timer, it should be better.
>>>>>>>
>>>>>>> What about a setTimeout running on the Csound clock, would that be possible? Then we won't need the yield callback.
>>>>>>>
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Maynooth University
>>>>>>> Ireland
>>>>>>>
>>>>>>>> On 17 Dec 2022, at 13:28, 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.
>>>>>>>> There was also a feature request for setOutputChannelCallback, I think I will implement that and this on the develop branch. But on design level, the latency of the callbacks should be the most accurate with sharedArrayBuffers and script-procesor-node setups. For all other cases, the signaling from csound to the main thread will need to go through message channels in order to call a registered callback. The only downside is potential delays, but we'll need to see if that's even something to worry about in the first place. But I imagine for script-processor-node, where all the processing is taking place on one thread, a slow callback could cause underruns is performKsmps.
>>>>>>>>
>>>>>>>> On Sat, 17 Dec 2022 at 14:03, Victor Lazzarini  wrote:
>>>>>>>> I was wondering if it is possible or viable to add a yield callback in Csound WASM, via a listener.
>>>>>>>>
>>>>>>>> My use case:
>>>>>>>>
>>>>>>>> - I am working with firing off events in Csound at certain times. For this I am using a combination of
>>>>>>>> the JS timer adjusted with the AudioContext time.  This works for about a minute or two, but then it starts to
>>>>>>>> go wrong as setTimeout() gets called more irregularly than at the start. While my corrections keep the overall
>>>>>>>> pulse going, the rhythm breaks down. In other words, this is unusable
>>>>>>>>
>>>>>>>> See what I have here:
>>>>>>>>
>>>>>>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Feditor.p5js.org%2Fvlazzarini%2Fsketches%2Fb_VAlSWsR&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079236763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XQYPNpjfaK40Y1u04XsX%2BJs2kubjOSjluT7VAPg7zWc%3D&reserved=0
>>>>>>>>
>>>>>>>> - If I had a callback from Csound, then I could fire the events more or less around the time they should
>>>>>>>> start, give or take a few ms, which is not too bad for me (as it is even at the start setTimeout can be late
>>>>>>>> by several ms). I could then modify the current scheme and drop setTimeout() and the AudioContext clock,
>>>>>>>> to just use the yield callback.
>>>>>>>>
>>>>>>>> Another possibility is to implement a csound.setTimeout() that is timed by the Csound clock. That would
>>>>>>>> actually be even simpler to use.
>>>>>>>> ========================
>>>>>>>> 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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CHfdLAO5ifwBTx1g3Bku7Lxe9ebcmHFsjO4YX8Kj%2F3k%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%7C660d6700168f4d211d3108dae0c3dc3a%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638069429079393434%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pp9wf8NhQO0DpTymQ1FY1fOBHhrZPp0sMbldkwudp00%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