Better support for multiple MIDI devices

Suggest and discuss new features here.
dag
Posts: 26
Joined: Thu Jul 21, 2016 8:59 am

Better support for multiple MIDI devices

Postby dag » Mon Aug 01, 2016 4:20 pm

G-Stomper currently works to some extent with more than one MIDI device connected via a USB hub, but I'm not sure if this is perhaps more an accident than an intentional feature because the UI only shows one of the devices and there are some issues. So, some ideas:

  1. Ensure multiple devices are handled properly. Notably, one issue I'm having is that G-Stomper only sends MIDI signals itself to the last connected device, the one shown in the MIDI setup. This often leads to issues for me such as no MIDI clock being sent to the correct MIDI device, and lesser issues like drum pads not being lit up on play because the MIDI Note messages are only being sent to the keyboard and not the controller with the pads.
  2. Map devices to MIDI Interfaces. It would be very useful if I could treat my keyboard and my controller as separate MIDI Interfaces despite both sending on Interface 01. I could, for example, control the VA synth with the keyboard and the sampler with the controller/pads, without being limited to 16 channels for both combined. It should be possible to make this distinction and map devices to interfaces virtually, because G-Stomper can already tell the devices apart (notably by name, but I imagine a more stable distinction can be made by, say, ALSA card, though I don't really know Android programming myself).
  3. Allow configuring devices (and/or interfaces) separately. Not critical for me but follows naturally from the rest, I think. For example, I might want clock and note messages sent only to the controller and never the keyboard. In my case it doesn't really matter, unless there's a noticable performance impact to sending these messages to all devices?

FWIW, my current rig consists of a Nexus 7 (2013) on Android 6 with an Arturia BeatStep controller and a CME Xkey keyboard, connected using a powered OTG hub.
User avatar
planet-h
Posts: 1293
Joined: Wed Jun 19, 2013 4:46 pm

Re: Better support for multiple MIDI devices

Postby planet-h » Tue Aug 02, 2016 8:12 am

Thanks for your message, Dag

The short answer:
G-Stomper does not support multiple MIDI devices hooked up over USB only.
To use multiple MIDI devices, you must hook them up over MIDI DIN using an USB2DIN MIDI interface.

I've implemented the multi-device-hookup over USB, but the results have not been satisfying. Multiple USB MIDI devices hooked up using an USB hub resulted in a very inaccurate timing, therefore that setup went never to live state. I'll see if that gets better with Android N (7.0) and post the results here.

The only stable solution is to use a DIN hookup for multiple devices. That way you can use much more than only two, and without any loss of stability.
Here's an example using an ESI MidiMate II interface and multiple MIDI hardware (all using IN and OUT):


Which of the controller/synth/drum machine controls a particular module in G-Stomper can be configured using the MIDI Channel and virtual interface setup. The ESI interface has two ports. Each can be either used as IN or OUT. So you can set it up as IN/IN, OUT/OUT or IN/OUT, what ever fits your needs. If you use it as IN/IN, the two ports are handled as two independent virtual interfaces, which means you have 32 Channels. G-Stomper fully support such virtual interfaces, which are provided by many controllers (e.g. the AKAI MPK225 has two of them, but technically up to 16 are possible).

As said, I'll check if it gets better with Android N (7.0), but for now, there's no support for multiple concurrent USB MIDI devices.
I'm sorry that this is not clearly stated in the docs, I'll update that soon.

PS.: And yes, of course, if there'll be support for multiple concurrent USB MIDI devices in the future, you'll be able to map them to virtual interfaces.
And to point 3.: Yes, agree, if multiple devices would be supported, this would be the way to go.
dag
Posts: 26
Joined: Thu Jul 21, 2016 8:59 am

Re: Better support for multiple MIDI devices

Postby dag » Tue Aug 02, 2016 4:30 pm

planet-h wrote:To use multiple MIDI devices, you must hook them up over MIDI DIN using an USB2DIN MIDI interface.


Bit of a problem in my case because the Xkey only supports USB, no MIDI DIN. The BeatStep supports MIDI DIN OUT but no IN.

planet-h wrote:I've implemented the multi-device-hookup over USB, but the results have not been satisfying. Multiple USB MIDI devices hooked up using an USB hub resulted in a very inaccurate timing, therefore that setup went never to live state. I'll see if that gets better with Android N (7.0) and post the results here.


By timing, are you talking about MIDI clock or about latency? In my case I only need clock synced with the BeatStep, and the latency is actually good enough even with the current "accidental" support with two devices connected. Or are you saying the latency was in fact worse with the "proper" multi-device support?

planet-h wrote:The ESI interface has two ports. Each can be either used as IN or OUT. So you can set it up as IN/IN, OUT/OUT or IN/OUT, what ever fits your needs.


Do you happen to know if the same is true for the Roland UM-ONE mk2? I ordered that to be able to use my larger "home" keyboard with DAWs, but perhaps if it can do two inputs instead of just one IN one OUT I could connect the keyboard and the BeatStep, "sacrificing" the Xkey and MIDI OUT to the BeatStep. That would mean G-Stomper would have to be a slave though, which hasn't worked well for me.

Would you consider adding the support regardless of timing accuracy, at least under a disclaimer or "experimental features" section? As I said, latency and clock hasn't been an issue for me even with two devices connected over USB; the main issue is that I can't control which device(s) G-Stomper sends MIDI OUT to, and that I would like to be able to treat them as separate interfaces.
User avatar
planet-h
Posts: 1293
Joined: Wed Jun 19, 2013 4:46 pm

Re: Better support for multiple MIDI devices

Postby planet-h » Wed Aug 03, 2016 7:05 am

dag wrote:Bit of a problem in my case because the Xkey only supports USB, no MIDI DIN. The BeatStep supports MIDI DIN OUT but no IN.


Fully understand the point, and absolutely agree, that having multi-USB-MIDI device support is essential, since many of the new MIDI controllers do only support USB.
I'll give the code a close look in the next update cycle and see if there's any chance to get it to work.

dag wrote:By timing, are you talking about MIDI clock or about latency? In my case I only need clock synced with the BeatStep, and the latency is actually good enough even with the current "accidental" support with two devices connected. Or are you saying the latency was in fact worse with the "proper" multi-device support?


I can only refer to MIDI IN, since at the time of the initial implementation, there was no MIDI OUT support.
I was sending different notes from two keyboards, and some of them had a massive delay (250ms and more).
To answer your question: Yes it was worse than the "accidential" support (probably because there have been more threads involved).

dag wrote:Do you happen to know if the same is true for the Roland UM-ONE mk2? I ordered that to be able to use my larger "home" keyboard with DAWs, but perhaps if it can do two inputs instead of just one IN one OUT I could connect the keyboard and the BeatStep, "sacrificing" the Xkey and MIDI OUT to the BeatStep. That would mean G-Stomper would have to be a slave though, which hasn't worked well for me.


No, this is unique for the ESI Midimate II.
The Roland UM-ONE is a good interface (I have one here for testing since a while). But it comes with two fixed IN and OUT ports, which have to be used as given.
I fully agree with you, that the DIN hookup would be a loss in your case.

dag wrote:Would you consider adding the support regardless of timing accuracy, at least under a disclaimer or "experimental features" section? As I said, latency and clock hasn't been an issue for me even with two devices connected over USB; the main issue is that I can't control which device(s) G-Stomper sends MIDI OUT to, and that I would like to be able to treat them as separate interfaces.


Not in the original form. Going live with such an inaccurate implementation would be (even if experimental) very bad for the image of the products.
But as already mentioned above, I'll check the multi-device-support in the next update cycle. If there's any way to get it to work properly, then I'll find it;)
dag
Posts: 26
Joined: Thu Jul 21, 2016 8:59 am

Re: Better support for multiple MIDI devices

Postby dag » Thu Aug 04, 2016 7:05 pm

Turns out there's no way to set the MIDI OUT channel on the bigger keyboard, so it's not very useful for use with G-Stomper. Not a complete waste getting the UM-ONE though because I can use it to practice the piano with Synthesia. :-)

New idea: could you possibly make MIDI interfaces configurable with memory per device? The idea being that if I can't have two devices connected at the same time, perhaps it could be set up such that I can switch device and have it set up correctly on the fly. So I plug in the BeatStep and control the sampler, and I switch to the Xkey and control the synth. I can do this today, but I hit the 16 channel limit rather quickly when both devices run on the same interface and have to compete for channels.

So basically, I want to be able to plug in the controller, go to MIDI settings and say "assign this device to interface 1", switch to the keyboard, go to MIDI settings and say "assign this device to interface 2", and then have these assignments remembered when I switch between the devices.

Does it sound sensible and doable?
User avatar
planet-h
Posts: 1293
Joined: Wed Jun 19, 2013 4:46 pm

Re: Better support for multiple MIDI devices

Postby planet-h » Fri Aug 05, 2016 7:07 am

dag wrote:New idea: could you possibly make MIDI interfaces configurable with memory per device? The idea being that if I can't have two devices connected at the same time, perhaps it could be set up such that I can switch device and have it set up correctly on the fly. So I plug in the BeatStep and control the sampler, and I switch to the Xkey and control the synth. I can do this today, but I hit the 16 channel limit rather quickly when both devices run on the same interface and have to compete for channels.

So basically, I want to be able to plug in the controller, go to MIDI settings and say "assign this device to interface 1", switch to the keyboard, go to MIDI settings and say "assign this device to interface 2", and then have these assignments remembered when I switch between the devices.

Does it sound sensible and doable?


Mapping physical devices to (virtual) interfaces is unfortunately not possible.
Virtual interfaces, also known as virtual cables, are part of the USB MIDI specification and are "per device".

In numbers this means:
Each physical device can provide up to 16 virtual interfaces/cables.
A physical device with 16 virtual interfaces can address 256 MIDI channels (16x16) with the setup of the current version.
These virtual interfaces are reserved and cannot be used to map physical devices.

If it is possible, I'd rather add an additional selector, where you can choose the physical device.
In the current version you have "Channel - Interface", new would be "Channel - Interface - physical device".

Also useful would be the ability to save MIDI setup presets in files, so that you could switch them easily for different uses.

I look into these details once there's a proper way to use multiple devices.
I'll keep you posted.
User avatar
planet-h
Posts: 1293
Joined: Wed Jun 19, 2013 4:46 pm

Re: Better support for multiple MIDI devices

Postby planet-h » Mon Aug 08, 2016 9:47 am

Just a heads up to keep you informed:
I just started with the tests and a bit of re-coding theses days, and the first results look very promising.
It looks like there either have been bugs in my first integration (which I used for the first tests around 1.5 years ago) or there have been improvements in the Android internal USB transmission. In either way, it looks much better now. There's still a timing impact by having multiple USB devices connected, but by far not that significant anymore.

If you want to be one of the first who gets the feature, then I recommend to join the G-Stomper Public BETA Group on google+ (for Google Play customers only). It's not yet in BETA, but as a member you'll get it straight away once the tests start.
User avatar
planet-h
Posts: 1293
Joined: Wed Jun 19, 2013 4:46 pm

Re: Better support for multiple MIDI devices

Postby planet-h » Tue Aug 09, 2016 1:19 pm

I just finished all the tests, and I have to say it is still laggy to use multiple concurrent USB interfaces.
It worked well with 2 controllers, with 3 it started to lag, with 4 it simply got far too laggy.

I'll add the functionality as an experimental feature in the following form:
You'll be able to connect multiple USB MIDI devices and those will all be shown in the MIDI setup.
You'll be able to send/receive the MIDI clock to/from all connected devices (based on the default IN/OUT interfaces).
You'll be able to send/receive all other MIDI event types to/from all connected devices.
But you won't be able to define the MIDI transmission settings per device.
Also you won't be able to connect a particular device to a track (like you can do with the MIDI channels and virtual interfaces)


Implementing the functionality listed in the two red lines would only make sense if the result would fit the required quality standards.
But unfortunately it doesn't. It looks like the USB port simply cannot handle the large data amount.
The more data is transmitted (independent of the direction), the more it starts to lag.
And it affects not only the MIDI transmission, it affects the complete application.
I'll allow multiple concurrent devices as an experimental feature with clear warning in form of a popup window.
But selling it as an official feature is unfortunately not possible, since the USB transmission is just too unstable.

Sorry for not having better news.
dag
Posts: 26
Joined: Thu Jul 21, 2016 8:59 am

Re: Better support for multiple MIDI devices

Postby dag » Wed Aug 10, 2016 5:30 am

What about device specific mappings for use with a single device at a time? It's not that hard to swap the connected device for me, but the usefulness of doing so is limited by the connected device always running on the same interface number. I like to map tracks to channels and with the default configuration (that many sound sets and demo patterns rely on) of 12 sampler tracks and 5 synth tracks that's already one more than the available 16 channels, and then I'm also discounting the possibility of controlling the master on one channel and having channels for the currently selected sampler and synth tracks. Since my two devices kind of reflect the G-Stomper separation of sampler and synth tracks it would be a very acceptable compromise for me to dedicate each device to each part of G-Stomper and then simply swap them when I want to work on another area. Then I could easily have 12 sampler tracks + 1 selected track + 1 master assigned on the pad/knob controller, and 5 synth tracks + 1 selected track + 1 master assigned on the keyboard controller, and still have room for more tracks on both. This would actually be a much bigger win for me than better support for USB hubs with all devices treated as one.

But that's still good news and I'm totally jumping on that beta program.
User avatar
planet-h
Posts: 1293
Joined: Wed Jun 19, 2013 4:46 pm

Re: Better support for multiple MIDI devices

Postby planet-h » Wed Aug 10, 2016 7:42 am

dag wrote:What about device specific mappings for use with a single device at a time? It's not that hard to swap the connected device for me, but the usefulness of doing so is limited by the connected device always running on the same interface number. I like to map tracks to channels and with the default configuration (that many sound sets and demo patterns rely on) of 12 sampler tracks and 5 synth tracks that's already one more than the available 16 channels, and then I'm also discounting the possibility of controlling the master on one channel and having channels for the currently selected sampler and synth tracks. Since my two devices kind of reflect the G-Stomper separation of sampler and synth tracks it would be a very acceptable compromise for me to dedicate each device to each part of G-Stomper and then simply swap them when I want to work on another area. Then I could easily have 12 sampler tracks + 1 selected track + 1 master assigned on the pad/knob controller, and 5 synth tracks + 1 selected track + 1 master assigned on the keyboard controller, and still have room for more tracks on both. This would actually be a much bigger win for me than better support for USB hubs with all devices treated as one.

But that's still good news and I'm totally jumping on that beta program.


Regarding the device specific mappings:
This is a tricky task for many reasons. When using multiple midi devices at once, then you don't have the guarantee that these are hooked up in the same order with every start. So the only real way to map the devices is to use the device "name". Even this is a slow mapping (not very handy for real time solutions), it would work. But what if someone uses multiple midi devices of the same type. Sure you can add a number at the end, but since there's no 100% safety that the hookup order is always the same, you'll never know which is which. And this is only the peak of the iceberg.

As already said, I'll probably integrate MIDI setup presets in the future, which you can save, load, switch at any time,

About exceeding the 16 channel limit:
As already mentioned above, many modern midi controllers provide multiple virtual interfaces, which can be all mapped in GSS (btw. no other Android app supports this).
The AKAI MPK225 provides 2 virtual interfaces for example, which lets you use 32 midi channels (2x16). In other words for each element on that controller you can set the Channel AND Interface. In the MPK225 the channels are named A1-A16 and B1-B16.

dag wrote:FWIW, my current rig consists of a Nexus 7 (2013) on Android 6 with an Arturia BeatStep controller and a CME Xkey keyboard, connected using a powered OTG hub.


Since I don't know what exact Beatstep or Xkey you use (there are various versions and revisions of the controllers on the market), I cannot say if these controllers do provide multiple virtual interfaces (and how many). Please take a look at the documentation of your controllers. If only one of them supports multiple virtual interfaces, then you can use 32 channels with both controllers together.

Return to “Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest