Cabbage Logo
Back to Cabbage Site

User selectable external editor?

As far as I remember, all I need to do is add support for named radiogroups :wink: How hard can it be :rofl:

1 Like

Oh yeah, now I rememberā€¦

Iā€™m just wondering if we canā€™t do this with Csound/Cabbage without having to tear up some internal stuff? The following code shows how it can be done with Cabbage, but there is an outstanding issue. Clicking on a button when it is on will cause it to go off, which ruins the illusion! I must think about a way of getting around that. Note this example uses Csound 6.14 and the new chngetk opcode, which takes an array of channels, and outputs to an array.

radioGroups.csd (1.7 KB)

I feel like weā€™ve had this exact conversation somewhere before, tho I looked and couldnā€™t find itā€¦ or maybe Iā€™m just misremembering. Ironically tho, I think that you had a nearly identical example at the time too. :rofl:

Which, btw this example doesnā€™t compile on 6.13 for some reason involving the chngetkā€¦ but thatā€™s neither here nor there for this discussionā€¦ I get the gist of what youā€™re suggesting, and I think I could get it to work.

I donā€™t mind using a method like this to get it to work for me, but I donā€™t particularly like it either. I feel like radio buttons is a common enough function that it should not need such clunky and customized code. Long term I do think itā€™s absolutely worth the effort to keep as much feature equivalence between imported widgets and normal ones as possible!

But again, this entire conversation feels like deja vu.

That saidā€¦ itā€™s dangerous to get me looking back through my old posts. So many great ideas Iā€™ve forgotten about. :stuck_out_tongue_winking_eye:

I do like the idea, but it will involve quite a lot of work to get it done. The underlying JUCE mechanisms for radiogroups only take integers, so adding this will involve a fairly major rewrite of a lot of code that I know works well. Iā€™m hesitant to mess with it.

Hrmā€¦ I donā€™t know a lot about the underlying JUCE/Cabbage infrastructure, and it may be an obvious/overly simple suggestionā€¦ but what if radiogroups still behave as before, with numeric group IDsā€¦ but imported radiogroups have the text prefixes from channel names reduced to ascii values (or a checksum of them) to create the numeric equivalents to their existing values? :thinking:

So for example, an imported button set could define itā€™s radiogroup(55), but when actually imported it has a channel(ā€œmainā€), which might reduce to ā€œ1234ā€, giving you a final radiogroup of 123455?

I think this would keep groups together, while still guaranteeing separation between multiple groups. I have no idea if itā€™s actually feasibleā€¦ just brainstorming here.

That was my first thought on this the first time it popped up. I will look into this approach again. I think I got something working and then realised Iā€™d somehow painted myself into a corner.

I gotta question, does this supersede CabbageLite, or is there a fundamental difference Iā€™m missing?

Iā€™ll write a post about this now, as it seems I should make the situation clearā€¦

Hey Rory! Sorry I didnā€™t get back to you on this earlier. It took me way too long to get Cabbage installing on my Linux box, and once I had, it took me a good week to realize the package name had a capital C in it. But abhorrent brainfarts aside, Iā€™ve got it running now, and the ā€œauto-load from diskā€ feature seems dead.

When I first enable it, and write something new to the file, it says I need to open a file first, even though Iā€™ve already got one open. I close the file, and open it again, and from there nothing happens when I write to the file. It just doesnā€™t automatically load it. Iā€™m using version 2.3.44 on Manjaro Linux.

What editor are you using to edit the .csd files? I canā€™t recall if I tested on Linux, but Iā€™m sure itā€™s working on other platforms.

Iā€™m using vim. Is there a specific trigger that it might not be hitting when writing?

Let me set up my Linux box. Iā€™ll get back to you in a few momentsā€¦

[edit] just building the latest tipā€¦

1 Like

What version of Cabbage are you using btw? You can find out in the ā€œAboutā€ menu commandā€¦

Itā€™s working here for me? Iā€™m on 2.3.44, which is the latest build. I open the file I want to edit in Cabbage, and then in my test editor. I then launch the file in Cabbage by hitting Ctrl+S. I then go back to my editor. From thereon in all changes appear in my Cabbage instrumentā€¦

Is this not working for you?

Using the start/stop button apparently isnā€™t quite the same as Ctrl+S. I was avoiding using Ctrl+S so it wouldnā€™t overwrite the changes I made in the other editor. But yes. That is mostly working. I do still randomly get a popup saying I need to open a file first, after which it stops working, but if I press ok, go back to Cabbage and hit Ctrl+S, it loads and works again for a while.

I havenā€™t found a clear pattern for what causes the popup yet, other than maybe spouts of inactivity without writing to the file? Not sure.

If you can recreate it let me know. I can look at a fix. It sounds pretty randomā€¦?

Will do! It seems pretty random right now, but nothing ever is.

I donā€™t know if this is helpful or will even work for your use case, but when Iā€™m using an external editor, I prefer to use the CabbageLite binary instead of the full version. It doesnā€™t clutter up my workspace as much since I donā€™t have a need for the internal editor and file management. Iā€™m pretty sure itā€™s packaged with all cabbage releases for now, but keep in mind Rory said heā€™ll be working to integrate the two into a single binary soon.

I donā€™t know if that would work for your workflow, perhaps you need some of the additional functionality of the full cabbage app. But FWIW I donā€™t encounter issues like accidentally overwriting files or being told a file isnā€™t open.

Hereā€™s a screenshot. CabbageLite floats as ā€œalways on topā€, and Iā€™m able to still edit in the background, save, and the changes immediately render.

1 Like

Yeah, I checked it out since you mentioned it earlier in the thread, and Iā€™m using that now! Itā€™s real handy! :slight_smile:

1 Like