Csound Csound-dev Csound-tekno Search About

[Csnd-dev] AudioWorklet

Date2017-10-30 15:48
FromSteven Yi
Subject[Csnd-dev] AudioWorklet
Hi All,

Just FYI, I started a repository for working on Csound AudioWorklet:

https://github.com/kunstmusik/csound-audioworklet

(I added a link to it from the Github issue:
https://github.com/csound/csound/issues/864)

I thought a separate repo would be good for now as it has the
pre-built .wasm file in there to work with.  Thought is to get the
basics working then move it over to main Csound repo.

I'll be looking at this a little each day as I'm interested in it for
live.csound.com, but since AudioWorklet is only in Chrome Canary and
not a stable implementation, it's not a priority development task for
me at the moment.  Any other looks/contributions appreciated!

Date2017-10-30 20:43
FromVictor Lazzarini
SubjectRe: [Csnd-dev] AudioWorklet
Thanks, that is a good idea. I might have some time in the next days as I will be travelling,
with some airport time to fill.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 30 Oct 2017, at 15:48, Steven Yi  wrote:
> 
> Hi All,
> 
> Just FYI, I started a repository for working on Csound AudioWorklet:
> 
> https://github.com/kunstmusik/csound-audioworklet
> 
> (I added a link to it from the Github issue:
> https://github.com/csound/csound/issues/864)
> 
> I thought a separate repo would be good for now as it has the
> pre-built .wasm file in there to work with.  Thought is to get the
> basics working then move it over to main Csound repo.
> 
> I'll be looking at this a little each day as I'm interested in it for
> live.csound.com, but since AudioWorklet is only in Chrome Canary and
> not a stable implementation, it's not a priority development task for
> me at the moment.  Any other looks/contributions appreciated!
> 

Date2017-10-31 17:21
FromSteven Yi
SubjectRe: [Csnd-dev] AudioWorklet
The repo has really the most limited skeleton at the moment.  If you
do get anywhere please do submit a PR.  I'll be slowly adding to it
when I can and want to keep in sync. :)

On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini
 wrote:
> Thanks, that is a good idea. I might have some time in the next days as I will be travelling,
> with some airport time to fill.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 30 Oct 2017, at 15:48, Steven Yi  wrote:
>>
>> Hi All,
>>
>> Just FYI, I started a repository for working on Csound AudioWorklet:
>>
>> https://github.com/kunstmusik/csound-audioworklet
>>
>> (I added a link to it from the Github issue:
>> https://github.com/csound/csound/issues/864)
>>
>> I thought a separate repo would be good for now as it has the
>> pre-built .wasm file in there to work with.  Thought is to get the
>> basics working then move it over to main Csound repo.
>>
>> I'll be looking at this a little each day as I'm interested in it for
>> live.csound.com, but since AudioWorklet is only in Chrome Canary and
>> not a stable implementation, it's not a priority development task for
>> me at the moment.  Any other looks/contributions appreciated!
>>

Date2017-11-01 14:49
FromSteven Yi
SubjectRe: [Csnd-dev] AudioWorklet
Hi All,

To keep everyone up to date, I found:

1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
project.  However, the issue I find is how to get the WASM binary
loaded and transferred into the AudioWorklet thread.  Faust looks to
compile WASM binary into JS code/text that is embedded into the .js
file used as the AudioWorklet Processor.  I tried doing some things to
load the binary data on the main thread then send it over to
AudioWorklet but did not find any way to do that.

2. More importantly, Chrome Canary does not yet implement message ports:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

As far as I understand, for us to communicate String text (i.e., live
code) with Csound, we would need that feature implemented.  (All of
the examples I've seen so far only deal with communicating numeric
values via AudioParams.)

3. Constructor - One of the other things I tried was to set a value in
the constructor of the AudioWorkletProcessor.  I saw in the Faust code
their Processors were generated to take in an "options" value.  I
tried the same and found that it always came in as undefined.  I don't
know if it's the case that I'm trying to do something that isn't
specified/determined, or if it's something that isn't implemented
(like #2 above).


What I do see as possible with things as they are is to do like Faust
and embed everything into the .js file for the Processor, include any
Csound CSD code.  If everything is fully encapsulated within the JS i
think it could be developed to work.  However, that's really not the
use case of what we'd want with a generic Csound AudioWorklet node,
and I'm not seeing any way at this time to get there.

For the time being, I'm going to stop any further work on a Csound
AudioWorklet.  I think we'll just need to wait a bit until there's
more implemented.

Thanks,
steven


On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi  wrote:
> The repo has really the most limited skeleton at the moment.  If you
> do get anywhere please do submit a PR.  I'll be slowly adding to it
> when I can and want to keep in sync. :)
>
> On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini
>  wrote:
>> Thanks, that is a good idea. I might have some time in the next days as I will be travelling,
>> with some airport time to fill.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 30 Oct 2017, at 15:48, Steven Yi  wrote:
>>>
>>> Hi All,
>>>
>>> Just FYI, I started a repository for working on Csound AudioWorklet:
>>>
>>> https://github.com/kunstmusik/csound-audioworklet
>>>
>>> (I added a link to it from the Github issue:
>>> https://github.com/csound/csound/issues/864)
>>>
>>> I thought a separate repo would be good for now as it has the
>>> pre-built .wasm file in there to work with.  Thought is to get the
>>> basics working then move it over to main Csound repo.
>>>
>>> I'll be looking at this a little each day as I'm interested in it for
>>> live.csound.com, but since AudioWorklet is only in Chrome Canary and
>>> not a stable implementation, it's not a priority development task for
>>> me at the moment.  Any other looks/contributions appreciated!
>>>

Date2017-11-01 15:49
FromVictor Lazzarini
SubjectRe: [Csnd-dev] AudioWorklet
It might be worth, if we can send in the WASM binary using some means to
have a proof of concept in the way you
described, even if it’s not what we want
to do eventually.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 15:49, Steven Yi <stevenyi@GMAIL.COM> wrote:

Hi All,

To keep everyone up to date, I found:

1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
project.  However, the issue I find is how to get the WASM binary
loaded and transferred into the AudioWorklet thread.  Faust looks to
compile WASM binary into JS code/text that is embedded into the .js
file used as the AudioWorklet Processor.  I tried doing some things to
load the binary data on the main thread then send it over to
AudioWorklet but did not find any way to do that.

2. More importantly, Chrome Canary does not yet implement message ports:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

As far as I understand, for us to communicate String text (i.e., live
code) with Csound, we would need that feature implemented.  (All of
the examples I've seen so far only deal with communicating numeric
values via AudioParams.)

3. Constructor - One of the other things I tried was to set a value in
the constructor of the AudioWorkletProcessor.  I saw in the Faust code
their Processors were generated to take in an "options" value.  I
tried the same and found that it always came in as undefined.  I don't
know if it's the case that I'm trying to do something that isn't
specified/determined, or if it's something that isn't implemented
(like #2 above).


What I do see as possible with things as they are is to do like Faust
and embed everything into the .js file for the Processor, include any
Csound CSD code.  If everything is fully encapsulated within the JS i
think it could be developed to work.  However, that's really not the
use case of what we'd want with a generic Csound AudioWorklet node,
and I'm not seeing any way at this time to get there.

For the time being, I'm going to stop any further work on a Csound
AudioWorklet.  I think we'll just need to wait a bit until there's
more implemented.

Thanks,
steven


On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi <stevenyi@gmail.com> wrote:
The repo has really the most limited skeleton at the moment.  If you
do get anywhere please do submit a PR.  I'll be slowly adding to it
when I can and want to keep in sync. :)

On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
Thanks, that is a good idea. I might have some time in the next days as I will be travelling,
with some airport time to fill.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 30 Oct 2017, at 15:48, Steven Yi <stevenyi@gmail.com> wrote:

Hi All,

Just FYI, I started a repository for working on Csound AudioWorklet:

https://github.com/kunstmusik/csound-audioworklet

(I added a link to it from the Github issue:
https://github.com/csound/csound/issues/864)

I thought a separate repo would be good for now as it has the
pre-built .wasm file in there to work with.  Thought is to get the
basics working then move it over to main Csound repo.

I'll be looking at this a little each day as I'm interested in it for
live.csound.com, but since AudioWorklet is only in Chrome Canary and
not a stable implementation, it's not a priority development task for
me at the moment.  Any other looks/contributions appreciated!

steven

Date2017-11-01 15:53
FromSteven Yi
SubjectRe: [Csnd-dev] AudioWorklet
Yeah, I was thinking the same. I subscribed to the chrome issue for MessagePort:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

and got a reply from Hong Chan.  I've replied there too with feedback
on what we're doing and what we'd like to do.  I'm trying to take a
rational approach and just present use cases and solicit feedback
there.  (Hong Chan seems like a nice guy from what I remember.)
Perhaps you could subscribe to that issue too?



On Wed, Nov 1, 2017 at 11:49 AM, Victor Lazzarini
 wrote:
> It might be worth, if we can send in the WASM binary using some means to
> have a proof of concept in the way you
> described, even if it’s not what we want
> to do eventually.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 1 Nov 2017, at 15:49, Steven Yi  wrote:
>
> Hi All,
>
> To keep everyone up to date, I found:
>
> 1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
> project.  However, the issue I find is how to get the WASM binary
> loaded and transferred into the AudioWorklet thread.  Faust looks to
> compile WASM binary into JS code/text that is embedded into the .js
> file used as the AudioWorklet Processor.  I tried doing some things to
> load the binary data on the main thread then send it over to
> AudioWorklet but did not find any way to do that.
>
> 2. More importantly, Chrome Canary does not yet implement message ports:
>
> https://bugs.chromium.org/p/chromium/issues/detail?id=774564
>
> As far as I understand, for us to communicate String text (i.e., live
> code) with Csound, we would need that feature implemented.  (All of
> the examples I've seen so far only deal with communicating numeric
> values via AudioParams.)
>
> 3. Constructor - One of the other things I tried was to set a value in
> the constructor of the AudioWorkletProcessor.  I saw in the Faust code
> their Processors were generated to take in an "options" value.  I
> tried the same and found that it always came in as undefined.  I don't
> know if it's the case that I'm trying to do something that isn't
> specified/determined, or if it's something that isn't implemented
> (like #2 above).
>
>
> What I do see as possible with things as they are is to do like Faust
> and embed everything into the .js file for the Processor, include any
> Csound CSD code.  If everything is fully encapsulated within the JS i
> think it could be developed to work.  However, that's really not the
> use case of what we'd want with a generic Csound AudioWorklet node,
> and I'm not seeing any way at this time to get there.
>
> For the time being, I'm going to stop any further work on a Csound
> AudioWorklet.  I think we'll just need to wait a bit until there's
> more implemented.
>
> Thanks,
> steven
>
>
> On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi  wrote:
>
> The repo has really the most limited skeleton at the moment.  If you
>
> do get anywhere please do submit a PR.  I'll be slowly adding to it
>
> when I can and want to keep in sync. :)
>
>
> On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini
>
>  wrote:
>
> Thanks, that is a good idea. I might have some time in the next days as I
> will be travelling,
>
> with some airport time to fill.
>
> ========================
>
> Prof. Victor Lazzarini
>
> Dean of Arts, Celtic Studies, and Philosophy,
>
> Maynooth University,
>
> Maynooth, Co Kildare, Ireland
>
> Tel: 00 353 7086936
>
> Fax: 00 353 1 7086952
>
>
> On 30 Oct 2017, at 15:48, Steven Yi  wrote:
>
>
> Hi All,
>
>
> Just FYI, I started a repository for working on Csound AudioWorklet:
>
>
> https://github.com/kunstmusik/csound-audioworklet
>
>
> (I added a link to it from the Github issue:
>
> https://github.com/csound/csound/issues/864)
>
>
> I thought a separate repo would be good for now as it has the
>
> pre-built .wasm file in there to work with.  Thought is to get the
>
> basics working then move it over to main Csound repo.
>
>
> I'll be looking at this a little each day as I'm interested in it for
>
> live.csound.com, but since AudioWorklet is only in Chrome Canary and
>
> not a stable implementation, it's not a priority development task for
>
> me at the moment.  Any other looks/contributions appreciated!
>
>

Date2017-11-01 15:59
FromVictor Lazzarini
SubjectRe: [Csnd-dev] AudioWorklet
Will do. Jari is someone who we might be able to contact about this, as he was going to work on an AudioWorklet port of his software.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 16:53, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yeah, I was thinking the same. I subscribed to the chrome issue for MessagePort:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

and got a reply from Hong Chan.  I've replied there too with feedback
on what we're doing and what we'd like to do.  I'm trying to take a
rational approach and just present use cases and solicit feedback
there.  (Hong Chan seems like a nice guy from what I remember.)
Perhaps you could subscribe to that issue too?



On Wed, Nov 1, 2017 at 11:49 AM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
It might be worth, if we can send in the WASM binary using some means to
have a proof of concept in the way you
described, even if it’s not what we want
to do eventually.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 15:49, Steven Yi <stevenyi@GMAIL.COM> wrote:

Hi All,

To keep everyone up to date, I found:

1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
project.  However, the issue I find is how to get the WASM binary
loaded and transferred into the AudioWorklet thread.  Faust looks to
compile WASM binary into JS code/text that is embedded into the .js
file used as the AudioWorklet Processor.  I tried doing some things to
load the binary data on the main thread then send it over to
AudioWorklet but did not find any way to do that.

2. More importantly, Chrome Canary does not yet implement message ports:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

As far as I understand, for us to communicate String text (i.e., live
code) with Csound, we would need that feature implemented.  (All of
the examples I've seen so far only deal with communicating numeric
values via AudioParams.)

3. Constructor - One of the other things I tried was to set a value in
the constructor of the AudioWorkletProcessor.  I saw in the Faust code
their Processors were generated to take in an "options" value.  I
tried the same and found that it always came in as undefined.  I don't
know if it's the case that I'm trying to do something that isn't
specified/determined, or if it's something that isn't implemented
(like #2 above).


What I do see as possible with things as they are is to do like Faust
and embed everything into the .js file for the Processor, include any
Csound CSD code.  If everything is fully encapsulated within the JS i
think it could be developed to work.  However, that's really not the
use case of what we'd want with a generic Csound AudioWorklet node,
and I'm not seeing any way at this time to get there.

For the time being, I'm going to stop any further work on a Csound
AudioWorklet.  I think we'll just need to wait a bit until there's
more implemented.

Thanks,
steven


On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi <stevenyi@gmail.com> wrote:

The repo has really the most limited skeleton at the moment.  If you

do get anywhere please do submit a PR.  I'll be slowly adding to it

when I can and want to keep in sync. :)


On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini

<Victor.Lazzarini@mu.ie> wrote:

Thanks, that is a good idea. I might have some time in the next days as I
will be travelling,

with some airport time to fill.

========================

Prof. Victor Lazzarini

Dean of Arts, Celtic Studies, and Philosophy,

Maynooth University,

Maynooth, Co Kildare, Ireland

Tel: 00 353 7086936

Fax: 00 353 1 7086952


On 30 Oct 2017, at 15:48, Steven Yi <stevenyi@gmail.com> wrote:


Hi All,


Just FYI, I started a repository for working on Csound AudioWorklet:


https://github.com/kunstmusik/csound-audioworklet


(I added a link to it from the Github issue:

https://github.com/csound/csound/issues/864)


I thought a separate repo would be good for now as it has the

pre-built .wasm file in there to work with.  Thought is to get the

basics working then move it over to main Csound repo.


I'll be looking at this a little each day as I'm interested in it for

live.csound.com, but since AudioWorklet is only in Chrome Canary and

not a stable implementation, it's not a priority development task for

me at the moment.  Any other looks/contributions appreciated!


steven

Date2017-11-01 16:12
FromVictor Lazzarini
SubjectRe: [Csnd-dev] AudioWorklet
Looks like he might be able to guide us.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 16:53, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yeah, I was thinking the same. I subscribed to the chrome issue for MessagePort:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

and got a reply from Hong Chan.  I've replied there too with feedback
on what we're doing and what we'd like to do.  I'm trying to take a
rational approach and just present use cases and solicit feedback
there.  (Hong Chan seems like a nice guy from what I remember.)
Perhaps you could subscribe to that issue too?



On Wed, Nov 1, 2017 at 11:49 AM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
It might be worth, if we can send in the WASM binary using some means to
have a proof of concept in the way you
described, even if it’s not what we want
to do eventually.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 15:49, Steven Yi <stevenyi@GMAIL.COM> wrote:

Hi All,

To keep everyone up to date, I found:

1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
project.  However, the issue I find is how to get the WASM binary
loaded and transferred into the AudioWorklet thread.  Faust looks to
compile WASM binary into JS code/text that is embedded into the .js
file used as the AudioWorklet Processor.  I tried doing some things to
load the binary data on the main thread then send it over to
AudioWorklet but did not find any way to do that.

2. More importantly, Chrome Canary does not yet implement message ports:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

As far as I understand, for us to communicate String text (i.e., live
code) with Csound, we would need that feature implemented.  (All of
the examples I've seen so far only deal with communicating numeric
values via AudioParams.)

3. Constructor - One of the other things I tried was to set a value in
the constructor of the AudioWorkletProcessor.  I saw in the Faust code
their Processors were generated to take in an "options" value.  I
tried the same and found that it always came in as undefined.  I don't
know if it's the case that I'm trying to do something that isn't
specified/determined, or if it's something that isn't implemented
(like #2 above).


What I do see as possible with things as they are is to do like Faust
and embed everything into the .js file for the Processor, include any
Csound CSD code.  If everything is fully encapsulated within the JS i
think it could be developed to work.  However, that's really not the
use case of what we'd want with a generic Csound AudioWorklet node,
and I'm not seeing any way at this time to get there.

For the time being, I'm going to stop any further work on a Csound
AudioWorklet.  I think we'll just need to wait a bit until there's
more implemented.

Thanks,
steven


On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi <stevenyi@gmail.com> wrote:

The repo has really the most limited skeleton at the moment.  If you

do get anywhere please do submit a PR.  I'll be slowly adding to it

when I can and want to keep in sync. :)


On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini

<Victor.Lazzarini@mu.ie> wrote:

Thanks, that is a good idea. I might have some time in the next days as I
will be travelling,

with some airport time to fill.

========================

Prof. Victor Lazzarini

Dean of Arts, Celtic Studies, and Philosophy,

Maynooth University,

Maynooth, Co Kildare, Ireland

Tel: 00 353 7086936

Fax: 00 353 1 7086952


On 30 Oct 2017, at 15:48, Steven Yi <stevenyi@gmail.com> wrote:


Hi All,


Just FYI, I started a repository for working on Csound AudioWorklet:


https://github.com/kunstmusik/csound-audioworklet


(I added a link to it from the Github issue:

https://github.com/csound/csound/issues/864)


I thought a separate repo would be good for now as it has the

pre-built .wasm file in there to work with.  Thought is to get the

basics working then move it over to main Csound repo.


I'll be looking at this a little each day as I'm interested in it for

live.csound.com, but since AudioWorklet is only in Chrome Canary and

not a stable implementation, it's not a priority development task for

me at the moment.  Any other looks/contributions appreciated!


steven

Date2017-11-01 16:45
FromSteven Yi
SubjectRe: [Csnd-dev] AudioWorklet

Yeah, so far so good! I need to find a way to get the chip off my shoulder about web audio and this feels like a good start. Let's see how it goes.


On Wed, Nov 1, 2017, 12:12 Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Looks like he might be able to guide us.


Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
On 1 Nov 2017, at 16:53, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yeah, I was thinking the same. I subscribed to the chrome issue for MessagePort:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

and got a reply from Hong Chan.  I've replied there too with feedback
on what we're doing and what we'd like to do.  I'm trying to take a
rational approach and just present use cases and solicit feedback
there.  (Hong Chan seems like a nice guy from what I remember.)
Perhaps you could subscribe to that issue too?



On Wed, Nov 1, 2017 at 11:49 AM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
It might be worth, if we can send in the WASM binary using some means to
have a proof of concept in the way you
described, even if it’s not what we want
to do eventually.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 15:49, Steven Yi <stevenyi@GMAIL.COM> wrote:

Hi All,

To keep everyone up to date, I found:

1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
project.  However, the issue I find is how to get the WASM binary
loaded and transferred into the AudioWorklet thread.  Faust looks to
compile WASM binary into JS code/text that is embedded into the .js
file used as the AudioWorklet Processor.  I tried doing some things to
load the binary data on the main thread then send it over to
AudioWorklet but did not find any way to do that.

2. More importantly, Chrome Canary does not yet implement message ports:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

As far as I understand, for us to communicate String text (i.e., live
code) with Csound, we would need that feature implemented.  (All of
the examples I've seen so far only deal with communicating numeric
values via AudioParams.)

3. Constructor - One of the other things I tried was to set a value in
the constructor of the AudioWorkletProcessor.  I saw in the Faust code
their Processors were generated to take in an "options" value.  I
tried the same and found that it always came in as undefined.  I don't
know if it's the case that I'm trying to do something that isn't
specified/determined, or if it's something that isn't implemented
(like #2 above).


What I do see as possible with things as they are is to do like Faust
and embed everything into the .js file for the Processor, include any
Csound CSD code.  If everything is fully encapsulated within the JS i
think it could be developed to work.  However, that's really not the
use case of what we'd want with a generic Csound AudioWorklet node,
and I'm not seeing any way at this time to get there.

For the time being, I'm going to stop any further work on a Csound
AudioWorklet.  I think we'll just need to wait a bit until there's
more implemented.

Thanks,
steven


On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi <stevenyi@gmail.com> wrote:

The repo has really the most limited skeleton at the moment.  If you

do get anywhere please do submit a PR.  I'll be slowly adding to it

when I can and want to keep in sync. :)


On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini

<Victor.Lazzarini@mu.ie> wrote:

Thanks, that is a good idea. I might have some time in the next days as I
will be travelling,

with some airport time to fill.

========================

Prof. Victor Lazzarini

Dean of Arts, Celtic Studies, and Philosophy,

Maynooth University,

Maynooth, Co Kildare, Ireland

Tel: 00 353 7086936

Fax: 00 353 1 7086952


On 30 Oct 2017, at 15:48, Steven Yi <stevenyi@gmail.com> wrote:


Hi All,


Just FYI, I started a repository for working on Csound AudioWorklet:


https://github.com/kunstmusik/csound-audioworklet


(I added a link to it from the Github issue:

https://github.com/csound/csound/issues/864)


I thought a separate repo would be good for now as it has the

pre-built .wasm file in there to work with.  Thought is to get the

basics working then move it over to main Csound repo.


I'll be looking at this a little each day as I'm interested in it for

live.csound.com, but since AudioWorklet is only in Chrome Canary and

not a stable implementation, it's not a priority development task for

me at the moment.  Any other looks/contributions appreciated!


steven

Date2017-11-01 17:44
FromVictor Lazzarini
SubjectRe: [Csnd-dev] AudioWorklet
I know what you mean. I read the comments in that blog you pointed, some were really badly informed. There was an advice there not to use a sine function because it was not bandlimited (!)
People like that should not be designing
an audio API.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 17:46, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yeah, so far so good! I need to find a way to get the chip off my shoulder about web audio and this feels like a good start. Let's see how it goes.


On Wed, Nov 1, 2017, 12:12 Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Looks like he might be able to guide us.


Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
On 1 Nov 2017, at 16:53, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yeah, I was thinking the same. I subscribed to the chrome issue for MessagePort:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

and got a reply from Hong Chan.  I've replied there too with feedback
on what we're doing and what we'd like to do.  I'm trying to take a
rational approach and just present use cases and solicit feedback
there.  (Hong Chan seems like a nice guy from what I remember.)
Perhaps you could subscribe to that issue too?



On Wed, Nov 1, 2017 at 11:49 AM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
It might be worth, if we can send in the WASM binary using some means to
have a proof of concept in the way you
described, even if it’s not what we want
to do eventually.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 1 Nov 2017, at 15:49, Steven Yi <stevenyi@GMAIL.COM> wrote:

Hi All,

To keep everyone up to date, I found:

1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
project.  However, the issue I find is how to get the WASM binary
loaded and transferred into the AudioWorklet thread.  Faust looks to
compile WASM binary into JS code/text that is embedded into the .js
file used as the AudioWorklet Processor.  I tried doing some things to
load the binary data on the main thread then send it over to
AudioWorklet but did not find any way to do that.

2. More importantly, Chrome Canary does not yet implement message ports:

https://bugs.chromium.org/p/chromium/issues/detail?id=774564

As far as I understand, for us to communicate String text (i.e., live
code) with Csound, we would need that feature implemented.  (All of
the examples I've seen so far only deal with communicating numeric
values via AudioParams.)

3. Constructor - One of the other things I tried was to set a value in
the constructor of the AudioWorkletProcessor.  I saw in the Faust code
their Processors were generated to take in an "options" value.  I
tried the same and found that it always came in as undefined.  I don't
know if it's the case that I'm trying to do something that isn't
specified/determined, or if it's something that isn't implemented
(like #2 above).


What I do see as possible with things as they are is to do like Faust
and embed everything into the .js file for the Processor, include any
Csound CSD code.  If everything is fully encapsulated within the JS i
think it could be developed to work.  However, that's really not the
use case of what we'd want with a generic Csound AudioWorklet node,
and I'm not seeing any way at this time to get there.

For the time being, I'm going to stop any further work on a Csound
AudioWorklet.  I think we'll just need to wait a bit until there's
more implemented.

Thanks,
steven


On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi <stevenyi@gmail.com> wrote:

The repo has really the most limited skeleton at the moment.  If you

do get anywhere please do submit a PR.  I'll be slowly adding to it

when I can and want to keep in sync. :)


On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini

<Victor.Lazzarini@mu.ie> wrote:

Thanks, that is a good idea. I might have some time in the next days as I
will be travelling,

with some airport time to fill.

========================

Prof. Victor Lazzarini

Dean of Arts, Celtic Studies, and Philosophy,

Maynooth University,

Maynooth, Co Kildare, Ireland

Tel: 00 353 7086936

Fax: 00 353 1 7086952


On 30 Oct 2017, at 15:48, Steven Yi <stevenyi@gmail.com> wrote:


Hi All,


Just FYI, I started a repository for working on Csound AudioWorklet:


https://github.com/kunstmusik/csound-audioworklet


(I added a link to it from the Github issue:

https://github.com/csound/csound/issues/864)


I thought a separate repo would be good for now as it has the

pre-built .wasm file in there to work with.  Thought is to get the

basics working then move it over to main Csound repo.


I'll be looking at this a little each day as I'm interested in it for

live.csound.com, but since AudioWorklet is only in Chrome Canary and

not a stable implementation, it's not a priority development task for

me at the moment.  Any other looks/contributions appreciated!


steven

Date2017-11-01 18:16
FromSteven Yi
SubjectRe: [Csnd-dev] AudioWorklet
In case anyone would like to know what article Victor and I were talking about:

http://blog.mecheye.net/2017/09/i-dont-know-who-the-web-audio-api-is-designed-for/

At this point, I'm happy to work with the WebAudio folks to get what
we want out of it to work. I'm sure if they can support our use cases,
it will also support many other people's use cases, and it's a win-win
for everyone.  I also have been taking the attitude that as long as we
can get what we want out of it, I'm happy to ignore all the parts that
don't really make sense to me to have within the API.



On Wed, Nov 1, 2017 at 1:44 PM, Victor Lazzarini  wrote:
> I know what you mean. I read the comments in that blog you pointed, some
> were really badly informed. There was an advice there not to use a sine
> function because it was not bandlimited (!)
> People like that should not be designing
> an audio API.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 1 Nov 2017, at 17:46, Steven Yi  wrote:
>
> Yeah, so far so good! I need to find a way to get the chip off my shoulder
> about web audio and this feels like a good start. Let's see how it goes.
>
>
> On Wed, Nov 1, 2017, 12:12 Victor Lazzarini  wrote:
>>
>> Looks like he might be able to guide us.
>>
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>> On 1 Nov 2017, at 16:53, Steven Yi  wrote:
>>
>> Yeah, I was thinking the same. I subscribed to the chrome issue for
>> MessagePort:
>>
>> https://bugs.chromium.org/p/chromium/issues/detail?id=774564
>>
>> and got a reply from Hong Chan.  I've replied there too with feedback
>> on what we're doing and what we'd like to do.  I'm trying to take a
>> rational approach and just present use cases and solicit feedback
>> there.  (Hong Chan seems like a nice guy from what I remember.)
>> Perhaps you could subscribe to that issue too?
>>
>>
>>
>> On Wed, Nov 1, 2017 at 11:49 AM, Victor Lazzarini
>>  wrote:
>>
>> It might be worth, if we can send in the WASM binary using some means to
>>
>> have a proof of concept in the way you
>>
>> described, even if it’s not what we want
>>
>> to do eventually.
>>
>>
>> Victor Lazzarini
>>
>> Dean of Arts, Celtic Studies, and Philosophy
>>
>> Maynooth University
>>
>> Ireland
>>
>>
>> On 1 Nov 2017, at 15:49, Steven Yi  wrote:
>>
>>
>> Hi All,
>>
>>
>> To keep everyone up to date, I found:
>>
>>
>> 1. WebAssembly and AudioWorklets:  Does work, as evidenced by Faust
>>
>> project.  However, the issue I find is how to get the WASM binary
>>
>> loaded and transferred into the AudioWorklet thread.  Faust looks to
>>
>> compile WASM binary into JS code/text that is embedded into the .js
>>
>> file used as the AudioWorklet Processor.  I tried doing some things to
>>
>> load the binary data on the main thread then send it over to
>>
>> AudioWorklet but did not find any way to do that.
>>
>>
>> 2. More importantly, Chrome Canary does not yet implement message ports:
>>
>>
>> https://bugs.chromium.org/p/chromium/issues/detail?id=774564
>>
>>
>> As far as I understand, for us to communicate String text (i.e., live
>>
>> code) with Csound, we would need that feature implemented.  (All of
>>
>> the examples I've seen so far only deal with communicating numeric
>>
>> values via AudioParams.)
>>
>>
>> 3. Constructor - One of the other things I tried was to set a value in
>>
>> the constructor of the AudioWorkletProcessor.  I saw in the Faust code
>>
>> their Processors were generated to take in an "options" value.  I
>>
>> tried the same and found that it always came in as undefined.  I don't
>>
>> know if it's the case that I'm trying to do something that isn't
>>
>> specified/determined, or if it's something that isn't implemented
>>
>> (like #2 above).
>>
>>
>>
>> What I do see as possible with things as they are is to do like Faust
>>
>> and embed everything into the .js file for the Processor, include any
>>
>> Csound CSD code.  If everything is fully encapsulated within the JS i
>>
>> think it could be developed to work.  However, that's really not the
>>
>> use case of what we'd want with a generic Csound AudioWorklet node,
>>
>> and I'm not seeing any way at this time to get there.
>>
>>
>> For the time being, I'm going to stop any further work on a Csound
>>
>> AudioWorklet.  I think we'll just need to wait a bit until there's
>>
>> more implemented.
>>
>>
>> Thanks,
>>
>> steven
>>
>>
>>
>> On Tue, Oct 31, 2017 at 1:21 PM, Steven Yi  wrote:
>>
>>
>> The repo has really the most limited skeleton at the moment.  If you
>>
>>
>> do get anywhere please do submit a PR.  I'll be slowly adding to it
>>
>>
>> when I can and want to keep in sync. :)
>>
>>
>>
>> On Mon, Oct 30, 2017 at 4:43 PM, Victor Lazzarini
>>
>>
>>  wrote:
>>
>>
>> Thanks, that is a good idea. I might have some time in the next days as I
>>
>> will be travelling,
>>
>>
>> with some airport time to fill.
>>
>>
>> ========================
>>
>>
>> Prof. Victor Lazzarini
>>
>>
>> Dean of Arts, Celtic Studies, and Philosophy,
>>
>>
>> Maynooth University,
>>
>>
>> Maynooth, Co Kildare, Ireland
>>
>>
>> Tel: 00 353 7086936
>>
>>
>> Fax: 00 353 1 7086952
>>
>>
>>
>> On 30 Oct 2017, at 15:48, Steven Yi  wrote:
>>
>>
>>
>> Hi All,
>>
>>
>>
>> Just FYI, I started a repository for working on Csound AudioWorklet:
>>
>>
>>
>> https://github.com/kunstmusik/csound-audioworklet
>>
>>
>>
>> (I added a link to it from the Github issue:
>>
>>
>> https://github.com/csound/csound/issues/864)
>>
>>
>>
>> I thought a separate repo would be good for now as it has the
>>
>>
>> pre-built .wasm file in there to work with.  Thought is to get the
>>
>>
>> basics working then move it over to main Csound repo.
>>
>>
>>
>> I'll be looking at this a little each day as I'm interested in it for
>>
>>
>> live.csound.com, but since AudioWorklet is only in Chrome Canary and
>>
>>
>> not a stable implementation, it's not a priority development task for
>>
>>
>> me at the moment.  Any other looks/contributions appreciated!
>>
>>
>>