#include <gig.h>
Inheritance diagram for gig::Instrument:
Public Member Functions | |
Region * | GetFirstRegion () |
Returns the first Region of the instrument. | |
Region * | GetNextRegion () |
Returns the next Region of the instrument. | |
Region * | AddRegion () |
void | DeleteRegion (Region *pRegion) |
virtual void | UpdateChunks () |
Apply Instrument with all its Regions to the respective RIFF chunks. | |
Region * | GetRegion (unsigned int Key) |
Returns the appropriate Region for a triggered note. | |
Public Attributes | |
int32_t | Attenuation |
in dB | |
uint16_t | EffectSend |
int16_t | FineTune |
in cents | |
uint16_t | PitchbendRange |
Number of semitones pitchbend controller can pitch (default is 2). | |
bool | PianoReleaseMode |
range_t | DimensionKeyRange |
0-127 (where 0 means C1 and 127 means G9) | |
Protected Types | |
typedef std::list< Region * > | RegionList |
typedef std::list< Articulation * > | ArticulationList |
Protected Member Functions | |
Instrument (File *pFile, RIFF::List *insList, progress_t *pProgress=NULL) | |
~Instrument () | |
Destructor. | |
void | UpdateRegionKeyTable () |
void | DeleteRegion (Region *pRegion) |
virtual void | LoadRegions () |
Resource * | GetParent () |
Articulation * | GetFirstArticulation () |
Articulation * | GetNextArticulation () |
void | LoadArticulations () |
Protected Attributes | |
Region * | RegionKeyTable [128] |
fast lookup for the corresponding Region of a MIDI key | |
bool | IsDrum |
Indicates if the Instrument is a drum type, as they differ in the synthesis model of DLS from melodic instruments. | |
uint16_t | MIDIBank |
Reflects combination of MIDIBankCoarse and MIDIBankFine (bank 1 - bank 16384). Do not change this value, it will not be saved! Change MIDIBankCoarse and MIDIBankFine instead (we might change that in future). | |
uint8_t | MIDIBankCoarse |
Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128). | |
uint8_t | MIDIBankFine |
Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128). | |
uint32_t | MIDIProgram |
Specifies the MIDI Program Change Number this Instrument should be assigned to. | |
uint32_t | Regions |
Reflects the number of Region defintions this Instrument has. | |
RIFF::List * | pCkInstrument |
RegionList * | pRegions |
RegionList::iterator | RegionsIterator |
Info * | pInfo |
Points (in any case) to an Info object, providing additional, optional infos and comments. | |
dlsid_t * | pDLSID |
Points to a dlsid_t structure if the file provided a DLS ID else is NULL. | |
Resource * | pParent |
RIFF::List * | pResourceList |
RIFF::List * | pParentList |
ArticulationList * | pArticulations |
ArticulationList::iterator | ArticulationsIterator |
Friends | |
class | File |
Definition at line 609 of file gig.h.
typedef std::list<Region*> DLS::Instrument::RegionList [protected, inherited] |
typedef std::list<Articulation*> DLS::Articulator::ArticulationList [protected, inherited] |
gig::Instrument::Instrument | ( | File * | pFile, | |
RIFF::List * | insList, | |||
progress_t * | pProgress = NULL | |||
) | [protected] |
Definition at line 2537 of file gig.cpp.
References gig::__notify_progress(), Attenuation, CHUNK_ID_3EWG, DimensionKeyRange, EffectSend, FineTune, RIFF::List::GetFirstSubList(), RIFF::List::GetListType(), RIFF::List::GetNextSubList(), RIFF::List::GetSubChunk(), RIFF::List::GetSubList(), gig::range_t::high, LIST_TYPE_LART, LIST_TYPE_LRGN, LIST_TYPE_RGN, gig::range_t::low, PianoReleaseMode, DLS::Resource::pInfo, PitchbendRange, DLS::Instrument::pRegions, RIFF::Chunk::ReadInt16(), RIFF::Chunk::ReadInt32(), RIFF::Chunk::ReadUint16(), RIFF::Chunk::ReadUint8(), RegionKeyTable, DLS::Instrument::Regions, and UpdateRegionKeyTable().
gig::Instrument::~Instrument | ( | ) | [protected, virtual] |
Destructor.
Removes RIFF chunks associated with this Instrument and frees all memory occupied by this instrument.
Reimplemented from DLS::Instrument.
Region * gig::Instrument::GetFirstRegion | ( | ) |
Returns the first Region of the instrument.
You have to call this method once before you use GetNextRegion().
Reimplemented from DLS::Instrument.
Definition at line 2655 of file gig.cpp.
References DLS::Instrument::pRegions, and DLS::Instrument::RegionsIterator.
Referenced by PrintRegions().
Region * gig::Instrument::GetNextRegion | ( | ) |
Returns the next Region of the instrument.
You have to call GetFirstRegion() once before you can use this method. By calling this method multiple times it iterates through the available Regions.
Reimplemented from DLS::Instrument.
Definition at line 2669 of file gig.cpp.
References DLS::Instrument::pRegions, and DLS::Instrument::RegionsIterator.
Region * gig::Instrument::AddRegion | ( | ) |
Reimplemented from DLS::Instrument.
Definition at line 2675 of file gig.cpp.
References RIFF::List::AddSubList(), RIFF::List::GetSubList(), LIST_TYPE_LRGN, LIST_TYPE_RGN, DLS::Instrument::pCkInstrument, DLS::Instrument::pRegions, DLS::Instrument::Regions, and UpdateRegionKeyTable().
Referenced by GigWriteTest::createNewGigFile().
void gig::Instrument::DeleteRegion | ( | Region * | pRegion | ) |
Definition at line 2689 of file gig.cpp.
References DLS::Instrument::DeleteRegion(), DLS::Instrument::pRegions, and UpdateRegionKeyTable().
void gig::Instrument::UpdateChunks | ( | ) | [virtual] |
Apply Instrument with all its Regions to the respective RIFF chunks.
You have to call File::Save() to make changes persistent.
Usually there is absolutely no need to call this method explicitly. It will be called automatically when File::Save() was called.
gig::Exception | if samples cannot be dereferenced |
Reimplemented from DLS::Instrument.
Definition at line 2600 of file gig.cpp.
References RIFF::List::AddSubChunk(), RIFF::List::AddSubList(), Attenuation, CHUNK_ID_3EWG, DimensionKeyRange, EffectSend, FineTune, RIFF::List::GetSubChunk(), RIFF::List::GetSubList(), gig::range_t::high, LIST_TYPE_LART, RIFF::Chunk::LoadChunkData(), gig::range_t::low, DLS::Instrument::pCkInstrument, PianoReleaseMode, PitchbendRange, DLS::Instrument::pRegions, and DLS::Instrument::UpdateChunks().
Region * gig::Instrument::GetRegion | ( | unsigned int | Key | ) |
Returns the appropriate Region for a triggered note.
Key | MIDI Key number of triggered note / key (0 - 127) |
Definition at line 2637 of file gig.cpp.
References DLS::Instrument::pRegions, and RegionKeyTable.
void gig::Instrument::UpdateRegionKeyTable | ( | ) | [protected] |
Definition at line 2577 of file gig.cpp.
References DLS::Instrument::pRegions, and RegionKeyTable.
Referenced by AddRegion(), DeleteRegion(), and Instrument().
void DLS::Instrument::DeleteRegion | ( | Region * | pRegion | ) | [inherited] |
Definition at line 945 of file DLS.cpp.
References DLS::Instrument::pRegions, and DLS::Instrument::Regions.
Referenced by DeleteRegion().
void DLS::Instrument::LoadRegions | ( | ) | [protected, virtual, inherited] |
Definition at line 919 of file DLS.cpp.
References RIFF::List::GetFirstSubList(), RIFF::List::GetListType(), RIFF::List::GetNextSubList(), RIFF::List::GetSubList(), LIST_TYPE_LRGN, LIST_TYPE_RGN, LIST_TYPE_RGN2, DLS::Instrument::pCkInstrument, and DLS::Instrument::pRegions.
Referenced by DLS::Instrument::AddRegion(), and DLS::Instrument::GetFirstRegion().
Resource* DLS::Resource::GetParent | ( | ) | [inline, inherited] |
Definition at line 337 of file DLS.h.
References DLS::Resource::pParent.
Referenced by gig::Region::AddDimension(), DLS::Region::GetSample(), gig::Region::GetSampleFromWavePool(), gig::Region::Region(), gig::Region::UpdateChunks(), and DLS::Region::UpdateChunks().
Articulation * DLS::Articulator::GetFirstArticulation | ( | ) | [inherited] |
Definition at line 167 of file DLS.cpp.
References DLS::Articulator::ArticulationsIterator, DLS::Articulator::LoadArticulations(), and DLS::Articulator::pArticulations.
Articulation * DLS::Articulator::GetNextArticulation | ( | ) | [inherited] |
Definition at line 174 of file DLS.cpp.
References DLS::Articulator::ArticulationsIterator, and DLS::Articulator::pArticulations.
void DLS::Articulator::LoadArticulations | ( | ) | [protected, inherited] |
Definition at line 180 of file DLS.cpp.
References CHUNK_ID_ART2, CHUNK_ID_ARTL, RIFF::Chunk::GetChunkID(), RIFF::List::GetFirstSubChunk(), RIFF::List::GetListType(), RIFF::List::GetNextSubChunk(), RIFF::List::GetSubList(), LIST_TYPE_LAR2, LIST_TYPE_LART, DLS::Articulator::pArticulations, and DLS::Articulator::pParentList.
Referenced by DLS::Articulator::GetFirstArticulation().
friend class File [friend] |
int32_t gig::Instrument::Attenuation |
uint16_t gig::Instrument::EffectSend |
int16_t gig::Instrument::FineTune |
uint16_t gig::Instrument::PitchbendRange |
Number of semitones pitchbend controller can pitch (default is 2).
Definition at line 625 of file gig.h.
Referenced by Instrument(), and UpdateChunks().
0-127 (where 0 means C1 and 127 means G9)
Definition at line 627 of file gig.h.
Referenced by Instrument(), and UpdateChunks().
Region* gig::Instrument::RegionKeyTable[128] [protected] |
fast lookup for the corresponding Region of a MIDI key
Definition at line 641 of file gig.h.
Referenced by GetRegion(), Instrument(), and UpdateRegionKeyTable().
bool DLS::Instrument::IsDrum [inherited] |
Indicates if the Instrument is a drum type, as they differ in the synthesis model of DLS from melodic instruments.
Definition at line 437 of file DLS.h.
Referenced by DLS::Instrument::Instrument(), and DLS::Instrument::UpdateChunks().
uint16_t DLS::Instrument::MIDIBank [inherited] |
Reflects combination of MIDIBankCoarse and MIDIBankFine (bank 1 - bank 16384). Do not change this value, it will not be saved! Change MIDIBankCoarse and MIDIBankFine instead (we might change that in future).
Definition at line 438 of file DLS.h.
Referenced by DLS::Instrument::Instrument(), PrintInstruments(), and DLS::Instrument::UpdateChunks().
uint8_t DLS::Instrument::MIDIBankCoarse [inherited] |
Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128).
Definition at line 439 of file DLS.h.
Referenced by DLS::Instrument::Instrument(), and DLS::Instrument::UpdateChunks().
uint8_t DLS::Instrument::MIDIBankFine [inherited] |
Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128).
Definition at line 440 of file DLS.h.
Referenced by DLS::Instrument::Instrument(), and DLS::Instrument::UpdateChunks().
uint32_t DLS::Instrument::MIDIProgram [inherited] |
Specifies the MIDI Program Change Number this Instrument should be assigned to.
Definition at line 441 of file DLS.h.
Referenced by DLS::Instrument::Instrument(), PrintInstruments(), and DLS::Instrument::UpdateChunks().
uint32_t DLS::Instrument::Regions [inherited] |
Reflects the number of Region defintions this Instrument has.
Definition at line 442 of file DLS.h.
Referenced by AddRegion(), DLS::Instrument::AddRegion(), DLS::Instrument::DeleteRegion(), Instrument(), DLS::Instrument::Instrument(), and DLS::Instrument::UpdateChunks().
RIFF::List* DLS::Instrument::pCkInstrument [protected, inherited] |
Definition at line 456 of file DLS.h.
Referenced by AddRegion(), DLS::Instrument::AddRegion(), DLS::Instrument::Instrument(), DLS::Instrument::LoadRegions(), UpdateChunks(), DLS::Instrument::UpdateChunks(), and DLS::Instrument::~Instrument().
RegionList* DLS::Instrument::pRegions [protected, inherited] |
Definition at line 457 of file DLS.h.
Referenced by AddRegion(), DLS::Instrument::AddRegion(), DeleteRegion(), DLS::Instrument::DeleteRegion(), GetFirstRegion(), DLS::Instrument::GetFirstRegion(), GetNextRegion(), DLS::Instrument::GetNextRegion(), GetRegion(), Instrument(), DLS::Instrument::Instrument(), DLS::Instrument::LoadRegions(), UpdateChunks(), DLS::Instrument::UpdateChunks(), UpdateRegionKeyTable(), and DLS::Instrument::~Instrument().
RegionList::iterator DLS::Instrument::RegionsIterator [protected, inherited] |
Definition at line 458 of file DLS.h.
Referenced by GetFirstRegion(), DLS::Instrument::GetFirstRegion(), GetNextRegion(), and DLS::Instrument::GetNextRegion().
Info* DLS::Resource::pInfo [inherited] |
Points (in any case) to an Info object, providing additional, optional infos and comments.
Definition at line 334 of file DLS.h.
Referenced by GigWriteTest::createNewGigFile(), ExtractSamples(), gig::File::File(), Instrument(), main(), PrintDimensionRegions(), PrintFileInformations(), PrintInstruments(), PrintRegions(), PrintSamples(), gig::Region::Region(), DLS::Resource::Resource(), gig::Sample::Sample(), GigWriteTest::testArticulationsOfCreatedGigFile(), DLS::Resource::UpdateChunks(), and DLS::Resource::~Resource().
dlsid_t* DLS::Resource::pDLSID [inherited] |
Points to a dlsid_t structure if the file provided a DLS ID else is NULL.
Definition at line 335 of file DLS.h.
Referenced by DLS::Resource::Resource(), and DLS::Resource::~Resource().
Resource* DLS::Resource::pParent [protected, inherited] |
Definition at line 340 of file DLS.h.
Referenced by DLS::Resource::GetParent(), DLS::Resource::Resource(), gig::Sample::UpdateChunks(), DLS::Instrument::~Instrument(), DLS::Region::~Region(), and DLS::Sample::~Sample().
RIFF::List* DLS::Resource::pResourceList [protected, inherited] |
RIFF::List* DLS::Articulator::pParentList [protected, inherited] |
Definition at line 291 of file DLS.h.
Referenced by DLS::Articulator::Articulator(), and DLS::Articulator::LoadArticulations().
ArticulationList* DLS::Articulator::pArticulations [protected, inherited] |
Definition at line 292 of file DLS.h.
Referenced by DLS::Articulator::Articulator(), DLS::Articulator::GetFirstArticulation(), DLS::Articulator::GetNextArticulation(), DLS::Articulator::LoadArticulations(), DLS::Articulator::UpdateChunks(), and DLS::Articulator::~Articulator().
ArticulationList::iterator DLS::Articulator::ArticulationsIterator [protected, inherited] |
Definition at line 293 of file DLS.h.
Referenced by DLS::Articulator::GetFirstArticulation(), and DLS::Articulator::GetNextArticulation().