libgig  4.1.0
gig Namespace Reference

Gigasampler/GigaStudio specific classes and definitions. More...

Classes

struct  buffer_t
 Pointer address and size of a buffer. More...
 
struct  crossfade_t
 Defines the envelope of a crossfade. More...
 
struct  dimension_def_t
 General dimension definition. More...
 
class  DimensionRegion
 Encapsulates articulation informations of a dimension region. More...
 
struct  eg_opt_t
 Defines behavior options for envelope generators (gig format extension). More...
 
class  Exception
 Will be thrown whenever a gig specific error occurs while trying to access a Gigasampler File. More...
 
class  File
 Provides convenient access to Gigasampler/GigaStudio .gig files. More...
 
class  Group
 Group of Gigasampler samples. More...
 
class  Instrument
 Provides access to a Gigasampler/GigaStudio instrument. More...
 
struct  leverage_ctrl_t
 Defines a controller that has a certain contrained influence on a particular synthesis parameter (used to define attenuation controller, EG1 controller and EG2 controller). More...
 
class  MidiRule
 Abstract base class for all MIDI rules. More...
 
class  MidiRuleAlternator
 MIDI rule to automatically cycle through specified sequences of different articulations. More...
 
class  MidiRuleCtrlTrigger
 MIDI rule for triggering notes by control change events. More...
 
class  MidiRuleLegato
 MIDI rule for instruments with legato samples. More...
 
class  MidiRuleUnknown
 A MIDI rule not yet implemented by libgig. More...
 
struct  playback_state_t
 Reflects the current playback state for a sample. More...
 
struct  range_t
 Lower and upper limit of a range. More...
 
class  Region
 Defines Region information of a Gigasampler/GigaStudio instrument. More...
 
class  Sample
 Encapsulates sample waves of Gigasampler/GigaStudio files used for playback. More...
 
class  Script
 Real-time instrument script (gig format extension). More...
 
class  ScriptGroup
 Group of instrument scripts (gig format extension). More...
 

Typedefs

typedef std::string String
 
typedef RIFF::progress_t progress_t
 
typedef RIFF::file_offset_t file_offset_t
 
typedef leverage_ctrl_t attenuation_ctrl_t
 Defines controller influencing attenuation. More...
 
typedef leverage_ctrl_t eg1_ctrl_t
 Defines controller influencing envelope generator 1. More...
 
typedef leverage_ctrl_t eg2_ctrl_t
 Defines controller influencing envelope generator 2. More...
 

Functions

size_t enumCount (const std::type_info &type)
 Amount of elements in given enum type. More...
 
const char * enumKey (const std::type_info &type, size_t value)
 Enum constant name of numeric value. More...
 
bool enumKey (const std::type_info &type, String key)
 Check if enum element exists. More...
 
const char ** enumKeys (const std::type_info &type)
 All element names of enum type. More...
 
size_t enumCount (String typeName)
 Amount of elements in given enum type. More...
 
const char * enumKey (String typeName, size_t value)
 Enum constant name of numeric value. More...
 
bool enumKey (String typeName, String key)
 Check if enum element exists. More...
 
const char ** enumKeys (String typeName)
 All element names of enum type. More...
 
size_t enumValue (String key)
 Numeric value of enum constant. More...
 
String libraryName ()
 Returns the name of this C++ library. More...
 
String libraryVersion ()
 Returns version of this C++ library. More...
 

Variables

 loop_type_normal = 0x00000000 loop_type_t { __VA_ARGS__ } loop_type_bidirectional = 0x00000001
 Standard types of sample loops. More...
 
 loop_type_backward = 0x00000002 )
 
 smpte_format_no_offset = 0x00000000 smpte_format_t { __VA_ARGS__ } smpte_format_24_frames = 0x00000018
 Society of Motion Pictures and Television E time format. More...
 
 smpte_format_25_frames = 0x00000019
 
 smpte_format_30_frames_dropping = 0x0000001D
 
 smpte_format_30_frames = 0x0000001E )
 
 curve_type_nonlinear = 0 curve_type_t { __VA_ARGS__ } curve_type_linear = 1
 Defines the shape of a function graph. More...
 
 curve_type_special = 2
 
 curve_type_unknown = 0xffffffff )
 
dim_bypass_ctrl_none dim_bypass_ctrl_t { __VA_ARGS__ } dim_bypass_ctrl_94
 Dimensions allow to bypass one of the following controllers. More...
 
dim_bypass_ctrl_none dim_bypass_ctrl_95
 
 lfo3_ctrl_internal = 0x00 lfo3_ctrl_t { __VA_ARGS__ } lfo3_ctrl_modwheel = 0x01
 Defines how LFO3 is controlled by. More...
 
 lfo3_ctrl_aftertouch = 0x02
 
 lfo3_ctrl_internal_modwheel = 0x03
 
 lfo3_ctrl_internal_aftertouch = 0x04 )
 
 lfo2_ctrl_internal = 0x00 lfo2_ctrl_t { __VA_ARGS__ } lfo2_ctrl_modwheel = 0x01
 Defines how LFO2 is controlled by. More...
 
 lfo2_ctrl_foot = 0x02
 
 lfo2_ctrl_internal_modwheel = 0x03
 
 lfo2_ctrl_internal_foot = 0x04 )
 
 lfo1_ctrl_internal = 0x00 lfo1_ctrl_t { __VA_ARGS__ } lfo1_ctrl_modwheel = 0x01
 Defines how LFO1 is controlled by. More...
 
 lfo1_ctrl_breath = 0x02
 
 lfo1_ctrl_internal_modwheel = 0x03
 
 lfo1_ctrl_internal_breath = 0x04 )
 
 vcf_cutoff_ctrl_none = 0x00 vcf_cutoff_ctrl_t { __VA_ARGS__ } vcf_cutoff_ctrl_none2 = 0x01
 Defines how the filter cutoff frequency is controlled by. More...
 
 vcf_cutoff_ctrl_modwheel = 0x81
 
 vcf_cutoff_ctrl_effect1 = 0x8c
 
 vcf_cutoff_ctrl_effect2 = 0x8d
 
 vcf_cutoff_ctrl_breath = 0x82
 
 vcf_cutoff_ctrl_foot = 0x84
 
 vcf_cutoff_ctrl_sustainpedal = 0xc0
 
 vcf_cutoff_ctrl_softpedal = 0xc3
 
 vcf_cutoff_ctrl_genpurpose7 = 0xd2
 
 vcf_cutoff_ctrl_genpurpose8 = 0xd3
 
 vcf_cutoff_ctrl_aftertouch = 0x80 )
 
 vcf_res_ctrl_none = 0xffffffff vcf_res_ctrl_t { __VA_ARGS__ } vcf_res_ctrl_genpurpose3 = 0
 Defines how the filter resonance is controlled by. More...
 
 vcf_res_ctrl_genpurpose4 = 1
 
 vcf_res_ctrl_genpurpose5 = 2
 
 vcf_res_ctrl_genpurpose6 = 3 )
 
 dimension_none = 0x00 dimension_t { __VA_ARGS__ } dimension_samplechannel = 0x80
 Defines the type of dimension, that is how the dimension zones (and thus how the dimension regions are selected by. More...
 
 dimension_layer = 0x81
 
 dimension_velocity = 0x82
 
 dimension_channelaftertouch = 0x83
 
 dimension_releasetrigger = 0x84
 
 dimension_keyboard = 0x85
 
 dimension_roundrobin = 0x86
 
 dimension_random = 0x87
 
 dimension_smartmidi = 0x88
 
 dimension_roundrobinkeyboard = 0x89
 
 dimension_modwheel = 0x01
 
 dimension_breath = 0x02
 
 dimension_foot = 0x04
 
 dimension_portamentotime = 0x05
 
 dimension_effect1 = 0x0c
 
 dimension_effect2 = 0x0d
 
 dimension_genpurpose1 = 0x10
 
 dimension_genpurpose2 = 0x11
 
 dimension_genpurpose3 = 0x12
 
 dimension_genpurpose4 = 0x13
 
 dimension_sustainpedal = 0x40
 
 dimension_portamento = 0x41
 
 dimension_sostenutopedal = 0x42
 
 dimension_softpedal = 0x43
 
 dimension_genpurpose5 = 0x30
 
 dimension_genpurpose6 = 0x31
 
 dimension_genpurpose7 = 0x32
 
 dimension_genpurpose8 = 0x33
 
 dimension_effect1depth = 0x5b
 
 dimension_effect2depth = 0x5c
 
 dimension_effect3depth = 0x5d
 
 dimension_effect4depth = 0x5e
 
 dimension_effect5depth = 0x5f )
 
split_type_normal split_type_t { __VA_ARGS__ } split_type_bit )
 Intended for internal usage: will be used to convert a dimension value into the corresponding dimension bit number. More...
 
 vcf_type_lowpass = 0x00 vcf_type_t { __VA_ARGS__ } vcf_type_lowpassturbo = 0xff
 Defines which frequencies are filtered by the VCF. More...
 
 vcf_type_bandpass = 0x01
 
 vcf_type_highpass = 0x02
 
 vcf_type_bandreject = 0x03 )
 

Detailed Description

Gigasampler/GigaStudio specific classes and definitions.

Typedef Documentation

◆ attenuation_ctrl_t

Defines controller influencing attenuation.

See also
leverage_ctrl_t

Definition at line 259 of file gig.h.

◆ eg1_ctrl_t

Defines controller influencing envelope generator 1.

See also
leverage_ctrl_t

Definition at line 266 of file gig.h.

◆ eg2_ctrl_t

Defines controller influencing envelope generator 2.

See also
leverage_ctrl_t

Definition at line 273 of file gig.h.

Function Documentation

◆ enumCount() [1/2]

size_t gig::enumCount ( const std::type_info &  type)

Amount of elements in given enum type.

Returns the amount of elements of the enum type given by type. If the requested enum type is unknown, then this function returns 0 instead.

Use the typeid() keyword of C++ to get a std::type_info object.

Parameters
type- enum type of interest
Returns
enum's amount of elements

Definition at line 206 of file typeinfo.cpp.

References enumCount().

Referenced by enumCount().

◆ enumCount() [2/2]

size_t gig::enumCount ( String  typeName)

Amount of elements in given enum type.

Returns the amount of elements of the enum type with raw C++ type name typeName. If the requested enum type is unknown, then this function returns 0 instead.

Note: you MUST pass the raw C++ type name, not a demangled human readable C++ type name. On doubt use the overloaded function which takes a std::type_info as argument instead.

Parameters
typeName- raw C++ type name of enum
Returns
enum's amount of elements

Definition at line 190 of file typeinfo.cpp.

References enumCount().

◆ enumKey() [1/4]

const char * gig::enumKey ( const std::type_info &  type,
size_t  value 
)

Enum constant name of numeric value.

Returns the enum constant name (a.k.a. enum element name) for the given numeric value and the given enum type. If either the requested enum type or enum constant numeric value is unknown, then this function returns NULL instead.

If the requested enum type contains several enum elements with the requested numeric enum value, then this function will simply return one of them, it is undefined which one it would return exactly in this case.

Use the typeid() keyword of C++ to get a std::type_info object.

Parameters
type- enum type of interest
value- numeric value of sought enum constant
Returns
true if requested enum element exists

Definition at line 305 of file typeinfo.cpp.

References enumKey().

Referenced by enumKey().

◆ enumKey() [2/4]

bool gig::enumKey ( const std::type_info &  type,
String  key 
)

Check if enum element exists.

Checks whether the enum constant with name key of requested enum type exists. If either the requested enum type or enum constant is unknown, then this function returns false instead.

Use the typeid() keyword of C++ to get a std::type_info object.

Parameters
type- enum type of interest
key- name of enum constant
Returns
true if requested enum element exists

Definition at line 257 of file typeinfo.cpp.

References enumKey().

◆ enumKey() [3/4]

const char * gig::enumKey ( String  typeName,
size_t  value 
)

Enum constant name of numeric value.

Returns the enum constant name (a.k.a. enum element name) for the given numeric value and the enum type with raw C++ enum type name typeName. If either the requested enum type or enum constant numeric value is unknown, then this function returns NULL instead.

If the requested enum type contains several enum elements with the requested numeric enum value, then this function will simply return one of them, it is undefined which one it would return exactly in this case.

Note: you MUST pass the raw C++ type name, not a demangled human readable C++ type name. On doubt use the overloaded function which takes a std::type_info as argument instead.

Parameters
typeName- raw C++ type name of enum
value- numeric value of sought enum constant
Returns
true if requested enum element exists

Definition at line 280 of file typeinfo.cpp.

References enumKey().

◆ enumKey() [4/4]

bool gig::enumKey ( String  typeName,
String  key 
)

Check if enum element exists.

Checks whether the enum constant with name key of enum type with raw C++ enum type name typeName exists. If either the requested enum type or enum constant is unknown, then this function returns false instead.

Note: you MUST pass the raw C++ type name, not a demangled human readable C++ type name. On doubt use the overloaded function which takes a std::type_info as argument instead.

Parameters
typeName- raw C++ type name of enum
key- name of enum constant
Returns
true if requested enum element exists

Definition at line 239 of file typeinfo.cpp.

References enumKey().

◆ enumKeys() [1/2]

const char ** gig::enumKeys ( const std::type_info &  type)

All element names of enum type.

Returns a NULL terminated array of C strings of all enum constant names of the given enum type. If the requested enum type is unknown, then this function returns NULL instead.

Use the typeid() keyword of C++ to get a std::type_info object.

Parameters
type- enum type of interest
Returns
list of all enum element names

Definition at line 342 of file typeinfo.cpp.

References enumKeys().

Referenced by enumKeys().

◆ enumKeys() [2/2]

const char ** gig::enumKeys ( String  typeName)

All element names of enum type.

Returns a NULL terminated array of C strings of all enum constant names of the given enum type with raw C++ enum type name typeName. If the requested enum type is unknown, then this function returns NULL instead.

Note: you MUST pass the raw C++ type name, not a demangled human readable C++ type name. On doubt use the overloaded function which takes a std::type_info as argument instead.

Parameters
typeName- raw C++ type name of enum
Returns
list of all enum element names

Definition at line 323 of file typeinfo.cpp.

References enumKeys().

◆ enumValue()

size_t gig::enumValue ( String  key)

Numeric value of enum constant.

Returns the numeric value (assigned at library compile time) to the enum constant with given name. If the requested enum constant is unknown, then this function returns 0 instead.

Parameters
key- enum constant name
Returns
enum constant's numeric value

Definition at line 219 of file typeinfo.cpp.

References enumValue().

Referenced by enumValue().

◆ libraryName()

String gig::libraryName ( )

Returns the name of this C++ library.

This is usually "libgig" of course. This call is equivalent to RIFF::libraryName() and DLS::libraryName().

Definition at line 6602 of file gig.cpp.

◆ libraryVersion()

String gig::libraryVersion ( )

Returns version of this C++ library.

This call is equivalent to RIFF::libraryVersion() and DLS::libraryVersion().

Definition at line 6610 of file gig.cpp.

Variable Documentation

◆ curve_type_nonlinear

gig::curve_type_nonlinear = 0 curve_type_t { __VA_ARGS__ } curve_type_linear = 1

Defines the shape of a function graph.

See also
enumCount(), enumKey(), enumKeys(), enumValue()

Definition at line 149 of file gig.h.

Referenced by gig::DimensionRegion::UpdateChunks().

◆ dim_bypass_ctrl_t

dim_bypass_ctrl_none gig::dim_bypass_ctrl_t { __VA_ARGS__ } dim_bypass_ctrl_94

Dimensions allow to bypass one of the following controllers.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< Effect 4 Depth (MIDI Controller 94) Effect 5 Depth (MIDI Controller 95)

Definition at line 159 of file gig.h.

◆ dimension_none

gig::dimension_none = 0x00 dimension_t { __VA_ARGS__ } dimension_samplechannel = 0x80

Defines the type of dimension, that is how the dimension zones (and thus how the dimension regions are selected by.

The number of dimension zones is always a power of two. All dimensions can have up to 32 zones (except the layer dimension with only up to 8 zones and the samplechannel dimension which currently allows only 2 zones).

See also
enumCount(), enumKey(), enumKeys(), enumValue()< Dimension not in use. If used sample has more than one channel (thus is not mono). For layering of up to 8 instruments (and eventually crossfading of 2 or 4 layers). Key Velocity (this is the only dimension in gig2 where the ranges can exactly be defined). Channel Key Pressure Special dimension for triggering samples on releasing a key. Dimension for keyswitching Different samples triggered each time a note is played, dimension regions selected in sequence Different samples triggered each time a note is played, random order For MIDI tools like legato and repetition mode Different samples triggered each time a note is played, any key advances the counter Modulation Wheel (MIDI Controller 1) Breath Controller (Coarse, MIDI Controller 2) Foot Pedal (Coarse, MIDI Controller 4) Portamento Time (Coarse, MIDI Controller 5) Effect Controller 1 (Coarse, MIDI Controller 12) Effect Controller 2 (Coarse, MIDI Controller 13) General Purpose Controller 1 (Slider, MIDI Controller 16) General Purpose Controller 2 (Slider, MIDI Controller 17) General Purpose Controller 3 (Slider, MIDI Controller 18) General Purpose Controller 4 (Slider, MIDI Controller 19) Sustain Pedal (MIDI Controller 64) Portamento (MIDI Controller 65) Sostenuto Pedal (MIDI Controller 66) Soft Pedal (MIDI Controller 67) General Purpose Controller 5 (Button, MIDI Controller 80) General Purpose Controller 6 (Button, MIDI Controller 81) General Purpose Controller 7 (Button, MIDI Controller 82) General Purpose Controller 8 (Button, MIDI Controller 83) Effect 1 Depth (MIDI Controller 91) Effect 2 Depth (MIDI Controller 92) Effect 3 Depth (MIDI Controller 93) Effect 4 Depth (MIDI Controller 94) Effect 5 Depth (MIDI Controller 95)

Definition at line 319 of file gig.h.

Referenced by gig::Region::DeleteDimension(), gig::DimensionRegion::SetVCFVelocityScale(), and gig::Region::UpdateChunks().

◆ lfo1_ctrl_internal

gig::lfo1_ctrl_internal = 0x00 lfo1_ctrl_t { __VA_ARGS__ } lfo1_ctrl_modwheel = 0x01

Defines how LFO1 is controlled by.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< Only internally controlled. Only controlled by external modulation wheel. Only controlled by external breath controller. Controlled internally and by external modulation wheel. Controlled internally and by external breath controller.

Definition at line 195 of file gig.h.

◆ lfo2_ctrl_internal

gig::lfo2_ctrl_internal = 0x00 lfo2_ctrl_t { __VA_ARGS__ } lfo2_ctrl_modwheel = 0x01

Defines how LFO2 is controlled by.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< Only internally controlled. Only controlled by external modulation wheel. Only controlled by external foot controller. Controlled internally and by external modulation wheel. Controlled internally and by external foot controller.

Definition at line 183 of file gig.h.

◆ lfo3_ctrl_internal

gig::lfo3_ctrl_internal = 0x00 lfo3_ctrl_t { __VA_ARGS__ } lfo3_ctrl_modwheel = 0x01

Defines how LFO3 is controlled by.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< Only internally controlled. Only controlled by external modulation wheel. Only controlled by aftertouch controller. Controlled internally and by external modulation wheel. Controlled internally and by aftertouch controller.

Definition at line 171 of file gig.h.

◆ loop_type_normal

gig::loop_type_normal = 0x00000000 loop_type_t { __VA_ARGS__ } loop_type_bidirectional = 0x00000001

Standard types of sample loops.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< Loop forward (normal) Alternating loop (forward/backward, also known as Ping Pong) Loop backward (reverse)

Definition at line 126 of file gig.h.

Referenced by gig::Sample::ReadAndLoop(), and gig::Sample::Sample().

◆ smpte_format_no_offset

gig::smpte_format_no_offset = 0x00000000 smpte_format_t { __VA_ARGS__ } smpte_format_24_frames = 0x00000018

Society of Motion Pictures and Television E time format.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< no SMPTE offset 24 frames per second 25 frames per second 30 frames per second with frame dropping (30 drop) 30 frames per second

Definition at line 138 of file gig.h.

Referenced by gig::Sample::Sample().

◆ split_type_t

split_type_normal gig::split_type_t { __VA_ARGS__ } split_type_bit )

Intended for internal usage: will be used to convert a dimension value into the corresponding dimension bit number.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< dimension value between 0-127 dimension values are already the sought bit number

Definition at line 330 of file gig.h.

◆ vcf_cutoff_ctrl_none

gig::vcf_cutoff_ctrl_none = 0x00 vcf_cutoff_ctrl_t { __VA_ARGS__ } vcf_cutoff_ctrl_none2 = 0x01

Defines how the filter cutoff frequency is controlled by.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< The difference between none and none2 is unknown Modulation Wheel (MIDI Controller 1) Effect Controller 1 (Coarse, MIDI Controller 12) Effect Controller 2 (Coarse, MIDI Controller 13) Breath Controller (Coarse, MIDI Controller 2) Foot Pedal (Coarse, MIDI Controller 4) Sustain Pedal (MIDI Controller 64) Soft Pedal (MIDI Controller 67) General Purpose Controller 7 (Button, MIDI Controller 82) General Purpose Controller 8 (Button, MIDI Controller 83) Key Pressure

Definition at line 214 of file gig.h.

◆ vcf_res_ctrl_none

gig::vcf_res_ctrl_none = 0xffffffff vcf_res_ctrl_t { __VA_ARGS__ } vcf_res_ctrl_genpurpose3 = 0

Defines how the filter resonance is controlled by.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< General Purpose Controller 3 (Slider, MIDI Controller 18) General Purpose Controller 4 (Slider, MIDI Controller 19) General Purpose Controller 5 (Button, MIDI Controller 80) General Purpose Controller 6 (Button, MIDI Controller 81)

Definition at line 226 of file gig.h.

Referenced by gig::DimensionRegion::UpdateChunks().

◆ vcf_type_lowpass

gig::vcf_type_lowpass = 0x00 vcf_type_t { __VA_ARGS__ } vcf_type_lowpassturbo = 0xff

Defines which frequencies are filtered by the VCF.

See also
enumCount(), enumKey(), enumKeys(), enumValue()< More poles than normal lowpass

Definition at line 351 of file gig.h.

Referenced by gig::DimensionRegion::UpdateChunks().