Cabbage Logo
Back to Cabbage Site

Midi<>osc bridge

Hi. I wonder, if it’s possible to use Cabbage as a scriptable bridge, that’ll do the conversion between my midi controller (Novation SL MkII) and DAW (Reaper), that can take OSC for control and send OSC feedback?
Is it possible to open midi ports directly from Cabbage, without using host’s midi devices?
Is it possible to start UDP client/server inside Cabbage to be able to send/receive OSC messages from Reaper?
Is it possible to send/receive osc messages with Cabbage?

If any of the answers to this questions are positive, I would be glad for a further explanations and also example scripts of how to do each part of the task.

I also wonder why Cabbage crashes so frequently? At least each time when I put a new VST inside VST folder, Reaper would crash upon scanning the folder. After that, plugin could be loaded in Reaper finely. There could be some other crashes after this, which I can’t trace for now.

The same thing happens when I’m trying to load Cabbage VST with SaviHost. It just can’t see the plugin (tried x86, x64 versions of SaviHost).

I’m sorry, if any of those questions was asked earlier. I just installed Cabbage today, so I can make midi<>osc bridge. Have bad experience using oscii-bot, VSTLua, Processing for the same purpose and now I want to try if Cabbage is capable of performing the requested task. Any help would be highly appreciated.

P.S. I’m using Windows 10 x64, latest Cabbage.

Cabbage can easily send and receive osc messages. Check out the OSC examples from the “Instructional” menu.

I’m not sure why you would want to do this. Your Cabbage instrument can receive MIDI data and then convert to OSC and send anywhere you like. While it may be possible for Cabbage to talk directly to the midi devices, it may block your host from using them.

I wasn’t aware of this issue. The editor is known to be a little flaky, but the plugins are usually rock solid. Windows has been a bit of a pain, but I’ll look into this problem on Monday. I’m currently rewriting the entire code base, weeding out any code that might lead to problems like this, and those found with the editor. Progress is slow but by the end of it I think we’ll have a much more robost and reliable system!

That’s because my MIDI controller have two MIDI ports - first for keyboard/modwheel and the second one for faders, pots, encoders and buttons. So, first port is used for perfomance and the second one is for control.
Reaper DAW can receive midi control messages, but cannot send midi feedback to the controller.
But Reaper can send feedback via OSC to OSC-enabled control surfaces, so I want second port to be seen and opened only by Cabbage, so it could read CC messages, convert them to OSC and send OSC to Reaper. Then Reaper will respond with OSC feedback to Cabbage, which would be translated to MIDI and sent to the controller, to light the LEDs and display the needed data on LCD. There should not be just direct midi<>conversion. It should be scriptable, so I could use different template, modes and shift buttons with a single midi controller to control different Reaper functions, like controlling volume for tracks in banks (1-8,9-16,etc) with only 8 physical faders. Something like this script for Ableton.

This should be a separate process, not involving Reaper’s assigned MIDI ports, either using standalone Cabbage version, VST version inside Reaper or VST version in other VST host (sadly, SaviHost cannot see VST’s, made by Cabbage).

I’m quite impressed of how you’re dealing with your software. Great attitude!

I wish it could use Lua language with the same possibilities, instead of Csound. :slight_smile:

Now I get it. Seems complicated but certainly worth a shot. I think it would be best to launch Cabbage in standalone mode and try that way. There is a chance you could use Csound’s own MIDI IO interface, but Cabbage is not designed to work this way so the results may be a little unpredictable. Cabbage basically takes care of all MIDI and audio IO, thus removing the need for Csound’s own interfaces. It also make Cabbage easier to port as a VST.

I’m not sure why Savihost is not working. I’ve used the simple host it is based on to debug Cabbage plugins quite a lot and never had issues. It would be related to the problem you mentioned in your first post. Once I address that problem it might take care of the Savihost issue.

Now, finally I have to ask why you are NOT using Lua for this? Can you not combine some of its OSC and MIDI libraries to do what you want? There is also a Lua interface for Csound. With it you can run Csound code inside your Lua script. See here.

Because I’m not a programmer myself and I want to have this bridge sitting quietly inside Reaper and do it’s job.
I’ve tried VstLua and even succesed with it, but the plugin itself is kinda buggy (abandonware, compiled from the source by some other dude long ago) and crashes from time to time. It’s also not possible to open midi devices directly from VSTLua, though api says that it should be possible.
And I’m not experienced enough to compile all the necessary libraries (socket, osc, midi, gui and others) the same way as the are embedded into VSTLua. As far as I can see, this pack was used for VSTLua’ expanded functionality, but I just don’t know how to make a solid app that would copy VSTLua’s possibilities.
I’m also looking at Ctrlr, which can load Lua scripts and trying to decide, which is better suits my needs - plain script in Cabbage, but with Csound or kinda complicated approach of Ctrlr of how to combine everything together, but with Lua scripting.

P.S. Just clicked your link, before pressing “reply” and found out that you mentioned Ctrlr in it. Sadly, it doesn’t have public API or extensive examples/tutorial for my needs.

I’ve crossed paths with the developer of Ctrlr on the JUCE forums from time to time. He seems quite approachable; open source developers usually are :wink:

Might be worth asking on the Ctrlr list what they think about what you are trying to do. It would probably be worth investigating all your options first. Of perhaps you’ve already asked there?

Atom (Roman) already implemented OSC to Ctrlr, after I’ve asked him about it, a few years ago. The problem was that I couldn’t find of how to use it properly. I’ve made some test panels without a good luck, but today I’ve found an unnofficial user manual, which is very extensive. Though it doesn’t cover the OSC part of Ctrlr, I feel like when I’ll finish reading it, I’ll be able to figure out how to complete the task.
Thank you for your kind support. If CSound’ syntax was more friendly, I would defenitely try to use Cabbage, even that I don’t need sound part of it.Thanka again, Rory.

P.S. BTW, your forum’s engine is beatuiful, in terms of UI. :trophy:

We use Discourse for the forum. All the hard work is done for us :wink: Good luck with your project. If Ctrlr doesn’t work out, we can try Cabbage.

I’m stuck with decoding string values in Ctrlr, like track names, but been able to get read any other data. Until Atom or some other Ctrlr user won’t help me, I’m stuck with Ctrlr script developement.
I would love to use Cabbage, but… CSOund syntax, you know. :slight_smile:
You’ve also mentioned that Cabbage isn’t intended to to open midi ports directly, which is kinda off. Yet, I feel like it’s possible to use then in Cabbage.