/[svn]/libgig/trunk/src/gig.h
ViewVC logotype

Diff of /libgig/trunk/src/gig.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1154 by schoenebeck, Wed Apr 11 16:33:56 2007 UTC revision 1416 by schoenebeck, Sun Oct 14 12:06:32 2007 UTC
# Line 38  Line 38 
38  # define CHUNK_ID_3EWG  0x33657767  # define CHUNK_ID_3EWG  0x33657767
39  # define CHUNK_ID_EWAV  0x65776176  # define CHUNK_ID_EWAV  0x65776176
40  # define CHUNK_ID_3GNM  0x33676E6D  # define CHUNK_ID_3GNM  0x33676E6D
41    # define CHUNK_ID_EINF  0x65696E66
42    # define CHUNK_ID_3CRC  0x33637263
43  #else  // little endian  #else  // little endian
44  # define LIST_TYPE_3PRG 0x67727033  # define LIST_TYPE_3PRG 0x67727033
45  # define LIST_TYPE_3EWL 0x6C776533  # define LIST_TYPE_3EWL 0x6C776533
# Line 50  Line 52 
52  # define CHUNK_ID_3EWG  0x67776533  # define CHUNK_ID_3EWG  0x67776533
53  # define CHUNK_ID_EWAV  0x76617765  # define CHUNK_ID_EWAV  0x76617765
54  # define CHUNK_ID_3GNM  0x6D6E6733  # define CHUNK_ID_3GNM  0x6D6E6733
55    # define CHUNK_ID_EINF  0x666E6965
56    # define CHUNK_ID_3CRC  0x63726333
57  #endif // WORDS_BIGENDIAN  #endif // WORDS_BIGENDIAN
58    
59  /** Gigasampler specific classes and definitions */  /** Gigasampler specific classes and definitions */
# Line 392  namespace gig { Line 396  namespace gig {
396              // Filter              // Filter
397              bool               VCFEnabled;                    ///< If filter should be used.              bool               VCFEnabled;                    ///< If filter should be used.
398              vcf_type_t         VCFType;                       ///< Defines the general filter characteristic (lowpass, highpass, bandpass, etc.).              vcf_type_t         VCFType;                       ///< Defines the general filter characteristic (lowpass, highpass, bandpass, etc.).
399              vcf_cutoff_ctrl_t  VCFCutoffController;           ///< Specifies which external controller has influence on the filter cutoff frequency.              vcf_cutoff_ctrl_t  VCFCutoffController;           ///< Specifies which external controller has influence on the filter cutoff frequency. @deprecated Don't alter directly, use SetVCFCutoffController() instead!
400              bool               VCFCutoffControllerInvert;     ///< Inverts values coming from the defined cutoff controller              bool               VCFCutoffControllerInvert;     ///< Inverts values coming from the defined cutoff controller
401              uint8_t            VCFCutoff;                     ///< Max. cutoff frequency.              uint8_t            VCFCutoff;                     ///< Max. cutoff frequency.
402              curve_type_t       VCFVelocityCurve;              ///< Defines a transformation curve for the incoming velocity values, affecting the VCF.              curve_type_t       VCFVelocityCurve;              ///< Defines a transformation curve for the incoming velocity values, affecting the VCF. @deprecated Don't alter directly, use SetVCFVelocityCurve() instead!
403              uint8_t            VCFVelocityScale;              ///< (0-127) Amount velocity controls VCF cutoff frequency (only if no other VCF cutoff controller is defined, otherwise this is the minimum cutoff).              uint8_t            VCFVelocityScale;              ///< (0-127) Amount velocity controls VCF cutoff frequency (only if no other VCF cutoff controller is defined, otherwise this is the minimum cutoff). @deprecated Don't alter directly, use SetVCFVelocityScale() instead!
404              uint8_t            VCFVelocityDynamicRange;       ///< 0x04 = lowest, 0x00 = highest              uint8_t            VCFVelocityDynamicRange;       ///< 0x04 = lowest, 0x00 = highest . @deprecated Don't alter directly, use SetVCFVelocityDynamicRange() instead!
405              uint8_t            VCFResonance;                  ///< Firm internal filter resonance weight.              uint8_t            VCFResonance;                  ///< Firm internal filter resonance weight.
406              bool               VCFResonanceDynamic;           ///< If <i>true</i>: Increases the resonance Q according to changes of controllers that actually control the VCF cutoff frequency (EG2, ext. VCF MIDI controller).              bool               VCFResonanceDynamic;           ///< If <i>true</i>: Increases the resonance Q according to changes of controllers that actually control the VCF cutoff frequency (EG2, ext. VCF MIDI controller).
407              vcf_res_ctrl_t     VCFResonanceController;        ///< Specifies which external controller has influence on the filter resonance Q.              vcf_res_ctrl_t     VCFResonanceController;        ///< Specifies which external controller has influence on the filter resonance Q.
408              bool               VCFKeyboardTracking;           ///< If <i>true</i>: VCF cutoff frequence will be dependend to the note key position relative to the defined breakpoint value.              bool               VCFKeyboardTracking;           ///< If <i>true</i>: VCF cutoff frequence will be dependend to the note key position relative to the defined breakpoint value.
409              uint8_t            VCFKeyboardTrackingBreakpoint; ///< See VCFKeyboardTracking (0 - 127).              uint8_t            VCFKeyboardTrackingBreakpoint; ///< See VCFKeyboardTracking (0 - 127).
410              // Key Velocity Transformations              // Key Velocity Transformations
411              curve_type_t       VelocityResponseCurve;         ///< Defines a transformation curve to the incoming velocity values affecting amplitude (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead).              curve_type_t       VelocityResponseCurve;         ///< Defines a transformation curve to the incoming velocity values affecting amplitude (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). @deprecated Don't alter directly, use SetVelocityResponseCurve() instead!
412              uint8_t            VelocityResponseDepth;         ///< Dynamic range of velocity affecting amplitude (0 - 4) (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead).              uint8_t            VelocityResponseDepth;         ///< Dynamic range of velocity affecting amplitude (0 - 4) (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). @deprecated Don't alter directly, use SetVelocityResponseDepth() instead!
413              uint8_t            VelocityResponseCurveScaling;  ///< 0 - 127 (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead)              uint8_t            VelocityResponseCurveScaling;  ///< 0 - 127 (usually you don't have to interpret this parameter, use GetVelocityAttenuation() instead). @deprecated Don't alter directly, use SetVelocityResponseCurveScaling() instead!
414              curve_type_t       ReleaseVelocityResponseCurve;  ///< Defines a transformation curve to the incoming release veloctiy values affecting envelope times.              curve_type_t       ReleaseVelocityResponseCurve;  ///< Defines a transformation curve to the incoming release veloctiy values affecting envelope times. @deprecated Don't alter directly, use SetReleaseVelocityResponseCurve() instead!
415              uint8_t            ReleaseVelocityResponseDepth;  ///< Dynamic range of release velocity affecting envelope time (0 - 4).              uint8_t            ReleaseVelocityResponseDepth;  ///< Dynamic range of release velocity affecting envelope time (0 - 4). @deprecated Don't alter directly, use SetReleaseVelocityResponseDepth() instead!
416              uint8_t            ReleaseTriggerDecay;           ///< 0 - 8              uint8_t            ReleaseTriggerDecay;           ///< 0 - 8
417              // Mix / Layer              // Mix / Layer
418              crossfade_t        Crossfade;              crossfade_t        Crossfade;
# Line 437  namespace gig { Line 441  namespace gig {
441              double GetVelocityAttenuation(uint8_t MIDIKeyVelocity);              double GetVelocityAttenuation(uint8_t MIDIKeyVelocity);
442              double GetVelocityRelease(uint8_t MIDIKeyVelocity);              double GetVelocityRelease(uint8_t MIDIKeyVelocity);
443              double GetVelocityCutoff(uint8_t MIDIKeyVelocity);              double GetVelocityCutoff(uint8_t MIDIKeyVelocity);
444                void SetVelocityResponseCurve(curve_type_t curve);
445                void SetVelocityResponseDepth(uint8_t depth);
446                void SetVelocityResponseCurveScaling(uint8_t scaling);
447                void SetReleaseVelocityResponseCurve(curve_type_t curve);
448                void SetReleaseVelocityResponseDepth(uint8_t depth);
449                void SetVCFCutoffController(vcf_cutoff_ctrl_t controller);
450                void SetVCFVelocityCurve(curve_type_t curve);
451                void SetVCFVelocityDynamicRange(uint8_t range);
452                void SetVCFVelocityScale(uint8_t scaling);
453                Region* GetParent() const;
454                // derived methods
455                DLS::Sampler::AddSampleLoop;
456                DLS::Sampler::DeleteSampleLoop;
457              // overridden methods              // overridden methods
458                virtual void SetGain(int32_t gain);
459              virtual void UpdateChunks();              virtual void UpdateChunks();
460          protected:          protected:
461              uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number.              uint8_t* VelocityTable; ///< For velocity dimensions with custom defined zone ranges only: used for fast converting from velocity MIDI value to dimension bit number.
462              DimensionRegion(RIFF::List* _3ewl);              DimensionRegion(Region* pParent, RIFF::List* _3ewl);
463                DimensionRegion(RIFF::List* _3ewl, const DimensionRegion& src);
464             ~DimensionRegion();             ~DimensionRegion();
465              friend class Region;              friend class Region;
466          private:          private:
# Line 480  namespace gig { Line 499  namespace gig {
499              double*                  pVelocityAttenuationTable;  ///< Points to the velocity table corresponding to the velocity parameters of this DimensionRegion.              double*                  pVelocityAttenuationTable;  ///< Points to the velocity table corresponding to the velocity parameters of this DimensionRegion.
500              double*                  pVelocityReleaseTable;      ///< Points to the velocity table corresponding to the release velocity parameters of this DimensionRegion              double*                  pVelocityReleaseTable;      ///< Points to the velocity table corresponding to the release velocity parameters of this DimensionRegion
501              double*                  pVelocityCutoffTable;       ///< Points to the velocity table corresponding to the filter velocity parameters of this DimensionRegion              double*                  pVelocityCutoffTable;       ///< Points to the velocity table corresponding to the filter velocity parameters of this DimensionRegion
502                Region*                  pRegion;
503    
504              leverage_ctrl_t DecodeLeverageController(_lev_ctrl_t EncodedController);              leverage_ctrl_t DecodeLeverageController(_lev_ctrl_t EncodedController);
505              _lev_ctrl_t     EncodeLeverageController(leverage_ctrl_t DecodedController);              _lev_ctrl_t     EncodeLeverageController(leverage_ctrl_t DecodedController);
506                double* GetReleaseVelocityTable(curve_type_t releaseVelocityResponseCurve, uint8_t releaseVelocityResponseDepth);
507                double* GetCutoffVelocityTable(curve_type_t vcfVelocityCurve, uint8_t vcfVelocityDynamicRange, uint8_t vcfVelocityScale, vcf_cutoff_ctrl_t vcfCutoffController);
508              double* GetVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling);              double* GetVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling);
509              double* CreateVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling);              double* CreateVelocityTable(curve_type_t curveType, uint8_t depth, uint8_t scaling);
510      };      };
# Line 556  namespace gig { Line 578  namespace gig {
578              unsigned long        FileNo;                  ///< File number (> 0 when sample is stored in an extension file, 0 when it's in the gig)              unsigned long        FileNo;                  ///< File number (> 0 when sample is stored in an extension file, 0 when it's in the gig)
579              RIFF::Chunk*         pCk3gix;              RIFF::Chunk*         pCk3gix;
580              RIFF::Chunk*         pCkSmpl;              RIFF::Chunk*         pCkSmpl;
581                uint32_t             crc;                     ///< CRC-32 checksum of the raw sample data
582    
583              Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset, unsigned long fileNo = 0);              Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset, unsigned long fileNo = 0);
584             ~Sample();             ~Sample();
# Line 598  namespace gig { Line 621  namespace gig {
621              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).              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).
622              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!              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!
623    
624                // own methods
625              DimensionRegion* GetDimensionRegionByValue(const uint DimValues[8]);              DimensionRegion* GetDimensionRegionByValue(const uint DimValues[8]);
626              DimensionRegion* GetDimensionRegionByBit(const uint8_t DimBits[8]);              DimensionRegion* GetDimensionRegionByBit(const uint8_t DimBits[8]);
627              Sample*          GetSample();              Sample*          GetSample();
628              void             AddDimension(dimension_def_t* pDimDef);              void             AddDimension(dimension_def_t* pDimDef);
629              void             DeleteDimension(dimension_def_t* pDimDef);              void             DeleteDimension(dimension_def_t* pDimDef);
630                // overridden methods
631                virtual void     SetKeyRange(uint16_t Low, uint16_t High);
632              virtual void     UpdateChunks();              virtual void     UpdateChunks();
633          protected:          protected:
634              Region(Instrument* pInstrument, RIFF::List* rgnList);              Region(Instrument* pInstrument, RIFF::List* rgnList);
# Line 637  namespace gig { Line 663  namespace gig {
663    
664              // derived methods from DLS::Resource              // derived methods from DLS::Resource
665              DLS::Resource::GetParent;              DLS::Resource::GetParent;
             // derived methods from DLS::Instrument  
             DLS::Instrument::MoveRegion;  
666              // overridden methods              // overridden methods
667              Region*   GetFirstRegion();              Region*   GetFirstRegion();
668              Region*   GetNextRegion();              Region*   GetNextRegion();
# Line 654  namespace gig { Line 678  namespace gig {
678             ~Instrument();             ~Instrument();
679              void UpdateRegionKeyTable();              void UpdateRegionKeyTable();
680              friend class File;              friend class File;
681                friend class Region; // so Region can call UpdateRegionKeyTable()
682      };      };
683    
684      /** @brief Group of Gigasampler objects      /** @brief Group of Gigasampler objects
# Line 692  namespace gig { Line 717  namespace gig {
717      /** Parses Gigasampler files and provides abstract access to the data. */      /** Parses Gigasampler files and provides abstract access to the data. */
718      class File : protected DLS::File {      class File : protected DLS::File {
719          public:          public:
720                static const DLS::version_t VERSION_2;
721                static const DLS::version_t VERSION_3;
722    
723              // derived attributes from DLS::Resource              // derived attributes from DLS::Resource
724              DLS::Resource::pInfo;              DLS::Resource::pInfo;
725              DLS::Resource::pDLSID;              DLS::Resource::pDLSID;
# Line 731  namespace gig { Line 759  namespace gig {
759              // own protected methods              // own protected methods
760              virtual void LoadSamples(progress_t* pProgress);              virtual void LoadSamples(progress_t* pProgress);
761              virtual void LoadInstruments(progress_t* pProgress);              virtual void LoadInstruments(progress_t* pProgress);
762                void SetSampleChecksum(Sample* pSample, uint32_t crc);
763              friend class Region;              friend class Region;
764              friend class Sample;              friend class Sample;
765              friend class Group; // so Group can access protected member pRIFF              friend class Group; // so Group can access protected member pRIFF

Legend:
Removed from v.1154  
changed lines
  Added in v.1416

  ViewVC Help
Powered by ViewVC