Non-Existing Midi Devices Being Populated In The Devicelist

When i have set a specific midi device for an instrument and reload my template song, i got the error ‘trying to set a midi device to a non existing device name’.

When printing the info what kind of device it tried to set i noticed a name not being available anywhere if the song is restructed:

Why are WDM devices passed to Lua routines if they are not approachable afterwards?

There seems to be a small moment in between song loading and song loaded were more devices are enumeratable than available.

This is expected an something you must deal with in your tool: Renoise never clears/invalidates such “missing” devices. If you forgot to turn on your MIDI device or are using the song on a system where this device is not present, the original device name setting in the instrument should not be cleared.

Renoise shows such devices as “NA - Some Name” in it’s GUI then to indicate that it was set, but currently does not exist.

Ok that sounds like a logical pitfall here, i should have scanned the song for any references first.
I think i saved the song with the 32-bit version of Renoise (I test both) where these WDM / MME drivers exist and the 64-bit drivers don’t offer these options.
good, so i first going to check if an existing reference exist on the list and pick device 1 if it doesn’t.

I don’t get this (N/A) part returned in the API when i fetch the midi_in_properties.device_name from the instrument though, i don’t know if it is hazardous to parse this along, it would make filtering a bit easier but it is not essential necessary.