13 #ifndef __INSTRUMENT_H__ 14 #define __INSTRUMENT_H__ 27 class InstrumentTemplate;
33 class ChannelListener;
92 MidiArticulation(
const QString& n,
const QString& d,
int v,
int g) : name(n), descr(d), velocity(v), gateTime(g) {}
106 static const int DEFAULT_COLOR = 0x3399ff;
126 bool _userBankController =
false;
127 bool _switchedToExpressive =
false;
129 mutable std::vector<MidiCoreEvent>
_init;
130 mutable bool _mustUpdateInit =
true;
134 static constexpr
char defaultVolume = 100;
136 enum class A : char {
137 HBANK, LBANK,
PROGRAM, VOLUME, PAN, CHORUS, REVERB,
143 SOLOMUTE, SOLO, MUTE, SYNTI, CHANNEL, USER_BANK_CONTROL
151 std::vector<MidiCoreEvent>& initList()
const;
154 void setName(
const QString& value);
155 QString
descr()
const {
return _descr; }
156 void setDescr(
const QString& value);
157 QString
synti()
const {
return _synti; }
158 void setSynti(
const QString& value);
159 int color()
const {
return _color; }
160 void setColor(
int value);
163 void setVolume(
char value);
164 char pan()
const {
return _pan; }
165 void setPan(
char value);
167 void setChorus(
char value);
169 void setReverb(
char value);
172 void setProgram(
int value);
173 int bank()
const {
return _bank; }
174 void setBank(
int value);
176 void setChannel(
int value);
179 void setSoloMute(
bool value);
180 bool mute()
const {
return _mute; }
181 void setMute(
bool value);
182 bool solo()
const {
return _solo; }
183 void setSolo(
bool value);
187 void setUserBankController(
bool val);
195 void updateInitList()
const;
201 void switchExpressive(
Synthesizer* synth,
bool expressive,
bool force =
false);
277 bool readProperties(
XmlReader&,
Part* ,
bool* customDrumset);
280 int channelIdx(
const QString& s)
const;
281 void updateVelocity(
int* velocity,
int channel,
const QString&
name);
282 void updateGateTime(
int*
gateTime,
int channelIdx,
const QString&
name);
295 void setDrumset(
const Drumset* ds);
299 void setUseDrumset(
bool val);
309 const QList<NamedEventList>&
midiActions()
const {
return _midiActions; }
310 const QList<MidiArticulation>&
articulation()
const {
return _articulation; }
312 const QList<Channel*>&
channel()
const {
return _channel; }
321 void setLongName(
const QString& f);
322 void setShortName(
const QString& f);
327 int minPitchP()
const;
328 int maxPitchP()
const;
329 int minPitchA()
const;
330 int maxPitchA()
const;
331 QString instrumentId()
const;
333 const QList<StaffName>& longNames()
const;
334 const QList<StaffName>& shortNames()
const;
335 QList<StaffName>& longNames();
337 QList<StaffName>& shortNames();
338 QString trackName()
const;
339 void setTrackName(
const QString& s);
344 void setSingleNoteDynamicsFromTemplate();
345 bool getSingleNoteDynamicsFromTemplate()
const;
void setTranspose(const Interval &v)
Definition: instrument.h:291
std::vector< MidiCoreEvent > _init
Definition: instrument.h:129
QString descr
Definition: instrument.h:71
QString name
Definition: instrument.h:84
char volume() const
Definition: instrument.h:162
bool singleNoteDynamics() const
Definition: instrument.h:342
bool _singleNoteDynamics
Definition: instrument.h:268
QString _synti
Definition: instrument.h:109
void setMaxPitchA(int v)
Definition: instrument.h:289
char chorus() const
Definition: instrument.h:166
int pos() const
Definition: instrument.h:51
bool solo() const
Definition: instrument.h:182
static Instrument defaultInstrument
Definition: instrument.h:354
QString _name
Definition: instrument.h:41
const StringData * stringData() const
Definition: instrument.h:318
int gateTime
Definition: instrument.h:87
Definition: synthesizer.h:41
~PartChannelSettingsLink()
Definition: instrument.h:241
void setNotifier(Notifier< Data > *n)
Definition: notifier.hpp:127
Definition: instrument.h:83
QString name() const
Definition: instrument.h:52
char _pan
Definition: instrument.h:112
void setMinPitchA(int v)
Definition: instrument.h:288
MidiArticulation(const QString &n, const QString &d, int v, int g)
Definition: instrument.h:92
Interval _transpose
Definition: instrument.h:256
int program() const
Definition: instrument.h:171
Definition: notifier.hpp:25
int _channel
Definition: instrument.h:119
char _volume
Definition: instrument.h:111
bool mute() const
Definition: instrument.h:180
Prop
Definition: instrument.h:141
QString _name
Definition: instrument.h:103
Definition: instrument.h:250
Definition: instrument.h:69
int channel() const
Definition: instrument.h:175
int color() const
Definition: instrument.h:159
QString name() const
Definition: instrument.h:153
QString descr() const
Definition: instrument.h:155
Channel * _bound
Definition: instrument.h:227
QString _descr
Definition: instrument.h:104
QList< MidiArticulation > _articulation
Definition: instrument.h:264
Channel * channel(int idx)
Definition: instrument.h:302
Definition of classes Clef.
const Channel * channel(int idx) const
Definition: instrument.h:303
bool _mute
Definition: instrument.h:122
Definition: instrument.h:40
void notify(Data d) const
Definition: notifier.hpp:92
int _bank
Definition: instrument.h:118
char _chorus
Definition: instrument.h:114
Definition: editdrumset.cpp:32
int main(int, char *[])
Definition: ltest.cpp:27
Definition: stringdata.h:35
void read(XmlReader &)
Definition: instrument.cpp:195
bool soloMute() const
Definition: instrument.h:178
Drumset * _drumset
Definition: instrument.h:260
int _color
Definition: instrument.h:107
QList< NamedEventList > midiActions
Definition: instrument.h:189
char _reverb
Definition: instrument.h:115
StaffNameList _shortNames
Definition: instrument.h:252
bool operator==(const StaffName &) const
Definition: instrument.cpp:1194
A
Definition: instrument.h:136
void setMaxPitchP(int v)
Definition: instrument.h:287
QString descr
Definition: instrument.h:85
QString _instrumentId
Definition: instrument.h:257
void swap(PartChannelSettingsLink &l1, PartChannelSettingsLink &l2)
Definition: instrument.cpp:966
const QList< Channel * > & channel() const
Definition: instrument.h:312
void clearChannels()
Definition: instrument.h:314
bool userBankController() const
Definition: instrument.h:186
char reverb() const
Definition: instrument.h:168
bool useDrumset() const
Definition: instrument.h:298
bool _soloMute
Definition: instrument.h:121
void setSingleNoteDynamics(bool val)
Definition: instrument.h:343
int _pos
Definition: instrument.h:42
Notifier< Channel::Prop > _notifier
Definition: instrument.h:147
void setMidiActions(const QList< NamedEventList > &l)
Definition: instrument.h:316
StaffName()
Definition: instrument.h:45
bool _excerpt
Definition: instrument.h:228
char pan() const
Definition: instrument.h:164
int velocity
Definition: instrument.h:86
bool _solo
Definition: instrument.h:123
QList< NamedEventList > _midiActions
Definition: instrument.h:263
std::vector< MidiCoreEvent > events
Definition: instrument.h:72
Interval transpose() const
Definition: instrument.h:290
const QList< NamedEventList > & midiActions() const
Definition: instrument.h:309
void addListener(ChannelListener *l)
Definition: instrument.cpp:907
Definition: interval.h:22
void setAmateurPitchRange(int a, int b)
Definition: instrument.h:300
Definition: aeolus.cpp:26
QString instrumentId()
Definition: instrument.h:292
Channel * _main
Definition: instrument.h:226
QString _trackName
Definition: instrument.h:253
void firePropertyChanged(Channel::Prop prop)
Definition: instrument.h:148
QList< ClefTypeList > _clefType
Definition: instrument.h:266
void write(XmlWriter &xml, const char *name) const
Definition: instrument.cpp:181
const QList< MidiArticulation > & articulation() const
Definition: instrument.h:310
static const char * DEFAULT_NAME
Definition: instrument.h:133
Definition: inspectorAmbitus.cpp:21
Definition: xmlwriter.h:26
void receive(Channel::Prop prop) override
Definition: instrument.h:214
bool _useDrumset
Definition: instrument.h:259
InstrumentList()
Definition: instrument.h:357
int _program
Definition: instrument.h:117
QString name
Definition: instrument.h:70
Definition: instrument.h:100
QList< Channel * > _channel
Definition: instrument.h:265
void setNotifier(Channel *ch)
Definition: instrument.h:211
Definition: xmlreader.h:28
char _minPitchP
Definition: instrument.h:255
static bool isExcerptProperty(Channel::Prop p)
Definition: instrument.h:230
StaffNameList _longNames
Definition: instrument.h:251
Definition: instrument.h:208
void setMinPitchP(int v)
Definition: instrument.h:286
bool operator==(const Channel &c)
Definition: instrument.h:196
Definition: instrtemplate.h:48
Definition: instrument.h:353
void setArticulation(const QList< MidiArticulation > &l)
Definition: instrument.h:317
int bank() const
Definition: instrument.h:173
Definition: instrument.h:221
void appendChannel(Channel *c)
Definition: instrument.h:313
StringData _stringData
Definition: instrument.h:261
static const std::initializer_list< Channel::Prop > excerptProperties
Definition: instrument.h:223
void setInstrumentId(const QString &instrumentId)
Definition: instrument.h:293
QList< MidiArticulation > articulation
Definition: instrument.h:190
QString synti() const
Definition: instrument.h:157
bool operator==(const NamedEventList &i) const
Definition: instrument.h:76
Drumset * drumset()
Definition: instrument.h:297
Definition: instrument.h:59
void setProfessionalPitchRange(int a, int b)
Definition: instrument.h:301
void setStringData(const StringData &d)
Definition: instrument.h:319
MidiArticulation()
Definition: instrument.h:91
PartChannelSettingsLink()
Definition: instrument.h:235
const Drumset * drumset() const
Definition: instrument.h:296