Solved: Send midi from custom module

Hi there,

i'm trying to set up a widget, that sends multiple values to a module. Based on the values i want to send midi notes to a daw.

What i did so far:

  1. Set up a button

grafik

  1. Setup a custom module:
module.exports = {

    oscOutFilter: function(data) 
    {
        var {address, args, host, port} = data
  
        if (address == '/fnord') {
            // var arg1 = args[0].value
            // var arg2 = args[1].value

            send('midi:loopMIDI', '/note', 1, 23, 100)
            return // bypass original osc message
        }
        return data
    }
  }

I can get inside the loop and access the send values, but i also get this error:

(ERROR, OSC) Malformed address: 1

So i assume the module want's to send OSC instead of MIDI. Question is: how to tell the module to send MIDI?

Thanks for any help :slight_smile:

Hi,

I believe the send method takes 6 params. Try this:
send('midi', 'loopMIDI', '/note', 1, 23, 100)

An alternative you can use as well is the following:

sendOsc({
        address: "/note",
        args: [
          { type: "i", value: 1},
          { type: "i", value: 23},
          { type: "i", value: 100 },
        ],
        host: "midi",
        port: "loopMIDI",
      })

Cheers,
DMDComposer

Hey DMDComposer,

i tried the first solution and it works, great :heart_eyes:

Thank you so much for your help, i bow before you :slight_smile:

1 Like