#include <gig.h>
Inheritance diagram for gig::Region:
Public Member Functions | |
DimensionRegion * | GetDimensionRegionByValue (const uint DimValues[8]) |
Use this method in your audio engine to get the appropriate dimension region with it's articulation data for the current situation. | |
DimensionRegion * | GetDimensionRegionByBit (const uint8_t DimBits[8]) |
Returns the appropriate DimensionRegion for the given dimension bit numbers (zone index). | |
Sample * | GetSample () |
Returns pointer address to the Sample referenced with this region. | |
void | AddDimension (dimension_def_t *pDimDef) |
Einstein would have dreamed of it - create a new dimension. | |
void | DeleteDimension (dimension_def_t *pDimDef) |
Delete an existing dimension. | |
virtual void | UpdateChunks () |
Apply Region settings and all its DimensionRegions to the respective RIFF chunks. | |
void | SetSample (Sample *pSample) |
Assign another sample to this Region. | |
Resource * | GetParent () |
Articulation * | GetFirstArticulation () |
Articulation * | GetNextArticulation () |
Public Attributes | |
unsigned int | Dimensions |
Number of defined dimensions, do not alter! | |
dimension_def_t | pDimensionDefinitions [8] |
Defines the five (gig2) or eight (gig3) possible dimensions (the dimension's controller and number of bits/splits). Use AddDimension() and DeleteDimension() to create a new dimension or delete an existing one. | |
uint32_t | DimensionRegions |
Total number of DimensionRegions this Region contains, do not alter! | |
DimensionRegion * | pDimensionRegions [256] |
Pointer array to the 32 (gig2) or 256 (gig3) possible dimension regions (reflects NULL for dimension regions not in use). Avoid to access the array directly and better use GetDimensionRegionByValue() instead, but of course in some cases it makes sense to use the array (e.g. iterating through all DimensionRegions). Use AddDimension() and DeleteDimension() to create a new dimension or delete an existing one (which will create or delete the respective dimension region(s) automatically). | |
unsigned int | Layers |
Amount of defined layers (1 - 32). A value of 1 actually means no layering, a value > 1 means there is Layer dimension. The same information can of course also be obtained by accessing pDimensionDefinitions. Do not alter this value! | |
range_t | KeyRange |
range_t | VelocityRange |
uint16_t | KeyGroup |
uint16_t | Layer |
bool | SelfNonExclusive |
bool | PhaseMaster |
uint16_t | PhaseGroup |
bool | MultiChannel |
uint32_t | Channel |
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. | |
uint8_t | UnityNote |
int16_t | FineTune |
int32_t | Gain |
bool | NoSampleDepthTruncation |
bool | NoSampleCompression |
uint32_t | SampleLoops |
Reflects the number of sample loops. | |
sample_loop_t * | pSampleLoops |
Points to the beginning of a sample loop array, or is NULL if there are no loops defined. | |
Protected Types | |
typedef std::list< Articulation * > | ArticulationList |
Protected Member Functions | |
Region (Instrument *pInstrument, RIFF::List *rgnList) | |
void | LoadDimensionRegions (RIFF::List *rgn) |
void | UpdateVelocityTable () |
Sample * | GetSampleFromWavePool (unsigned int WavePoolTableIndex, progress_t *pProgress=NULL) |
~Region () | |
Destructor. | |
void | LoadArticulations () |
Protected Attributes | |
RIFF::List * | pCkRegion |
uint32_t | WavePoolTableIndex |
Sample * | pSample |
uint16_t | FormatOptionFlags |
uint16_t | WaveLinkOptionFlags |
Resource * | pParent |
RIFF::List * | pResourceList |
RIFF::List * | pParentList |
RIFF::List * | pParentList |
ArticulationList * | pArticulations |
ArticulationList::iterator | ArticulationsIterator |
uint32_t | uiHeaderSize |
uint32_t | SamplerOptions |
Friends | |
class | Instrument |
Definition at line 585 of file gig.h.
typedef std::list<Articulation*> DLS::Articulator::ArticulationList [protected, inherited] |
gig::Region::Region | ( | Instrument * | pInstrument, | |
RIFF::List * | rgnList | |||
) | [protected] |
Definition at line 2072 of file gig.cpp.
References RIFF::List::AddSubList(), gig::dimension_def_t::bits, CHUNK_ID_3LNK, gig::dimension_def_t::dimension, gig::dimension_keyboard, gig::dimension_layer, gig::dimension_none, gig::dimension_random, gig::dimension_releasetrigger, gig::dimension_roundrobin, gig::dimension_samplechannel, DimensionRegions, Dimensions, DLS::Resource::GetParent(), GetSample(), GetSampleFromWavePool(), RIFF::List::GetSubChunk(), RIFF::List::GetSubList(), Layers, LIST_TYPE_3EWL, LIST_TYPE_3PRG, LoadDimensionRegions(), pDimensionDefinitions, pDimensionRegions, DLS::Resource::pInfo, gig::DimensionRegion::pSample, DLS::File::pVersion, DLS::File::pWavePoolTable, RIFF::Chunk::ReadUint32(), RIFF::Chunk::ReadUint8(), RIFF::Chunk::SetPos(), gig::dimension_def_t::split_type, gig::split_type_bit, gig::split_type_normal, RIFF::stream_curpos, UpdateVelocityTable(), gig::dimension_def_t::zone_size, and gig::dimension_def_t::zones.
gig::Region::~Region | ( | ) | [protected, virtual] |
Destructor.
Removes RIFF chunks associated with this Region.
Reimplemented from DLS::Region.
Definition at line 2420 of file gig.cpp.
References pDimensionRegions.
DimensionRegion * gig::Region::GetDimensionRegionByValue | ( | const uint | DimValues[8] | ) |
Use this method in your audio engine to get the appropriate dimension region with it's articulation data for the current situation.
Just call the method with the current MIDI controller values and you'll get the DimensionRegion with the appropriate articulation data for the current situation (for this Region of course only). To do that you'll first have to look which dimensions with which controllers and in which order are defined for this Region when you load the .gig file. Special cases are e.g. layer or channel dimensions where you just put in the index numbers instead of a MIDI controller value (means 0 for left channel, 1 for right channel or 0 for layer 0, 1 for layer 1, etc.).
DimValues | MIDI controller values (0-127) for dimension 0 to 7 |
Definition at line 2444 of file gig.cpp.
References gig::dimension_def_t::bits, gig::dimension_velocity, Dimensions, pDimensionDefinitions, pDimensionRegions, gig::split_type_bit, gig::split_type_normal, gig::DimensionRegion::VelocityTable, and gig::DimensionRegion::VelocityUpperLimit.
Referenced by GigWriteTest::testArticulationsOfCreatedGigFile().
DimensionRegion * gig::Region::GetDimensionRegionByBit | ( | const uint8_t | DimBits[8] | ) |
Returns the appropriate DimensionRegion for the given dimension bit numbers (zone index).
You usually use GetDimensionRegionByValue instead of calling this method directly!
DimBits | Bit numbers for dimension 0 to 7 |
Definition at line 2493 of file gig.cpp.
References gig::dimension_def_t::bits, pDimensionDefinitions, and pDimensionRegions.
Sample * gig::Region::GetSample | ( | ) |
Returns pointer address to the Sample referenced with this region.
This is the global Sample for the entire Region (not sure if this is actually used by the Gigasampler engine - I would only use the Sample referenced by the appropriate DimensionRegion instead of this sample).
Reimplemented from DLS::Region.
Definition at line 2512 of file gig.cpp.
References GetSampleFromWavePool(), DLS::Region::pSample, and DLS::Region::WavePoolTableIndex.
Referenced by PrintRegions(), Region(), and GigWriteTest::testArticulationsOfCreatedGigFile().
void gig::Region::AddDimension | ( | dimension_def_t * | pDimDef | ) |
Einstein would have dreamed of it - create a new dimension.
Creates a new dimension with the dimension definition given by pDimDef. The appropriate amount of DimensionRegions will be created. There is a hard limit of dimensions and total amount of "bits" all dimensions can have. This limit is dependant to what gig file format version this file refers to. The gig v2 (and lower) format has a dimension limit and total amount of bits limit of 5, whereas the gig v3 format has a limit of 8.
pDimDef | - defintion of the new dimension |
gig::Exception | if dimension of the same type exists already | |
gig::Exception | if amount of dimensions or total amount of dimension bits limit is violated |
Definition at line 2307 of file gig.cpp.
References RIFF::List::AddSubList(), gig::dimension_def_t::bits, gig::dimension_def_t::dimension, gig::dimension_layer, DimensionRegions, Dimensions, DLS::Resource::GetParent(), Layers, LIST_TYPE_3EWL, DLS::Region::pCkRegion, pDimensionDefinitions, pDimensionRegions, DLS::File::pVersion, ToString(), UpdateVelocityTable(), and gig::dimension_def_t::zones.
void gig::Region::DeleteDimension | ( | dimension_def_t * | pDimDef | ) |
Delete an existing dimension.
Deletes the dimension given by pDimDef and deletes all respective dimension regions, that is all dimension regions where the dimension's bit(s) part is greater than 0. In case of a 'sustain pedal' dimension for example this would delete all dimension regions for the case(s) where the sustain pedal is pressed down.
pDimDef | - dimension to delete |
gig::Exception | if given dimension cannot be found |
Definition at line 2357 of file gig.cpp.
References gig::dimension_def_t::bits, gig::dimension_def_t::dimension, gig::dimension_layer, gig::dimension_none, DimensionRegions, Dimensions, Layers, pDimensionDefinitions, pDimensionRegions, and gig::dimension_def_t::zones.
void gig::Region::UpdateChunks | ( | ) | [virtual] |
Apply Region settings and all its DimensionRegions 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::Region.
Definition at line 2164 of file gig.cpp.
References RIFF::List::AddSubChunk(), gig::dimension_def_t::bits, CHUNK_ID_3LNK, DimensionRegions, DLS::Resource::GetParent(), RIFF::List::GetSubChunk(), RIFF::Chunk::LoadChunkData(), DLS::Region::pCkRegion, pDimensionDefinitions, pDimensionRegions, DLS::Region::pSample, DLS::File::pSamples, DLS::File::pVersion, DLS::Region::UpdateChunks(), and gig::dimension_def_t::zones.
void gig::Region::LoadDimensionRegions | ( | RIFF::List * | rgn | ) | [protected] |
Definition at line 2215 of file gig.cpp.
References RIFF::List::GetFirstSubList(), RIFF::List::GetListType(), RIFF::List::GetNextSubList(), RIFF::List::GetSubList(), LIST_TYPE_3EWL, LIST_TYPE_3PRG, and pDimensionRegions.
Referenced by Region().
void gig::Region::UpdateVelocityTable | ( | ) | [protected] |
Definition at line 2231 of file gig.cpp.
References gig::dimension_def_t::bits, gig::dimension_velocity, DimensionRegions, Dimensions, pDimensionDefinitions, pDimensionRegions, gig::DimensionRegion::VelocityTable, and gig::dimension_def_t::zones.
Referenced by AddDimension(), and Region().
Sample * gig::Region::GetSampleFromWavePool | ( | unsigned int | WavePoolTableIndex, | |
progress_t * | pProgress = NULL | |||
) | [protected] |
Definition at line 2517 of file gig.cpp.
References gig::Sample::FileNo, gig::File::GetFirstSample(), gig::File::GetNextSample(), DLS::Resource::GetParent(), DLS::File::pWavePoolTable, DLS::File::pWavePoolTableHi, and DLS::Sample::ulWavePoolOffset.
Referenced by GetSample(), and Region().
void DLS::Region::SetSample | ( | Sample * | pSample | ) | [inherited] |
Assign another sample to this Region.
pSample | - sample to be assigned |
Definition at line 802 of file DLS.cpp.
References DLS::Region::pSample, and DLS::Region::WavePoolTableIndex.
Referenced by GigWriteTest::createNewGigFile().
Resource* DLS::Resource::GetParent | ( | ) | [inline, inherited] |
Definition at line 337 of file DLS.h.
References DLS::Resource::pParent.
Referenced by AddDimension(), DLS::Region::GetSample(), GetSampleFromWavePool(), 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 Instrument [friend] |
unsigned int gig::Region::Dimensions |
Number of defined dimensions, do not alter!
Definition at line 587 of file gig.h.
Referenced by AddDimension(), DeleteDimension(), GetDimensionRegionByValue(), PrintRegions(), Region(), GigWriteTest::testArticulationsOfCreatedGigFile(), and UpdateVelocityTable().
Defines the five (gig2) or eight (gig3) possible dimensions (the dimension's controller and number of bits/splits). Use AddDimension() and DeleteDimension() to create a new dimension or delete an existing one.
Definition at line 588 of file gig.h.
Referenced by AddDimension(), DeleteDimension(), GetDimensionRegionByBit(), GetDimensionRegionByValue(), PrintRegions(), Region(), UpdateChunks(), and UpdateVelocityTable().
uint32_t gig::Region::DimensionRegions |
Total number of DimensionRegions this Region contains, do not alter!
Definition at line 589 of file gig.h.
Referenced by AddDimension(), DeleteDimension(), Region(), GigWriteTest::testArticulationsOfCreatedGigFile(), UpdateChunks(), and UpdateVelocityTable().
Pointer array to the 32 (gig2) or 256 (gig3) possible dimension regions (reflects NULL for dimension regions not in use). Avoid to access the array directly and better use GetDimensionRegionByValue() instead, but of course in some cases it makes sense to use the array (e.g. iterating through all DimensionRegions). Use AddDimension() and DeleteDimension() to create a new dimension or delete an existing one (which will create or delete the respective dimension region(s) automatically).
Definition at line 590 of file gig.h.
Referenced by AddDimension(), GigWriteTest::createNewGigFile(), DeleteDimension(), GetDimensionRegionByBit(), GetDimensionRegionByValue(), LoadDimensionRegions(), PrintDimensionRegions(), PrintRegions(), Region(), UpdateChunks(), UpdateVelocityTable(), and ~Region().
unsigned int gig::Region::Layers |
Amount of defined layers (1 - 32). A value of 1 actually means no layering, a value > 1 means there is Layer dimension. The same information can of course also be obtained by accessing pDimensionDefinitions. Do not alter this value!
Definition at line 591 of file gig.h.
Referenced by AddDimension(), DeleteDimension(), PrintRegions(), and Region().
range_t DLS::Region::KeyRange [inherited] |
Definition at line 409 of file DLS.h.
Referenced by GigWriteTest::createNewGigFile(), PrintRegions(), DLS::Region::Region(), GigWriteTest::testArticulationsOfCreatedGigFile(), and DLS::Region::UpdateChunks().
range_t DLS::Region::VelocityRange [inherited] |
Definition at line 410 of file DLS.h.
Referenced by GigWriteTest::createNewGigFile(), PrintRegions(), DLS::Region::Region(), GigWriteTest::testArticulationsOfCreatedGigFile(), and DLS::Region::UpdateChunks().
uint16_t DLS::Region::KeyGroup [inherited] |
Definition at line 411 of file DLS.h.
Referenced by GigWriteTest::createNewGigFile(), DLS::Region::Region(), GigWriteTest::testArticulationsOfCreatedGigFile(), and DLS::Region::UpdateChunks().
uint16_t DLS::Region::Layer [inherited] |
Definition at line 412 of file DLS.h.
Referenced by PrintRegions(), DLS::Region::Region(), and DLS::Region::UpdateChunks().
bool DLS::Region::SelfNonExclusive [inherited] |
Definition at line 413 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
bool DLS::Region::PhaseMaster [inherited] |
Definition at line 414 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
uint16_t DLS::Region::PhaseGroup [inherited] |
Definition at line 415 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
bool DLS::Region::MultiChannel [inherited] |
Definition at line 416 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
uint32_t DLS::Region::Channel [inherited] |
Definition at line 417 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
RIFF::List* DLS::Region::pCkRegion [protected, inherited] |
Definition at line 423 of file DLS.h.
Referenced by AddDimension(), DLS::Region::Region(), UpdateChunks(), DLS::Region::UpdateChunks(), and DLS::Region::~Region().
uint32_t DLS::Region::WavePoolTableIndex [protected, inherited] |
Definition at line 424 of file DLS.h.
Referenced by GetSample(), DLS::Region::GetSample(), DLS::Region::Region(), DLS::Region::SetSample(), and DLS::Region::UpdateChunks().
Sample* DLS::Region::pSample [protected, inherited] |
Definition at line 425 of file DLS.h.
Referenced by GetSample(), DLS::Region::GetSample(), DLS::Region::Region(), DLS::Region::SetSample(), UpdateChunks(), and DLS::Region::UpdateChunks().
uint16_t DLS::Region::FormatOptionFlags [protected, inherited] |
Definition at line 426 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
uint16_t DLS::Region::WaveLinkOptionFlags [protected, inherited] |
Definition at line 427 of file DLS.h.
Referenced by DLS::Region::Region(), and DLS::Region::UpdateChunks().
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(), gig::Instrument::Instrument(), main(), PrintDimensionRegions(), PrintFileInformations(), PrintInstruments(), PrintRegions(), PrintSamples(), 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().
RIFF::List* DLS::Sampler::pParentList [protected, inherited] |
Definition at line 360 of file DLS.h.
Referenced by DLS::Sampler::Sampler(), gig::DimensionRegion::UpdateChunks(), and DLS::Sampler::UpdateChunks().
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().
uint8_t DLS::Sampler::UnityNote [inherited] |
Definition at line 350 of file DLS.h.
Referenced by PrintDimensionRegions(), DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
int16_t DLS::Sampler::FineTune [inherited] |
Definition at line 351 of file DLS.h.
Referenced by PrintDimensionRegions(), DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
int32_t DLS::Sampler::Gain [inherited] |
Definition at line 352 of file DLS.h.
Referenced by gig::DimensionRegion::DimensionRegion(), PrintDimensionRegions(), DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
bool DLS::Sampler::NoSampleDepthTruncation [inherited] |
Definition at line 353 of file DLS.h.
Referenced by DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
bool DLS::Sampler::NoSampleCompression [inherited] |
Definition at line 354 of file DLS.h.
Referenced by DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
uint32_t DLS::Sampler::SampleLoops [inherited] |
Reflects the number of sample loops.
Definition at line 355 of file DLS.h.
Referenced by PrintRegions(), gig::Sample::ReadAndLoop(), DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
sample_loop_t* DLS::Sampler::pSampleLoops [inherited] |
Points to the beginning of a sample loop array, or is NULL if there are no loops defined.
Definition at line 356 of file DLS.h.
Referenced by gig::Sample::ReadAndLoop(), DLS::Sampler::Sampler(), DLS::Sampler::UpdateChunks(), and DLS::Sampler::~Sampler().
uint32_t DLS::Sampler::uiHeaderSize [protected, inherited] |
Definition at line 361 of file DLS.h.
Referenced by DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().
uint32_t DLS::Sampler::SamplerOptions [protected, inherited] |
Definition at line 362 of file DLS.h.
Referenced by gig::DimensionRegion::DimensionRegion(), DLS::Sampler::Sampler(), and DLS::Sampler::UpdateChunks().