Cabbage Logo
Back to Cabbage Site

Sending MIDI and listening to multi part OSC. Win 64bit (resolved)

Hi,
I’ve changed the gate example to send a midi message when it is triggered, so I can have an audio to midi trigger, for drum triggering. However this only works the first time. I looked into it more, and if I build the midi out example with no changes and connect it to a synth or the midi monitor example it doesn’t work for correctly when pressing the keyboard. I’ve tried the latest windows beta and the current release build. I’m running windows 10.

I also have an issue with only the last variable in a received OSC message being received.

     kk        OSClisten    gilisten, "/midi", "iiii", kst, kch, kd1, kd2
    
    if (kk == 0) goto done
    
    printks "kst = %i, kch = %i, kd1 = %i, kd2 = %i\\n", \
             0.1, kst, kch, kd1, kd2
    
    midiout    kst, kch, kd1, kd2

This is basically the default example of OSC from the csound site, with midiout added. If I don’t have the midiout it behaves the same. Only the kd2 variable has a valid value. If I change the types or add more or less values it’s always the same. I’ve tried sending from c with liblo and python with python-osc, with the identical outcome. I’ve got no idea if I’m doing something wrong or if this isn’t supported.

Thanks.

I’ll look into the MIDI issue, but I’m not sure about the OSC problem. Where are the OSC messages coming from?

…looks like there is an issue with MIDI with this latest build. I made some changes to allow Cabbage to intercept all types of MIDI messages, but it looks like I did so at a cost to its output. Leave it with me.

…actually, it’s working Ok, but there was an issue with the MIDI_Out instrument. Can you test the one attached below.

MIDI_Out.csd (656 Bytes)

Here’s a MIDI version of the gate instrument. You’ll see that instrument 1000, the main instrument now starts instrument 1, which outputs MIDI values on channel 1. Be careful here, as it can generate a lot of MIDI notes in quick succession. BTW, I’ve no idea how to use this instrument in a DAW. I just tested with CabbageStudio when routing MIDI and audio is a drag and drop process.
MIDIGate.csd (11.6 KB)

Thanks for the quick response! This attached csd works in Csound.

osc_out.csd (1.4 KB)

You can test it with oscsend from liblo, or anything else that sends osc.

under mingw64 / msys2, the double slash is needed on midi to escape mingw path expansion:

oscsend.exe "osc.udp://localhost:47120" //midi iiii 144 1 50 120

if it’s compiled natively it should work with:

oscsend.exe "osc.udp://localhost:47120" /midi iiii 144 1 50 120

Which confused me a lot until I just printed what was received.

Great, I can mark this thread as resolved.