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

Application for composing #73

Closed gogins closed 5 years ago

gogins commented 5 years ago

This would supersede CsoundHtml5 and the Csound for Android application, and be somewhat similar to Common Music/Grace or Nyquist in spirit. There might also be a "headless" version to replace csound.node.

This would resemble CsoundHtml5 but would run on both Linux and Android. It would support JavaScript and Common Music for composition, and have an interface so that could be extended. It would support Csound for synthesis, and have an interface so that could be extended. It would run HTML, and that would be the only graphical user interface, but there would be hooks to the composition and synthesis interfaces.

The basic idea is to reproduce my full composition studio on an Android tablet, in an extensible way.

gogins commented 5 years ago

Look at Kivy for a cross platform user interface.

gogins commented 5 years ago

I am looking into using JUCE. It promises to build both Linux and Android apps from the same code. The license problems may not be as severe as I thought. I think that by using Csound only as system libraries, or by using the option "later version of license" for Csound code, I can produce a legal application.

gogins commented 5 years ago

I don't think JUCE is a good idea, just a feeling.

gogins commented 5 years ago

It is essential that there be one instance of CSOUND in every dynamic language's runtime context, so that e.g. an HTML GUI can communicate with the instance of Csound that was created by the application, and so that different scripting languages will communicate with the same running instance of Csound.

This should all be managed by CsoundProducer, which will make the various language runtimes and contexts available to the application, and also be usable from plain C++.

gogins commented 5 years ago

https://code.tutsplus.com/tutorials/create-a-material-design-tabbed-interface-in-an-android-app--cms-30120

gogins commented 5 years ago

My bete noire has always been creating software that neither I nor anybody else ends up using.

The goal here is to achieve a way of editing and rendering Csound/HTML5/Common Lisp pieces on both Android and Linux (and ultimately OS X).

Using csound.node is a mistake because "require" does not exist on Android or in plain Web pages.

Using Qt is a mistake because of the God-awful QtWebChannel.

The evidence of my mess is get_csound.js. This should be replaced by just csound.js and require would never be used.

Ideally, all environments would work identically to WebAssembly, except that the filesystem would be accessible on Android and Linux, and accessible via the fs module in NW.js.

gogins commented 5 years ago

To minimize the work and ensure the objective I will first do the Android app, and then either run it directly on Linux using Anbox or port it. I can image adapting the existing Csound for Android app as follows:

  1. Change to CsoundProducer and add Common Lisp/nudruz support.
  2. Change to a tabbed layout above the messages window. The tabs would include Editor, HTML, Sliders, and Help.
  3. Add x86_64 to the native targets.
  4. Bring the native builds into Android Studio using CMake instead of ndk-build.
gogins commented 5 years ago

Closed by mistake. I have updated CsoundForAndroid to build for the x86_64 architecture. The Csound for Android app thus built runs on Anbox on Ubuntu. However, only the native Csound pieces seem to work. But that may be due to missing opcodes. It is. It all runs now.

gogins commented 5 years ago

I am not decided as to Python and LuaJIT support for Android.

gogins commented 5 years ago

I changed my mind. The strategy is an all new app for Android with much code pasted in from the old app, and an upgrade and rename for CsoundHtml5.

gogins commented 5 years ago
gogins commented 5 years ago

https://github.com/JetBrains/kotlin-native/blob/master/INTEROP.md

gogins commented 5 years ago

In anbox the Android WebView will not display external URLs.

gogins commented 5 years ago

I have not been able to get CsoundHtml5 to work very well. It consistently freezes when rendering a Csound piece that uses HTML. This may be related to the following Qt SDK bug: https://bugreports.qt.io/browse/QTBUG-59922.

I have decided not to pursue CsoundHtml5 further, but to set it aside, remove it from my packages, and maintain csound.node in preference. I have switched from using Lua to using Bash to run NW.js when rendering pieces with csound.node. This is easier to understand and keeps the editor working while NW.js is working, unlike the previous Lua solution.

gogins commented 5 years ago

I will proceed by updating the Csound for Android app as follows:

gogins commented 5 years ago

I am closing this issue and re-opening it as a new issue that will be less confusing.