gogins / csound-extended

Extensions for Csound including algorithmic composition, Android app, and WebAssembly.
GNU Lesser General Public License v2.1
40 stars 1 forks source link

Add Score::toJson and a JavaScript class for displaying that JSON as a 3-D piano roll #191

Closed gogins closed 2 years ago

gogins commented 2 years ago

The purpose is to enable using the C++ CsoundAC library or other C++ code to generate scores using the Clang opcodes, and then to call JavaScript in a Web page created with the WebKit opcodes for displaying that score as a three-dimensional piano roll.

gogins commented 2 years ago

I am now getting a JavaScript score into the browser, using a lame polling hack. So now I can move ahead.

I think it will suffice to enqueue scripts from the webkit_run_javascript opcode until the load_finished state is signalled by callback. Then the scripts can be executed.

gogins commented 2 years ago

Working now but would prefer an alternative to animate, and the grid size and score bounding box size don't seem to match.

gogins commented 2 years ago

This is all fixed now. I was using the wrong field of the JSON events for time. Animate is fine, it can be throttled.