PDA

View Full Version : (Re)Connect USB midi interface on the fly


mschnell
09-24-2017, 02:34 AM
I just got a new keyboard to go with my Live setup. It is a Kawai VPC 1. Same features a "software"-power on pushbutton, and it can be programmed to power off automatically after a definable non-usage time (or never). But it can't be configured to power on automatically when the power (via USB) is applied, which IMHO is very silly.

Now for a Live situation I power of the setup by a main switch. Everything starts automatically (including the embedded PC running Reaper). Only the VPC 1 stays asleep.

If I am not quick enough pushing the power button of the keyboard, Reaper will start before the appropriate USB-Midi port appears in the OS (Windows).

Accordingly Reaper will not see it and will never receive any Midi from the keyboard.

Is there any way to configure Reaper (or add some script) to re-try attaching to the midi ports necessary for the setup ?

(I do know that this had been impossible with Win XP, but with Win greater than 7, the OSes USB handling is improved so that a program can re-try a device attached by USB.)

Thank a lot,
-Michael

cfillion
09-24-2017, 03:14 AM
Action: Reset all MIDI devices? I have it assigned to a shortcut since it comes handy so often with USB devices...

You could make a script to run this action automatically after everything is up and running, or some amount of time.

mschnell
09-24-2017, 05:10 AM
Thanks a lot !

This does work (for testing, I added the action to the file menu).

Now the next question is how to integrate it in my live setup.

While I already did write some thousand lines of JSFX code, I have no idea about ReaScript, so please pardon my ignorance :(

With m live setup I don't have any PC keyboard, mouse or monitor so no chance to use menus or shortcuts.

I supposedly would need to do a functionality that monitors the input from the midi device and if nothing is detected fire the action.

I could easily integrate the detection in my set of midi handling JSFXes and in case of danger e.g. send out a Midi event. Same could be routed towards the ReaScript engine by "MidiToReaControlPath". But I am lost thinking about how such a midi message would fire the action. In fact I could use LiveConfigs for this as I do know that same is able to detect midi events and fire actions, but this does not seem very appropriate...

Any ideas ?

Thanks again,
-Michael

eliot
09-24-2017, 05:14 AM
I'm not OP, but I had the exact same problem. Thanks much.