Csound Csound-dev Csound-tekno Search About

Re: [Csnd] [EXTERNAL] [Csnd] csound.js ReadScore method

Date2020-11-25 15:43
FromJean Basile Sosa
SubjectRe: [Csnd] [EXTERNAL] [Csnd] csound.js ReadScore method
It's the very first beginning but I hope to share this project when it will be completed... 

The next step is to send values in time of each i score event to the web UI, but after having take a look of all csound.js methods I wonder how I can do this. 

Maybe would you suggest me something?

Thanks again,

Jean Basile

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

Date2020-12-18 16:35
FromSteven Yi
SubjectRe: [Csnd] [EXTERNAL] [Csnd] csound.js ReadScore method
Sorry for a late reply!

One option to sync up Csound with visual is to use channels. It is not
perhaps the most elegant and that we may want to add a host event
opcode in the future, but for now you can see how this might work here
in this p5.js sketch:

https://editor.p5js.org/kunstmusik/sketches/K0t1doE6J

You should see the visual change with the amplitude envelope. You
might try various strategies for channel values and signaling to the
host.

For others, what do you think about something like this:

[csound code]

instr x
  host_event "eventName", 0,1,2,3,4,5
endin

[host code]
// JS
csound.addHostEventListener(evt => {
  console.log(`event ${evt.name} with args ${evt.args}`);
});

// C
typdef void (hostEventCallback*) (CSOUND*, CS_VARIABLE**);

void myHostEventCallback(CSOUND* csound, CS_VARIABLE** args) {
  // CS_VARIABLE would allow query of CS_TYPE, would need additional
API for querying data structures
}
csoundAddHostEventListener(csound, &myHostEventCallback);


On Wed, Nov 25, 2020 at 10:43 AM Jean Basile Sosa
 wrote:
>
> It's the very first beginning but I hope to share this project when it will be completed...
>
> The next step is to send values in time of each i score event to the web UI, but after having take a look of all csound.js methods I wonder how I can do this.
>
> Maybe would you suggest me something?
>
> Thanks again,
>
> Jean Basile
>
> 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

Date2020-12-19 05:28
Fromandy fillebrown
SubjectRe: [Csnd] [EXTERNAL] [Csnd] csound.js ReadScore method
You can override the host console function and use the Csound print opcodes to send strings to it. Send JSON from Csound to host to simplify parsing and filtering.


On Fri, Dec 18, 2020 at 11:35 AM Steven Yi <stevenyi@gmail.com> wrote:
Sorry for a late reply!

One option to sync up Csound with visual is to use channels. It is not
perhaps the most elegant and that we may want to add a host event
opcode in the future, but for now you can see how this might work here
in this p5.js sketch:

https://editor.p5js.org/kunstmusik/sketches/K0t1doE6J

You should see the visual change with the amplitude envelope. You
might try various strategies for channel values and signaling to the
host.

For others, what do you think about something like this:

[csound code]

instr x
  host_event "eventName", 0,1,2,3,4,5
endin

[host code]
// JS
csound.addHostEventListener(evt => {
  console.log(`event ${evt.name} with args ${evt.args}`);
});

// C
typdef void (hostEventCallback*) (CSOUND*, CS_VARIABLE**);

void myHostEventCallback(CSOUND* csound, CS_VARIABLE** args) {
  // CS_VARIABLE would allow query of CS_TYPE, would need additional
API for querying data structures
}
csoundAddHostEventListener(csound, &myHostEventCallback);


On Wed, Nov 25, 2020 at 10:43 AM Jean Basile Sosa
<sosa.jeanbasile@gmail.com> wrote:
>
> It's the very first beginning but I hope to share this project when it will be completed...
>
> The next step is to send values in time of each i score event to the web UI, but after having take a look of all csound.js methods I wonder how I can do this.
>
> Maybe would you suggest me something?
>
> Thanks again,
>
> Jean Basile
>
> 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