You are reading a single comment by @indianajones and its replies. Click here to read the full conversation.
  • Ahh ok, so you're basically saying:

    • There's some input device which is wired up to an Espruino WiFi (not via MIDI)
    • You want the Espruino WiFi to create MIDI data based on the input from that device and then send it over WiFi?

    The existing MIDI module only receives MIDI commands by the look of it, so if you're sending them you'll have to roll your own, but that's not too hard... And I assume that MIDI over TCP really is just sending the same raw MIDI data but over TCP not Serial?

    All you need to do is follow the code at https://www.espruino.com/Internet#socketĀ­s to create a socket connection, then when you're connected you send the raw MIDI data with client.write(); - you just want to make sure you send the data as binary, so something like:

    function sendNote(channel, on, pitch, velocity) {
      socket.write(E.toString([
        (on?0b10010000:0b10000000)|channel,
        pitch,
        velocity]))
    }
    
  • Yes, MIDI over TCP is just the same MIDI command sequence, only over a TCP connection instead of serial connection. I'm sure there's some kind of "hey this is a MIDI packet" header or something, which I'm still researching, but the MIDI part is typical MIDI.

    Thanks for the info, I'll start working on it. And I'd be happy to submit the module to the Espruino project when I'm finished.

About