The 'getInstrumentTypeName' API function returns "VST" for both my effect (reverb) plugin ("Oril River 1") and my instrument plugin ("DPiano-E 1"):
I am ultimately trying to get a list of midi-playable plugins open in the program:
1. Use getNumAudioInstruments to find number of audio instruments.
2. Use getAudioInstrumentId to get instrument id from instrument number
3. Use getInstrumentTypeName to get instrument type [currently returns 'VST' even when plugin is VSTi]
4. Use getInstrumentName to get instrument name from instrument ids that are VSTi. (ideally from step 3)
Is there some other way to accomplish this?
It seems the plugin itself has properties to determine whether it is a VSTi:
(this is a screenshot of the same two plugins above opened in Hermann Sieb's freeware VSTHost, http://hermannseib.com/english/vsthost.htm)
Is there any way to distinguish between VST and VSTi plugins?
-
- Posts: 34
- Joined: 06 Jan 2018 23:03
Re: Is there any way to distinguish between VST and VSTi plugins?
VST plugins report whether they accept MIDI or not. In addition, there is a string reported by the plugins called category, which is often set to "Effect" or "Synth" (see plugin manager). As far as I can see, there isn't an API function to get info about whether it accepts MIDI or not, but you can get the category by using the getSoundPluginRegistry function, although that function returns a lot of stuff, and the format of it might change.
Re: Is there any way to distinguish between VST and VSTi plugins?
As a followup to getSoundPluginRegistry, you can find category of an instrument by iterating the hash tables returned by getSoundPluginRegistry and use getInstrumentTypeName and getInstrumentPluginName to find correct entry.
Re: Is there any way to distinguish between VST and VSTi plugins?
You can actually get info about whether the instrument accepts midi or not by using the function getInstrumentInfo. However this function just returns a long string with lots of info separated by lineshifts, so you have to parse the info from it manually. Note though, that lots of effect plugins also accept MIDI, so it's probably better to use "category".
Re: Is there any way to distinguish between VST and VSTi plugins?
Code: Select all
(define (get-instrument-category instrument-id)
(define entry (find-first (to-list (<ra> :get-sound-plugin-registry))
(lambda (entry)
(and (entry :type-name)
(entry :name)
(string=? (entry :type-name) (<ra> :get-instrument-type-name instrument-id))
(string=? (entry :name) (<ra> :get-instrument-plugin-name instrument-id))))))
(and entry
(entry :category)))
-
- Posts: 34
- Joined: 06 Jan 2018 23:03
Re: Is there any way to distinguish between VST and VSTi plugins?
Thanks for the detailed responses.
IMHO, the 'ideal' solution would be to update the getInstrumentTypeName function to return "VSTi" if you already know the VST plugin instrument category is 'Synth'... but I am in no position to be dictating feature requests.
Ultimately my goal is to add "Next Midi Instrument" / "Previous Midi Instrument' actions (shortcuts) so I can easily cycle through all the available playable midi instruments in the mixer without having to find/click on them in the GUI...
I am successfully parsing the getSoundPluginRegistry info and finding the instruments with hash tables containing ':category "Synth"''.
IMHO, the 'ideal' solution would be to update the getInstrumentTypeName function to return "VSTi" if you already know the VST plugin instrument category is 'Synth'... but I am in no position to be dictating feature requests.
Ultimately my goal is to add "Next Midi Instrument" / "Previous Midi Instrument' actions (shortcuts) so I can easily cycle through all the available playable midi instruments in the mixer without having to find/click on them in the GUI...
Re: Is there any way to distinguish between VST and VSTi plugins?
> IMHO, the 'ideal' solution would be to update the getInstrumentTypeName function to return "VSTi" if you already know the VST plugin instrument category is 'Synth'... but I am in no position to be dictating feature requests.
That would create an inconsistent API since type name is used to distinguish instrument types (plugin types / etc.), and there is no plugin type called "VSTi'". A "VSTi" plugin is just a vst plugin that creates sound when receiving midi notes. I don't think there is any way for a host to safely determine whether a vst plugin does that or not.
That would create an inconsistent API since type name is used to distinguish instrument types (plugin types / etc.), and there is no plugin type called "VSTi'". A "VSTi" plugin is just a vst plugin that creates sound when receiving midi notes. I don't think there is any way for a host to safely determine whether a vst plugin does that or not.
Re: Is there any way to distinguish between VST and VSTi plugins?
It would in my opinion make more sense to add an API call called "InstrumentIsPlayingNotes" (or something like that), or a more general "getInstrumentProperties" function that returns a hash table with all types of info about an instrument.
-
- Posts: 34
- Joined: 06 Jan 2018 23:03
Re: Is there any way to distinguish between VST and VSTi plugins?
Thanks for weighing in- an 'InstrumentIsPlayingNotes' API addition sounds like the right approach...