|
|
|
04-04-2019, 07:04 AM
|
#1
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
|
Identification of USB Midi devices
When unplugging and re-plugging an USB Midi device, it often gets a new ID number. This is more likely when different socket is used, but I seem to remember that is sometimes happened just "on the fly". This of course is not a problem generated by Reaper, but by the OS (Windows 7 in my case).
This is a very annoying reason of problems "on the road".
Now some USB devices seem to keep their ID even when connected to a different socket.
In fact each Midi device (be it USB or virtual, e.g. by LoopMidi) provides (and in Reaper is shown with) a dedicated name. I don't have multiple identical USB hardware devices, so I can't know if they will get the same name, but this special case supposedly is of lesser significance.
But as the names are different, it should be possible to tag an internal ID number to a dedicated name and with that keep the connection in the projects intact, even if the OS Midi device ID number changes.
-Michael
Last edited by mschnell; 04-06-2019 at 04:47 AM.
|
|
|
04-06-2019, 04:46 AM
|
#2
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
|
... bump ...
|
|
|
04-14-2019, 09:41 PM
|
#4
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
|
I would need either an option to make Reaper generally ignore the "number plus dash plus blank" characters the Windows OS (or whoever) adds to the start of certain Midi device name (resulting in multiple identical hardware devices not being usable at the same time - in the same time like e.g. multiple "Audio 6" devices (the instances of which get exactly the name name by the OS), or some intelligent way to have the user manage this situation.
-Michael
|
|
|
05-05-2019, 09:36 AM
|
#5
|
Human being with feelings
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
|
I renamed my two otherwise identical Midi Fighter Twister units. That enabled me to search for that new name and find the correct midi id.
Lua code I use to change banks on my MFT.
Code:
local m_com = {
-- m_com[k].target_devnum will hold the devices number for each command
{ device = "Twister2", -- will be replaced with target device number+16 for actual command
midicmd = '0x9'..string.format("%x", 3), -- NoteOn on midi channel 0-15
midinotecc = 3 , -- bank no.4
vel = 127 }, -- velocity or CC value
}
-- end of command list
local target_devices = {}
local i,k = 0 , 0
local target_devnum = {} -- array to collect device numbers
local mdev_outno = reaper.GetNumMIDIOutputs() -- grab number of midi outputs in Reaper
msgclr()
msg("Midi Outs Reaper: " .. mdev_outno)
msg("Stepping through devices...")
-- collect device ids for each command
for k=1, #m_com, 1 do
target_devices[k] = m_com[k].device
end
for k=1, #target_devices, 1 do
for i=1, mdev_outno, 1 do
retval, mdev_name = reaper.GetMIDIOutputName(i, "")
if retval then
if string.find(mdev_name,target_devices[k]) then -- check for target device name(s)
m_com[k].target_devnum = i -- add device number to command list
msg("Device found. No." .. i .. " " .. mdev_name .." matches " .. target_devices[k])
end
end
end
end
-- Send out commands
for i=1, #m_com, 1 do
reaper.StuffMIDIMessage( tonumber(m_com[i].target_devnum)+16 , m_com[i].midicmd, m_com[i].midinotecc, m_com[i].vel )
msg("Sent note to " ..m_com[i].device )
end
|
|
|
05-05-2019, 02:27 PM
|
#6
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
|
Quote:
Originally Posted by airon
I renamed my two otherwise identical Midi Fighter Twister units. That enabled me to search for that new name and find the correct midi id.
|
How have you been able to do this ?
-Michael
|
|
|
05-06-2019, 06:19 AM
|
#7
|
Human being with feelings
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
|
Quote:
Originally Posted by mschnell
How have you been able to do this ?
-Michael
|
This is just for inside Reaper.
Preferences / Midi Devices
Right-click on a device entry. At the top of the dialogue box you can set an Alias name.
"X-TOUCH MINI" became "Xmini1" for example. That's the name Reaper then uses. It's what my code looks for.
"Midi Fighter Twister" (for both units) became "Twister1" for the first plugged in unit, and "Twister2" for the second.
|
|
|
05-06-2019, 06:49 AM
|
#8
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
|
Maybe giving the same alias name to "multiple" devices that got different names in Windows due to plugging the same hardware to a different USB socket, might solve the original issue ...
-Michael
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:20 AM.
|