Swapping my midi controller USB ports generates incrementing device names

I have a Nord Stage 3, a Novation Impulse 61, and I’m using a USB HUB.

If I swap the Nord into a different USB Hub port then the Nord’s MIDI Device name stays the same “Nord Stage 3 MIDI”, which is perfect.

However, when I do the same with the Impulse, “something” seems to generate an incrementing device name for each different USB port that I plug it into. As shown in the logs below, using 5 different ports, generated 5 separate device names. The last entry of “Impulse” is me plugging it back into the original port.

This is a pain because changing the USB port makes the original “Impulse” device name show as “disconnected” until I manually remap to the numbered device name.

00231366 15866 [21880:2]: MidiDeviceManager - Found MIDI Device: input : Nord Stage 3 MIDI
00231366 0 [21880:2]: MidiDeviceManager - Found MIDI Device: output: Nord Stage 3 MIDI
00244382 13016 [21880:2]: MidiDeviceManager - Lost MIDI Device: input : 3- Impulse
00244382 0 [21880:2]: MidiDeviceManager - Lost MIDI Device: input : MIDIIN2 (3- Impulse)
00244382 0 [21880:2]: MidiDeviceManager - Lost MIDI Device: output: 3- Impulse
00254453 10071 [21880:2]: MidiDeviceManager - Found MIDI Device: input : 4- Impulse
00254453 0 [21880:2]: MidiDeviceManager - Found MIDI Device: input : MIDIIN2 (4- Impulse)
00254453 0 [21880:2]: MidiDeviceManager - Found MIDI Device: output: 4- Impulse
00370499 116046 [21880:2]: MidiDeviceManager - Lost MIDI Device: input : 4- Impulse
00370499 0 [21880:2]: MidiDeviceManager - Lost MIDI Device: input : MIDIIN2 (4- Impulse)
00370499 0 [21880:2]: MidiDeviceManager - Lost MIDI Device: output: 4- Impulse
00384601 14102 [21880:2]: MidiDeviceManager - Found MIDI Device: input : 5- Impulse
00384601 0 [21880:2]: MidiDeviceManager - Found MIDI Device: input : MIDIIN2 (5- Impulse)
00384601 0 [21880:2]: MidiDeviceManager - Found MIDI Device: output: 5- Impulse
00397618 13017 [21880:2]: MidiDeviceManager - Lost MIDI Device: input : 5- Impulse
00397618 0 [21880:2]: MidiDeviceManager - Lost MIDI Device: input : MIDIIN2 (5- Impulse)
00397618 0 [21880:2]: MidiDeviceManager - Lost MIDI Device: output: 5- Impulse
00402636 5018 [21880:2]: MidiDeviceManager - Found MIDI Device: input : Impulse
00402636 0 [21880:2]: MidiDeviceManager - Found MIDI Device: input : MIDIIN2 (Impulse)
00402636 0 [21880:2]: MidiDeviceManager - Found MIDI Device: output: Impulse

Yes, this is a major annoyance with Windows, that it re-numbers devices like this (sometimes even when using the same port). My wish (if it could be implemented) would be to tell Cantabile to ignore prefixes 1-, 2-, etc. in the device name and recognize that it’s the same device. This would need to be a user option (maybe per device) since there may be some users who actually have two of the same device, where the prefix actually distinguishes devices. @Brad, any possiblities for help here ?

Is an application for “Ghostbusters” or “USB Oblivion” to remove the non-connected hardware? FWIW, I label my USB ports so the controllers and audio devices are always returned to the same USB port.

There is a kind of work around for this:

  1. When the device gets a new name…
  2. Go to Tools → Options → MIDI Ports
  3. Instead of right clicking and choosing the new device name…
  4. Double click the port and select the new device name, while leaving the old device name checked.
  5. Repeat this everytime it happens and eventually the numbers will start recycling

You’ll end up with a whole bunch of numbered devices all selected and Cantabile will use whichever one happens to be available at the time.

As a better fix, what if I was to add an option to manually add a device, and it allowed wildcard characters or regex? Logged it here.

1 Like

That’s what I’ve been doing. I just can’t figure out how/why Windows adds devices…

image

I know this doesn’t help: Windows USB enumeration tends to suck!
Maybe a good workaround is to use dear old-school MIDI if possible.

1 Like

Hi @brad, resurrecting this discussion. I have this with a number of devices, most painfully cq20b mixer as not immediately obvious its not receiving sysex. From what I see wildcards would be sufficient?
Thanks, John

Hi.

Windows is terrible at enumerating ports and has been since forever.

I missed Brad’s idea for wild cards, but it seems a good idea. :slight_smile:

In the meantime, a tool like USB Oblivion download | SourceForge.net can get rid of enumerated ports.

The other recommendation is to label your leads and ports and always plug into the same port.

2 Likes

Which you need to do, even if using a midi interface. The wrong port ain’t addressing the right stuff.
What’s so annoying with Windows is that it actually interferes with the clean running of the system, imposing new distractions into your lovely clean setup.
Capitalization is another issue. The X-Touch Mini appears as X-TOUCH MINI on one system. Why? :zany_face:

Agreed on labelling. It is IMO crucial on USB Ports to avoid this problem.

I had a hard lesson learnt many years ago when I was using Cantabile 2, which was a lot more fussy about missing ports than Cantabile 3 and 4 are

I had a laptop with three USB ports, two of which were USB 3 and one USB 2, I had a sound card that would only work in USB 2 so I always plugging it into the USB 2 ports … until one day I made a mistake in setting up, and whilst diagnosing the issue, I managed to completely mess up the Cantabile 2 config.

That was also the day I learnt that having a backup is no good when it is sitting at home, over an hour’s drive away!

Once I realised the problem and plugged in things correctly, I got the Setlist restored just before the gig. It was one of the most stressful pre-gig experiences I ever had. After that I labelled all the cables and ports, and ensured the backups came out with me!

3 Likes

There is a windows executable called devcon. Make sure you get the correct (32 or 64bit) version and drop it into the \windows\system32.

Rename the file either way to devcon.exe

Unplug as many USB devices as possible.

Create a batch file with the code below and run it. You will have the option to list, or delete the references. This does NOT delete the driver, so when you plug the device back in, Windows will see your device. Follow the other suggestions about labeling! This helps cut the Windows confusion in the future.

Rick

REM Batch file to delete unused usb references
@echo off
:: Show Non-Resident Devices using devcon
set “showonly=”
set /a counter=0
set /a remcnt=0
set /a failcnt=0
set /a totdev=0
set /p ans=Select (S) to Show non-devices but do not delete; (R) to show and remove -
if /i “%ans%” EQU “S” set "showonly=echo cmd: "
echo Run devcon in ‘%ans%’ mode
pause
DEVCON Find * | FIND /I /V “matching device(s)” > “%tmp%\DevicesExist.txt”

for /F "tokens=1 delims=: " %%A IN (‘DEVCON FindAll * ^| FIND /I /V “matching device(s)”’) DO (
set /a totdev+=1
TYPE “%tmp%\DevicesExist.txt” | FIND “%%~A” >NUL
rem IF ERRORLEVEL 1 %showonly% DEVCON Remove “@%%~A” & set /a counter+=1
IF ERRORLEVEL 1 (set/a counter+=1 & %showonly% DEVCON Remove “@%%~A” || (echo %%~A failed >> %temp%\DeviceRemFailed.txt & set /a failcnt+=1 ))
)
echo.
echo %Counter% non-resident devices found of %totdev% total devices.
set /a remcnt=totdev-counter
set /a remcnt-=failcnt
if /i “%ans%” EQU “R” echo %remcnt% removed. %failcnt% removal failures.
set “counter=” & set “remcnt=” & set “failcnt=” & set “totdev=”
Del /P “%tmp%\DevicesExist.txt”

4 Likes

Rick, I moved the devcon.exe file to the system32 folder and ran the batch file and invited to press R to remove the files.
I’m then shown this cryptic message - Run devcon in ΓÇÿRΓÇÖ mode

Erm…no idea what that means. :slight_smile:
Any clues?
Thanks!

Yes, I can help your friend with that.

This error message:

Run devcon in ‘R’ mode

was likely intended to say:

Run devcon in 'remove' mode

But due to text encoding issues, it showed strange characters like ΓÇÿ instead of a regular single quote '.


What’s Happening?

Your friend probably ran a batch file that uses devcon.exe (the Device Console tool from Microsoft) to remove a device (like a driver or virtual adapter). But the message is either:

  • malformed in the script (wrong character encoding)
  • or unclear because it’s just a generic prompt

Steps to Help Your Friend

:white_check_mark: 1. Confirm the Batch File Contents

Ask your friend to open the .bat file with Notepad or Notepad++ and look for the line that refers to devcon and the R prompt.

It might look like:

devcon remove <hardware_ID>

or it might pause and say something like:

echo Press R to remove...
pause

There is no ‘R’ mode in devcon. remove is the actual command.


:white_check_mark: 2. Correct Way to Use Devcon to Remove a Device

Here’s an example:

devcon remove "ROOT\MyDevice"

If you’re just trying to remove a device silently and permanently, you don’t need any R prompt. The script should just run:

@echo off
devcon.exe remove "Hardware_ID"
pause

Encoding Fix

If the script contains strange symbols like ΓÇÿ, save the file again in UTF-8 (without BOM) or ANSI using Notepad++, to avoid text corruption.


Summary

  • That message is just badly encoded and not a real mode of devcon.
  • devcon remove is the correct command format.
  • Check and fix the batch file content and encoding.
  • No need to press “R”, just run the command directly.

:hammer_and_wrench: What’s Happening?

Your friend is using a tool called DevCon — short for “Device Console”.
This tool lets Windows users add, remove, or manage devices, like drivers, Bluetooth adapters, USB devices, and so on.

Someone gave your friend a batch file (a little script that runs automatically) which is supposed to use DevCon to remove a device.


:thinking: What’s the Problem?

After running the batch file, your friend saw this strange message:

mathematica

Copy code

Run devcon in ΓÇÿRΓÇÖ mode

That looks like gibberish. It should probably say:

nginx

Copy code

Run devcon in 'remove' mode

This happened because:

  • The file was saved with the wrong text encoding
  • Or it was written in a way that causes Windows to show weird characters instead of quotes

:white_check_mark: What DevCon Actually Does

DevCon uses this format:

arduino

Copy code

devcon remove [device ID]

So for example:

arduino

Copy code

devcon remove ROOT\MyDevice

That line would remove a driver or device with that ID.


:cross_mark: There’s No “R Mode”

Your friend is being told to “press R” or “run in R mode” — but that doesn’t exist in DevCon.
The command should already be removing the device if it’s set up correctly.

So the confusing part is:

  • Not their fault
  • Just a badly written message or file

:broom: What You (or They) Can Do to Fix It

Option 1: Let Me Fix It

If you send me the batch file (.bat), I’ll clean it up, correct the commands, and send it back.


Option 2: Fix It Manually (Easy Way)

  1. Right-click the .bat file and choose Edit
    It will open in Notepad.
  2. Look for a line that says something like:

css

Copy code

echo Press R to remove
pause

or something strange with those symbols.
3. Replace the strange message with:

bash

Copy code

echo Removing the device now...
  1. Look for a line that starts with:

nginx

Copy code

devcon

Make sure it looks like this:

arduino

Copy code

devcon remove [something here]

If there’s no actual command, then the batch file doesn’t do anything useful.
5. Save the file.
6. Right-click the file and choose Run as Administrator
(This is important — DevCon needs admin rights to remove devices)


:white_check_mark: Example of a Clean Working File

Here is what a good working .bat file might look like:

bat

Copy code

@echo off
echo Removing device...
devcon remove "ROOT\SomeDeviceName"
pause

If it pauses and says “Press R”, that part is just cosmetic — the command to actually remove the device is what matters.


:brain: Summary for Non-Tech Users

  • The message you saw is just badly written and not your fault
  • DevCon doesn’t have an “R mode” — it just runs commands like “remove”
  • The batch file may have confusing or broken text
  • I can fix the file if you send it
  • Otherwise, open it in Notepad, fix the strange message, and make sure it has a valid devcon remove line
  • Always run it as administrator

Wow. Great write up hcmc! You covered way more bases than I could have. I really should have stated to use notepad or some other text editor. That was a mistake on my part.

Rick

looks like an AI assistant to me but I could be wrong …

The message “Run devcon in ΓÇÿRΓÇÖ mode” is a text encoding error. Here’s what it was supposed to say:

:white_check_mark: Correct version:

“Run devcon in ‘R’ mode”

But even this message still makes no sense, because DevCon (devcon.exe) doesn’t have a mode called ‘R’.


:cross_mark: Why it shows weird symbols like “ΓÇÿ”:

Those characters (ΓÇÿ and ΓÇÖ) are corrupted versions of single quotes '.
This usually happens when a text file was written in one encoding (like UTF-8) and opened in another (like ANSI or Windows-1252), causing misinterpretation of special characters.

  • (left single quote) becomes ΓÇÿ
  • (right single quote) becomes ΓÇÖ

:light_bulb: So what does that line actually mean?

It tries to say:

Run devcon in 'R' mode

But that’s:

  • Incorrect syntax for DevCon (there’s no “R” mode)
  • Likely a confusing or buggy message written by whoever created the batch file

:receipt: DevCon works with clear commands like:

  • devcon find → to list devices
  • devcon remove → to remove devices
  • devcon install → to install drivers

There is no such thing as devcon -R or devcon in R mode.


:white_check_mark: Final Answer:

The message “Run devcon in ΓÇÿRΓÇÖ mode” is a corrupted, meaningless message likely intended to say “Run devcon in ‘R’ mode” — but this is still incorrect, since DevCon does not have a mode called ‘R’.
It’s just a bad or broken message, possibly left by mistake in the batch file.

1 Like

Well, I appreciate the effort there! I have previously been reticent to use AI to check code, because it’s routinely wrong, and because I have no coding skills I ain’t got a clue what it gets wrong :zany_face:

In the meantime, I trawled something up that’s been lurking on my Dropbox since Win XP 32 bit.
MidiMan (before M-Audio takeover) released a little utility way back when called MIDIFIX, which was supplied with their popular MIDIMan interfaces. (Still use one) A quick way to zap redundant ports. I took a chance and ran it. I cleared out my midi ports, including all the dupes and re-added with no nasty side effects.
I did this in the full knowledge that this was developed in WIN XP, but I’m backed up.
There’s a bunch of risky looking stuff with the same name online - different functionality.
If anyone is interested in running this at their own risk, let me know.

1 Like

I am a real Human a Sound Designer and Sound Eng an TI Eng working in Montage M Systems

1 Like

In that case I must say your formatting is excellent. Thanks for your contributions. :slight_smile:

1 Like