IpatchSF2File

IpatchSF2File — SoundFont file type

Synopsis




                    IpatchSF2Phdr;
                    IpatchSF2Ihdr;
                    IpatchSF2Shdr;
                    IpatchSF2Bag;
                    IpatchSF2File;
                    IpatchSF2FileClass;
IpatchSF2File*      ipatch_sf2_file_new                 (void);
void                ipatch_sf2_file_set_sample_pos      (IpatchSF2File *file,
                                                         guint sample_pos);
guint               ipatch_sf2_file_get_sample_pos      (IpatchSF2File *file);
void                ipatch_sf2_file_set_sample_size     (IpatchSF2File *file,
                                                         guint sample_size);
guint               ipatch_sf2_file_get_sample_size     (IpatchSF2File *file);

Object Hierarchy


  GObject
   +----IpatchItem
         +----IpatchFile
               +----IpatchSF2File

Properties


  "sample-pos"               guint                 : Read / Write
  "sample-size"              guint                 : Read / Write

Description

This type defines a SoundFont IpatchFile type.

Details

IpatchSF2Phdr

typedef struct {
  guint8 name[20];		/* preset name */
  guint16 program;		/* MIDI program number */
  guint16 bank;			/* MIDI bank number */
  guint16 bag_index;	      /* index into preset bag (#IPFileBag) */
  guint32 library;		/* Not used (preserved) */
  guint32 genre;		/* Not used (preserved) */
  guint32 morphology;		/* Not used (preserved) */
} IpatchSF2Phdr;


IpatchSF2Ihdr

typedef struct {
  char name[20];		/* name of instrument */
  guint16 bag_index;		/* instrument bag index (#IPFileBag) */
} IpatchSF2Ihdr;


IpatchSF2Shdr

typedef struct {
  char name[20];		/* sample name */
  guint32 start;		/* offset to start of sample */
  guint32 end;			/* offset to end of sample */
  guint32 loop_start;		/* offset to start of loop */
  guint32 loop_end;		/* offset to end of loop */
  guint32 rate;			/* sample rate recorded at */
  guint8 root_note;		/* root midi key number */
  gint8 fine_tune;		/* pitch correction in cents */
  guint16 link_index;	  /* linked sample index for stereo samples */
  guint16 type;	       /* type of sample (see IpatchSF2SampleFlags) */
} IpatchSF2Shdr;


IpatchSF2Bag

typedef struct {
  guint16 mod_index;		/* index into modulator list */
  guint16 gen_index;		/* index into generator list */
} IpatchSF2Bag;


IpatchSF2File

typedef struct _IpatchSF2File IpatchSF2File;


IpatchSF2FileClass

typedef struct {
  IpatchFileClass parent_class;
} IpatchSF2FileClass;


ipatch_sf2_file_new ()

IpatchSF2File*      ipatch_sf2_file_new                 (void);

Create a new SoundFont file object.

Returns : New SoundFont file object (derived from IpatchFile) with a reference count of 1. Caller owns the reference and removing it will destroy the item.

ipatch_sf2_file_set_sample_pos ()

void                ipatch_sf2_file_set_sample_pos      (IpatchSF2File *file,
                                                         guint sample_pos);

Sets the position of the sample data chunk in a SoundFont file object.

file : SoundFont file object to set position of sample chunk
sample_pos : Position in the SoundFont file of the first sample of the sample data chunk, in bytes

ipatch_sf2_file_get_sample_pos ()

guint               ipatch_sf2_file_get_sample_pos      (IpatchSF2File *file);

Gets the position of the sample data chunk in a SoundFont file object.

file : SoundFont file object to get position of sample chunk from
Returns : Position in the SoundFont file of the first sample of the sample data chunk, in bytes

ipatch_sf2_file_set_sample_size ()

void                ipatch_sf2_file_set_sample_size     (IpatchSF2File *file,
                                                         guint sample_size);

Sets the size of the sample data chunk in a SoundFont file object.

file : SoundFont file object to set the size of the sample chunk
sample_size : Size of the sample data chunk, in samples

ipatch_sf2_file_get_sample_size ()

guint               ipatch_sf2_file_get_sample_size     (IpatchSF2File *file);

Gets the size of the sample data chunk in a SoundFont file object.

file : SoundFont file object to get the size of the sample chunk from
Returns : Size of the sample data chunk, in samples

Property Details

The "sample-pos" property

  "sample-pos"               guint                 : Read / Write

Position in file of SoundFont sample data chunk.

Default value: 0


The "sample-size" property

  "sample-size"              guint                 : Read / Write

Size of SoundFont sample data chunk in file.

Default value: 0

See Also

IpatchSF2