libinstpatch Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
IpatchSF2Sample; enum IpatchSF2SampleChannel; #define IPATCH_SF2_SAMPLE_RATE_MIN #define IPATCH_SF2_SAMPLE_RATE_MAX #define IPATCH_SF2_SAMPLE_LENGTH_MIN #define IPATCH_SF2_SAMPLE_FLAG_ROM #define IPATCH_SAMPLE_UNUSED_FLAG_SHIFT IpatchSF2Sample * ipatch_sf2_sample_new (void
); IpatchSF2Sample * ipatch_sf2_sample_first (IpatchIter *iter
); IpatchSF2Sample * ipatch_sf2_sample_next (IpatchIter *iter
); void ipatch_sf2_sample_set_name (IpatchSF2Sample *sample
,const char *name
); char * ipatch_sf2_sample_get_name (IpatchSF2Sample *sample
); void ipatch_sf2_sample_set_data (IpatchSF2Sample *sample
,IpatchSampleData *sampledata
); IpatchSampleData * ipatch_sf2_sample_get_data (IpatchSF2Sample *sample
); IpatchSampleData * ipatch_sf2_sample_peek_data (IpatchSF2Sample *sample
); void ipatch_sf2_sample_set_linked (IpatchSF2Sample *sample
,IpatchSF2Sample *linked
); IpatchSF2Sample * ipatch_sf2_sample_get_linked (IpatchSF2Sample *sample
); IpatchSF2Sample * ipatch_sf2_sample_peek_linked (IpatchSF2Sample *sample
); void ipatch_sf2_sample_set_blank (IpatchSF2Sample *sample
);
"channel" IpatchSF2SampleChannel : Read / Write "fine-tune" gint : Read / Write "linked-sample" IpatchSF2Sample* : Read / Write "loop-end" guint : Read / Write "loop-start" guint : Read / Write "name" gchar* : Read / Write "rom" gboolean : Read / Write "root-note" gint : Read / Write "sample-data" IpatchSampleData* : Read / Write "sample-rate" gint : Read / Write
SoundFont samples are children of IpatchSF2 objects and are referenced by IpatchSF2IZone objects. They define the audio which is synthesized.
typedef enum { IPATCH_SF2_SAMPLE_CHANNEL_MONO, IPATCH_SF2_SAMPLE_CHANNEL_LEFT, IPATCH_SF2_SAMPLE_CHANNEL_RIGHT } IpatchSF2SampleChannel;
Sample channel orientation.
#define IPATCH_SF2_SAMPLE_RATE_MIN 400 /* min sample rate (by standard) */
#define IPATCH_SF2_SAMPLE_RATE_MAX 50000 /* max rate (by the standard) */
#define IPATCH_SF2_SAMPLE_LENGTH_MIN 32 /* min length (by the standard) */
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). |
IpatchSF2Sample * ipatch_sf2_sample_first (IpatchIter *iter
);
Gets the first item in a sample iterator. A convenience wrapper for
ipatch_iter_first()
.
|
Patch item iterator containing IpatchSF2Sample items |
Returns : |
The first sample in iter or NULL if empty.
|
IpatchSF2Sample * ipatch_sf2_sample_next (IpatchIter *iter
);
Gets the next item in a sample iterator. A convenience wrapper for
ipatch_iter_next()
.
|
Patch item iterator containing IpatchSF2Sample items |
Returns : |
The next sample in iter or NULL if at the end of the list.
|
void ipatch_sf2_sample_set_name (IpatchSF2Sample *sample
,const char *name
);
Sets the name of a SoundFont sample.
|
Sample to set name of |
|
Value to set name to |
char * ipatch_sf2_sample_get_name (IpatchSF2Sample *sample
);
Gets the name of a SoundFont sample.
|
Sample to get name of |
Returns : |
Name of sample or NULL if not set. String value should be freed
when finished with it.
|
void ipatch_sf2_sample_set_data (IpatchSF2Sample *sample
,IpatchSampleData *sampledata
);
Set a sample's sample data object.
|
Sample to set sample data of |
|
Sample data to set sample to |
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.
|
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.
|
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.
|
Sample to get sample data from |
Returns : |
Sample data object of sample or NULL if none. Remember that a
reference is NOT added.
|
void ipatch_sf2_sample_set_linked (IpatchSF2Sample *sample
,IpatchSF2Sample *linked
);
Sets the stereo linked sample of a sample item.
|
Sample to set linked sample of |
|
Sample that is stereo linked to sample or NULL to unset.
|
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.
|
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.
|
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.
|
Sample to get linked sample from |
Returns : |
Linked sample object of sample or NULL if none. Remember that a
reference is NOT added.
|
void ipatch_sf2_sample_set_blank (IpatchSF2Sample *sample
);
Set the sample data of a sample item to blank data.
|
Sample to set to blank sample data |
"channel"
property"channel" IpatchSF2SampleChannel : Read / Write
Channel orientation.
Default value: IPATCH_SF2_SAMPLE_CHANNEL_MONO
"fine-tune"
property"fine-tune" gint : Read / Write
Fine tuning in cents.
Allowed values: [-99,99]
Default value: 0
"linked-sample"
property"linked-sample" IpatchSF2Sample* : Read / Write
Stereo linked sample object.
"loop-end"
property"loop-end" guint : Read / Write
Loop end in frames (after loop).
Default value: 0
"loop-start"
property"loop-start" guint : Read / Write
Start of loop in frames.
Default value: 0
"root-note"
property"root-note" gint : Read / Write
Root MIDI note.
Allowed values: [0,127]
Default value: 60
"sample-rate"
property"sample-rate" gint : Read / Write
Sampling rate in Hertz.
Allowed values: [8000,192000]
Default value: 44100