## IpatchGigRegion IpatchGigRegion — GigaSampler region object |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                        IpatchGigRegion;
    enum                IpatchGigRegionFlags;
    #define             IPATCH_GIG_REGION_FLAG_MASK
    #define             IPATCH_GIG_REGION_UNUSED_FLAG_SHIFT
    IpatchGigRegion *   ipatch_gig_region_new               (void);
    IpatchGigRegion *   ipatch_gig_region_first             (IpatchIter *iter);
    IpatchGigRegion *   ipatch_gig_region_next              (IpatchIter *iter);
    void                ipatch_gig_region_set_note_range    (IpatchGigRegion *region,
                                                             int low,
                                                             int high);
    void                ipatch_gig_region_set_velocity_range
                                                            (IpatchGigRegion *region,
                                                             int low,
                                                             int high);
    void                ipatch_gig_region_new_dimension     (IpatchGigRegion *region,
                                                             IpatchGigDimensionType type,
                                                             int split_count);
    void                ipatch_gig_region_remove_dimension  (IpatchGigRegion *region,
                                                             int dim_index,
                                                             int split_index);

## Object Hierarchy

      GObject
       +----IpatchItem
             +----IpatchContainer
                   +----IpatchGigRegion

## Properties

      "channel"                  gint                  : Read / Write
      "key-group"                gint                  : Read / Write
      "layer-group"              gint                  : Read / Write
      "multi-channel"            gboolean              : Read / Write
      "note-range"               IpatchRange*          : Read / Write
      "phase-group"              gint                  : Read / Write
      "phase-master"             gboolean              : Read / Write
      "self-non-exclusive"       gboolean              : Read / Write
      "velocity-range"           IpatchRange*          : Read / Write

## Description

GigaSampler region objects are children of IpatchGigInst objects.

## Details

### IpatchGigRegion

    typedef struct _IpatchGigRegion IpatchGigRegion;

### enum IpatchGigRegionFlags

    typedef enum
    {
      IPATCH_GIG_REGION_SELF_NON_EXCLUSIVE = 1 << IPATCH_CONTAINER_UNUSED_FLAG_SHIFT,
      IPATCH_GIG_REGION_PHASE_MASTER = 1 << (IPATCH_CONTAINER_UNUSED_FLAG_SHIFT + 1),
      IPATCH_GIG_REGION_MULTI_CHANNEL = 1 << (IPATCH_CONTAINER_UNUSED_FLAG_SHIFT + 2)
    } IpatchGigRegionFlags;

### IPATCH_GIG_REGION_FLAG_MASK

    #define IPATCH_GIG_REGION_FLAG_MASK  (0x0F << IPATCH_CONTAINER_UNUSED_FLAG_SHIFT)

### IPATCH_GIG_REGION_UNUSED_FLAG_SHIFT

    #define             IPATCH_GIG_REGION_UNUSED_FLAG_SHIFT

### ipatch_gig_region_new ()

    IpatchGigRegion *   ipatch_gig_region_new               (void);

Create a new GigaSampler instrument region.

Returns : | New GigaSampler region with a ref count of 1 which the caller owns.

### ipatch_gig_region_first ()

    IpatchGigRegion *   ipatch_gig_region_first             (IpatchIter *iter);

Gets the first item in a region iterator. A convenience wrapper for `ipatch_iter_first()`.

`iter` : | Patch item iterator containing IpatchGigRegion items
Returns : | The first region in `iter` or `NULL` if empty.

### ipatch_gig_region_next ()

    IpatchGigRegion *   ipatch_gig_region_next              (IpatchIter *iter);

Gets the next item in a region iterator. A convenience wrapper for `ipatch_iter_next()`.

`iter` : | Patch item iterator containing IpatchGigRegion items
Returns : | The next region in `iter` or `NULL` if at the end of the list.

### ipatch_gig_region_set_note_range ()

    void                ipatch_gig_region_set_note_range    (IpatchGigRegion *region,
                                                             int low,
                                                             int high);

Set the MIDI note range that a region is active on.

`region` : | Region to set note range of
`low` : | Low value of range (MIDI note # between 0 and 127)
`high` : | High value of range (MIDI note # between 0 and 127)

### ipatch_gig_region_set_velocity_range ()

    void                ipatch_gig_region_set_velocity_range
                                                            (IpatchGigRegion *region,
                                                             int low,
                                                             int high);

Set the MIDI velocity range that a region is active on.

`region` : | Region to set velocity range of
`low` : | Low value of range (MIDI velocity # between 0 and 127)
`high` : | High value of range (MIDI velocity # between 0 and 127)

### ipatch_gig_region_new_dimension ()

    void                ipatch_gig_region_new_dimension     (IpatchGigRegion *region,
                                                             IpatchGigDimensionType type,
                                                             int split_count);

Adds a new dimension to a GigaSampler region. The dimension is allocated `split_count` number of dimension bits which means the total number of sub regions will be multiplied by a factor of 2 to the power of `split_count`. There can be a maximum of 32 sub regions for a total of 5 used split bits.

`region` : | GigaSampler region
`type` : | Type of dimension to add
`split_count` : | Split bit count

### ipatch_gig_region_remove_dimension ()

    void                ipatch_gig_region_remove_dimension  (IpatchGigRegion *region,
                                                             int dim_index,
                                                             int split_index);

Removes a dimension from a GigaSampler region, including all related sub regions (except those that correspond to the `split_index`), and re-organizes sub regions for new dimension map.

`region` : | GigaSampler region
`dim_index` : | Index of an existing dimension to remove (0-4)
`split_index` : | Split index to use in the dimension to remove

## Property Details

### The `"channel"` property

      "channel"                  gint                  : Read / Write

DLS audio channel identifier.

Allowed values: [0,262143]

Default value: 0

### The `"key-group"` property

      "key-group"                gint                  : Read / Write

Percussion key group.

Allowed values: [0,15]

Default value: 0

### The `"layer-group"` property

      "layer-group"              gint                  : Read / Write

Layer group.

Allowed values: [0,65535]

Default value: 0

### The `"multi-channel"` property

      "multi-channel"            gboolean              : Read / Write

Multi channel.

Default value: FALSE

### The `"note-range"` property

      "note-range"               IpatchRange*          : Read / Write

MIDI note range.

### The `"phase-group"` property

      "phase-group"              gint                  : Read / Write

Phase locked sample group.

Allowed values: [0,65535]

Default value: 0

### The `"phase-master"` property

      "phase-master"             gboolean              : Read / Write

Multi channel phase lock master.

Default value: FALSE

### The `"self-non-exclusive"` property

      "self-non-exclusive"       gboolean              : Read / Write

Self non exclusive.

Default value: FALSE

### The `"velocity-range"` property

      "velocity-range"           IpatchRange*          : Read / Write

MIDI velocity range.

## See Also

#IpatchGigInst, IpatchGig