IpatchSF2Writer

IpatchSF2Writer — SoundFont writer object

Stability Level

Stable, unless otherwise indicated

Functions

Properties

gboolean migrate-samples Read / Write

Object Hierarchy

    GObject
    ╰── IpatchRiff
        ╰── IpatchSF2Writer

Description

Object for writing a tree of SoundFont objects (IpatchSF2) to a SoundFont file.

Functions

ipatch_sf2_writer_new ()

IpatchSF2Writer *
ipatch_sf2_writer_new (IpatchFileHandle *handle,
                       IpatchSF2 *sfont);

Create a new SoundFont 2 file writer.

Parameters

handle

SoundFont file handle to save to or NULL to set later

 

sfont

SoundFont object to save or NULL to set later

 

Returns

The new SoundFont writer


ipatch_sf2_writer_set_patch ()

void
ipatch_sf2_writer_set_patch (IpatchSF2Writer *writer,
                             IpatchSF2 *sfont);

Set the SoundFont patch object to save with a SoundFont writer.

Parameters

writer

SoundFont writer object

 

sfont

SoundFont patch to save

 

ipatch_sf2_writer_set_file_handle ()

void
ipatch_sf2_writer_set_file_handle (IpatchSF2Writer *writer,
                                   IpatchFileHandle *handle);

ipatch_sf2_writer_save ()

gboolean
ipatch_sf2_writer_save (IpatchSF2Writer *writer,
                        GError **err);

Write a SoundFont object to a file.

Parameters

writer

SoundFont writer object

 

err

Location to store error info or NULL

 

Returns

TRUE on success, FALSE on error


ipatch_sf2_writer_create_stores ()

IpatchList *
ipatch_sf2_writer_create_stores (IpatchSF2Writer *writer);

Create sample stores and add them to applicable IpatchSampleData objects and return object list. This function can be called multiple times, additional calls will return the same list.

Parameters

writer

SoundFont writer object

 

Returns

List of sample stores which the caller owns a reference to or NULL.

[transfer full]

Since: 1.1.0


ipatch_sf2_write_phdr ()

void
ipatch_sf2_write_phdr (IpatchFileHandle *handle,
                       const IpatchSF2Phdr *phdr);

Buffer writes a preset header into handle from a phdr structure.

[skip]

Parameters

handle

File handle to buffer writes to, commit after calling this function

 

phdr

Preset header structure to store

 

ipatch_sf2_write_ihdr ()

void
ipatch_sf2_write_ihdr (IpatchFileHandle *handle,
                       const IpatchSF2Ihdr *ihdr);

Writes an instrument header into handle from a ihdr structure.

[skip]

Parameters

handle

File handle to buffer writes to, commit after calling this function

 

ihdr

Instrument header structure to store

 

ipatch_sf2_write_shdr ()

void
ipatch_sf2_write_shdr (IpatchFileHandle *handle,
                       const IpatchSF2Shdr *shdr);

Writes a sample header into handle from a shdr structure.

[skip]

Parameters

handle

File handle to buffer writes to, commit after calling this function

 

shdr

Sample header structure to store

 

ipatch_sf2_write_bag ()

void
ipatch_sf2_write_bag (IpatchFileHandle *handle,
                      const IpatchSF2Bag *bag);

Writes a preset or instrument bag into handle from a bag structure.

[skip]

Parameters

handle

File handle to buffer writes to, commit after calling this function

 

bag

Bag structure to store

 

ipatch_sf2_write_mod ()

void
ipatch_sf2_write_mod (IpatchFileHandle *handle,
                      const IpatchSF2Mod *mod);

Writes a modulator into handle from a mod structure.

[skip]

Parameters

handle

File handle to buffer writes to, commit after calling this function

 

mod

Modulator structure to store

 

ipatch_sf2_write_gen ()

void
ipatch_sf2_write_gen (IpatchFileHandle *handle,
                      int genid,
                      const IpatchSF2GenAmount *amount);

Writes a generator into handle from a genid and amount structure.

[skip]

Parameters

handle

File handle to buffer writes to, commit after calling this function

 

genid

ID of generator to store

 

amount

Generator amount to store

 

Property Details

The “migrate-samples” property

  “migrate-samples”          gboolean

Was supposed to migrate sample data to the new file, was not implemented properly though. Does nothing now.

IpatchSF2Writer:migrate-samples has been deprecated since version 1.1.0 and should not be used in newly-written code.

Use ipatch_sf2_writer_create_stores() instead.

Owner: IpatchSF2Writer

Flags: Read / Write

Default value: FALSE