patch not choosing port as predicted

mkap7's icon

Hi folks,
I'm trying to make a patch that will output through the built-in Microsoft GS Wavetable synth on a PC, but will NOT use the built-in synth on the mac (where it will use it as an AU instead). I made a tiny patch that just plays one note to troubleshoot this desired behavior without the rest of the patcher (attached). I want this patch to output a note if we are on a PC, but to output nothing if we are on a mac. But it still puts out the note on my Mac.

I am figuring that because there is no port for the Windows thing on a mac, Max goes for the only available option as a default, and in fact the inspector won't let me change the port from the built in Mac synth. I also thought that the box for "matchport" would help, but that one is also italicized as if disabled.

At this point, I have another solution which would bypass this issue....but now I just want to know how to do it. Is there a way to set this particular sub-patch up so that it will output specifically to the MS GS Wavetable on a PC.....or nothing? Thanks!

Source Audio's icon

Check OS and disable midi out
if it is Mac, or enable if it is Windows.
I allreay posted that :
https://cycling74.com/forums/sending-midi-output-to-the-default-built-in-synth-whether-mac-or-pc

ad matchport argument to noteout, that's all.

Also take care about disabling messages and initialisation
of vst~ object on windows, you don't want a bunch of errors
when calling au plugins on windows....

I would make 2 patches, mac and win, in any case if you target standalone app at some point, you will face some differences anyway.

by the way you wrote :

"I made a tiny patch that just plays one note to troubleshoot this desired behavior without the rest of the patcher (attached)."

I can't see anything attached here.

Roman Thilenius's icon

[gestalt]...? among others.

Source Audio's icon

getting OS is least problem here, but dealing with midi, Audio Driver,
vst~ or not etc - needs few objects to deal with it.

mkap7's icon

Oh, sorry, forgot to attach the attachment. Here it is.

Two separate patches is probably the way to go, but I'm still going to try to get this solution to work.....just because. Looking over your suggestion now - thanks!

(I am going to simplify the situation by getting rid of the whole VST part of the larger patch. There was a reason for doing it this way that is no longer important to the project.)

NOTE OUT.maxpat
Max Patch

mkap7's icon

p.s. I did try your other solution, and it identifies the OS correctly, but isn't disabling the MIDI. Having another look right now.

Source Audio's icon

my example in that other thread had nothing to do with disabling
midi, but to set port to virtual synth per platform if it is available at all.

Have a look here :
if you want to use gestalt as Roman suggested, just see that it names mac different than getystem max message.
windows is same....
This patcher will activate gate to pass midi to Windows GS synth
or initialise vst pug and route midi to it, and activate audio driver on Mac.


Max Patch
Copy patch and select New From Clipboard in Max.

If you now decide not to use vst pugin, then simply use my first screenshot from that different thread.

What you need to understand is that midi objects can not be initialised using non existing ports.
In old days , where this port matching stuff was not available, one would
list available devices, try to recall wanted one from menu, and if it was not found disable that midi object and post error...

mkap7's icon

"...midi objects can not be initialized using non-existing ports". Words to live by.

That is one of the walls I've been bumping my head against.
And thanks for this latest patch - will spend some time today understanding it, and then implementing!
Already noticing a few things that I was misunderstanding.