![]() |
![]() |
![]() |
libInstPatch Reference Manual | ![]() |
---|---|---|---|---|
IpatchDLS2Inst; IpatchDLS2InstClass; #define IPATCH_DLS2_INST_BANK_MASK IpatchDLS2Inst* ipatch_dls2_inst_new (void); #define ipatch_dls2_inst_get_regions (inst) IpatchDLS2Inst* ipatch_dls2_inst_first (IpatchIter *iter); IpatchDLS2Inst* ipatch_dls2_inst_next (IpatchIter *iter); char* ipatch_dls2_inst_get_info (IpatchDLS2Inst *inst, guint32 fourcc); void ipatch_dls2_inst_set_info (IpatchDLS2Inst *inst, guint32 fourcc, const char *val); void ipatch_dls2_inst_set_midi_locale (IpatchDLS2Inst *inst, int bank, int program); void ipatch_dls2_inst_get_midi_locale (IpatchDLS2Inst *inst, int *bank, int *program); int ipatch_dls2_inst_compare (const IpatchDLS2Inst *p1, const IpatchDLS2Inst *p2); GSList* ipatch_dls2_inst_get_conns (IpatchDLS2Inst *inst); void ipatch_dls2_inst_set_conn (IpatchDLS2Inst *inst, const IpatchDLS2Conn *conn); void ipatch_dls2_inst_unset_conn (IpatchDLS2Inst *inst, const IpatchDLS2Conn *conn); void ipatch_dls2_inst_unset_all_conns (IpatchDLS2Inst *inst); guint ipatch_dls2_inst_conn_count (IpatchDLS2Inst *inst);
"archive-location" gchararray : Read / Write "artist" gchararray : Read / Write "bank" gint : Read / Write "comment" gchararray : Read / Write "commissioned" gchararray : Read / Write "copyright" gchararray : Read / Write "date" gchararray : Read / Write "engineer" gchararray : Read / Write "genre" gchararray : Read / Write "keywords" gchararray : Read / Write "medium" gchararray : Read / Write "name" gchararray : Read / Write "percussion" gboolean : Read / Write "product" gchararray : Read / Write "program" gint : Read / Write "software" gchararray : Read / Write "source" gchararray : Read / Write "source-form" gchararray : Read / Write "subject" gchararray : Read / Write "technician" gchararray : Read / Write
This object defines a DLS instrument. This object is a container for IpatchDLS2Region objects and also manages the MIDI locale (bank:program numbers) of the instrument (equivalent to IpatchSF2Preset objects in SoundFont patches).
#define IPATCH_DLS2_INST_BANK_MASK 0x3FFF
Mask for the bank number of the bank field (IPATCH_DLS2_INST_BANK_PERCUSSION bit is also in this field).
IpatchDLS2Inst* ipatch_dls2_inst_new (void);
Create a new DLS instrument object.
Returns : | New DLS instrument 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). |
#define ipatch_dls2_inst_get_regions(inst)
Get a DLS instrument's regions.
inst : |
DLS instrument object |
Returns : | Iterator populated with the instrument's regions. |
IpatchDLS2Inst* ipatch_dls2_inst_first (IpatchIter *iter);
Gets the first item in an instrument iterator. A convenience wrapper for
ipatch_iter_first()
.
iter : |
Patch item iterator containing IpatchDLS2Inst items |
Returns : | The first instrument in iter or NULL if empty.
|
IpatchDLS2Inst* ipatch_dls2_inst_next (IpatchIter *iter);
Gets the next item in an instrument iterator. A convenience wrapper for
ipatch_iter_next()
.
iter : |
Patch item iterator containing IpatchDLS2Inst items |
Returns : | The next instrument in iter or NULL if at the end of the list.
|
char* ipatch_dls2_inst_get_info (IpatchDLS2Inst *inst, guint32 fourcc);
Get a DLS instrument info string by FOURCC integer ID (integer representation of a 4 character RIFF chunk ID, see IpatchRiffParser).
inst : |
DLS instrument to get info from |
fourcc : |
FOURCC integer id of INFO to get |
Returns : | New allocated info string value or NULL if no info with the
given fourcc ID. String should be freed when finished with it.
|
void ipatch_dls2_inst_set_info (IpatchDLS2Inst *inst, guint32 fourcc, const char *val);
Sets an INFO value in a DLS instrument object. Emits changed signal.
inst : |
DLS instrument to set info of |
fourcc : |
FOURCC integer ID of INFO to set |
val : |
Value to set info to or NULL to unset (clear) info.
|
void ipatch_dls2_inst_set_midi_locale (IpatchDLS2Inst *inst, int bank, int program);
Sets the MIDI locale of a DLS instrument (bank and program numbers).
inst : |
DLS instrument to set MIDI locale of |
bank : |
MIDI bank number to assign to instrument |
program : |
MIDI program number to assign to instrument |
void ipatch_dls2_inst_get_midi_locale (IpatchDLS2Inst *inst, int *bank, int *program);
Gets the MIDI locale of a DLS instrument (bank and program numbers).
int ipatch_dls2_inst_compare (const IpatchDLS2Inst *p1, const IpatchDLS2Inst *p2);
Instrument comparison function for sorting. Compare two instruments by their MIDI bank:program numbers. Note that this function is compatible with GCompareFunc and can therefore be used with g_list_sort, etc.
FIXME: Also note that percussion instruments are sorted after regular ones.
p1 : |
First instrument in comparison |
p2 : |
Second instrument in comparison |
Returns : | Comparison result that is less than, equal to, or greater than zero
if p1 is found, respectively, to be less than, to match, or be greater
than p2 .
|
GSList* ipatch_dls2_inst_get_conns (IpatchDLS2Inst *inst);
Gets a list of connections from a DLS instrument. List should be freed with
ipatch_dls2_conn_list_free()
(free_conns set to TRUE
) when finished
with it.
inst : |
Instrument to get connections from |
Returns : | New list of connections (IpatchDLS2Conn) in inst or
NULL if no connections. Remember to free it when finished.
|
void ipatch_dls2_inst_set_conn (IpatchDLS2Inst *inst, const IpatchDLS2Conn *conn);
Set a global DLS connection in an instrument. See
ipatch_dls2_conn_list_set()
for more details.
inst : |
DLS instrument |
conn : |
Connection |
void ipatch_dls2_inst_unset_conn (IpatchDLS2Inst *inst, const IpatchDLS2Conn *conn);
Remove a global DLS connection from an instrument. See
ipatch_dls2_conn_list_unset()
for more details.
inst : |
DLS instrument |
conn : |
Connection |
void ipatch_dls2_inst_unset_all_conns (IpatchDLS2Inst *inst);
Remove all global connections in an instrument.
inst : |
DLS instrument |
guint ipatch_dls2_inst_conn_count (IpatchDLS2Inst *inst);
Count number of connections in a instrument
inst : |
Instrument to count connections in |
Returns : | Count of connections |
archive-location
" property"archive-location" gchararray : Read / Write
Location of archived material.
Default value: NULL
artist
" property"artist" gchararray : Read / Write
Artist of the original subject material.
Default value: NULL
bank
" property"bank" gint : Read / Write
MIDI bank number consisting of the MIDI locale bank and the IPATCH_DLS2_INST_BANK_PERCUSSION flag.
Allowed values: [0,16383]
Default value: 0
commissioned
" property"commissioned" gchararray : Read / Write
Person or organization who commissioned the material.
Default value: NULL
copyright
" property"copyright" gchararray : Read / Write
Copyright information.
Default value: NULL
date
" property"date" gchararray : Read / Write
Creation date in YYYY-MM-DD format.
Default value: NULL
engineer
" property"engineer" gchararray : Read / Write
Name of the engineer who worked on material (if multiple engineers separate with semicolon and a blank).
Default value: NULL
genre
" property"genre" gchararray : Read / Write
Describes the genre of the original work such as electro industrial, gothic, instrumental surf, psycho-billy, EBM, rock, etc.
Default value: NULL
keywords
" property"keywords" gchararray : Read / Write
Keywords that refere to the material. Multiple keywords separated by a semicolon and a blank (example: FX; barnyard; animal).
Default value: NULL
medium
" property"medium" gchararray : Read / Write
Describes the original medium of the material, such as, CD, MP3, etc.
Default value: NULL
name
" property"name" gchararray : Read / Write
Stores the title of the material.
Default value: "untitled"
percussion
" property"percussion" gboolean : Read / Write
Percussion instrument?.
Default value: FALSE
product
" property"product" gchararray : Read / Write
The name of the product the material is intended for.
Default value: NULL
program
" property"program" gint : Read / Write
MIDI locale program number.
Allowed values: [0,127]
Default value: 0
software
" property"software" gchararray : Read / Write
Identifies the software used to create the material.
Default value: NULL
source
" property"source" gchararray : Read / Write
Identifies the name of the person or organization who supplied the original material.
Default value: NULL
source-form
" property"source-form" gchararray : Read / Write
The original form of the material that was digitally sampled. Not necessarily the same as "medium".
Default value: NULL
subject
" property"subject" gchararray : Read / Write
Defines the subject of the material such as "Music to milk by".
Default value: NULL
technician
" property"technician" gchararray : Read / Write
The technician who sampled the material.
Default value: NULL