Default Response bytes question

So far, most of the devices I’ve been working with use a series of constant bytes as part of the initial sysex message. It has been sufficient to distinguish between them all, even between different models from the same manufacturer.

However, I started looking at a Korg device and the first byte (post-F0) is a constant (42h) but the next byte is a value with the MIDI channel embedded into the bottom 4 bits. Then the 3rd and 4th bytes are constants as expected.

To handle this, I believe I need a LUA function to handle the (constant | MIDI Channel) byte, but I’m not sure how to set that up since the user will be picking the MIDI channel from an on-screen encoder or possibly loading a saved version from a snapshot.

Anyone done this before?

Iirc it is similar to the Waldorf pulse, where the device ID (value between 0-126, set on the device, where 127 is the broadcast ID. Not to be confused with the sysex typical device ID), is at a similar position. If so, have a look at @NewIgnis pulse preset

1 Like

I’ll take a look. I do see that convention used from time to time. With the Korg, the MIDI channel is in the lower 4 bits of that byte, so channel 1 would be coded as 0x30, channel 2 as 0x32, etc up to 0x3F for channel 16

1 Like

Sorry for late reply, I’ve been out of E1 for a while.

Take a look at my last Korg KingKorg version Electra One App

In most Sysex’s you’ll find a function for it:
image

The function adds ‘devChannel’

function getChannelByte(device)
  return (0x30 + (devChannel - 1))
end

whereby devChannel is read out of device 1 as follows at the beginning of the lua. So I’m assuming the user will not change the ID of the device, but he can change port and midi channel at his desire.

deviceId = 1 -- the device ID used in the E1 preset
device = devices.get(deviceId)
devPort = device:getPort()
devChannel = device:getChannel()