DLS.h
/***************************************************************************
* *
* libgig - C++ cross-platform Gigasampler format file access library *
* *
* Copyright (C) 2003-2025 by Christian Schoenebeck *
* <cuse@users.sourceforge.net> *
* *
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
***************************************************************************/
#ifndef __DLS_H__
#define __DLS_H__
#include "RIFF.h"
#if WORDS_BIGENDIAN
# define RIFF_TYPE_DLS 0x444C5320
# define LIST_TYPE_WVPL 0x7776706C
# define LIST_TYPE_DWPL 0x6477706C
# define LIST_TYPE_WAVE 0x77617665
# define LIST_TYPE_LINS 0X6C696E73
# define LIST_TYPE_INS 0X696E7320
# define LIST_TYPE_LRGN 0x6C72676E
# define LIST_TYPE_LART 0x6C617274
# define LIST_TYPE_LAR2 0x6C617232
# define LIST_TYPE_RGN 0x72676E20
# define LIST_TYPE_RGN2 0x72676E32
# define CHUNK_ID_IARL 0x4941524C
# define CHUNK_ID_IART 0x49415254
# define CHUNK_ID_ICMS 0x49434D53
# define CHUNK_ID_IGNR 0x49474E52
# define CHUNK_ID_IKEY 0x494B4559
# define CHUNK_ID_IMED 0x494D4544
# define CHUNK_ID_ISBJ 0x4953424A
# define CHUNK_ID_ISRC 0x49535243
# define CHUNK_ID_ISRF 0x49535246
# define CHUNK_ID_ITCH 0x49544348
# define CHUNK_ID_VERS 0x76657273
# define CHUNK_ID_DLID 0x646C6964
# define CHUNK_ID_FMT 0x666D7420
# define CHUNK_ID_DATA 0x64617461
# define CHUNK_ID_INSH 0x696E7368
# define CHUNK_ID_RGNH 0x72676E68
# define CHUNK_ID_WLNK 0x776C6E6B
# define CHUNK_ID_PTBL 0x7074626C
# define CHUNK_ID_WSMP 0x77736D70
# define CHUNK_ID_COLH 0x636F6C68
# define CHUNK_ID_ARTL 0x6172746C
# define CHUNK_ID_ART2 0x61727432
# define CHUNK_ID_XFIL 0x7866696C
# define CHUNK_ID_DOXF 0x646F7866
#else // little endian
# define RIFF_TYPE_DLS 0x20534C44
# define LIST_TYPE_WVPL 0x6C707677
# define LIST_TYPE_DWPL 0x6C707764
# define LIST_TYPE_WAVE 0x65766177
# define LIST_TYPE_LINS 0X736E696C
# define LIST_TYPE_INS 0X20736E69
# define LIST_TYPE_LRGN 0x6E67726C
# define LIST_TYPE_LART 0x7472616C
# define LIST_TYPE_LAR2 0x3272616C
# define LIST_TYPE_RGN 0x206E6772
# define LIST_TYPE_RGN2 0x326E6772
# define CHUNK_ID_IARL 0x4C524149
# define CHUNK_ID_IART 0x54524149
# define CHUNK_ID_ICMS 0x534D4349
# define CHUNK_ID_IGNR 0x524E4749
# define CHUNK_ID_IKEY 0x59454B49
# define CHUNK_ID_IMED 0x44454D49
# define CHUNK_ID_ISBJ 0x4A425349
# define CHUNK_ID_ISRC 0x43525349
# define CHUNK_ID_ISRF 0x46525349
# define CHUNK_ID_ITCH 0x48435449
# define CHUNK_ID_VERS 0x73726576
# define CHUNK_ID_DLID 0x64696C64
# define CHUNK_ID_FMT 0x20746D66
# define CHUNK_ID_DATA 0x61746164
# define CHUNK_ID_INSH 0x68736E69
# define CHUNK_ID_RGNH 0x686E6772
# define CHUNK_ID_WLNK 0x6B6E6C77
# define CHUNK_ID_PTBL 0x6C627470
# define CHUNK_ID_WSMP 0x706D7377
# define CHUNK_ID_COLH 0x686C6F63
# define CHUNK_ID_ARTL 0x6C747261
# define CHUNK_ID_ART2 0x32747261
# define CHUNK_ID_XFIL 0x6C696678
# define CHUNK_ID_DOXF 0x66786F64
#endif // WORDS_BIGENDIAN
#define DLS_WAVE_FORMAT_PCM 0x0001
//TODO: no support for conditional chunks <cdl> yet
namespace DLS {
typedef std::string String;
typedef RIFF::progress_t progress_t;
typedef RIFF::file_offset_t file_offset_t;
struct version_t {
uint16_t minor;
uint16_t major;
uint16_t build;
uint16_t release;
};
struct dlsid_t {
uint32_t ulData1;
uint16_t usData2;
uint16_t usData3;
uint8_t abData[8];
};
enum conn_src_t {
// Modulator Sources
conn_src_none = 0x0000,
conn_src_lfo = 0x0001,
conn_src_keyonvelocity = 0x0002,
conn_src_keynumber = 0x0003,
conn_src_eg1 = 0x0004,
conn_src_eg2 = 0x0005,
conn_src_pitchwheel = 0x0006,
conn_src_polypressure = 0x0007,
conn_src_channelpressure = 0x0008,
conn_src_vibrato = 0x0009,
// MIDI Controller Sources
conn_src_cc1 = 0x0081,
conn_src_cc7 = 0x0087,
conn_src_cc10 = 0x008A,
conn_src_cc11 = 0x008B,
conn_src_cc91 = 0x00DB,
conn_src_cc93 = 0x00DD,
// Registered Parameter Numbers
conn_src_rpn0 = 0x0100,
conn_src_rpn1 = 0x0101,
conn_src_rpn2 = 0x0102
};
enum conn_dst_t {
// Generic Destinations
conn_dst_none = 0x0000,
conn_dst_gain = 0x0001,
conn_dst_reserved = 0x0002,
conn_dst_pitch = 0x0003,
conn_dst_pan = 0x0004,
conn_dst_keynumber = 0x0005,
// Channel Output Destinations
conn_dst_left = 0x0010,
conn_dst_right = 0x0011,
conn_dst_center = 0x0012,
conn_dst_lfe_channel = 0x0013,
conn_dst_leftrear = 0x0014,
conn_dst_rightrear = 0x0015,
conn_dst_chorus = 0x0080,
conn_dst_reverb = 0x0081,
// Modulator LFO Destinations
conn_dst_lfo_frequency = 0x0104,
conn_dst_lfo_startdelay = 0x0105,
// Vibrato LFO Destinations
conn_dst_vib_frequency = 0x0114,
conn_dst_vib_startdelay = 0x0115,
// EG Destinations
conn_dst_eg1_attacktime = 0x0206,
conn_dst_eg1_decaytime = 0x0207,
conn_dst_eg1_reserved = 0x0208,
conn_dst_eg1_releasetime = 0x0209,
conn_dst_eg1_sustainlevel = 0x020A,
conn_dst_eg1_delaytime = 0x020B,
conn_dst_eg1_holdtime = 0x020C,
conn_dst_eg1_shutdowntime = 0x020D,
conn_dst_eg2_attacktime = 0x030A,
conn_dst_eg2_decaytime = 0x030B,
conn_dst_eg2_reserved = 0x030C,
conn_dst_eg2_releasetime = 0x030D,
conn_dst_eg2_sustainlevel = 0x030E,
conn_dst_eg2_delaytime = 0x030F,
conn_dst_eg2_holdtime = 0x0310,
// Filter Destinations
conn_dst_filter_cutoff = 0x0500,
conn_dst_filter_q = 0x0501
};
enum conn_trn_t {
conn_trn_none = 0x0000,
conn_trn_concave = 0x0001,
conn_trn_convex = 0x0002,
conn_trn_switch = 0x0003
};
struct range_t {
uint16_t low;
uint16_t high;
inline bool operator< (const range_t& other) const {
if (low < other.low) return true;
if (low > other.low) return false;
return high < other.high;
}
inline bool operator== (const range_t& other) const {
return low == other.low && high == other.high;
}
inline bool overlaps(uint16_t scalar) const {
return low <= scalar && scalar <= high;
}
inline bool overlaps(const range_t& other) const {
return overlaps(other.low) || overlaps(other.high) ||
other.overlaps(low) || other.overlaps(high);
}
};
struct sample_loop_t {
uint32_t Size;
uint32_t LoopType;
uint32_t LoopStart;
uint32_t LoopLength;
};
// just symbol prototyping
class File;
class Instrument;
class Region;
class Sample;
class Connection {
public:
conn_src_t Source;
conn_trn_t SourceTransform;
bool SourceInvert;
bool SourceBipolar;
conn_src_t Control;
conn_trn_t ControlTransform;
bool ControlInvert;
bool ControlBipolar;
conn_dst_t Destination;
conn_trn_t DestinationTransform;
uint32_t Scale;
protected:
struct conn_block_t {
uint16_t source;
uint16_t control;
uint16_t destination;
uint16_t transform;
uint32_t scale;
};
Connection() {}
void Init(conn_block_t* Header);
conn_block_t ToConnBlock();
virtual ~Connection() {}
friend class Articulation;
};
class Storage {
public:
virtual void UpdateChunks(progress_t* pProgress) = 0;
virtual void DeleteChunks() = 0;
};
class Articulation : public Storage {
public:
Connection* pConnections;
uint32_t Connections;
Articulation(RIFF::Chunk* artl);
virtual ~Articulation();
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
protected:
RIFF::Chunk* pArticulationCk;
uint32_t HeaderSize;
};
class Articulator : public Storage {
public:
Articulator(RIFF::List* ParentList);
Articulation* GetArticulation(size_t pos);
Articulation* GetFirstArticulation() LIBGIG_DEPRECATED_API("Use GetArticulation() instead.");
Articulation* GetNextArticulation() LIBGIG_DEPRECATED_API("Use GetArticulation() instead.");
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
virtual void CopyAssign(const Articulator* orig);
protected:
typedef std::vector<Articulation*> ArticulationList;
RIFF::List* pParentList;
ArticulationList* pArticulations;
ArticulationList::iterator ArticulationsIterator;
void LoadArticulations();
virtual ~Articulator();
};
class Info : public Storage {
public:
String Name;
String ArchivalLocation;
String CreationDate;
String Comments;
String Product;
String Copyright;
String Artists;
String Genre;
String Keywords;
String Engineer;
String Technician;
String Software;
String Medium;
String Source;
String SourceForm;
String Commissioned;
String Subject;
bool UseFixedLengthStrings LIBGIG_DEPRECATED_API("Not used anymore, use SetFixedStringLengths() instead.");
struct string_length_t {
uint32_t chunkId;
int length;
};
Info(RIFF::List* list);
void SetFixedStringLengths(const string_length_t* lengths);
virtual ~Info();
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
virtual void CopyAssign(const Info* orig);
private:
RIFF::List* pResourceListChunk;
const string_length_t* pFixedStringLengths;
static void LoadString(uint32_t ChunkID, RIFF::List* lstINFO, String& s);
void SaveString(uint32_t ChunkID, RIFF::List* lstINFO, const String& s, const String& sDefault);
};
class Resource : public Storage {
public:
Info* pInfo;
dlsid_t* pDLSID;
Resource* GetParent() { return pParent; }
const Resource* GetParent() const { return pParent; }
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
void GenerateDLSID();
static void GenerateDLSID(dlsid_t* pDLSID);
virtual void CopyAssign(const Resource* orig);
protected:
Resource* pParent;
RIFF::List* pResourceList;
Resource(Resource* Parent, RIFF::List* lstResource);
virtual ~Resource();
};
class Sampler : public Storage {
public:
uint8_t UnityNote;
int16_t FineTune;
int32_t Gain;
bool NoSampleDepthTruncation;
bool NoSampleCompression;
uint32_t SampleLoops;
sample_loop_t* pSampleLoops;
void AddSampleLoop(sample_loop_t* pLoopDef);
void DeleteSampleLoop(sample_loop_t* pLoopDef);
virtual void SetGain(int32_t gain);
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
virtual void CopyAssign(const Sampler* orig);
protected:
RIFF::List* pParentList;
uint32_t uiHeaderSize;
uint32_t SamplerOptions;
Sampler(RIFF::List* ParentList);
virtual ~Sampler();
};
class Sample : public Resource {
public:
uint16_t FormatTag;
uint16_t Channels;
uint32_t SamplesPerSecond;
uint32_t AverageBytesPerSecond;
uint16_t BlockAlign;
uint16_t BitDepth;
file_offset_t SamplesTotal;
uint FrameSize;
void* LoadSampleData();
void ReleaseSampleData();
file_offset_t GetSize() const;
void Resize(file_offset_t NewSize);
file_offset_t SetPos(file_offset_t SampleCount, RIFF::stream_whence_t Whence = RIFF::stream_start);
file_offset_t Read(void* pBuffer, file_offset_t SampleCount);
file_offset_t Write(void* pBuffer, file_offset_t SampleCount);
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
virtual void CopyAssign(const Sample* orig);
protected:
RIFF::List* pWaveList;
RIFF::Chunk* pCkData;
RIFF::Chunk* pCkFormat;
file_offset_t ullWavePoolOffset; // needed for comparison with the wave pool link table, thus the link to instruments
Sample(File* pFile, RIFF::List* waveList, file_offset_t WavePoolOffset);
virtual ~Sample();
void CopyAssignCore(const Sample* orig);
friend class File;
friend class Region; // Region has to compare the wave pool offset to get its sample
};
class Region : public Resource, public Articulator, public Sampler {
public:
range_t KeyRange;
range_t VelocityRange;
uint16_t KeyGroup;
uint16_t Layer;
bool SelfNonExclusive;
bool PhaseMaster;
uint16_t PhaseGroup;
bool MultiChannel;
uint32_t Channel;
Sample* GetSample();
void SetSample(Sample* pSample);
virtual void SetKeyRange(uint16_t Low, uint16_t High);
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
virtual void CopyAssign(const Region* orig);
protected:
RIFF::List* pCkRegion;
uint32_t WavePoolTableIndex; // index in the wave pool table to the sample wave this region is linked to
Sample* pSample; // every region refers to exactly one sample
uint16_t FormatOptionFlags;
uint16_t WaveLinkOptionFlags;
Region(Instrument* pInstrument, RIFF::List* rgnList);
virtual ~Region();
friend class Instrument;
};
class Instrument : public Resource, public Articulator {
public:
bool IsDrum;
uint16_t MIDIBank;
uint8_t MIDIBankCoarse;
uint8_t MIDIBankFine;
uint32_t MIDIProgram;
uint32_t Regions;
size_t CountRegions();
Region* GetRegionAt(size_t pos);
Region* GetFirstRegion() LIBGIG_DEPRECATED_API("Use GetRegionAt() instead.");
Region* GetNextRegion() LIBGIG_DEPRECATED_API("Use GetRegionAt() instead.");
Region* AddRegion();
void DeleteRegion(Region* pRegion);
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void DeleteChunks() OVERRIDE;
virtual void CopyAssign(const Instrument* orig);
protected:
typedef std::vector<Region*> RegionList;
struct midi_locale_t {
uint32_t bank;
uint32_t instrument;
};
RIFF::List* pCkInstrument;
RegionList* pRegions;
RegionList::iterator RegionsIterator;
Instrument(File* pFile, RIFF::List* insList);
void CopyAssignCore(const Instrument* orig);
virtual void LoadRegions();
virtual ~Instrument();
friend class File;
friend class Region;
private:
void MoveRegion(Region* pSrc, Region* pDst);
};
class File : public Resource {
public:
version_t* pVersion;
uint32_t Instruments;
File();
File(RIFF::File* pRIFF);
String GetFileName();
void SetFileName(const String& name);
Sample* GetSample(size_t index);
Sample* GetFirstSample() LIBGIG_DEPRECATED_API("Use GetSample() instead.");
Sample* GetNextSample() LIBGIG_DEPRECATED_API("Use GetSample() instead.");
Sample* AddSample();
size_t CountSamples();
void DeleteSample(Sample* pSample);
Instrument* GetInstrument(size_t index);
Instrument* GetFirstInstrument() LIBGIG_DEPRECATED_API("Use GetInstrument() instead.");
Instrument* GetNextInstrument() LIBGIG_DEPRECATED_API("Use GetInstrument() instead.");
Instrument* AddInstrument();
void DeleteInstrument(Instrument* pInstrument);
RIFF::File* GetRiffFile();
RIFF::File* GetExtensionFile(int index);
virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
virtual void Save(const String& Path, progress_t* pProgress = NULL);
virtual void Save(progress_t* pProgress = NULL);
virtual ~File();
protected:
typedef std::vector<Sample*> SampleList;
typedef std::vector<Instrument*> InstrumentList;
RIFF::File* pRIFF;
std::list<RIFF::File*> ExtensionFiles;
SampleList* pSamples;
SampleList::iterator SamplesIterator;
InstrumentList* pInstruments;
InstrumentList::iterator InstrumentsIterator;
uint32_t WavePoolHeaderSize;
uint32_t WavePoolCount;
uint32_t* pWavePoolTable;
uint32_t* pWavePoolTableHi;
bool b64BitWavePoolOffsets;
bool bOwningRiff;
virtual void LoadSamples();
virtual void LoadInstruments();
virtual void UpdateFileOffsets();
void __ensureMandatoryChunksExist();
friend class Region; // Region has to look in the wave pool table to get its sample
private:
void __UpdateWavePoolTableChunk();
void __UpdateWavePoolTable();
};
class Exception : public RIFF::Exception {
public:
Exception(String format, ...);
Exception(String format, va_list arg);
void PrintMessage() const;
protected:
Exception();
};
String libraryName();
String libraryVersion();
} // namespace DLS
#endif // __DLS_H__
DLS::Articulation
Provides access to the defined connections used for the synthesis model.
Definition DLS.h:328
DLS::Articulation::pConnections
Connection * pConnections
Points to the beginning of a Connection array.
Definition DLS.h:330
DLS::Articulation::DeleteChunks
virtual void DeleteChunks()
Remove all RIFF chunks associated with this Articulation object.
Definition DLS.cpp:179
DLS::Articulation::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)
Apply articulation connections to the respective RIFF chunks.
Definition DLS.cpp:154
DLS::Articulation::Connections
uint32_t Connections
Reflects the number of Connections.
Definition DLS.h:331
DLS::Articulation::Articulation
Articulation(RIFF::Chunk *artl)
Constructor.
Definition DLS.cpp:119
DLS::Articulator::GetNextArticulation
Articulation * GetNextArticulation()
Returns the next Articulation from the list of articulations.
Definition DLS.cpp:234
DLS::Articulator::GetFirstArticulation
Articulation * GetFirstArticulation()
Returns the first Articulation in the list of articulations.
Definition DLS.cpp:216
DLS::Articulator::GetArticulation
Articulation * GetArticulation(size_t pos)
Returns Articulation at supplied pos position within the articulation list.
Definition DLS.cpp:200
DLS::Articulator::CopyAssign
virtual void CopyAssign(const Articulator *orig)
Not yet implemented in this version, since the .gig format does not need to copy DLS articulators and...
Definition DLS.cpp:306
DLS::Connection
Defines a connection within the synthesis model.
Definition DLS.h:249
DLS::File
Parses DLS Level 1 and 2 compliant files and provides abstract access to the data.
Definition DLS.h:564
DLS::File::pVersion
version_t * pVersion
Points to a version_t structure if the file provided a version number else is set to NULL.
Definition DLS.h:566
DLS::File::AddInstrument
Instrument * AddInstrument()
Add a new instrument definition.
Definition DLS.cpp:1965
DLS::File::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)
Apply all the DLS file's current instruments, samples and settings to the respective RIFF chunks.
Definition DLS.cpp:2052
DLS::File::__ensureMandatoryChunksExist
void __ensureMandatoryChunksExist()
Checks if all (for DLS) mandatory chunks exist, if not they will be created.
Definition DLS.cpp:2471
DLS::File::File
File()
Constructor.
Definition DLS.cpp:1660
DLS::File::GetNextInstrument
Instrument * GetNextInstrument()
Returns a pointer to the next Instrument object of the file, NULL otherwise.
Definition DLS.cpp:1937
DLS::File::GetSample
Sample * GetSample(size_t index)
Returns Sample object of index.
Definition DLS.cpp:1780
DLS::File::GetNextSample
Sample * GetNextSample()
Returns a pointer to the next Sample object of the file, NULL otherwise.
Definition DLS.cpp:1808
DLS::File::SetFileName
void SetFileName(const String &name)
You may call this method store a future file name, so you don't have to to pass it to the Save() call...
Definition DLS.cpp:2040
DLS::File::UpdateFileOffsets
virtual void UpdateFileOffsets()
Updates all file offsets stored all over the file.
Definition DLS.cpp:2462
DLS::File::DeleteInstrument
void DeleteInstrument(Instrument *pInstrument)
Delete an instrument.
Definition DLS.cpp:1984
DLS::File::Instruments
uint32_t Instruments
Reflects the number of available Instrument objects.
Definition DLS.h:567
DLS::File::Save
virtual void Save(const String &Path, progress_t *pProgress=NULL)
Save changes to another file.
Definition DLS.cpp:2294
DLS::File::GetInstrument
Instrument * GetInstrument(size_t index)
Returns the instrument with the given index from the list of instruments of this file.
Definition DLS.cpp:1909
DLS::File::bOwningRiff
bool bOwningRiff
If true then pRIFF was implicitly allocated by this class and hence pRIFF will automatically be freed...
Definition DLS.h:605
DLS::File::CountSamples
size_t CountSamples()
Returns the total amount of samples of this DLS file.
Definition DLS.cpp:1858
DLS::File::DeleteSample
void DeleteSample(Sample *pSample)
Delete a sample.
Definition DLS.cpp:1891
DLS::File::GetRiffFile
RIFF::File * GetRiffFile()
Returns the underlying RIFF::File used for persistency of this DLS::File object.
Definition DLS.cpp:1999
DLS::File::GetFirstSample
Sample * GetFirstSample()
Returns a pointer to the first Sample object of the file, NULL otherwise.
Definition DLS.cpp:1794
DLS::File::GetFirstInstrument
Instrument * GetFirstInstrument()
Returns a pointer to the first Instrument object of the file, NULL otherwise.
Definition DLS.cpp:1923
DLS::File::AddSample
Sample * AddSample()
Add a new sample.
Definition DLS.cpp:1871
DLS::File::GetExtensionFile
RIFF::File * GetExtensionFile(int index)
Returns extension file of given index.
Definition DLS.cpp:2015
DLS::File::GetFileName
String GetFileName()
File name of this DLS file.
Definition DLS.cpp:2032
DLS::Info
Optional information for DLS files, instruments, samples, etc.
Definition DLS.h:363
DLS::Info::Subject
String Subject
<ISBJ-ck>. Describes the contents of the file.
Definition DLS.h:381
DLS::Info::Genre
String Genre
<IGNR-ck>. Descirbes the original work, such as, Jazz, Classic, Rock, Techno, Rave,...
Definition DLS.h:372
DLS::Info::Keywords
String Keywords
<IKEY-ck>. Provides a list of keywords that refer to the file or subject of the file....
Definition DLS.h:373
DLS::Info::SourceForm
String SourceForm
<ISRF-ck>. Identifies the original form of the material that was digitized, such as record,...
Definition DLS.h:379
DLS::Info::Comments
String Comments
<ICMT-ck>. Provides general comments about the file or the subject of the file. Sentences might end w...
Definition DLS.h:368
DLS::Info::Medium
String Medium
<IMED-ck>. Describes the original subject of the file, such as, record, CD, and so forth.
Definition DLS.h:377
DLS::Info::Info
Info(RIFF::List *list)
Constructor.
Definition DLS.cpp:332
DLS::Info::Software
String Software
<ISFT-ck>. Identifies the name of the sofware package used to create the file.
Definition DLS.h:376
DLS::Info::Artists
String Artists
<IART-ck>. Lists the artist of the original subject of the file.
Definition DLS.h:371
DLS::Info::Product
String Product
<IPRD-ck>. Specifies the name of the title the file was originally intended for, such as World Ruler ...
Definition DLS.h:369
DLS::Info::Name
String Name
<INAM-ck>. Stores the title of the subject of the file, such as, Seattle From Above.
Definition DLS.h:365
DLS::Info::CreationDate
String CreationDate
<ICRD-ck>. Specifies the date the subject of the file was created. List dates in yyyy-mm-dd format.
Definition DLS.h:367
DLS::Info::ArchivalLocation
String ArchivalLocation
<IARL-ck>. Indicates where the subject of the file is stored.
Definition DLS.h:366
DLS::Info::Engineer
String Engineer
<IENG-ck>. Stores the name of the engineer who worked on the file. Multiple engineer names are separa...
Definition DLS.h:374
DLS::Info::UseFixedLengthStrings
bool UseFixedLengthStrings
Definition DLS.h:382
DLS::Info::Commissioned
String Commissioned
<ICMS-ck>. Lists the name of the person or organization that commissioned the subject of the file,...
Definition DLS.h:380
DLS::Info::Copyright
String Copyright
<ICOP-ck>. Records the copyright information for the file.
Definition DLS.h:370
DLS::Info::Source
String Source
<ISRC-ck>. Identifies the name of the person or organization who supplied the original subject of the...
Definition DLS.h:378
DLS::Info::Technician
String Technician
<ITCH-ck>. Identifies the technician who sampled the subject file.
Definition DLS.h:375
DLS::Instrument
Provides all neccessary information for the synthesis of a DLS Instrument.
Definition DLS.h:524
DLS::Instrument::CopyAssign
virtual void CopyAssign(const Instrument *orig)
Make a (semi) deep copy of the Instrument object given by orig and assign it to this object.
Definition DLS.cpp:1635
DLS::Instrument::MIDIBankFine
uint8_t MIDIBankFine
Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128).
Definition DLS.h:529
DLS::Instrument::DeleteChunks
virtual void DeleteChunks()
Remove all RIFF chunks associated with this Instrument object.
Definition DLS.cpp:1592
DLS::Instrument::GetFirstRegion
Region * GetFirstRegion()
Returns the first Region of the instrument.
Definition DLS.cpp:1451
DLS::Instrument::GetNextRegion
Region * GetNextRegion()
Returns the next Region of the instrument.
Definition DLS.cpp:1468
DLS::Instrument::MIDIBankCoarse
uint8_t MIDIBankCoarse
Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128).
Definition DLS.h:528
DLS::Instrument::IsDrum
bool IsDrum
Indicates if the Instrument is a drum type, as they differ in the synthesis model of DLS from melodic...
Definition DLS.h:526
DLS::Instrument::Regions
uint32_t Regions
Reflects the number of Region defintions this Instrument has.
Definition DLS.h:531
DLS::Instrument::MIDIBank
uint16_t MIDIBank
Reflects combination of MIDIBankCoarse and MIDIBankFine (bank 1 - bank 16384). Do not change this val...
Definition DLS.h:527
DLS::Instrument::Instrument
Instrument(File *pFile, RIFF::List *insList)
Constructor.
Definition DLS.cpp:1389
DLS::Instrument::MIDIProgram
uint32_t MIDIProgram
Specifies the MIDI Program Change Number this Instrument should be assigned to.
Definition DLS.h:530
DLS::Instrument::GetRegionAt
Region * GetRegionAt(size_t pos)
Returns Region at supplied pos position within the region list of this instrument.
Definition DLS.cpp:1435
DLS::Instrument::CountRegions
size_t CountRegions()
Returns the amount of regions of this instrument.
Definition DLS.cpp:1419
DLS::Instrument::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)
Apply Instrument with all its Regions to the respective RIFF chunks.
Definition DLS.cpp:1536
DLS::Region
Defines Region information of an Instrument.
Definition DLS.h:493
DLS::Region::CopyAssign
virtual void CopyAssign(const Region *orig)
Make a (semi) deep copy of the Region object given by orig and assign it to this object.
Definition DLS.cpp:1342
DLS::Region::SetSample
void SetSample(Sample *pSample)
Assign another sample to this Region.
Definition DLS.cpp:1233
DLS::Region::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)
Apply Region settings to the respective RIFF chunks.
Definition DLS.cpp:1280
DLS::Region::KeyRange
range_t KeyRange
Definition DLS.h:495
DLS::Region::SetKeyRange
virtual void SetKeyRange(uint16_t Low, uint16_t High)
Modifies the key range of this Region and makes sure the respective chunks are in correct order.
Definition DLS.cpp:1245
DLS::Region::DeleteChunks
virtual void DeleteChunks()
Remove all RIFF chunks associated with this Region object.
Definition DLS.cpp:1201
DLS::Resource
Abstract base class which encapsulates data structures which all DLS resources are able to provide.
Definition DLS.h:404
DLS::Resource::Resource
Resource(Resource *Parent, RIFF::List *lstResource)
Constructor.
Definition DLS.cpp:539
DLS::Resource::pInfo
Info * pInfo
Points (in any case) to an Info object, providing additional, optional infos and comments.
Definition DLS.h:406
DLS::Resource::pDLSID
dlsid_t * pDLSID
Points to a dlsid_t structure if the file provided a DLS ID else is NULL.
Definition DLS.h:407
DLS::Sample
Encapsulates sample waves used for playback.
Definition DLS.h:457
DLS::Sample::Read
file_offset_t Read(void *pBuffer, file_offset_t SampleCount)
Reads SampleCount number of sample points from the current position into the buffer pointed by pBuffe...
Definition DLS.cpp:1081
DLS::Sample::ReleaseSampleData
void ReleaseSampleData()
Free sample data from RAM.
Definition DLS.cpp:989
DLS::Sample::CopyAssignCore
void CopyAssignCore(const Sample *orig)
Make a deep copy of the Sample object given by orig (without the actual sample waveform data however)...
Definition DLS.cpp:914
DLS::Sample::BlockAlign
uint16_t BlockAlign
The block alignment (in bytes) of the waveform data. Playback software needs to process a multiple of...
Definition DLS.h:463
DLS::Sample::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)
Apply sample and its settings to the respective RIFF chunks.
Definition DLS.cpp:1115
DLS::Sample::Resize
void Resize(file_offset_t NewSize)
Resize sample.
Definition DLS.cpp:1036
DLS::Sample::SetPos
file_offset_t SetPos(file_offset_t SampleCount, RIFF::stream_whence_t Whence=RIFF::stream_start)
Sets the position within the sample (in sample points, not in bytes).
Definition DLS.cpp:1063
DLS::Sample::BitDepth
uint16_t BitDepth
Size of each sample per channel (only if known sample data format is used, 0 otherwise).
Definition DLS.h:464
DLS::Sample::CopyAssign
virtual void CopyAssign(const Sample *orig)
Make a deep copy of the Sample object given by orig and assign it to this object.
Definition DLS.cpp:934
DLS::Sample::LoadSampleData
void * LoadSampleData()
Load sample data into RAM.
Definition DLS.cpp:980
DLS::Sample::Channels
uint16_t Channels
Number of channels represented in the waveform data, e.g. 1 for mono, 2 for stereo (defaults to 1=mon...
Definition DLS.h:460
DLS::Sample::GetSize
file_offset_t GetSize() const
Returns sample size.
Definition DLS.cpp:1003
DLS::Sample::SamplesPerSecond
uint32_t SamplesPerSecond
Sampling rate at which each channel should be played (defaults to 44100 if Sample was created with In...
Definition DLS.h:461
DLS::Sample::SamplesTotal
file_offset_t SamplesTotal
Reflects total number of sample points (only if known sample data format is used, 0 otherwise),...
Definition DLS.h:465
DLS::Sample::DeleteChunks
virtual void DeleteChunks()
Remove all RIFF chunks associated with this Sample object.
Definition DLS.cpp:891
DLS::Sample::FormatTag
uint16_t FormatTag
Format ID of the waveform data (should be DLS_WAVE_FORMAT_PCM for DLS1 compliant files,...
Definition DLS.h:459
DLS::Sample::FrameSize
uint FrameSize
Reflects the size (in bytes) of one single sample point (only if known sample data format is used,...
Definition DLS.h:466
DLS::Sample::AverageBytesPerSecond
uint32_t AverageBytesPerSecond
The average number of bytes per second at which the waveform data should be transferred (Playback sof...
Definition DLS.h:462
DLS::Sample::Sample
Sample(File *pFile, RIFF::List *waveList, file_offset_t WavePoolOffset)
Constructor.
Definition DLS.cpp:840
DLS::Sample::Write
file_offset_t Write(void *pBuffer, file_offset_t SampleCount)
Write sample wave data.
Definition DLS.cpp:1101
DLS::Sampler::DeleteChunks
virtual void DeleteChunks()
Remove all RIFF chunks associated with this Sampler object.
Definition DLS.cpp:751
DLS::Sampler::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)
Apply all sample player options to the respective RIFF chunk.
Definition DLS.cpp:710
DLS::Sampler::CopyAssign
virtual void CopyAssign(const Sampler *orig)
Make a deep copy of the Sampler object given by orig and assign it to this object.
Definition DLS.cpp:805
DLS::Sampler::AddSampleLoop
void AddSampleLoop(sample_loop_t *pLoopDef)
Adds a new sample loop with the provided loop definition.
Definition DLS.cpp:759
DLS::Sampler::SampleLoops
uint32_t SampleLoops
Reflects the number of sample loops.
Definition DLS.h:432
DLS::Sampler::pSampleLoops
sample_loop_t * pSampleLoops
Points to the beginning of a sample loop array, or is NULL if there are no loops defined.
Definition DLS.h:433
DLS::Sampler::DeleteSampleLoop
void DeleteSampleLoop(sample_loop_t *pLoopDef)
Deletes an existing sample loop.
Definition DLS.cpp:781
DLS::Sampler::Gain
int32_t Gain
Definition DLS.h:429
DLS::Storage
Abstract base class for all classes using RIFF::Chunks for persistency.
Definition DLS.h:283
DLS::Storage::DeleteChunks
virtual void DeleteChunks()=0
Remove all RIFF chunks associated with this object.
DLS::Storage::UpdateChunks
virtual void UpdateChunks(progress_t *pProgress)=0
Apply object's changes to the respective RIF::Chunks.
RIFF::Chunk
Ordinary RIFF Chunk.
Definition RIFF.h:186
RIFF::File
RIFF File.
Definition RIFF.h:314
RIFF::List
RIFF List Chunk.
Definition RIFF.h:262
DLS
DLS specific classes and definitions.
Definition DLS.h:108
DLS::libraryName
String libraryName()
Returns the name of this C++ library.
Definition DLS.cpp:2650
DLS::libraryVersion
String libraryVersion()
Returns version of this C++ library.
Definition DLS.cpp:2658
DLS::conn_src_t
conn_src_t
Connection Sources.
Definition DLS.h:131
DLS::conn_dst_t
conn_dst_t
Connection Destinations.
Definition DLS.h:157
DLS::conn_trn_t
conn_trn_t
Connection Transforms.
Definition DLS.h:202
RIFF
RIFF specific classes and definitions.
Definition RIFF.h:101
RIFF::stream_whence_t
stream_whence_t
File stream position dependent to these relations.
Definition RIFF.h:128
RIFF::file_offset_t
uint64_t file_offset_t
Type used by libgig for handling file positioning during file I/O tasks.
Definition RIFF.h:111
DLS::dlsid_t
Every subject of an DLS file and the file itself can have an unique, computer generated ID.
Definition DLS.h:123
DLS::range_t
Lower and upper limit of a range.
Definition DLS.h:210
DLS::range_t::low
uint16_t low
Low value of range.
Definition DLS.h:211
DLS::range_t::high
uint16_t high
High value of range.
Definition DLS.h:212
DLS::sample_loop_t
Defines Sample Loop Points.
Definition DLS.h:235
DLS::sample_loop_t::LoopLength
uint32_t LoopLength
Length of the looping area (in sample points).
Definition DLS.h:239
DLS::sample_loop_t::Size
uint32_t Size
For internal usage only: usually reflects exactly sizeof(sample_loop_t), otherwise if the value is la...
Definition DLS.h:236
DLS::sample_loop_t::LoopStart
uint32_t LoopStart
The start value specifies the offset (in sample points) in the waveform data of the first sample poin...
Definition DLS.h:238
DLS::sample_loop_t::LoopType
uint32_t LoopType
Defines how the waveform samples will be looped (appropriate loop types for the gig format are define...
Definition DLS.h:237
DLS::version_t
Quadtuple version number ("major.minor.release.build").
Definition DLS.h:115
RIFF::progress_t
Used for indicating the progress of a certain task.
Definition RIFF.h:167