[sharing] VST Plugin Scanner!
Hey folks! Thought I'd share this little piece of code I wrote today, part of a larger project. Basically, I've always hated the 'easy way' of loading VSTs into a umenu -- because the enduser has no idea really if a plugin you choose is going to load! Sometimes you might be trying to load a 32 bit plugin while in 64bit mode, sometimes you'll realize it was an iLok-protected demo license you were too lazy to remove from the folder. Plus, keeping those 'invalid' plugins out of your giant list of 200 plugins just makes things look nicer!
So, this little snippet here will let you choose a folder, then click a button to begin scanning that folder. Each plugin will be loaded sequentially, and if they're valid plugins will get added to a [coll] object. It'll also add the name of the folder you scanned to the beginning of the [coll], with the ID of 'folder.' Currently it doesn't go past listing them all in the [coll], but it shouldn't be that hard to take that and put it into whatever format you'd like to use (I'd imagine by populating a umenu, and using the foldername from the [coll] for the umenu's 'prefix' attribute, but hey if you wanna use that list to generate a fancy jitter-based cloud of plugin names, have at it).
Some current issues that I haven't figured out (and wouldn't mind some outside input on!):
• Certain plugins seem to consistently lock it up on loading (for me, it's Kilohearts' 'Disperser' VST, and Native Instruments 'Maschine 2'). I had to just pull them out of the folder to get it to finish a scan. Oddly these plugins load just fine if I load them into vst~ manually. Not sure what's causing it, maybe I'm sending a signal too early somewhere?
• Sometimes it just crashes for no good reason. Hard to figure those out.
• A few of the samplehack plugins (the +plugins, the ++plugins work fine) seem to be hit or miss as to whether they'll load or not.
• If you have iLok plugins in the folder, but don't have the license, they WILL throw up a 'hey do you have that license' window, so you can't just walk away and come back later.
!!! This has so far only been tested on macOS High Sierra 10.13.2, running Max7.3.5, with VST plugins. Haven't even tried it on AU plugins. And I don't really have a windows machine, so I can't test it on there either. !!!