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

Save csd file from playpen performances, standalone csound will use the saved channel values #175

Closed gogins closed 3 years ago

gogins commented 3 years ago

Currently, running a Csound piece written in Python in the SciTE "playpen" will save and restore channel values set during performance.

Change the way this works, so that channel value "preset" saved from a Python piece will automatically be read and restored from an automatically saved csd file and preset file.

In other words, performing a Python piece with a UI will enable saving a picece.py.csd file and a piece.ui.channels preset file. When the piece.py.csd is performed standalone, it will automatically read piece.ui.channels and restore the channel files in the orchestra header.

This might be tricky because of chnexport.

Should be doable by sending lines from readfi to evalstr at the end of the orchestra header. That means changing the playpen code to write not JSON but:

gk_mychannel = myvalue
...
gogins commented 3 years ago

String values (but not channel names) must be quoted.

gogins commented 3 years ago

Works now. Will port back from michael.gogins.studio.