Closed gogins closed 3 years ago
The coloring schemes must be nice for:
Csound currently has variables in an eye-watering dim violet. Needs to be pale grey like C++, or something. Opcode names need to be a slightly different color. Csound colors global, i-rate, k-rate, and a-rate variables different. I have much improved these colors.
As for a visual form builder, I will try a bit harder. If I can get something acceptable I'll remove the playpen, because for the other things SciTE is better, more reliable, and more easily maintained. Possibilities to investigate:
Questions for Cabbage:
The Qt designer program looks very good, not surprising. I will see if that can be used with pyside6 or something.
This must be done: https://stackoverflow.com/questions/68528717/environment-variable-pyside-designer-plugins-is-not-set-bailing-out
This is starting to work. I need to refine the pattern and handle saved control values.
How annoying! Signals from sliders are just an int value. Not a float, and no hint of which widget emitted the signal.
Solution: encapsulate the widget, the channel name, and csound in a Controller class that will be the slot for the widget signals.
It may be possible to tag control channel widgets somehow to enable this to be set up programmatically.
With Qt the widgets and signals suitable for automatically setting up control channels have changed:
The post_process
function fails unless the Csound options include -RW
for rewriting the soundfile header length on every write. I have added these options. Evidently Csound will not fix up the soundfile header at all without these options.
The Gtk playpen always can rerun a piece, the Qt playpen can seldom rerun a piece. The Gtk one uses CsoundThreaded, I have tried the Qt one with both ctcsound and CsoundThreaded but it doesn't work either way.
This is interesting, but didn't help: https://github.com/csound/csound/issues/1464.
In the failed second run, the instruments don't print channel changes and don't render audio.
I suppose if I have a theory here, it's that the stop call finished but then csoundPerformKsmps is still called or has not returned, and this messes up the subsequent shutdown and restart.
I redid the playpen example with CsoundThreaded performing a csd file and it restarted just fine.
This indicates an unfortunate interaction between Csound and PySide6.
Possibly I should try changing PySide6 for the Gtk system with SciTE. I did that, and it solved the problem, at least using CsoundThreaded. I will now try it with ctcsound.
I prefer the default look and feel of Gtk, it is more refined, but I prefer Qt Designer to Glade. Oh well.
This leaves me with a new problem, the code for showing the widgets and running Csound is fairly extensive and it might be wiser to encapsulate in a new module. Perhaps if I design and name things wisely I won't have to break it in the future.
I'm closing this now. No doubt there are a few rough edges but these will have to be found out by actually using the playpen.