Unable to set Channel.midiBank and Channel.midiProgram value via Addin script

• Mar 16, 2021 - 06:40
Reported version
3.6
Type
Plugins
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

It seems the code in instruments.h needs to follow the sample in the channel.mute lines to update midiBank and midi.Program as integers range 1 to 16
ie append { activeChannel()->setmidiBank(qBound(1, val, 16)); }
ie append { activeChannel()->setmidiBank(qBound(1, val, 16)); }

   bool mute() const { return _channel->mute(); }
   void setMute(bool val) { activeChannel()->setMute(val); }

   int midiProgram() const { return _channel->program(); }
   void setMidiProgram(int prog);  // < change here ---------------------------------<<
   int midiBank() const { return _channel->bank(); }
   void setMidiBank(int bank);  // < change here ---------------------------------<<

Comments

Status active needs info

What code exactly (branch, file and line) and where are you talking about? in ...libmscore/instruments.h I find nothing even remotely similar to your description/code snippet (and that isn't the place for code used by plugins anyhow).
And why would this be a bug? Adding the ability of making some setting available to Plugins whould be a Suggestes (AKA feature request)

For the 3.x branch maybe you're talking about mscore/plugin/api/instrument.cpp lines 65-83?