Disabling Microsoft MIDI ports in standalone

    Nov 29 2012 | 2:18 am
    Anyone know of a way to disable MIDI ports in a standalone on Windows? Specifically the "MIcrosoft Synthesizer" and "Microsoft GS Wavetble SW Synth"?
    Here is what I've been struggling with -
    I am building a standalone application that will use audio input from the soundcard via the ASIO4LALL driver, and send MIDI through a virtual port to other applications. Since I only need an input, I would like to leave the soundcard output available to other applications. The "Microsoft Synthesizer" and "Microsoft GS Wavetable SW Synth" ports interfere with this, causing the soundcard output to become unavailable to other applications. The problem is that if the patch contains any midi i/o objects (notein, noteout, midiout, etc), Max seems to automatically load the Microsoft Synth drivers somehwere, even if I explicitly load other virtual MIDI ports as arguments to those objects.
    The solution is to open the patch, open MIDI Setup, disable the two microsoft drivers, then restart the patch - at that point, the soundcard output in ASIO4ALL becomes once again available to other applications. However, I'd like to hide this from the user as much as possible by automatically disabling these ports somehow. I also plan on removing the menubar, so MIDI Setup won't be accessible from there.
    Here's what I've tried -
    1) I can remove the "Microsoft Synthesizer" DM by sending ( ";#SM deleteoutport "Microsoft Synthesizer" ) on patch load. However, I can't remove "Microsoft GS Wavetable SW Synth" MME this way - Max spits out "sysmidi: deleteoutport: driver doesn't delete ports"..
    2) Opening MIDI Setup in edit mode, i can see th deviceviewer containing the ui has an inlet. But no help file, documentation, or info on this form regarding how to address it via the inlet.
    Anyone have any suggestions on how to skin this cat? Ideally I want to handle this automatically behind the scenes. As a last resort, I can leave the MIDI Setup in there but I'd like that to be accessible via button on the UI, instead of menubar (so that I can remove the menubar in my standalone). Many thanks!!

    • Nov 29 2012 | 2:48 am
      Oh, and:
      3) I am aware that you can remove files from support//mididrivers folder . However, I need to keep the midi_mme.mxe in there so my patch can use a virtual MIDI port (midi yoke).
    • Nov 30 2012 | 4:34 pm
      Tough one - not sure that you can do all of what you want to do. A few things that might be helpful though:
      1) You don't need to delete the Microsoft Synthesizer DM command stuff - just don't include the midi_dm.mxe in your standalone's support/mididrivers/ folder, and then that option won't appear.
      2) I've never found a way to delete the Microsoft GS Wavetable Synth entry, as long as you're using the MME driver.
      3) If you want to include the MIDI Setup functionality, try putting that patch into edit mode, copy the whole deviceviewer object, then copy it into your own patch, and bring up that patch using a button in your UI - I'm guessing you know how to do that part already. If you'd like, you can even constrain your UI to hide the offset and abbrev part of the deviceviewer table, to simply things...
    • Nov 30 2012 | 5:19 pm
      i was struggeling with the same thing (tried everything). my solution was to make the midi setup available for the user so that everybody using asio4all drivers could disable microsoft ports. you don't need the menubar, " ;max midisetup " in a messagebox should work..O.
    • Nov 30 2012 | 7:51 pm
      Thanks for the tips, Dan and Olsen! I tried snipping [deviceviewer] out of the MIDI Setup window but it doesn't stick in the standalone. I had resigned myself to making the MIDI Setup menu item available but considering that I'm removing everything else in the JSON file it would've looked mighty lonely up there! Great to know that I can access via global max message instead. Cheers!
      (BTW, I've been referencing your pdf on making "slick standalones", Dan, many thanks for that!).
    • Nov 30 2012 | 7:57 pm
      @dan i tried point 3 but it was not possible to make it work in the standalone. "the object can't be found"
    • Dec 02 2012 | 4:07 pm
      Ah bummer. There must be some way to force the application to include that object in its bundle, but in trying just now couldn't figure it out I'm afraid...