Csound Csound-dev Csound-tekno Search About

Csound Emscripten question

Date2015-11-19 08:18
FromRory Walsh
SubjectCsound Emscripten question
I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:

                csoundObj.compileCSD("test.csd  --midifile=test.mid");

But that don't work. Any ideas?

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

Date2015-11-19 09:07
FromEd Costello
SubjectRe: Csound Emscripten question
I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance. 
Ed

On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:

                csoundObj.compileCSD("test.csd  --midifile=test.mid");

But that don't work. Any ideas?

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

Date2015-11-19 11:28
FromRory Walsh
SubjectRe: Csound Emscripten question
Don't suppose you have an e4xample handy of how to do this? I'm looking to use a midi file from a server to play a Csound instrument?

On 19 November 2015 at 09:07, Ed Costello <phasereset@gmail.com> wrote:
I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance. 
Ed

On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:

                csoundObj.compileCSD("test.csd  --midifile=test.mid");

But that don't work. Any ideas?

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

Date2015-11-19 11:31
FromVictor Lazzarini
SubjectRe: Csound Emscripten question
I think we should look at the code again to make ksmps independent of the web audio buffering. From a global
perspective, I cannot see that being impossible.

========================
Dr 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 19 Nov 2015, at 09:07, Ed Costello  wrote:
> 
> I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance. 
> Ed
> 
> On 19 November 2015 at 09:18, Rory Walsh  wrote:
> I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:
> 
>                 csoundObj.compileCSD("test.csd  --midifile=test.mid");
> 
> But that don't work. Any ideas? 
> 
> 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

Date2015-11-19 12:31
FromEd Costello
SubjectRe: Csound Emscripten question
Yes, it would be better if it was flexible in this respect. I will add an issue to github. 
Rory, I've just checked and although there is a way to send MIDI data via a connected MIDI device, there is currently no way to send MIDI messages to Csound directly in the public API, I thought there was so apologies if I gave that impression. The only way I can think of to play a MIDI file would be to set up a MIDI loopback, play the MIDI file from one program, send it to the loopback device and get the browser to receive through that loopback device. That sounds like major hassle though. But if you were up for it, enabling MIDI input to the browser is done like this:

var midiInputCallback = function(status) {

if (status === true) {
// We have successfully enabled midi
}
else {
// Error midi was not successfully enabled
}
};

csound.enableMidiInput(midiInputCallback);

Midi is then received from the first connected MIDI device.


On 19 November 2015 at 12:31, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I think we should look at the code again to make ksmps independent of the web audio buffering. From a global
perspective, I cannot see that being impossible.

========================
Dr 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 19 Nov 2015, at 09:07, Ed Costello <phasereset@gmail.com> wrote:
>
> I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance.
> Ed
>
> On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
> I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:
>
>                 csoundObj.compileCSD("test.csd  --midifile=test.mid");
>
> But that don't work. Any ideas?
>
> 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

Date2015-11-19 12:36
FromRory Walsh
SubjectRe: Csound Emscripten question
Thanks Ed, I was afraid of that. Adding compile flags seems like it should be simple enough? If I wanted to add features, how would I go about doing it? How is this Csound js interface even built? I can't find any info on it. There seems to be no documentation on what's available or possible, or how to build it? Any ideas?

On 19 November 2015 at 12:31, Ed Costello <phasereset@gmail.com> wrote:
Yes, it would be better if it was flexible in this respect. I will add an issue to github. 
Rory, I've just checked and although there is a way to send MIDI data via a connected MIDI device, there is currently no way to send MIDI messages to Csound directly in the public API, I thought there was so apologies if I gave that impression. The only way I can think of to play a MIDI file would be to set up a MIDI loopback, play the MIDI file from one program, send it to the loopback device and get the browser to receive through that loopback device. That sounds like major hassle though. But if you were up for it, enabling MIDI input to the browser is done like this:

var midiInputCallback = function(status) {

if (status === true) {
// We have successfully enabled midi
}
else {
// Error midi was not successfully enabled
}
};

csound.enableMidiInput(midiInputCallback);

Midi is then received from the first connected MIDI device.


On 19 November 2015 at 12:31, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I think we should look at the code again to make ksmps independent of the web audio buffering. From a global
perspective, I cannot see that being impossible.

========================
Dr 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 19 Nov 2015, at 09:07, Ed Costello <phasereset@gmail.com> wrote:
>
> I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance.
> Ed
>
> On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
> I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:
>
>                 csoundObj.compileCSD("test.csd  --midifile=test.mid");
>
> But that don't work. Any ideas?
>
> 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

Date2015-11-19 12:41
FromEd Costello
SubjectRe: Csound Emscripten question
There are instructions to build here https://github.com/csound/csound/tree/develop/emscripten, the source is there as well, you want to look at CsoundObj.c and CsoundObj.js. They are pretty simple files where the C file wraps the Csound C API for use with Emscripten and the Javascript file just wraps the compiled C code into a Javascript object. There is also a list of methods with descriptions in the Floss manual. 
Ed

On 19 November 2015 at 13:36, Rory Walsh <rorywalsh@ear.ie> wrote:
Thanks Ed, I was afraid of that. Adding compile flags seems like it should be simple enough? If I wanted to add features, how would I go about doing it? How is this Csound js interface even built? I can't find any info on it. There seems to be no documentation on what's available or possible, or how to build it? Any ideas?

On 19 November 2015 at 12:31, Ed Costello <phasereset@gmail.com> wrote:
Yes, it would be better if it was flexible in this respect. I will add an issue to github. 
Rory, I've just checked and although there is a way to send MIDI data via a connected MIDI device, there is currently no way to send MIDI messages to Csound directly in the public API, I thought there was so apologies if I gave that impression. The only way I can think of to play a MIDI file would be to set up a MIDI loopback, play the MIDI file from one program, send it to the loopback device and get the browser to receive through that loopback device. That sounds like major hassle though. But if you were up for it, enabling MIDI input to the browser is done like this:

var midiInputCallback = function(status) {

if (status === true) {
// We have successfully enabled midi
}
else {
// Error midi was not successfully enabled
}
};

csound.enableMidiInput(midiInputCallback);

Midi is then received from the first connected MIDI device.


On 19 November 2015 at 12:31, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I think we should look at the code again to make ksmps independent of the web audio buffering. From a global
perspective, I cannot see that being impossible.

========================
Dr 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 19 Nov 2015, at 09:07, Ed Costello <phasereset@gmail.com> wrote:
>
> I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance.
> Ed
>
> On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
> I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:
>
>                 csoundObj.compileCSD("test.csd  --midifile=test.mid");
>
> But that don't work. Any ideas?
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2015-11-19 12:44
FromRory Walsh
SubjectRe: Csound Emscripten question
Thanks Ed. Should get me started!

On 19 November 2015 at 12:41, Ed Costello <phasereset@gmail.com> wrote:
There are instructions to build here https://github.com/csound/csound/tree/develop/emscripten, the source is there as well, you want to look at CsoundObj.c and CsoundObj.js. They are pretty simple files where the C file wraps the Csound C API for use with Emscripten and the Javascript file just wraps the compiled C code into a Javascript object. There is also a list of methods with descriptions in the Floss manual. 
Ed

On 19 November 2015 at 13:36, Rory Walsh <rorywalsh@ear.ie> wrote:
Thanks Ed, I was afraid of that. Adding compile flags seems like it should be simple enough? If I wanted to add features, how would I go about doing it? How is this Csound js interface even built? I can't find any info on it. There seems to be no documentation on what's available or possible, or how to build it? Any ideas?

On 19 November 2015 at 12:31, Ed Costello <phasereset@gmail.com> wrote:
Yes, it would be better if it was flexible in this respect. I will add an issue to github. 
Rory, I've just checked and although there is a way to send MIDI data via a connected MIDI device, there is currently no way to send MIDI messages to Csound directly in the public API, I thought there was so apologies if I gave that impression. The only way I can think of to play a MIDI file would be to set up a MIDI loopback, play the MIDI file from one program, send it to the loopback device and get the browser to receive through that loopback device. That sounds like major hassle though. But if you were up for it, enabling MIDI input to the browser is done like this:

var midiInputCallback = function(status) {

if (status === true) {
// We have successfully enabled midi
}
else {
// Error midi was not successfully enabled
}
};

csound.enableMidiInput(midiInputCallback);

Midi is then received from the first connected MIDI device.


On 19 November 2015 at 12:31, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I think we should look at the code again to make ksmps independent of the web audio buffering. From a global
perspective, I cannot see that being impossible.

========================
Dr 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 19 Nov 2015, at 09:07, Ed Costello <phasereset@gmail.com> wrote:
>
> I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance.
> Ed
>
> On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
> I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:
>
>                 csoundObj.compileCSD("test.csd  --midifile=test.mid");
>
> But that don't work. Any ideas?
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-11-27 19:30
FromRory Walsh
SubjectRe: Csound Emscripten question
Following on from a discussion earlier, it appears that command-line flags are ignored in the emscripten build. 

On 19 November 2015 at 12:44, Rory Walsh <rorywalsh@ear.ie> wrote:
Thanks Ed. Should get me started!

On 19 November 2015 at 12:41, Ed Costello <phasereset@gmail.com> wrote:
There are instructions to build here https://github.com/csound/csound/tree/develop/emscripten, the source is there as well, you want to look at CsoundObj.c and CsoundObj.js. They are pretty simple files where the C file wraps the Csound C API for use with Emscripten and the Javascript file just wraps the compiled C code into a Javascript object. There is also a list of methods with descriptions in the Floss manual. 
Ed

On 19 November 2015 at 13:36, Rory Walsh <rorywalsh@ear.ie> wrote:
Thanks Ed, I was afraid of that. Adding compile flags seems like it should be simple enough? If I wanted to add features, how would I go about doing it? How is this Csound js interface even built? I can't find any info on it. There seems to be no documentation on what's available or possible, or how to build it? Any ideas?

On 19 November 2015 at 12:31, Ed Costello <phasereset@gmail.com> wrote:
Yes, it would be better if it was flexible in this respect. I will add an issue to github. 
Rory, I've just checked and although there is a way to send MIDI data via a connected MIDI device, there is currently no way to send MIDI messages to Csound directly in the public API, I thought there was so apologies if I gave that impression. The only way I can think of to play a MIDI file would be to set up a MIDI loopback, play the MIDI file from one program, send it to the loopback device and get the browser to receive through that loopback device. That sounds like major hassle though. But if you were up for it, enabling MIDI input to the browser is done like this:

var midiInputCallback = function(status) {

if (status === true) {
// We have successfully enabled midi
}
else {
// Error midi was not successfully enabled
}
};

csound.enableMidiInput(midiInputCallback);

Midi is then received from the first connected MIDI device.


On 19 November 2015 at 12:31, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I think we should look at the code again to make ksmps independent of the web audio buffering. From a global
perspective, I cannot see that being impossible.

========================
Dr 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 19 Nov 2015, at 09:07, Ed Costello <phasereset@gmail.com> wrote:
>
> I think any flags sent are ignored. There are flags set internally when Csound is instantiated to make sure it has a ksmps value compatible with the Web Audio API callback. The Csound javascript API does support midi input though so if you wanted it to play a MIDI file you could send MIDI data to the Csound instance.
> Ed
>
> On 19 November 2015 at 09:18, Rory Walsh <rorywalsh@ear.ie> wrote:
> I'm just wondering if there is a way to pass command line flags to Csound on startup using the JS interface? I tried:
>
>                 csoundObj.compileCSD("test.csd  --midifile=test.mid");
>
> But that don't work. Any ideas?
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here