public class

SF2Soundbank

extends Object
implements Soundbank
java.lang.Object
   ↳ com.sun.media.sound.SF2Soundbank

Class Overview

A SoundFont 2.04 soundbank reader. Based on SoundFont 2.04 specification from:

http://developer.creative.com
http://www.soundfont.com/ ;

Summary

Fields
protected String comments
protected String copyright
protected String creationDate
protected String engineers
protected int major
protected int minor
protected String name
protected String product
protected String romName
protected int romVersionMajor
protected int romVersionMinor
protected String targetEngine
protected String tools
Public Constructors
SF2Soundbank()
SF2Soundbank(URL url)
SF2Soundbank(File file)
SF2Soundbank(InputStream inputstream)
Public Methods
void addInstrument(SF2Instrument resource)
void addResource(SoundbankResource resource)
String getCreationDate()
String getDescription()
Obtains a textual description of the sound bank, suitable for display.
Instrument getInstrument(Patch patch)
Obtains an Instrument from the given Patch.
SF2Instrument[] getInstruments()
Obtains a list of instruments contained in this sound bank.
SF2Layer[] getLayers()
String getName()
Obtains the name of the sound bank.
String getProduct()
SoundbankResource[] getResources()
Extracts a list of non-Instrument resources contained in the sound bank.
String getRomName()
int getRomVersionMajor()
int getRomVersionMinor()
SF2Sample[] getSamples()
String getTargetEngine()
String getTools()
String getVendor()
Obtains a string naming the company that provides the sound bank
String getVersion()
Obtains the version string for the sound bank.
void removeInstrument(SF2Instrument resource)
void removeResource(SoundbankResource resource)
void save(String name)
void save(OutputStream out)
void save(File file)
void setCreationDate(String creationDate)
void setDescription(String s)
void setName(String s)
void setProduct(String product)
void setRomName(String romName)
void setRomVersionMajor(int romVersionMajor)
void setRomVersionMinor(int romVersionMinor)
void setTargetEngine(String targetEngine)
void setTools(String tools)
void setVendor(String s)
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.sound.midi.Soundbank

Fields

protected String comments

protected String copyright

protected String creationDate

protected String engineers

protected int major

protected int minor

protected String name

protected String product

protected String romName

protected int romVersionMajor

protected int romVersionMinor

protected String targetEngine

protected String tools

Public Constructors

public SF2Soundbank ()

public SF2Soundbank (URL url)

Throws
IOException

public SF2Soundbank (File file)

Throws
IOException

public SF2Soundbank (InputStream inputstream)

Throws
IOException

Public Methods

public void addInstrument (SF2Instrument resource)

public void addResource (SoundbankResource resource)

public String getCreationDate ()

public String getDescription ()

Obtains a textual description of the sound bank, suitable for display.

Returns
  • a String that describes the sound bank

public Instrument getInstrument (Patch patch)

Obtains an Instrument from the given Patch.

Parameters
patch a Patch object specifying the bank index and program change number
Returns
  • the requested instrument, or null if the sound bank doesn't contain that instrument

public SF2Instrument[] getInstruments ()

Obtains a list of instruments contained in this sound bank.

Returns
  • an array of the Instruments in this SoundBank If the sound bank contains no instruments, returns an array of length 0.

public SF2Layer[] getLayers ()

public String getName ()

Obtains the name of the sound bank.

Returns
  • a String naming the sound bank

public String getProduct ()

public SoundbankResource[] getResources ()

Extracts a list of non-Instrument resources contained in the sound bank.

Returns
  • an array of resources, exclusing instruments. If the sound bank contains no resources (other than instruments), returns an array of length 0.

public String getRomName ()

public int getRomVersionMajor ()

public int getRomVersionMinor ()

public SF2Sample[] getSamples ()

public String getTargetEngine ()

public String getTools ()

public String getVendor ()

Obtains a string naming the company that provides the sound bank

Returns
  • the vendor string

public String getVersion ()

Obtains the version string for the sound bank.

Returns
  • a String that indicates the sound bank's version

public void removeInstrument (SF2Instrument resource)

public void removeResource (SoundbankResource resource)

public void save (String name)

Throws
IOException

public void save (OutputStream out)

Throws
IOException

public void save (File file)

Throws
IOException

public void setCreationDate (String creationDate)

public void setDescription (String s)

public void setName (String s)

public void setProduct (String product)

public void setRomName (String romName)

public void setRomVersionMajor (int romVersionMajor)

public void setRomVersionMinor (int romVersionMinor)

public void setTargetEngine (String targetEngine)

public void setTools (String tools)

public void setVendor (String s)