The Alternative Csound Reference Manual
Previous |  | Next

# sfpreset

sfpreset -- Assigns an existing preset of a SoundFont2 (SF2) sample file to an index number.

## Description

Assigns an existing preset of a previously loaded SoundFont2 (SF2) sample file to an index number. These opcodes allow management the sample-structure of SF2 files. In order to understand the usage of these opcodes, the user must have some knowledge of the SF2 format, so a brief description of this format can be found in the SoundFont2 File Format Appendix.

sfpreset should be placed in the header section of a Csound orchestra.

## Syntax

ir sfpreset iprog, ibank, ifilhandle, ipreindex

## Initialization

ir -- output to be used by other SF2 opcodes. For sfpreset, ir is ipreindex.

iprog -- program number of a bank of presets in a SF2 file

ibank -- number of a specific bank of a SF2 file

ifilhandle -- unique number generated by sfload opcode to be used as an identifier for a SF2 file. Several SF2 files can be loaded and activated at the same time.

ipreindex -- preset index

## Performance

sfpreset assigns an existing preset of a previously loaded SF2 file to an index number, to be used later with the opcodes sfplay and sfplaym. The user must previously know the program and the bank numbers of the preset in order to fill the corresponding arguments. Any number of sfpreset instances can be placed in the header section of an orchestra, each one assigning a different preset belonging to the same (or different) SF2 file to different index numbers.

These opcodes only support the sample structure of SF2 files. The modulator structure of the SoundFont2 format is not supported in Csound. Any modulation or processing to the sample data is left to the Csound user, bypassing all restrictions forced by the SF2 standard.

## See Also

sfilist, sfinstr, sfinstrm, sfload, sfpassign, sfplay, sfplaym, sfplist

## Credits

Author: Gabriel Maldonado
Italy
May 2000

New in Csound Version 4.07

Previous | Home | Next
sfplist | Up | shaker