Closed gogins closed 2 years ago
Always keeping in mind, this stuff already has far too many dependencies, and I have just added quite a few for the Clang opcodes.
Seems to me this can be done with the Chromium Embedded Framework and calling CefDoMessageLoopWork
on a timer or in csoundPerformKsmps
.
There would opcodes to interface with CEF. These require thought. A C++ interface could also be supported for the Clang opcodes.
But the WebKit browser might be a better choice because CEF involves multiple processes. This can probably be adapted: https://wiki.gnome.org/Projects/WebKitGtk/ProgrammingGuide/Tutorial.
Or better yet the https://github.com/WebKit/WebKit/tree/main/Tools/MiniBrowser. If I can get this up in Csound I can proceed.
Here are my design principles for the computer music playpen, in other words, for extending my toolkit for algorithmic composition and synthesis:
These principles follow from developing or contributing to many front ends for Csound that I have ended up not using. Only C++, Python, and HTML5 have I used much.
Similar tendencies can be observed e.g. in SuperCollider, ChuCK, Pure Data, etc.
Building WebKit from source did not work out of the box for me at all. The MiniBrowser did not build out of the box.
I will see how many files are involved in the MiniBrowser and try to build it against the system packages for WebKit. If I can, good, if not, I will try the simple example. Not so many files...
Gtkmm doesn't wrap WebKit, but see this; https://stackoverflow.com/questions/17039942/example-of-using-webkitgtk-with-gtkmm-3-0. Worked right out of the box.
I have completed a usable version of WebKit opcodes for Csound, that constitutes my rethought design for now. Moving on to compose some music this way. The takeway is this:
The general philosophy is now to push all software used to make music with Csound down into Csound itself, in the form of plugin opcodes. Everything is compiled at run time by Csound, by the embedded Clang JIT compiler, or by the embedded WebKit browser.
In this way, Csound itself is the only tool, or the top-level tool, used for composing.
Ideally all pieces run from a standard code editor, all code is contained in one Csound .csd file, and HTML5 is supported. On reflection, I think this would be better than GTK.
The basic principle, based on much contrary experience, is that all Csound integrations should be implemented and used as Csound plugin opcodes. Only this guarantees that every part of a piece can be written in a .csd file.