/[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 3323 by schoenebeck, Thu Jul 20 22:09:54 2017 UTC revision 3486 by schoenebeck, Mon Feb 25 17:10:09 2019 UTC
# Line 2  Line 2 
2   *                                                                         *   *                                                                         *
3   *   libgig - C++ cross-platform Gigasampler format file access library    *   *   libgig - C++ cross-platform Gigasampler format file access library    *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003-2017 by Christian Schoenebeck                      *   *   Copyright (C) 2003-2018 by Christian Schoenebeck                      *
6   *                              <cuse@users.sourceforge.net>               *   *                              <cuse@users.sourceforge.net>               *
7   *                                                                         *   *                                                                         *
8   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
# Line 120  namespace gig { Line 120  namespace gig {
120       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
121       */       */
122      GIG_DECLARE_ENUM(loop_type_t,      GIG_DECLARE_ENUM(loop_type_t,
123          loop_type_normal        = 0x00000000,  ///< Loop forward (normal)          loop_type_normal        = 0x00000000,  /**< Loop forward (normal) */
124          loop_type_bidirectional = 0x00000001,  ///< Alternating loop (forward/backward, also known as Ping Pong)          loop_type_bidirectional = 0x00000001,  /**< Alternating loop (forward/backward, also known as Ping Pong) */
125          loop_type_backward      = 0x00000002   ///< Loop backward (reverse)          loop_type_backward      = 0x00000002   /**< Loop backward (reverse) */
126      );      );
127    
128      /** Society of Motion Pictures and Television E time format.      /** Society of Motion Pictures and Television E time format.
# Line 130  namespace gig { Line 130  namespace gig {
130       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
131       */       */
132      GIG_DECLARE_ENUM(smpte_format_t,      GIG_DECLARE_ENUM(smpte_format_t,
133          smpte_format_no_offset          = 0x00000000,  ///< no SMPTE offset          smpte_format_no_offset          = 0x00000000,  /**< no SMPTE offset */
134          smpte_format_24_frames          = 0x00000018,  ///< 24 frames per second          smpte_format_24_frames          = 0x00000018,  /**< 24 frames per second */
135          smpte_format_25_frames          = 0x00000019,  ///< 25 frames per second          smpte_format_25_frames          = 0x00000019,  /**< 25 frames per second */
136          smpte_format_30_frames_dropping = 0x0000001D,  ///< 30 frames per second with frame dropping (30 drop)          smpte_format_30_frames_dropping = 0x0000001D,  /**< 30 frames per second with frame dropping (30 drop) */
137          smpte_format_30_frames          = 0x0000001E   ///< 30 frames per second          smpte_format_30_frames          = 0x0000001E   /**< 30 frames per second */
138      );      );
139    
140      /** Defines the shape of a function graph.      /** Defines the shape of a function graph.
# Line 142  namespace gig { Line 142  namespace gig {
142       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
143       */       */
144      GIG_DECLARE_ENUM(curve_type_t,      GIG_DECLARE_ENUM(curve_type_t,
145          curve_type_nonlinear = 0,          curve_type_nonlinear = 0,          /**< Non-linear curve type. */
146          curve_type_linear    = 1,          curve_type_linear    = 1,          /**< Linear curve type. */
147          curve_type_special   = 2,          curve_type_special   = 2,          /**< Special curve type. */
148          curve_type_unknown   = 0xffffffff          curve_type_unknown   = 0xffffffff  /**< Unknown curve type. */
149      );      );
150    
151      /** Dimensions allow to bypass one of the following controllers.      /** Dimensions allow to bypass one of the following controllers.
# Line 153  namespace gig { Line 153  namespace gig {
153       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
154       */       */
155      GIG_DECLARE_ENUM(dim_bypass_ctrl_t,      GIG_DECLARE_ENUM(dim_bypass_ctrl_t,
156          dim_bypass_ctrl_none,          dim_bypass_ctrl_none, /**< No controller bypass. */
157          dim_bypass_ctrl_94,   ///< Effect 4 Depth (MIDI Controller 94)          dim_bypass_ctrl_94,   /**< Effect 4 Depth (MIDI Controller 94) */
158          dim_bypass_ctrl_95    ///< Effect 5 Depth (MIDI Controller 95)          dim_bypass_ctrl_95    /**< Effect 5 Depth (MIDI Controller 95) */
159      );      );
160    
161      /** Defines how LFO3 is controlled by.      /** Defines how LFO3 is controlled by.
# Line 163  namespace gig { Line 163  namespace gig {
163       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
164       */       */
165      GIG_DECLARE_ENUM(lfo3_ctrl_t,      GIG_DECLARE_ENUM(lfo3_ctrl_t,
166          lfo3_ctrl_internal            = 0x00, ///< Only internally controlled.          lfo3_ctrl_internal            = 0x00, /**< Only internally controlled. */
167          lfo3_ctrl_modwheel            = 0x01, ///< Only controlled by external modulation wheel.          lfo3_ctrl_modwheel            = 0x01, /**< Only controlled by external modulation wheel. */
168          lfo3_ctrl_aftertouch          = 0x02, ///< Only controlled by aftertouch controller.          lfo3_ctrl_aftertouch          = 0x02, /**< Only controlled by aftertouch controller. */
169          lfo3_ctrl_internal_modwheel   = 0x03, ///< Controlled internally and by external modulation wheel.          lfo3_ctrl_internal_modwheel   = 0x03, /**< Controlled internally and by external modulation wheel. */
170          lfo3_ctrl_internal_aftertouch = 0x04  ///< Controlled internally and by aftertouch controller.          lfo3_ctrl_internal_aftertouch = 0x04  /**< Controlled internally and by aftertouch controller. */
171      );      );
172    
173      /** Defines how LFO2 is controlled by.      /** Defines how LFO2 is controlled by.
# Line 175  namespace gig { Line 175  namespace gig {
175       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
176       */       */
177      GIG_DECLARE_ENUM(lfo2_ctrl_t,      GIG_DECLARE_ENUM(lfo2_ctrl_t,
178          lfo2_ctrl_internal            = 0x00, ///< Only internally controlled.          lfo2_ctrl_internal            = 0x00, /**< Only internally controlled. */
179          lfo2_ctrl_modwheel            = 0x01, ///< Only controlled by external modulation wheel.          lfo2_ctrl_modwheel            = 0x01, /**< Only controlled by external modulation wheel. */
180          lfo2_ctrl_foot                = 0x02, ///< Only controlled by external foot controller.          lfo2_ctrl_foot                = 0x02, /**< Only controlled by external foot controller. */
181          lfo2_ctrl_internal_modwheel   = 0x03, ///< Controlled internally and by external modulation wheel.          lfo2_ctrl_internal_modwheel   = 0x03, /**< Controlled internally and by external modulation wheel. */
182          lfo2_ctrl_internal_foot       = 0x04  ///< Controlled internally and by external foot controller.          lfo2_ctrl_internal_foot       = 0x04  /**< Controlled internally and by external foot controller. */
183      );      );
184    
185      /** Defines how LFO1 is controlled by.      /** Defines how LFO1 is controlled by.
# Line 187  namespace gig { Line 187  namespace gig {
187       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
188       */       */
189      GIG_DECLARE_ENUM(lfo1_ctrl_t,      GIG_DECLARE_ENUM(lfo1_ctrl_t,
190          lfo1_ctrl_internal            = 0x00, ///< Only internally controlled.          lfo1_ctrl_internal            = 0x00, /**< Only internally controlled. */
191          lfo1_ctrl_modwheel            = 0x01, ///< Only controlled by external modulation wheel.          lfo1_ctrl_modwheel            = 0x01, /**< Only controlled by external modulation wheel. */
192          lfo1_ctrl_breath              = 0x02, ///< Only controlled by external breath controller.          lfo1_ctrl_breath              = 0x02, /**< Only controlled by external breath controller. */
193          lfo1_ctrl_internal_modwheel   = 0x03, ///< Controlled internally and by external modulation wheel.          lfo1_ctrl_internal_modwheel   = 0x03, /**< Controlled internally and by external modulation wheel. */
194          lfo1_ctrl_internal_breath     = 0x04  ///< Controlled internally and by external breath controller.          lfo1_ctrl_internal_breath     = 0x04  /**< Controlled internally and by external breath controller. */
195      );      );
196    
197      /** Defines how the filter cutoff frequency is controlled by.      /** Defines how the filter cutoff frequency is controlled by.
# Line 199  namespace gig { Line 199  namespace gig {
199       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
200       */       */
201      GIG_DECLARE_ENUM(vcf_cutoff_ctrl_t,      GIG_DECLARE_ENUM(vcf_cutoff_ctrl_t,
202          vcf_cutoff_ctrl_none         = 0x00,          vcf_cutoff_ctrl_none         = 0x00,  /**< No MIDI controller assigned for filter cutoff frequency. */
203          vcf_cutoff_ctrl_none2        = 0x01,  ///< The difference between none and none2 is unknown          vcf_cutoff_ctrl_none2        = 0x01,  /**< The difference between none and none2 is unknown */
204          vcf_cutoff_ctrl_modwheel     = 0x81,  ///< Modulation Wheel (MIDI Controller 1)          vcf_cutoff_ctrl_modwheel     = 0x81,  /**< Modulation Wheel (MIDI Controller 1) */
205          vcf_cutoff_ctrl_effect1      = 0x8c,  ///< Effect Controller 1 (Coarse, MIDI Controller 12)          vcf_cutoff_ctrl_effect1      = 0x8c,  /**< Effect Controller 1 (Coarse, MIDI Controller 12) */
206          vcf_cutoff_ctrl_effect2      = 0x8d,  ///< Effect Controller 2 (Coarse, MIDI Controller 13)          vcf_cutoff_ctrl_effect2      = 0x8d,  /**< Effect Controller 2 (Coarse, MIDI Controller 13) */
207          vcf_cutoff_ctrl_breath       = 0x82,  ///< Breath Controller (Coarse, MIDI Controller 2)          vcf_cutoff_ctrl_breath       = 0x82,  /**< Breath Controller (Coarse, MIDI Controller 2) */
208          vcf_cutoff_ctrl_foot         = 0x84,  ///< Foot Pedal (Coarse, MIDI Controller 4)          vcf_cutoff_ctrl_foot         = 0x84,  /**< Foot Pedal (Coarse, MIDI Controller 4) */
209          vcf_cutoff_ctrl_sustainpedal = 0xc0,  ///< Sustain Pedal (MIDI Controller 64)          vcf_cutoff_ctrl_sustainpedal = 0xc0,  /**< Sustain Pedal (MIDI Controller 64) */
210          vcf_cutoff_ctrl_softpedal    = 0xc3,  ///< Soft Pedal (MIDI Controller 67)          vcf_cutoff_ctrl_softpedal    = 0xc3,  /**< Soft Pedal (MIDI Controller 67) */
211          vcf_cutoff_ctrl_genpurpose7  = 0xd2,  ///< General Purpose Controller 7 (Button, MIDI Controller 82)          vcf_cutoff_ctrl_genpurpose7  = 0xd2,  /**< General Purpose Controller 7 (Button, MIDI Controller 82) */
212          vcf_cutoff_ctrl_genpurpose8  = 0xd3,  ///< General Purpose Controller 8 (Button, MIDI Controller 83)          vcf_cutoff_ctrl_genpurpose8  = 0xd3,  /**< General Purpose Controller 8 (Button, MIDI Controller 83) */
213          vcf_cutoff_ctrl_aftertouch   = 0x80   ///< Key Pressure          vcf_cutoff_ctrl_aftertouch   = 0x80   /**< Key Pressure */
214      );      );
215    
216      /** Defines how the filter resonance is controlled by.      /** Defines how the filter resonance is controlled by.
# Line 218  namespace gig { Line 218  namespace gig {
218       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
219       */       */
220      GIG_DECLARE_ENUM(vcf_res_ctrl_t,      GIG_DECLARE_ENUM(vcf_res_ctrl_t,
221          vcf_res_ctrl_none        = 0xffffffff,          vcf_res_ctrl_none        = 0xffffffff,  /**< No MIDI controller assigned for filter resonance. */
222          vcf_res_ctrl_genpurpose3 = 0,           ///< General Purpose Controller 3 (Slider, MIDI Controller 18)          vcf_res_ctrl_genpurpose3 = 0,           /**< General Purpose Controller 3 (Slider, MIDI Controller 18) */
223          vcf_res_ctrl_genpurpose4 = 1,           ///< General Purpose Controller 4 (Slider, MIDI Controller 19)          vcf_res_ctrl_genpurpose4 = 1,           /**< General Purpose Controller 4 (Slider, MIDI Controller 19) */
224          vcf_res_ctrl_genpurpose5 = 2,           ///< General Purpose Controller 5 (Button, MIDI Controller 80)          vcf_res_ctrl_genpurpose5 = 2,           /**< General Purpose Controller 5 (Button, MIDI Controller 80) */
225          vcf_res_ctrl_genpurpose6 = 3            ///< General Purpose Controller 6 (Button, MIDI Controller 81)          vcf_res_ctrl_genpurpose6 = 3            /**< General Purpose Controller 6 (Button, MIDI Controller 81) */
226      );      );
227    
228      /**      /**
# Line 239  namespace gig { Line 239  namespace gig {
239           * @see enumCount(), enumKey(), enumKeys(), enumValue()           * @see enumCount(), enumKey(), enumKeys(), enumValue()
240           */           */
241          GIG_DECLARE_ENUM(type_t,          GIG_DECLARE_ENUM(type_t,
242              type_none              = 0x00, ///< No controller defined              type_none              = 0x00, /**< No controller defined */
243              type_channelaftertouch = 0x2f, ///< Channel Key Pressure              type_channelaftertouch = 0x2f, /**< Channel Key Pressure */
244              type_velocity          = 0xff, ///< Key Velocity              type_velocity          = 0xff, /**< Key Velocity */
245              type_controlchange     = 0xfe  ///< Ordinary MIDI control change controller, see field 'controller_number'              type_controlchange     = 0xfe  /**< Ordinary MIDI control change controller, see field 'controller_number' */
246          );          );
247    
248          type_t type;              ///< Controller type          type_t type;              ///< Controller type
# Line 282  namespace gig { Line 282  namespace gig {
282       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
283       */       */
284      GIG_DECLARE_ENUM(dimension_t,      GIG_DECLARE_ENUM(dimension_t,
285          dimension_none              = 0x00, ///< Dimension not in use.          dimension_none              = 0x00, /**< Dimension not in use. */
286          dimension_samplechannel     = 0x80, ///< If used sample has more than one channel (thus is not mono).          dimension_samplechannel     = 0x80, /**< If used sample has more than one channel (thus is not mono). */
287          dimension_layer             = 0x81, ///< For layering of up to 8 instruments (and eventually crossfading of 2 or 4 layers).          dimension_layer             = 0x81, /**< For layering of up to 8 instruments (and eventually crossfading of 2 or 4 layers). */
288          dimension_velocity          = 0x82, ///< Key Velocity (this is the only dimension in gig2 where the ranges can exactly be defined).          dimension_velocity          = 0x82, /**< Key Velocity (this is the only dimension in gig2 where the ranges can exactly be defined). */
289          dimension_channelaftertouch = 0x83, ///< Channel Key Pressure          dimension_channelaftertouch = 0x83, /**< Channel Key Pressure */
290          dimension_releasetrigger    = 0x84, ///< Special dimension for triggering samples on releasing a key.          dimension_releasetrigger    = 0x84, /**< Special dimension for triggering samples on releasing a key. */
291          dimension_keyboard          = 0x85, ///< Dimension for keyswitching          dimension_keyboard          = 0x85, /**< Dimension for keyswitching */
292          dimension_roundrobin        = 0x86, ///< Different samples triggered each time a note is played, dimension regions selected in sequence          dimension_roundrobin        = 0x86, /**< Different samples triggered each time a note is played, dimension regions selected in sequence */
293          dimension_random            = 0x87, ///< Different samples triggered each time a note is played, random order          dimension_random            = 0x87, /**< Different samples triggered each time a note is played, random order */
294          dimension_smartmidi         = 0x88, ///< For MIDI tools like legato and repetition mode          dimension_smartmidi         = 0x88, /**< For MIDI tools like legato and repetition mode */
295          dimension_roundrobinkeyboard = 0x89, ///< Different samples triggered each time a note is played, any key advances the counter          dimension_roundrobinkeyboard = 0x89, /**< Different samples triggered each time a note is played, any key advances the counter */
296          dimension_modwheel          = 0x01, ///< Modulation Wheel (MIDI Controller 1)          dimension_modwheel          = 0x01, /**< Modulation Wheel (MIDI Controller 1) */
297          dimension_breath            = 0x02, ///< Breath Controller (Coarse, MIDI Controller 2)          dimension_breath            = 0x02, /**< Breath Controller (Coarse, MIDI Controller 2) */
298          dimension_foot              = 0x04, ///< Foot Pedal (Coarse, MIDI Controller 4)          dimension_foot              = 0x04, /**< Foot Pedal (Coarse, MIDI Controller 4) */
299          dimension_portamentotime    = 0x05, ///< Portamento Time (Coarse, MIDI Controller 5)          dimension_portamentotime    = 0x05, /**< Portamento Time (Coarse, MIDI Controller 5) */
300          dimension_effect1           = 0x0c, ///< Effect Controller 1 (Coarse, MIDI Controller 12)          dimension_effect1           = 0x0c, /**< Effect Controller 1 (Coarse, MIDI Controller 12) */
301          dimension_effect2           = 0x0d, ///< Effect Controller 2 (Coarse, MIDI Controller 13)          dimension_effect2           = 0x0d, /**< Effect Controller 2 (Coarse, MIDI Controller 13) */
302          dimension_genpurpose1       = 0x10, ///< General Purpose Controller 1 (Slider, MIDI Controller 16)          dimension_genpurpose1       = 0x10, /**< General Purpose Controller 1 (Slider, MIDI Controller 16) */
303          dimension_genpurpose2       = 0x11, ///< General Purpose Controller 2 (Slider, MIDI Controller 17)          dimension_genpurpose2       = 0x11, /**< General Purpose Controller 2 (Slider, MIDI Controller 17) */
304          dimension_genpurpose3       = 0x12, ///< General Purpose Controller 3 (Slider, MIDI Controller 18)          dimension_genpurpose3       = 0x12, /**< General Purpose Controller 3 (Slider, MIDI Controller 18) */
305          dimension_genpurpose4       = 0x13, ///< General Purpose Controller 4 (Slider, MIDI Controller 19)          dimension_genpurpose4       = 0x13, /**< General Purpose Controller 4 (Slider, MIDI Controller 19) */
306          dimension_sustainpedal      = 0x40, ///< Sustain Pedal (MIDI Controller 64)          dimension_sustainpedal      = 0x40, /**< Sustain Pedal (MIDI Controller 64) */
307          dimension_portamento        = 0x41, ///< Portamento (MIDI Controller 65)          dimension_portamento        = 0x41, /**< Portamento (MIDI Controller 65) */
308          dimension_sostenutopedal    = 0x42, ///< Sostenuto Pedal (MIDI Controller 66)          dimension_sostenutopedal    = 0x42, /**< Sostenuto Pedal (MIDI Controller 66) */
309          dimension_softpedal         = 0x43, ///< Soft Pedal (MIDI Controller 67)          dimension_softpedal         = 0x43, /**< Soft Pedal (MIDI Controller 67) */
310          dimension_genpurpose5       = 0x30, ///< General Purpose Controller 5 (Button, MIDI Controller 80)          dimension_genpurpose5       = 0x30, /**< General Purpose Controller 5 (Button, MIDI Controller 80) */
311          dimension_genpurpose6       = 0x31, ///< General Purpose Controller 6 (Button, MIDI Controller 81)          dimension_genpurpose6       = 0x31, /**< General Purpose Controller 6 (Button, MIDI Controller 81) */
312          dimension_genpurpose7       = 0x32, ///< General Purpose Controller 7 (Button, MIDI Controller 82)          dimension_genpurpose7       = 0x32, /**< General Purpose Controller 7 (Button, MIDI Controller 82) */
313          dimension_genpurpose8       = 0x33, ///< General Purpose Controller 8 (Button, MIDI Controller 83)          dimension_genpurpose8       = 0x33, /**< General Purpose Controller 8 (Button, MIDI Controller 83) */
314          dimension_effect1depth      = 0x5b, ///< Effect 1 Depth (MIDI Controller 91)          dimension_effect1depth      = 0x5b, /**< Effect 1 Depth (MIDI Controller 91) */
315          dimension_effect2depth      = 0x5c, ///< Effect 2 Depth (MIDI Controller 92)          dimension_effect2depth      = 0x5c, /**< Effect 2 Depth (MIDI Controller 92) */
316          dimension_effect3depth      = 0x5d, ///< Effect 3 Depth (MIDI Controller 93)          dimension_effect3depth      = 0x5d, /**< Effect 3 Depth (MIDI Controller 93) */
317          dimension_effect4depth      = 0x5e, ///< Effect 4 Depth (MIDI Controller 94)          dimension_effect4depth      = 0x5e, /**< Effect 4 Depth (MIDI Controller 94) */
318          dimension_effect5depth      = 0x5f  ///< Effect 5 Depth (MIDI Controller 95)          dimension_effect5depth      = 0x5f  /**< Effect 5 Depth (MIDI Controller 95) */
319      );      );
320    
321      /**      /**
# Line 325  namespace gig { Line 325  namespace gig {
325       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
326       */       */
327      GIG_DECLARE_ENUM(split_type_t,      GIG_DECLARE_ENUM(split_type_t,
328          split_type_normal,         ///< dimension value between 0-127          split_type_normal,         /**< dimension value between 0-127 */
329          split_type_bit             ///< dimension values are already the sought bit number          split_type_bit             /**< dimension values are already the sought bit number */
330      );      );
331    
332      /** General dimension definition. */      /** General dimension definition. */
# Line 343  namespace gig { Line 343  namespace gig {
343       * @see enumCount(), enumKey(), enumKeys(), enumValue()       * @see enumCount(), enumKey(), enumKeys(), enumValue()
344       */       */
345      GIG_DECLARE_ENUM(vcf_type_t,      GIG_DECLARE_ENUM(vcf_type_t,
346          vcf_type_lowpass      = 0x00,          vcf_type_lowpass      = 0x00, /**< Standard lowpass filter type. */
347          vcf_type_lowpassturbo = 0xff, ///< More poles than normal lowpass          vcf_type_lowpassturbo = 0xff, /**< More poles than normal lowpass. */
348          vcf_type_bandpass     = 0x01,          vcf_type_bandpass     = 0x01, /**< Bandpass filter type. */
349          vcf_type_highpass     = 0x02,          vcf_type_highpass     = 0x02, /**< Highpass filter type. */
350          vcf_type_bandreject   = 0x03          vcf_type_bandreject   = 0x03  /**< Band reject filter type. */
351      );      );
352    
353      /**      /**
# Line 381  namespace gig { Line 381  namespace gig {
381      };      };
382    
383      /**      /**
384       * Defines behavior options for envelope generators.       * Defines behavior options for envelope generators (gig format extension).
385       *       *
386       * These options allow to override the precise default behavior of the       * These options allow to override the precise default behavior of the
387       * envelope generators' state machines.       * envelope generators' state machines.
# Line 406  namespace gig { Line 406  namespace gig {
406      struct eg_opt_t {      struct eg_opt_t {
407          bool AttackCancel;     ///< Whether the "attack" stage is cancelled when receiving a note-off (default: @c true).          bool AttackCancel;     ///< Whether the "attack" stage is cancelled when receiving a note-off (default: @c true).
408          bool AttackHoldCancel; ///< Whether the "attack hold" stage is cancelled when receiving a note-off (default: @c true).          bool AttackHoldCancel; ///< Whether the "attack hold" stage is cancelled when receiving a note-off (default: @c true).
409          bool DecayCancel;      ///< Whether the "decay" stage is cancelled when receiving a note-off (default: @c true).          bool Decay1Cancel;     ///< Whether the "decay 1" stage is cancelled when receiving a note-off (default: @c true).
410            bool Decay2Cancel;     ///< Whether the "decay 2" stage is cancelled when receiving a note-off (default: @c true).
411          bool ReleaseCancel;    ///< Whether the "release" stage is cancelled when receiving a note-on (default: @c true).          bool ReleaseCancel;    ///< Whether the "release" stage is cancelled when receiving a note-on (default: @c true).
412    
413          eg_opt_t();          eg_opt_t();
414          void serialize(Serialization::Archive* archive);          void serialize(Serialization::Archive* archive);
415      };      };
416    
417        /** @brief Defines behaviour of release triggered sample(s) on sustain pedal up event.
418         *
419         * This option defines whether a sustain pedal up event (CC#64) would cause
420         * release triggered samples to be played (if any).
421         *
422         * @b Note: This option is an extension to the original gig file format,
423         * so this option is not available with the original Gigasampler/GigaStudio
424         * software! Currently only LinuxSampler and gigedit support this option!
425         *
426         * By default (which equals the original Gigasampler/GigaStudio behaviour)
427         * no release triggered samples are played if the sustain pedal is released.
428         * So usually in the gig format release triggered samples are only played
429         * on MIDI note-off events.
430         *
431         * @see enumCount(), enumKey(), enumKeys(), enumValue()
432         */
433        GIG_DECLARE_ENUM(sust_rel_trg_t,
434            sust_rel_trg_none        = 0x00, /**< No release triggered sample(s) are played on sustain pedal up (default). */
435            sust_rel_trg_maxvelocity = 0x01, /**< Play release trigger sample(s) on sustain pedal up, and simply use 127 as MIDI velocity for playback. */
436            sust_rel_trg_keyvelocity = 0x02  /**< Play release trigger sample(s) on sustain pedal up, and use the key`s last MIDI note-on velocity for playback. */
437        );
438    
439      // just symbol prototyping      // just symbol prototyping
440      class File;      class File;
441      class Instrument;      class Instrument;
# Line 551  namespace gig { Line 574  namespace gig {
574              uint16_t           SampleStartOffset;             ///< Number of samples the sample start should be moved (0 - 2000).              uint16_t           SampleStartOffset;             ///< Number of samples the sample start should be moved (0 - 2000).
575              double             SampleAttenuation;             ///< Sample volume (calculated from DLS::Sampler::Gain)              double             SampleAttenuation;             ///< Sample volume (calculated from DLS::Sampler::Gain)
576              uint8_t            DimensionUpperLimits[8];       ///< gig3: defines the upper limit of the dimension values for this dimension region. In case you wondered why this is defined on DimensionRegion level and not on Region level: the zone sizes (upper limits) of the velocity dimension can indeed differ in the individual dimension regions, depending on which zones of the other dimension types are currently selected. So this is exceptional for the velocity dimension only. All other dimension types have the same dimension zone sizes for every single DimensionRegion (of the sample Region).              uint8_t            DimensionUpperLimits[8];       ///< gig3: defines the upper limit of the dimension values for this dimension region. In case you wondered why this is defined on DimensionRegion level and not on Region level: the zone sizes (upper limits) of the velocity dimension can indeed differ in the individual dimension regions, depending on which zones of the other dimension types are currently selected. So this is exceptional for the velocity dimension only. All other dimension types have the same dimension zone sizes for every single DimensionRegion (of the sample Region).
577              eg_opt_t           EGOptions;                     ///< [gig extension]: Behavior options which should be used for all 3 envelope generators.              eg_opt_t           EG1Options;                    ///< [gig extension]: Behavior options which should be used for envelope generator 1 (volume amplitude EG).
578                eg_opt_t           EG2Options;                    ///< [gig extension]: Behavior options which should be used for envelope generator 2 (filter cutoff EG).
579                sust_rel_trg_t     SustainReleaseTrigger;         ///< [gig extension]: Whether a sustain pedal up event shall play release trigger sample.
580                bool               NoNoteOffReleaseTrigger;       ///< [gig extension]: If @c true then don't play a release trigger sample on MIDI note-off events.
581    
582              // derived attributes from DLS::Sampler              // derived attributes from DLS::Sampler
583              using DLS::Sampler::UnityNote;              using DLS::Sampler::UnityNote;
# Line 578  namespace gig { Line 604  namespace gig {
604              using DLS::Sampler::AddSampleLoop;              using DLS::Sampler::AddSampleLoop;
605              using DLS::Sampler::DeleteSampleLoop;              using DLS::Sampler::DeleteSampleLoop;
606              // overridden methods              // overridden methods
607              virtual void SetGain(int32_t gain);              virtual void SetGain(int32_t gain) OVERRIDE;
608              virtual void UpdateChunks(progress_t* pProgress);              virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
609              virtual void CopyAssign(const DimensionRegion* orig);              virtual void CopyAssign(const DimensionRegion* orig);
610          protected:          protected:
611              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.
# Line 771  namespace gig { Line 797  namespace gig {
797              file_offset_t ReadAndLoop(void* pBuffer, file_offset_t SampleCount, playback_state_t* pPlaybackState, DimensionRegion* pDimRgn, buffer_t* pExternalDecompressionBuffer = NULL);              file_offset_t ReadAndLoop(void* pBuffer, file_offset_t SampleCount, playback_state_t* pPlaybackState, DimensionRegion* pDimRgn, buffer_t* pExternalDecompressionBuffer = NULL);
798              file_offset_t Write(void* pBuffer, file_offset_t SampleCount);              file_offset_t Write(void* pBuffer, file_offset_t SampleCount);
799              Group*        GetGroup() const;              Group*        GetGroup() const;
800              virtual void  UpdateChunks(progress_t* pProgress);              virtual void  UpdateChunks(progress_t* pProgress) OVERRIDE;
801              void CopyAssignMeta(const Sample* orig);              void CopyAssignMeta(const Sample* orig);
802              void CopyAssignWave(const Sample* orig);              void CopyAssignWave(const Sample* orig);
803              uint32_t GetWaveDataCRC32Checksum();              uint32_t GetWaveDataCRC32Checksum();
# Line 865  namespace gig { Line 891  namespace gig {
891              void             SplitDimensionZone(dimension_t type, int zone);              void             SplitDimensionZone(dimension_t type, int zone);
892              void             SetDimensionType(dimension_t oldType, dimension_t newType);              void             SetDimensionType(dimension_t oldType, dimension_t newType);
893              // overridden methods              // overridden methods
894              virtual void     SetKeyRange(uint16_t Low, uint16_t High);              virtual void     SetKeyRange(uint16_t Low, uint16_t High) OVERRIDE;
895              virtual void     UpdateChunks(progress_t* pProgress);              virtual void     UpdateChunks(progress_t* pProgress) OVERRIDE;
896              virtual void     CopyAssign(const Region* orig);              virtual void     CopyAssign(const Region* orig);
897          protected:          protected:
898              Region(Instrument* pInstrument, RIFF::List* rgnList);              Region(Instrument* pInstrument, RIFF::List* rgnList);
# Line 959  namespace gig { Line 985  namespace gig {
985          protected:          protected:
986              MidiRuleCtrlTrigger(RIFF::Chunk* _3ewg);              MidiRuleCtrlTrigger(RIFF::Chunk* _3ewg);
987              MidiRuleCtrlTrigger();              MidiRuleCtrlTrigger();
988              void UpdateChunks(uint8_t* pData) const;              void UpdateChunks(uint8_t* pData) const OVERRIDE;
989              friend class Instrument;              friend class Instrument;
990      };      };
991    
# Line 999  namespace gig { Line 1025  namespace gig {
1025          protected:          protected:
1026              MidiRuleLegato(RIFF::Chunk* _3ewg);              MidiRuleLegato(RIFF::Chunk* _3ewg);
1027              MidiRuleLegato();              MidiRuleLegato();
1028              void UpdateChunks(uint8_t* pData) const;              void UpdateChunks(uint8_t* pData) const OVERRIDE;
1029              friend class Instrument;              friend class Instrument;
1030      };      };
1031    
# Line 1051  namespace gig { Line 1077  namespace gig {
1077          protected:          protected:
1078              MidiRuleAlternator(RIFF::Chunk* _3ewg);              MidiRuleAlternator(RIFF::Chunk* _3ewg);
1079              MidiRuleAlternator();              MidiRuleAlternator();
1080              void UpdateChunks(uint8_t* pData) const;              void UpdateChunks(uint8_t* pData) const OVERRIDE;
1081              friend class Instrument;              friend class Instrument;
1082      };      };
1083    
# Line 1071  namespace gig { Line 1097  namespace gig {
1097      class MidiRuleUnknown : public MidiRule {      class MidiRuleUnknown : public MidiRule {
1098          protected:          protected:
1099              MidiRuleUnknown() { }              MidiRuleUnknown() { }
1100              void UpdateChunks(uint8_t* pData) const { }              void UpdateChunks(uint8_t* pData) const OVERRIDE { }
1101              friend class Instrument;              friend class Instrument;
1102      };      };
1103    
# Line 1095  namespace gig { Line 1121  namespace gig {
1121       * - <a href="http://doc.linuxsampler.org/Instrument_Scripts/NKSP_Language/Reference/">NKSP Reference Manual</a>       * - <a href="http://doc.linuxsampler.org/Instrument_Scripts/NKSP_Language/Reference/">NKSP Reference Manual</a>
1122       * - <a href="http://doc.linuxsampler.org/Gigedit/Managing_Scripts">Using Instrument Scripts with Gigedit</a>       * - <a href="http://doc.linuxsampler.org/Gigedit/Managing_Scripts">Using Instrument Scripts with Gigedit</a>
1123       */       */
1124      class Script {      class Script : protected DLS::Storage {
1125          public:          public:
1126              enum Encoding_t {              enum Encoding_t {
1127                  ENCODING_ASCII = 0 ///< Standard 8 bit US ASCII character encoding (default).                  ENCODING_ASCII = 0 ///< Standard 8 bit US ASCII character encoding (default).
# Line 1121  namespace gig { Line 1147  namespace gig {
1147          protected:          protected:
1148              Script(ScriptGroup* group, RIFF::Chunk* ckScri);              Script(ScriptGroup* group, RIFF::Chunk* ckScri);
1149              virtual ~Script();              virtual ~Script();
1150              void UpdateChunks(progress_t* pProgress);              void UpdateChunks(progress_t* pProgress) OVERRIDE;
1151                void DeleteChunks() OVERRIDE;
1152              void RemoveAllScriptReferences();              void RemoveAllScriptReferences();
1153              friend class ScriptGroup;              friend class ScriptGroup;
1154              friend class Instrument;              friend class Instrument;
# Line 1143  namespace gig { Line 1170  namespace gig {
1170       * not available in the GigaStudio 4 software. It is currently only       * not available in the GigaStudio 4 software. It is currently only
1171       * supported by LinuxSampler and gigedit.       * supported by LinuxSampler and gigedit.
1172       */       */
1173      class ScriptGroup {      class ScriptGroup : protected DLS::Storage {
1174          public:          public:
1175              String   Name; ///< Name of this script group. For example to be displayed in an instrument editor.              String   Name; ///< Name of this script group. For example to be displayed in an instrument editor.
1176    
# Line 1154  namespace gig { Line 1181  namespace gig {
1181              ScriptGroup(File* file, RIFF::List* lstRTIS);              ScriptGroup(File* file, RIFF::List* lstRTIS);
1182              virtual ~ScriptGroup();              virtual ~ScriptGroup();
1183              void LoadScripts();              void LoadScripts();
1184              void UpdateChunks(progress_t* pProgress);              virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
1185                virtual void DeleteChunks() OVERRIDE;
1186              friend class Script;              friend class Script;
1187              friend class File;              friend class File;
1188          private:          private:
# Line 1207  namespace gig { Line 1235  namespace gig {
1235              Region*   AddRegion();              Region*   AddRegion();
1236              void      DeleteRegion(Region* pRegion);              void      DeleteRegion(Region* pRegion);
1237              void      MoveTo(Instrument* dst);              void      MoveTo(Instrument* dst);
1238              virtual void UpdateChunks(progress_t* pProgress);              virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
1239              virtual void CopyAssign(const Instrument* orig);              virtual void CopyAssign(const Instrument* orig);
1240              // own methods              // own methods
1241              Region*   GetRegion(unsigned int Key);              Region*   GetRegion(unsigned int Key);
# Line 1261  namespace gig { Line 1289  namespace gig {
1289       * there is always at least one Group in a .gig file, no matter if you       * there is always at least one Group in a .gig file, no matter if you
1290       * created one yet or not.       * created one yet or not.
1291       */       */
1292      class Group {      class Group : public DLS::Storage {
1293          public:          public:
1294              String Name; ///< Stores the name of this Group.              String Name; ///< Stores the name of this Group.
1295    
# Line 1271  namespace gig { Line 1299  namespace gig {
1299          protected:          protected:
1300              Group(File* file, RIFF::Chunk* ck3gnm);              Group(File* file, RIFF::Chunk* ck3gnm);
1301              virtual ~Group();              virtual ~Group();
1302              virtual void UpdateChunks(progress_t* pProgress);              virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
1303                virtual void DeleteChunks() OVERRIDE;
1304              void MoveAll();              void MoveAll();
1305              friend class File;              friend class File;
1306          private:          private:
# Line 1319  namespace gig { Line 1348  namespace gig {
1348          public:          public:
1349              static const DLS::version_t VERSION_2;              static const DLS::version_t VERSION_2;
1350              static const DLS::version_t VERSION_3;              static const DLS::version_t VERSION_3;
1351                static const DLS::version_t VERSION_4;
1352    
1353              // derived attributes from DLS::Resource              // derived attributes from DLS::Resource
1354              using DLS::Resource::pInfo;              using DLS::Resource::pInfo;
# Line 1333  namespace gig { Line 1363  namespace gig {
1363              using DLS::File::Save;              using DLS::File::Save;
1364              using DLS::File::GetFileName;              using DLS::File::GetFileName;
1365              using DLS::File::SetFileName;              using DLS::File::SetFileName;
1366                using DLS::File::GetRiffFile;
1367              // overridden  methods              // overridden  methods
1368              File();              File();
1369              File(RIFF::File* pRIFF);              File(RIFF::File* pRIFF);
# Line 1340  namespace gig { Line 1371  namespace gig {
1371              Sample*     GetNextSample();      ///< Returns a pointer to the next <i>Sample</i> object of the file, <i>NULL</i> otherwise.              Sample*     GetNextSample();      ///< Returns a pointer to the next <i>Sample</i> object of the file, <i>NULL</i> otherwise.
1372              Sample*     GetSample(uint index);              Sample*     GetSample(uint index);
1373              Sample*     AddSample();              Sample*     AddSample();
1374                size_t      CountSamples();
1375              void        DeleteSample(Sample* pSample);              void        DeleteSample(Sample* pSample);
1376              Instrument* GetFirstInstrument(); ///< Returns a pointer to the first <i>Instrument</i> object of the file, <i>NULL</i> otherwise.              Instrument* GetFirstInstrument(); ///< Returns a pointer to the first <i>Instrument</i> object of the file, <i>NULL</i> otherwise.
1377              Instrument* GetNextInstrument();  ///< Returns a pointer to the next <i>Instrument</i> object of the file, <i>NULL</i> otherwise.              Instrument* GetNextInstrument();  ///< Returns a pointer to the next <i>Instrument</i> object of the file, <i>NULL</i> otherwise.
1378              Instrument* GetInstrument(uint index, progress_t* pProgress = NULL);              Instrument* GetInstrument(uint index, progress_t* pProgress = NULL);
1379              Instrument* AddInstrument();              Instrument* AddInstrument();
1380              Instrument* AddDuplicateInstrument(const Instrument* orig);              Instrument* AddDuplicateInstrument(const Instrument* orig);
1381                size_t      CountInstruments();
1382              void        DeleteInstrument(Instrument* pInstrument);              void        DeleteInstrument(Instrument* pInstrument);
1383              Group*      GetFirstGroup(); ///< Returns a pointer to the first <i>Group</i> object of the file, <i>NULL</i> otherwise.              Group*      GetFirstGroup(); ///< Returns a pointer to the first <i>Group</i> object of the file, <i>NULL</i> otherwise.
1384              Group*      GetNextGroup();  ///< Returns a pointer to the next <i>Group</i> object of the file, <i>NULL</i> otherwise.              Group*      GetNextGroup();  ///< Returns a pointer to the next <i>Group</i> object of the file, <i>NULL</i> otherwise.
# Line 1362  namespace gig { Line 1395  namespace gig {
1395              ScriptGroup* AddScriptGroup();              ScriptGroup* AddScriptGroup();
1396              void        DeleteScriptGroup(ScriptGroup* pGroup);              void        DeleteScriptGroup(ScriptGroup* pGroup);
1397              virtual    ~File();              virtual    ~File();
1398              virtual void UpdateChunks(progress_t* pProgress);              virtual void UpdateChunks(progress_t* pProgress) OVERRIDE;
1399          protected:          protected:
1400              // overridden protected methods from DLS::File              // overridden protected methods from DLS::File
1401              virtual void LoadSamples();              virtual void LoadSamples() OVERRIDE;
1402              virtual void LoadInstruments();              virtual void LoadInstruments() OVERRIDE;
1403              virtual void LoadGroups();              virtual void LoadGroups();
1404              virtual void UpdateFileOffsets();              virtual void UpdateFileOffsets() OVERRIDE;
1405              // own protected methods              // own protected methods
1406              virtual void LoadSamples(progress_t* pProgress);              virtual void LoadSamples(progress_t* pProgress);
1407              virtual void LoadInstruments(progress_t* pProgress);              virtual void LoadInstruments(progress_t* pProgress);

Legend:
Removed from v.3323  
changed lines
  Added in v.3486

  ViewVC Help
Powered by ViewVC