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