2 * Copyright (C) 2005-2006 Sampo Savolainen <v2@iki.fi>
3 * Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
4 * Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
5 * Copyright (C) 2007-2011 Carl Hetherington <carl@carlh.net>
6 * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
7 * Copyright (C) 2007-2016 Tim Mayberry <mojofunk@gmail.com>
8 * Copyright (C) 2013-2015 John Emmas <john@creativepost.co.uk>
9 * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include "pbd/gstdio_compat.h"
29 #include <glibmm/fileutils.h>
30 #include <glibmm/miscutils.h>
31 #include <glibmm/convert.h>
33 #include "pbd/floating.h"
34 #include "pbd/locale_guard.h"
36 #include "ardour/vst_types.h"
37 #include "ardour/vst_plugin.h"
38 #include "ardour/vestige/vestige.h"
39 #include "ardour/session.h"
40 #include "ardour/filesystem_paths.h"
41 #include "ardour/audio_buffer.h"
47 using namespace ARDOUR;
49 VSTPlugin::VSTPlugin (AudioEngine& engine, Session& session, VSTHandle* handle)
50 : Plugin (engine, session)
56 , _transport_sample (0)
57 , _transport_speed (0.f)
58 , _eff_bypassed (false)
60 memset (&_timeInfo, 0, sizeof(_timeInfo));
63 VSTPlugin::VSTPlugin (const VSTPlugin& other)
65 , _handle (other._handle)
66 , _state (other._state)
67 , _plugin (other._plugin)
70 , _midi_out_buf (other._midi_out_buf)
71 , _transport_sample (0)
72 , _transport_speed (0.f)
73 , _parameter_defaults (other._parameter_defaults)
74 , _eff_bypassed (other._eff_bypassed)
76 memset (&_timeInfo, 0, sizeof(_timeInfo));
79 VSTPlugin::~VSTPlugin ()
85 VSTPlugin::open_plugin ()
87 _plugin = _state->plugin;
88 assert (_plugin->ptr1 == this); // should have been set by {mac_vst|fst|lxvst}_instantiate
90 _state->plugin->dispatcher (_plugin, effOpen, 0, 0, 0, 0);
91 _state->vst_version = _plugin->dispatcher (_plugin, effGetVstVersion, 0, 0, 0, 0);
95 VSTPlugin::init_plugin ()
97 /* set rate and blocksize */
98 _plugin->dispatcher (_plugin, effSetSampleRate, 0, 0, NULL, (float) _session.sample_rate());
99 _plugin->dispatcher (_plugin, effSetBlockSize, 0, _session.get_block_size(), NULL, 0.0f);
104 VSTPlugin::designated_bypass_port ()
106 if (_plugin->dispatcher (_plugin, effCanDo, 0, 0, const_cast<char*> ("bypass"), 0.0f) != 0) {
107 #ifdef ALLOW_VST_BYPASS_TO_FAIL // yet unused, see also plugin_insert.cc
108 return UINT32_MAX - 1; // emulate a port
110 /* check if plugin actually supports it,
111 * e.g. u-he Presswerk CanDo "bypass" but calling effSetBypass is a NO-OP.
112 * (presumably the plugin-author thinks hard-bypassing is a bad idea,
113 * particularly since the plugin itself provides a bypass-port)
115 intptr_t value = 0; // not bypassed
116 if (0 != _plugin->dispatcher (_plugin, 44 /*effSetBypass*/, 0, value, NULL, 0)) {
117 cerr << "Emulate VST Bypass Port for " << name() << endl; // XXX DEBUG
118 return UINT32_MAX - 1; // emulate a port
120 cerr << "Do *not* Emulate VST Bypass Port for " << name() << endl; // XXX DEBUG
128 VSTPlugin::deactivate ()
130 _plugin->dispatcher (_plugin, effMainsChanged, 0, 0, NULL, 0.0f);
134 VSTPlugin::activate ()
136 _plugin->dispatcher (_plugin, effMainsChanged, 0, 1, NULL, 0.0f);
140 VSTPlugin::set_block_size (pframes_t nframes)
143 _plugin->dispatcher (_plugin, effSetBlockSize, 0, nframes, NULL, 0.0f);
149 VSTPlugin::requires_fixed_sized_buffers () const
151 /* This controls if Ardour will split the plugin's run()
152 * on automation events in order to pass sample-accurate automation
153 * via standard control-ports.
155 * When returning true Ardour will *not* sub-divide the process-cycle.
156 * Automation events that happen between cycle-start and cycle-end will be
157 * ignored (ctrl values are interpolated to cycle-start).
159 * Note: This does not guarantee a fixed block-size.
160 * e.g The process cycle may be split when looping, also
161 * the period-size may change any time: see set_block_size()
163 if (get_info()->n_inputs.n_midi() > 0) {
164 /* we don't yet implement midi buffer offsets (for split cycles).
165 * Also session_vst callbacls uses _session.transport_sample() directly
166 * (for BBT) which is not offset for plugin cycle split.
174 VSTPlugin::default_value (uint32_t which)
176 return _parameter_defaults[which];
180 VSTPlugin::get_parameter (uint32_t which) const
182 if (which == UINT32_MAX - 1) {
183 // ardour uses enable-semantics: 1: enabled, 0: bypassed
184 return _eff_bypassed ? 0.f : 1.f;
186 return _plugin->getParameter (_plugin, which);
190 VSTPlugin::set_parameter (uint32_t which, float newval)
192 if (which == UINT32_MAX - 1) {
193 // ardour uses enable-semantics: 1: enabled, 0: bypassed
194 intptr_t value = (newval <= 0.f) ? 1 : 0;
195 cerr << "effSetBypass " << value << endl; // XXX DEBUG
196 int rv = _plugin->dispatcher (_plugin, 44 /*effSetBypass*/, 0, value, NULL, 0);
198 _eff_bypassed = (value == 1);
200 cerr << "effSetBypass failed rv=" << rv << endl; // XXX DEBUG
201 #ifdef ALLOW_VST_BYPASS_TO_FAIL // yet unused, see also vst_plugin.cc
202 // emit signal.. hard un/bypass from here?!
208 float oldval = get_parameter (which);
210 if (PBD::floateq (oldval, newval, 1)) {
214 _plugin->setParameter (_plugin, which, newval);
216 float curval = get_parameter (which);
218 if (!PBD::floateq (curval, oldval, 1)) {
219 /* value has changed, follow rest of the notification path */
220 Plugin::set_parameter (which, newval);
225 VSTPlugin::parameter_changed_externally (uint32_t which, float value )
227 ParameterChangedExternally (which, value); /* EMIT SIGNAL */
228 Plugin::set_parameter (which, value);
233 VSTPlugin::nth_parameter (uint32_t n, bool& ok) const
239 /** Get VST chunk as base64-encoded data.
240 * @param single true for single program, false for all programs.
241 * @return 0-terminated base64-encoded data; must be passed to g_free () by caller.
244 VSTPlugin::get_chunk (bool single) const
247 int32_t data_size = _plugin->dispatcher (_plugin, 23 /* effGetChunk */, single ? 1 : 0, 0, &data, 0);
248 if (data_size == 0) {
252 return g_base64_encode (data, data_size);
255 /** Set VST chunk from base64-encoded data.
256 * @param 0-terminated base64-encoded data.
257 * @param single true for single program, false for all programs.
258 * @return 0 on success, non-0 on failure
261 VSTPlugin::set_chunk (gchar const * data, bool single)
265 guchar* raw_data = g_base64_decode (data, &size);
267 pthread_mutex_lock (&_state->state_lock);
268 r = _plugin->dispatcher (_plugin, 24 /* effSetChunk */, single ? 1 : 0, size, raw_data, 0);
269 pthread_mutex_unlock (&_state->state_lock);
276 VSTPlugin::add_state (XMLNode* root) const
280 if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
282 gchar* data = get_chunk (false);
287 /* store information */
289 XMLNode* chunk_node = new XMLNode (X_("chunk"));
291 chunk_node->add_content (data);
294 chunk_node->set_property ("program", (int) _plugin->dispatcher (_plugin, effGetProgram, 0, 0, NULL, 0));
296 root->add_child_nocopy (*chunk_node);
300 XMLNode* parameters = new XMLNode ("parameters");
302 for (int32_t n = 0; n < _plugin->numParams; ++n) {
304 snprintf (index, sizeof (index), "param-%d", n);
305 parameters->set_property (index, _plugin->getParameter (_plugin, n));
308 root->add_child_nocopy (*parameters);
313 VSTPlugin::set_state (const XMLNode& node, int version)
319 if ((child = find_named_node (node, X_("chunk"))) != 0) {
322 if (child->get_property (X_("program"), pgm)) {
323 _plugin->dispatcher (_plugin, effSetProgram, 0, pgm, NULL, 0);
326 XMLPropertyList::const_iterator i;
327 XMLNodeList::const_iterator n;
329 for (n = child->children ().begin (); n != child->children ().end (); ++n) {
330 if ((*n)->is_content ()) {
331 /* XXX: this may be dubious for the same reasons that we delay
332 execution of load_preset.
334 ret = set_chunk ((*n)->content().c_str(), false);
338 } else if ((child = find_named_node (node, X_("parameters"))) != 0) {
340 XMLPropertyList::const_iterator i;
342 for (i = child->properties().begin(); i != child->properties().end(); ++i) {
345 sscanf ((*i)->name().c_str(), "param-%d", ¶m);
346 float value = string_to<float>((*i)->value());
348 _plugin->setParameter (_plugin, param, value);
355 Plugin::set_state (node, version);
360 VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) const
362 VstParameterProperties prop;
364 memset (&prop, 0, sizeof (VstParameterProperties));
367 if (_plugin->dispatcher (_plugin, effGetParameterProperties, which, 0, &prop, 0)) {
369 /* i have yet to find or hear of a VST plugin that uses this */
370 /* RG: faust2vsti does use this :) */
372 if (prop.flags & kVstParameterUsesIntegerMinMax) {
373 desc.lower = prop.minInteger;
374 desc.upper = prop.maxInteger;
380 const float range = desc.upper - desc.lower;
382 if (prop.flags & kVstParameterUsesIntStep && prop.stepInteger < range) {
383 desc.step = prop.stepInteger;
384 desc.smallstep = prop.stepInteger;
385 desc.largestep = prop.stepInteger;
386 desc.integer_step = true;
387 desc.rangesteps = 1 + ceilf (range / desc.step);
388 } else if (prop.flags & kVstParameterUsesFloatStep && prop.stepFloat < range) {
389 desc.step = prop.stepFloat;
390 desc.smallstep = prop.smallStepFloat;
391 desc.largestep = prop.largeStepFloat;
392 desc.rangesteps = 1 + ceilf (range / desc.step);
394 desc.smallstep = desc.step = range / 300.0f;
395 desc.largestep = range / 30.0f;
398 if (strlen(prop.label) == 0) {
399 _plugin->dispatcher (_plugin, effGetParamName, which, 0, prop.label, 0);
402 desc.toggled = prop.flags & kVstParameterIsSwitch;
403 desc.label = Glib::locale_to_utf8 (prop.label);
409 char label[VestigeMaxLabelLen];
410 /* some VST plugins expect this buffer to be zero-filled */
411 memset (label, 0, sizeof (label));
413 _plugin->dispatcher (_plugin, effGetParamName, which, 0, label, 0);
415 desc.label = Glib::locale_to_utf8 (label);
418 desc.smallstep = desc.step = 1.f / 300.f;
419 desc.largestep = 1.f / 30.f;
422 /* TODO we should really call
423 * desc.update_steps ()
424 * instead of manually assigning steps. Yet, VST prop is (again)
425 * the odd one out compared to other plugin formats.
428 if (_parameter_defaults.find (which) == _parameter_defaults.end ()) {
429 _parameter_defaults[which] = get_parameter (which);
431 desc.normal = _parameter_defaults[which];
438 VSTPlugin::load_preset (PresetRecord r)
443 s = load_user_preset (r);
445 s = load_plugin_preset (r);
449 Plugin::load_preset (r);
456 VSTPlugin::load_plugin_preset (PresetRecord r)
458 /* This is a plugin-provided preset.
459 We can't dispatch directly here; too many plugins expects only one GUI thread.
462 /* Extract the index of this preset from the URI */
466 int const p = sscanf (r.uri.c_str(), "VST:%d:%d", &id, &index);
469 sscanf (r.uri.c_str(), "VST:%d:%d", &id, &index);
471 _state->want_program = index;
472 LoadPresetProgram (); /* EMIT SIGNAL */ /* used for macvst */
477 VSTPlugin::load_user_preset (PresetRecord r)
479 /* This is a user preset; we load it, and this code also knows about the
480 non-direct-dispatch thing.
483 boost::shared_ptr<XMLTree> t (presets_tree ());
488 XMLNode* root = t->root ();
490 for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
492 (*i)->get_property (X_("label"), label);
494 if (label != r.label) {
498 if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
500 /* Load a user preset chunk from our XML file and send it via a circuitous route to the plugin */
502 if (_state->wanted_chunk) {
503 g_free (_state->wanted_chunk);
506 for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
507 if ((*j)->is_content ()) {
508 /* we can't dispatch directly here; too many plugins expect only one GUI thread */
510 guchar* raw_data = g_base64_decode ((*j)->content().c_str(), &size);
511 _state->wanted_chunk = raw_data;
512 _state->wanted_chunk_size = size;
513 _state->want_chunk = 1;
514 LoadPresetProgram (); /* EMIT SIGNAL */ /* used for macvst */
523 for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
524 if ((*j)->name() == X_("Parameter")) {
528 if (!(*j)->get_property (X_("index"), index) ||
529 !(*j)->get_property (X_("value"), value)) {
530 // flag error and continue?
534 set_parameter (index, value);
535 PresetPortSetValue (index, value); /* EMIT SIGNAL */
547 VSTPlugin::do_save_preset (string name)
549 boost::shared_ptr<XMLTree> t (presets_tree ());
554 // prevent dups -- just in case
555 t->root()->remove_nodes_and_delete (X_("label"), name);
560 snprintf (tmp, 31, "%ld", _presets.size() + 1);
566 sha1_write (&s, (const uint8_t *) name.c_str(), name.size ());
567 sha1_write (&s, (const uint8_t *) tmp, strlen(tmp));
568 sha1_result_hash (&s, hash);
570 string const uri = string_compose (X_("VST:%1:x%2"), unique_id (), hash);
572 if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
573 p = new XMLNode (X_("ChunkPreset"));
575 p = new XMLNode (X_("Preset"));
578 p->set_property (X_("uri"), uri);
579 p->set_property (X_("version"), version ());
580 p->set_property (X_("label"), name);
581 p->set_property (X_("numParams"), parameter_count ());
583 if (_plugin->flags & 32) {
585 gchar* data = get_chunk (true);
586 p->add_content (string (data));
591 for (uint32_t i = 0; i < parameter_count(); ++i) {
592 if (parameter_is_input (i)) {
593 XMLNode* c = new XMLNode (X_("Parameter"));
594 c->set_property (X_("index"), i);
595 c->set_property (X_("value"), get_parameter (i));
596 p->add_child_nocopy (*c);
601 t->root()->add_child_nocopy (*p);
603 std::string f = Glib::build_filename (ARDOUR::user_config_directory (), "presets");
604 f = Glib::build_filename (f, presets_file ());
611 VSTPlugin::do_remove_preset (string name)
613 boost::shared_ptr<XMLTree> t (presets_tree ());
618 t->root()->remove_nodes_and_delete (X_("label"), name);
620 std::string f = Glib::build_filename (ARDOUR::user_config_directory (), "presets");
621 f = Glib::build_filename (f, presets_file ());
627 VSTPlugin::describe_parameter (Evoral::Parameter param)
629 char name[VestigeMaxLabelLen];
630 if (param.id() == UINT32_MAX - 1) {
631 strcpy (name, _("Plugin Enable"));
635 memset (name, 0, sizeof (name));
637 /* some VST plugins expect this buffer to be zero-filled */
639 _plugin->dispatcher (_plugin, effGetParamName, param.id(), 0, name, 0);
641 if (name[0] == '\0') {
642 strcpy (name, _("Unknown"));
649 VSTPlugin::plugin_latency () const
651 #if ( defined(__x86_64__) || defined(_M_X64) )
652 return *((int32_t *) (((char *) &_plugin->flags) + 24)); /* initialDelay */
654 return *((int32_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */
658 set<Evoral::Parameter>
659 VSTPlugin::automatable () const
661 set<Evoral::Parameter> ret;
663 for (uint32_t i = 0; i < parameter_count(); ++i) {
664 ret.insert (ret.end(), Evoral::Parameter(PluginAutomation, 0, i));
671 VSTPlugin::connect_and_run (BufferSet& bufs,
672 samplepos_t start, samplepos_t end, double speed,
673 ChanMapping const& in_map, ChanMapping const& out_map,
674 pframes_t nframes, samplecnt_t offset)
676 Plugin::connect_and_run(bufs, start, end, speed, in_map, out_map, nframes, offset);
678 if (pthread_mutex_trylock (&_state->state_lock)) {
679 /* by convention 'effSetChunk' should not be called while processing
680 * http://www.reaper.fm/sdk/vst/vst_ext.php
682 * All VSTs don't use in-place, PluginInsert::connect_and_run()
683 * does clear output buffers, so we can just return.
688 _transport_sample = start;
689 _transport_speed = speed;
691 ChanCount bufs_count;
692 bufs_count.set(DataType::AUDIO, 1);
693 bufs_count.set(DataType::MIDI, 1);
696 BufferSet& silent_bufs = _session.get_silent_buffers(bufs_count);
697 BufferSet& scratch_bufs = _session.get_scratch_buffers(bufs_count);
699 /* VC++ doesn't support the C99 extension that allows
701 typeName foo[variableDefiningSize];
703 Use alloca instead of dynamic array (rather than std::vector which
704 allocs on the heap) because this is realtime code.
707 float** ins = (float**)alloca(_plugin->numInputs*sizeof(float*));
708 float** outs = (float**)alloca(_plugin->numOutputs*sizeof(float*));
712 uint32_t in_index = 0;
713 for (i = 0; i < (int32_t) _plugin->numInputs; ++i) {
716 index = in_map.get(DataType::AUDIO, in_index++, &valid);
718 ? bufs.get_audio(index).data(offset)
719 : silent_bufs.get_audio(0).data(offset);
722 uint32_t out_index = 0;
723 for (i = 0; i < (int32_t) _plugin->numOutputs; ++i) {
726 index = out_map.get(DataType::AUDIO, out_index++, &valid);
728 ? bufs.get_audio(index).data(offset)
729 : scratch_bufs.get_audio(0).data(offset);
732 if (bufs.count().n_midi() > 0) {
735 const uint32_t buf_index_in = in_map.get(DataType::MIDI, 0, &valid);
736 /* TODO: apply offset to MIDI buffer and trim at nframes */
738 v = bufs.get_vst_midi (buf_index_in);
741 const uint32_t buf_index_out = out_map.get(DataType::MIDI, 0, &valid);
743 _midi_out_buf = &bufs.get_midi(buf_index_out);
744 /* TODO: apply offset to MIDI buffer and trim at nframes */
745 _midi_out_buf->silence(nframes, offset);
750 _plugin->dispatcher (_plugin, effProcessEvents, 0, 0, v, 0);
754 /* we already know it can support processReplacing */
755 _plugin->processReplacing (_plugin, &ins[0], &outs[0], nframes);
758 pthread_mutex_unlock (&_state->state_lock);
763 VSTPlugin::unique_id () const
767 snprintf (buf, sizeof (buf), "%d", _plugin->uniqueID);
774 VSTPlugin::name () const
776 if (!_info->name.empty ()) {
777 return _info->name.c_str();
779 return _handle->name;
783 VSTPlugin::maker () const
785 return _info->creator.c_str();
789 VSTPlugin::label () const
791 return _handle->name;
795 VSTPlugin::version () const
797 return _plugin->version;
801 VSTPlugin::parameter_count () const
803 return _plugin->numParams;
807 VSTPlugin::has_editor () const
809 return _plugin->flags & effFlagsHasEditor;
813 VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
816 assert (len > VestigeMaxShortLabelLen);
817 memset (buf, 0, len);
819 _plugin->dispatcher (_plugin, 7 /* effGetParamDisplay */, param, 0, buf, 0);
821 if (buf[0] == '\0') {
828 while (*first_nonws && isspace (*first_nonws)) {
832 if (*first_nonws == '\0') {
836 memmove (buf, first_nonws, strlen (buf) - (first_nonws - buf) + 1);
841 VSTPlugin::find_presets ()
843 /* Built-in presets */
845 int const vst_version = _plugin->dispatcher (_plugin, effGetVstVersion, 0, 0, NULL, 0);
846 for (int i = 0; i < _plugin->numPrograms; ++i) {
848 PresetRecord r (string_compose (X_("VST:%1:%2"), unique_id (), std::setw(4), std::setfill('0'), i), "", false);
850 if (vst_version >= 2) {
852 if (_plugin->dispatcher (_plugin, 29, i, 0, buf, 0) == 1) {
855 r.label = string_compose (_("Preset %1"), i);
858 r.label = string_compose (_("Preset %1"), i);
861 _presets.insert (make_pair (r.uri, r));
864 /* User presets from our XML file */
866 boost::shared_ptr<XMLTree> t (presets_tree ());
869 XMLNode* root = t->root ();
870 for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
874 if (!(*i)->get_property (X_("uri"), uri) || !(*i)->get_property (X_("label"), label)) {
878 PresetRecord r (uri, label, true);
879 _presets.insert (make_pair (r.uri, r));
885 /** @return XMLTree with our user presets; could be a new one if no existing
886 * one was found, or 0 if one was present but badly-formatted.
889 VSTPlugin::presets_tree () const
891 XMLTree* t = new XMLTree;
893 std::string p = Glib::build_filename (ARDOUR::user_config_directory (), "presets");
895 if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
896 if (g_mkdir_with_parents (p.c_str(), 0755) != 0) {
897 error << _("Unable to make VST presets directory") << endmsg;
901 p = Glib::build_filename (p, presets_file ());
903 if (!Glib::file_test (p, Glib::FILE_TEST_EXISTS)) {
904 t->set_root (new XMLNode (X_("VSTPresets")));
917 /** @return Index of the first user preset in our lists */
919 VSTPlugin::first_user_preset_index () const
921 return _plugin->numPrograms;
925 VSTPlugin::presets_file () const
927 return string("vst-") + unique_id ();
931 VSTPluginInfo::VSTPluginInfo (VSTInfo* nfo)
935 snprintf (buf, sizeof (buf), "%d", nfo->UniqueID);
941 creator = nfo->creator;
942 n_inputs.set_audio (nfo->numInputs);
943 n_outputs.set_audio (nfo->numOutputs);
944 n_inputs.set_midi ((nfo->wantMidi & 1) ? 1 : 0);
945 n_outputs.set_midi ((nfo->wantMidi & 2) ? 1 : 0);
947 _is_instrument = nfo->isInstrument;
951 VSTPluginInfo::is_instrument () const
953 if (_is_instrument) {
956 return PluginInfo::is_instrument ();