Cabbage Logo
Back to Cabbage Site

Midi Control Best Practices

Hello,

I am wondering what the best practices for midi implementation with cabbage are. When using pure csound, I would hardcode the midi implementation (channel, controller numbers ect). Of course, if I am developing a vst with cabbage, I don’t really want to do that. I am using widgets and chnget to control parameters. The user can then map the widgets to a midi controller in their daw. However, I am unsure how to best implement the midi keyboard, since I want to use the keyboard widget (which triggers csound events rather than midi events). The solution in the PadSynth.csd example seems to be to send all midi messages to one instrument that only handles midi and triggers csound events based on that midi. Is that still the best way to implement coexisting midi keyboards and keyboard widgets?

This is not correct. The keyboard widget sends MIDI data to Csound. It’s up to you how best to handle it. The boilerplate synth in Cabbage (file -> new synth) handles MIDI using the the midi IO command line flags. This lets you assign a p-field for different MIDI messages. I find this the simplest way to handle MIDI because you don’t need to write any MIDI specific code in your instrument.

This is also a valid approach. It might give you better control over the incoming MIDI data but it’s also a little more work to get right.

Snap. I’m glad I don’t have to do this any more. With MIDI mapping so accessible in host DAWs, it’s one less hardship to worry about.

1 Like

Ah, thank you! Now I understand how it works!