rorywalsh / cabbage

Framework for developing audio plugins with the Csound programming language.
http://cabbageaudio.com
GNU General Public License v3.0
503 stars 35 forks source link

Cabbage widget to edit/save Csound code #148

Closed gogins closed 4 months ago

gogins commented 5 months ago

I am requesting a new Cabbage widget, a text edit box that will enable users to edit the Csound source code of a plugin, and save it back to the plugin's CSD file. Ideally, the editor would have a Save button, but alternatively, it would suffice to save the edited code every time the plugin is stopped, and to re-load the edited code every time the plugin is started.

rorywalsh commented 5 months ago

Why not open the .csd file in a proper editor and edit it there while the plugin is running? Add autoUpdate() to your form declaration and it will automatically recompile each time you save changes. Note that if you add or remove widgets you will need to re-instantiate the plugin as widgets are tied to plugin parameters, and as you will know from your own experience, these cannot by altered dynamically while plugin is loaded 👍

gogins commented 5 months ago

I did not know about auto update, I will try that.

On Thu, Feb 8, 2024, 16:19 Rory Walsh @.***> wrote:

Why not open the .csd file in a proper editor and edit it there while the plugin is running? Add autoUpdate() https://cabbageaudio.com/docs/form/#autoUpdate to your form declaration and it will automatically recompile each time you save changes. Note that if you add or remove widgets you will need to re-instantiate the plugin as widgets are tied to plugin parameters, and as you will know from your own experience, these cannot by altered dynamically while plugin is loaded 👍

— Reply to this email directly, view it on GitHub https://github.com/rorywalsh/cabbage/issues/148#issuecomment-1934473370, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQIGJNWR3LPLSDZVIUXTTTYST3I3AVCNFSM6AAAAABC74EZ3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZUGQ3TGMZXGA . You are receiving this because you authored the thread.Message ID: @.***>

gogins commented 4 months ago

I tried this. I use Visual Studio code as an editor. First I tried with auto-save enabled in the editor. The Cabbage synth played as it should, but editing the .csd file caused Reaper to either freeze or crash. Next I tried with auto-save disabled, using a manual save after my edits. This casued Reaper to freeze or crash, but sometimes Reaper continued to run but the Cabbage synth went dead and would not play again until Reaper was closed or restarted.

I wll try again with a simpler Cabbage synth that I will post here.

gogins commented 4 months ago

With a Cabbage synth that contains only one instrument and no signal routing, the auto-save and recompile .csd feature works as advertised.