| 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 |