long story short I need to refresh my midi input device programmatically without manually updating it in the menu. Is there a variable or object similar to |; pd dsp 1 | that can automatically refresh my midi device?
-
object to reset/refresh midi device
-
@godintrash This might help...... midisettings-help.pd ......?
Probably uses an external nowadays..... [mediasettings]If you set up your midi as you wish and click ok in the dialog it will print the message that you need to send to pd...... [midi-dialog x x x x etc.( .... to restore that setting.
David. -
Losing a midi device is a major pain in any kind of live situation.
In windows and mac audio software will only see what midi hardware exists when it is first loaded - so if you plug something in after PD was opened it won't be available. It's just some legacy "its always been this way" bs, midi has been around for a very long time. Maybe midi 2.0 takes care of this? Ive had no interest in it
What I do is use a virtual port - in windows loopMidi and on mac digging deep in to the audio/midi settings to check the UAC connection to be on. on both I will rename the virtual ports to something sane like where its meant to go, or come from, or what its meant to do because virtual ports can be misused as they talk bidirectionaly (hardware midi only works in one direction - typically its an Out creating notes, ccs, etc meant to be received to a software programs In)
The magic secret sauce is combining a virtual port with a routing program, on windows Midi-OX because it remembers each instance and their filters, connections - so when I accidentally yank a usb out I can just plug it back in and close/reopen it and the software won't have any problems except maybe a stuck note. on mac midi monitor or midi patchbay it looks like midi monitor refreshes on the fly so you can set it to act as a destination, and then tick the hardware on and off as it shows up (as long as its running before you launch your audio program there's no need to mess with the virtual UAC port either).
This approach could also be done through the shell with python or some automation but it's never been a problem enough for me to look into
-
@whale-av tested [mediasettings/midisettings-help] just to make sure and yeah, on mac or windows it won't see any new midi devices - like if you plug in a usb midi doot or create a new virtual port until pure data is closed and reopened, tested plugdata and reaper too just to make sure audio programs still all usually act like this on windows and mac
-
@dogsynthesis Yes, in windows MidiOx will also only see ports that are available as it starts. Pd also queries pins as it starts. Not sure whether the OP needs to change settings or refresh pins, but I don't know any way to ask for a refresh. Will check the tcl when I get some time.
David.