#include <Instrument.h>
Collaboration diagram for TSE3::Ins::Instrument:
Public Types | |
enum | BankSelMethod { BankSelMethod_Normal = 0, BankSelMethod_MSB = 1, BankSelMethod_LSB = 2, BankSelMethod_Patch = 3 } |
Public Member Functions | |
Instrument (const std::string &title, const std::string &filename, TSE3::Progress *progess=0) | |
const std::string & | title () const |
const std::string & | filename () const |
void | setTitle (const std::string &title) |
int | bankSelMethod () const |
void | setBankSelMethod (int b) |
bool | useNotesAsController () const |
void | setUseNotesAsControllers (bool u) |
size_t | numBanks () const |
int | bank (int index) const |
int | bank (const Voice &voice) const |
int | bankLSB (int index) const |
int | bankMSB (int index) const |
PatchData * | patch (int index) const |
PatchData * | patchForBank (int bank) const |
PatchData * | patchForBank (int bankLSB, int bankMSB) const |
size_t | numKeys () const |
NoteData * | key (size_t index) const |
NoteData * | keyForVoice (const Voice &voice) const |
size_t | numDrums () const |
Voice | drum (size_t index) const |
bool | isDrum (const Voice &voice) const |
ControlData * | control () const |
RpnData * | rpn () const |
NrpnData * | nrpn () const |
void | write (std::ostream &out) |
The Instrument class holds information about a specific MIDI instrument. This includes the voices it provides, control commands it understands, drum note names and so on.
The Instrument class is based on the instrument definitions supplied in Cakewalk .ins instrument definition files.
|
An enum type defining the Instrument's bank select method. It has the following values
|
|
Creates an instrument with the given name from information contained in the given file. This file will be a Cakewalk .ins file. Whilst the file is being loaded, the progess can be reported via the interface.
|
|
Returns the title of this instrument.
|
|
Returns the filename of the source of the instrument definition.
|
|
Sets the title.
|
|
Returns the BankSelMethod, the values for this are defined as the BankSelMethod_XXX constants.
|
|
Sets the BankSelMethod.
|
|
Returns the UseNotesAsControllers value.
|
|
Sets the UseNotesAsControllers value.
|
|
Returns the number of banks of patch data defined by this instrument.
|
|
Returns the bank number in the form:
|
|
Returns the bank number in the form:
|
|
Returns the bank LSB for the set of patches with index If you call this method with an invalid parameter, the result is undefined.
|
|
Returns the bank MSB for the set of patches with index If you call this method with an invalid parameter, the result is undefined.
|
|
Returns the PatchData object for the given bank.
|
|
Returns the PatchData object for the given bank, or 0 if there is none. Note that this function takes the bank change number (as read from bank()), not the bank index. If there is no PatchData for this bank, then zero is returned.
You can specify
|
|
Like the patchForBank(int) above, but takes the LSB and MSB parameters separately. This function actually fowards responsibility onto the other version. It is provided as a convenience. If either of the LSB or MSB parameters are -1, then the overal bank value passed on is -1.
|
|
Returns the number of sets of NoteData defined by this instrument.
|
|
Returns the NoteData with the given If you call this method with an invalid parameter, the result is undefined.
|
|
Returns the NoteData for the given Voice. If there is no such Voice, then zero is returned.
|
|
Returns the number of drum statuses defined by this instrument.
|
|
Returns the drum Voice with the given If you call this method with an invalid parameter, the result is undefined.
|
|
Returns whether the specified
|
|
Returns the ControlData for this Instrument, if there is any defined, or zero if there is none.
|
|
Returns the RpnData for this Instrument, if there is any defined, or zero if there is none.
|
|
Returns the NrpnData for this Instrument, if there is any defined, or zero if there is none.
|
|
Write the minimal .ins file for this instrument.
|