Send SysEx data to different devices

I’ve never needed to work with more than one instrument—which is obviously called devices—simultaneously on the E1 before.

Today I tried it. I spent a lot of time reading the manuals and searching the forum. Unfortunately, I couldn’t find an example that fit my—in my personal view, very simple—requirement. I found the tutorial “[LUA] Send multiple,” but that only covers different ports, not devices. I’ve now set up a second device in E1, #2.

In my humble simplicity, I imagine one could write:

midi.sendSysex(PORT_1, DEVICE_2, {67, 16, 127, 28, 04, 00, 00, 00, 16})

…but unfortunately, that doesn’t work. During my experiments, I even discovered that USB-connected ports are recognized in the editor.

Again, since most devices are connected via USB nowadays I’m wondering if these ports couldn’t be directly recognized as separate devices. But that’s probably all far too simple, yet apparently too complicated for me. :man_shrugging:t3:

I simply want to send a MIDI command via a function, as in the example above which works for device 1, and send a few similar ones to a different device.

It would be great if someone could “enlighten” me. Maybe only with a hint to the manual reference or a forum post that contains a simple working example. Thank you in advance.

Hello, as Sysex devices have specific addresses (set by the manufacturer ID and device ID), could you not just forward all messages to both devices? Device A will ignore any messages meant for Device B and vice versa.
This is assuming you can send multiple Sysex messages from one control on the E1 (If so, I guess you would just paste one after another).
I find the Visual Editor is useful for getting started with a message and the JSON is quicker for copy/pasting/editing.

Here’s some info on Sysex formatting in case you are new to it:

Basic SysEx Structure

  • Start: F0 (hexadecimal)

  • Manufacturer ID: A 3-byte code identifying the device manufacturer (e.g., 41 for Roland).

  • Device ID (Optional): Identifies a specific device on a channel (e.g., 7F for universal, 00-7F for specific).

  • Data Bytes: The actual command and parameters, using values 00-7F.

  • Checksum (Optional): A calculated value (often Z in editors) to verify data integrity, placed before F7.

  • End: F7 (hexadecimal)

Thanks @J-Ox for your answer. I’m not really new to SysEx and know these facts. :wink:

If only the E1 would send commands to multiple devices simultaneously! But it doesn’t. At least mine doesn’t. Using a MIDI monitor, I can confirm that all MIDI data is being sent to only one device, presumably by default.

And even if your suggestion worked for SysEx data, it wouldn’t be possible to use simple CC commands in the same way, right? So there must be a way to specify which device the data is sent to.

It would even be helpful to know if I could use one of the existing presets as an example to see how it works. But unfortunately, I don’t have time to check them all. :man_shrugging:t3:

I’ve not played with it but there’s an option to control existing knobs/parameters on the E1 (performance page), so you may be able to assign one control to many that are already set up. For instance, the ‘new control’ affects VCF, VCA & Reverb amount all with one turn (and each affected control could be for a different synth).

1 Like

Sysex commands are like broadcasts; they are sent to all devices, as a kind of ‘to whom it concerns’.
That is why these commands first start with a byte indicating the brand of the device you talk to. Brands will immediately disregard someone else’s sysEx message.

The rest of the message construction is up to that manufacturer to ensure the message for his instruments are understood correctly. Typically the subsequent bytes will identify model and submodel for that reason.

Good implementors will also provide a sysEx deviceID, you then need to set on both sides (instrument and E1). This is done in case you have more than one instrument of the same brand, model and submodel to distinguish between them. Without it, both instruments would handle the same sysEx command, which is usually not desired.

But there are still manufacturers out there that don’t respect those rules, and then end up with issues once customers buy multiple instruments from them.

Anyway, the only traffic control variable you have in the command, is the physical port you want the message to be sent out on. Any E1-device you have in your preset will typically be assigned to one of two ports. Example:

So be sure you transmit your message to the same port your instrument is connected to.
Furthermore:

  • the internal MIDI routing in the E1 might influence that behaviour, but I’m not acquainted sufficiently with that part of the E1 to guide you there.
  • be sure you don’t have any sysEx filters set on the physical path between the E1 and the instrument, that might block any sysEx traffic.

An example of such message:

First of all, I insert same initialisation on the device I work with in LUA:

local deviceId = 1
local deviceSysex = parameterMap.get(deviceId, PT_VIRTUAL, 35)
local devPort = devices.get(deviceId):getPort ()

Above, I set my port variable to E1’s device nr 1.
You see I also have the sysEx device Id set up via control 35, so I read that one too in memory

 midi.sendSysex (devPort, {0x43, 2*16 + deviceSysex, 0x5C,0x00,0x00,0x00})

The example above is for a Yamaha (0x43). As it is for an AN1X, it expects as second byte 32+deviceSysex, and as third byte the constnat 0x5C.
The rest of the message is payload (in this case 0x00,0x00,0x00)

1 Like

Thank you so much @NewIgnis.

I think I am fine with the SysEx basics. Today I just tested some things again and recognized that I obviously had an external MIDI routing issue. I now see that messages are sent to all connected instruments on the same port simultaneously.

Just to confirm I got this right:

Is the only separation of MIDI messages for multiple instruments connected to the same port (1 or 2) for i.e. CC data the MIDI channel?

The device ID in your example: Does it refer to this ID (#3 in my example)?

good questions
.

  1. Yes, for MIDI CC, RPN and NRPN signals, the separation for multiple instruments is only the MIDI channel. If you need to address more than 16 instruments, you need extra separate transmission paths. That’s one of the reasons Martin gave two DIN MIDI OUT ports to his Electra one. Now you can control 32 MIDI channels.
  2. Yes, the concept of devices within the Electra One, is to be compared with an ‘instrument’ you want to assign its own channel and port to. That’s is why it is so easy on the Electra one to make one preset that controls multiple instruments via CC. My example referred indeed to deviceId 1, because I use that Device as a default in all my presets. So if I want to give one of my instruments a different MIDI channel I don’t change the device in all Electra controls, bur rather the Port and MIDI channel assigned to device 1.

in my example the ‘deviceSysex’ corresponds to with the MIDI standard usually refers to as a (optional) differentiator in sysEx messages

1 Like

Hi @hape, the number shown on the device selection list is the MIDI channel. It is a good point to have the device Id visible in the editor too. I will add it there.

From the above communication, I assume @NewIgnis @J-Ox helped you to get it going, right?

The list of USB devices you mentioned in your first post is what editor sees because it it running on the computer. Electra does not have access to those unless you route Electra’s Port 1 / 2 to them on your computer.

1 Like

Thanks a lot again @NewIgnis and @martin for your answers. Much appreciated.

Unfortunately, I have to focus on different work starting today and will not have the chance to check something or get back to your answers. I will do as soon as I can.

1 Like

Now is the time for me to get back to this topic. :wink:

If I understand correctly the MIDI Ports are kind of “hard-wired”. Port 1 uses the USB connection and Port 2 DIN MIDI. It is not possible to use i.e. both Ports on the USB connection on the E1 internally. Is that correct?

I’m pretty sure that I still didn’t get the idea behind devices. Taken from the manual:

Device

An identification of the synthesizer, sampler, VST plugin, or any other MIDI device where the MIDI messages generated by the Control will be sent. An example of a device is “Yamaha DX7, Rack 1”. The device represents a particular synthesizer connected to a MIDI port and channel.

Synthesizers, samplers, plug-ins, and so on are mostly MIDI multitimbral these days. This means they receive MIDI signals on up to 16 MIDI channels simultaneously. If I understand correctly, and I want to use two types of these instruments—I could also call them devices—I need to connect them to USB for one and DIN MIDI for the other.

If I connect older instruments that aren’t MIDI multitimbral and only receive one channel, I can, of course, use multiple instruments (devices) per port. Since the separation in both cases is defined by the chosen port and MIDI channel, what additional advantages do “devices” and their ID’s offer?

Apologies for the maybe stupid question but even after searching the User Guide and the API-Lua Extension I didn’t find an answer.

It’s different : an E1 Mk1 or Mk2 has 4 DIN MIDI connectors : Pair 1 MIDI In/out and Pair 2 MIDI In/out.
These are your 2 pairs.
I can’t tell you much about the USB in the regars, because in my set-up the USB is only used to connect to the PC for transmitting presets, and the DIN MIDI connector are the ones used to connect to my (physical) MIDI instruments.
Since each MIDI pair can address 16 channels, the two of them together delivers you up to 32 MIDI channels to choose from.

A E1-device is a combination of one such port with one such MIDI channel. IF you therefor want to address 3 MIDI channels on one single phycial mutlitimbral synth, then for the E1 you will use 3 ‘devices’.
"
From the manual " The device represents a particular synthesizer connected to a MIDI port and channel.

I you use all 16 channels on one multitimbral synth at once, then you will ‘consume’ 16 E1 devices.

As a side note: multitimbral synths were much more around in the '90s and '00s . Practically all racksynth material were made multitimbral. V-synth, Waldorf micro Q , Waldorf Blofeld, EMU Proteus, Korg 01R/W , Korg Triton Rack, Roland XV5080, Yamaha TG77… just to name a few.
Nowadays much less physical instruments are mutlitimbral, because most of them had their effects sections shared for all timbres and with current equipment that is no longer desired.

So for the E1 to know on what physical port (DIN MIDI 1 or DIN MIDI 2) and what channel on that port (1-16) a certain MIDI must be sent on, you need to tell that sending control to what device it belongs.

The advantage only becomes apparent once you start making a preset that controls many MIDI channels at te same time of course.

1 Like

Thanks a lot for your reply and the explanation. It think this is pretty much clear to me.

The combination of a selected Port and the MIDI channel already defines a device. Right?

If - for example - I send the following command via Lua:

midi.sendControlChange(PORT_1, 1, 74, 90)

… the Port and channel are included so E1 “knows” where to send this data to. Taken from your example:

local deviceId = 1
local deviceSysex = parameterMap.get(deviceId, PT_VIRTUAL, 35)
local devPort = devices.get(deviceId):getPort ()

… I’m still not sure what benefits this provides in addition. I’m so sorry… :man_shrugging:t3:

Look in the web editor how a control is defined: you will see it is related to a device, not to a port and channel.
Imagine you made a preset for one device with 200 controls. And now after you’ve made the whole preset, you’d like to change the MIDI channel of your synth
If all 200 controls would have referred each to port and channel, you now would have to change all 200 controls…. Imagine the work and the risk for error.

With this device concept you only change the channel and/or port of the device and all 200 controls will change accordingly… one change => 200 controls change along

Thanks @NewIgnis. This is clear and makes sense.

I only wondered about your command line…

local deviceId = 1

But I think I’m getting closer… :blush:

Thanks again!

1 Like

If a preset is only targeting one device, it’s obvious I then rename that first device’s name, and assign it the right port and channel, and then assign these to my controls.
In lua I then do the same: I kind of refer to the that device by calling it deviceId, and assign it to the first device. Of couse I could have kept using “1” in all lua commands, but the day someone want to reuse the code, ho would he to search for all instances of “1” in the code, verify if that 1 corrsesponds with the meaning of ‘the device’ and only then change it into the new device number he wants. Much easier only to have to change this only once, no ? Hence the deviceId = 1 in the initial part of almost all my lua.

2 Likes