IpatchSF2Sample

IpatchSF2Sample — SoundFont audio sample

Stability Level

Stable, unless otherwise indicated

Functions

Properties

IpatchSF2SampleChannel channel Read / Write
int fine-tune Read / Write
IpatchSF2Sample * linked-sample Read / Write
guint loop-end Read / Write
guint loop-start Read / Write
char * name Read / Write
gboolean rom Read / Write
int root-note Read / Write
IpatchSampleData * sample-data Read / Write
int sample-rate Read / Write

Types and Values

Object Hierarchy

    GEnum
    ╰── IpatchSF2SampleChannel
    GObject
    ╰── IpatchItem
        ╰── IpatchSF2Sample

Description

SoundFont samples are children of IpatchSF2 objects and are referenced by IpatchSF2IZone objects. They define the audio which is synthesized.

Functions

ipatch_sf2_sample_new ()

IpatchSF2Sample *
ipatch_sf2_sample_new (void);

Create a new SoundFont sample object.

Returns

New SoundFont sample with a reference count of 1. Caller owns the reference and removing it will destroy the item, unless another reference is added (if its parented for example).


ipatch_sf2_sample_first ()

IpatchSF2Sample *
ipatch_sf2_sample_first (IpatchIter *iter);

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

[skip]

Parameters

iter

Patch item iterator containing IpatchSF2Sample items

 

Returns

The first sample in iter or NULL if empty.


ipatch_sf2_sample_next ()

IpatchSF2Sample *
ipatch_sf2_sample_next (IpatchIter *iter);

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

[skip]

Parameters

iter

Patch item iterator containing IpatchSF2Sample items

 

Returns

The next sample in iter or NULL if at the end of the list.


ipatch_sf2_sample_set_name ()

void
ipatch_sf2_sample_set_name (IpatchSF2Sample *sample,
                            const char *name);

Sets the name of a SoundFont sample.

Parameters

sample

Sample to set name of

 

name

Value to set name to.

[nullable]

ipatch_sf2_sample_get_name ()

char *
ipatch_sf2_sample_get_name (IpatchSF2Sample *sample);

Gets the name of a SoundFont sample.

Parameters

sample

Sample to get name of

 

Returns

Name of sample or NULL if not set. String value should be freed when finished with it.

[nullable][transfer full]


ipatch_sf2_sample_set_data ()

void
ipatch_sf2_sample_set_data (IpatchSF2Sample *sample,
                            IpatchSampleData *sampledata);

Set a sample's sample data object.

Parameters

sample

Sample to set sample data of

 

sampledata

Sample data to set sample to.

[nullable]

ipatch_sf2_sample_get_data ()

IpatchSampleData *
ipatch_sf2_sample_get_data (IpatchSF2Sample *sample);

Get the IpatchSampleData item of a sample. Sample data item is referenced before returning and caller is responsible for unreferencing it with g_object_unref() when finished with it.

Parameters

sample

Sample to get sample data from

 

Returns

Sample data object of sample or NULL if none. Remember to unreference with g_object_unref() when finished with it.

[transfer full]


ipatch_sf2_sample_peek_data ()

IpatchSampleData *
ipatch_sf2_sample_peek_data (IpatchSF2Sample *sample);

Get the IpatchSampleData item of a sample. Like ipatch_sf2_sample_get_data() but sample data object is not referenced. This function should only be used if a reference of the sample data object is ensured or only the pointer value is of importance.

[skip]

Parameters

sample

Sample to get sample data from

 

Returns

Sample data object of sample or NULL if none. Remember that a reference is NOT added.

[transfer none]


ipatch_sf2_sample_set_linked ()

void
ipatch_sf2_sample_set_linked (IpatchSF2Sample *sample,
                              IpatchSF2Sample *linked);

Sets the stereo linked sample of a sample item.

Parameters

sample

Sample to set linked sample of

 

linked

Sample that is stereo linked to sample or NULL to unset.

[nullable]

ipatch_sf2_sample_get_linked ()

IpatchSF2Sample *
ipatch_sf2_sample_get_linked (IpatchSF2Sample *sample);

Get the stereo linked sample from sample . If a sample is returned the caller owns a reference and should unref it with g_object_unref() when finished with it.

Parameters

sample

Sample to get linked sample from

 

Returns

The linked stereo sample or NULL if no linked sample. Remember to unref the returned sample with g_object_unref() when finished with it.

[transfer full]


ipatch_sf2_sample_peek_linked ()

IpatchSF2Sample *
ipatch_sf2_sample_peek_linked (IpatchSF2Sample *sample);

Get the stereo linked sample from sample . Like ipatch_sf2_sample_get_linked() but sample object is not referenced. This function should only be used if a reference of the sample object is ensured or only the pointer value is of importance.

[skip]

Parameters

sample

Sample to get linked sample from

 

Returns

Linked sample object of sample or NULL if none. Remember that a reference is NOT added.

[transfer none]


ipatch_sf2_sample_set_blank ()

void
ipatch_sf2_sample_set_blank (IpatchSF2Sample *sample);

Set the sample data of a sample item to blank data.

Parameters

sample

Sample to set to blank sample data

 

Types and Values

enum IpatchSF2SampleChannel

Sample channel orientation.

Members

IPATCH_SF2_SAMPLE_CHANNEL_MONO

Mono sample

 

IPATCH_SF2_SAMPLE_CHANNEL_LEFT

Left channel of a stereo pair (“linked-sample” will be set to the right channel)

 

IPATCH_SF2_SAMPLE_CHANNEL_RIGHT

Right channel of a stereo pair (“linked-sample” will be set to the left channel)

 

IPATCH_SF2_SAMPLE_RATE_MIN

#define IPATCH_SF2_SAMPLE_RATE_MIN 400 /* min sample rate (by standard) */

IPATCH_SF2_SAMPLE_RATE_MAX

#define IPATCH_SF2_SAMPLE_RATE_MAX 50000 /* max rate (by the standard) */

IPATCH_SF2_SAMPLE_LENGTH_MIN

#define IPATCH_SF2_SAMPLE_LENGTH_MIN 32 /* min length (by the standard) */

enum IpatchSF2SampleFlags

Members

IPATCH_SF2_SAMPLE_FLAG_ROM

IpatchItem flag for indicating ROM sample

 

IPATCH_SF2_SAMPLE_UNUSED_FLAG_SHIFT

#define             IPATCH_SF2_SAMPLE_UNUSED_FLAG_SHIFT

Property Details

The “channel” property

  “channel”                  IpatchSF2SampleChannel

Channel orientation.

Owner: IpatchSF2Sample

Flags: Read / Write

Default value: IPATCH_SF2_SAMPLE_CHANNEL_MONO


The “fine-tune” property

  “fine-tune”                int

Fine tuning in cents.

Owner: IpatchSF2Sample

Flags: Read / Write

Allowed values: [-99,99]

Default value: 0


The “linked-sample” property

  “linked-sample”            IpatchSF2Sample *

Stereo linked sample object.

Owner: IpatchSF2Sample

Flags: Read / Write


The “loop-end” property

  “loop-end”                 guint

Loop end in frames (after loop).

Owner: IpatchSF2Sample

Flags: Read / Write

Default value: 0


The “loop-start” property

  “loop-start”               guint

Start of loop in frames.

Owner: IpatchSF2Sample

Flags: Read / Write

Default value: 0


The “name” property

  “name”                     char *

Name.

Owner: IpatchSF2Sample

Flags: Read / Write

Default value: NULL


The “rom” property

  “rom”                      gboolean

ROM sample flag.

Owner: IpatchSF2Sample

Flags: Read / Write

Default value: FALSE


The “root-note” property

  “root-note”                int

Root MIDI note.

Owner: IpatchSF2Sample

Flags: Read / Write

Allowed values: [0,127]

Default value: 60


The “sample-data” property

  “sample-data”              IpatchSampleData *

Sample data.

Owner: IpatchSF2Sample

Flags: Read / Write


The “sample-rate” property

  “sample-rate”              int

Sampling rate in Hertz.

Owner: IpatchSF2Sample

Flags: Read / Write

Allowed values: [100,192000]

Default value: 44100

See Also

IpatchSF2, IpatchSF2IZone