16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.sound.midi; 27 28 import javax.sound.sampled.AudioInputStream; 29 30 /** 31 * A {@code SoundbankResource} represents any audio resource stored in a 32 * {@link Soundbank}. Common soundbank resources include: 33 * <ul> 34 * <li>Instruments. An instrument may be specified in a variety of ways. 35 * However, all soundbanks have some mechanism for defining instruments. In 36 * doing so, they may reference other resources stored in the soundbank. Each 37 * instrument has a {@code Patch} which specifies the MIDI program and bank by 38 * which it may be referenced in MIDI messages. Instrument information may be 39 * stored in {@link Instrument} objects.</li> 40 * <li>Audio samples. A sample typically is a sampled audio waveform which 41 * contains a short sound recording whose duration is a fraction of a second, or 42 * at most a few seconds. These audio samples may be used by a 43 * {@link Synthesizer} to synthesize sound in response to MIDI commands, or 44 * extracted for use by an application. (The terminology reflects musicians' use 45 * of the word "sample" to refer collectively to a series of contiguous audio 46 * samples or frames, rather than to a single, instantaneous sample.) The data 47 * class for an audio sample will be an object that encapsulates the audio 48 * sample data itself and information about how to interpret it (the format of 49 * the audio data), such as an {@link AudioInputStream}.</li> 50 * <li>Embedded sequences. A sound bank may contain built-in song data stored in 51 * a data object such as a {@link Sequence}.</li> 52 * </ul> 53 * Synthesizers that use wavetable synthesis or related techniques play back the 54 * audio in a sample when synthesizing notes, often when emulating the 55 * real-world instrument that was originally recorded. However, there is not 56 * necessarily a one-to-one correspondence between the {@code Instruments} and 57 * samples in a {@code Soundbank}. A single {@code Instrument} can use multiple 58 * SoundbankResources (typically for notes of dissimilar pitch or brightness). 59 * Also, more than one {@code Instrument} can use the same sample. 60 * 61 * @author Kara Kytle 62 */ 63 public abstract class SoundbankResource { 64 65 /** 66 * The sound bank that contains the {@code SoundbankResources}. 67 */ 68 private final Soundbank soundBank; 69 70 /** 71 * The name of the {@code SoundbankResource}. | 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.sound.midi; 27 28 import javax.sound.sampled.AudioInputStream; 29 30 /** 31 * A {@code SoundbankResource} represents any audio resource stored in a 32 * {@link Soundbank}. Common soundbank resources include: 33 * <ul> 34 * <li>Instruments. An instrument may be specified in a variety of ways. 35 * However, all soundbanks have some mechanism for defining instruments. In 36 * doing so, they may reference other resources stored in the soundbank. 37 * Each instrument has a {@code Patch} which specifies the MIDI program and 38 * bank by which it may be referenced in MIDI messages. Instrument information 39 * may be stored in {@link Instrument} objects. 40 * <li>Audio samples. A sample typically is a sampled audio waveform which 41 * contains a short sound recording whose duration is a fraction of a 42 * second, or at most a few seconds. These audio samples may be used by a 43 * {@link Synthesizer} to synthesize sound in response to MIDI commands, or 44 * extracted for use by an application. (The terminology reflects musicians' 45 * use of the word "sample" to refer collectively to a series of contiguous 46 * audio samples or frames, rather than to a single, instantaneous sample.) 47 * The data class for an audio sample will be an object that encapsulates 48 * the audio sample data itself and information about how to interpret it 49 * (the format of the audio data), such as an {@link AudioInputStream}. 50 * <li>Embedded sequences. A sound bank may contain built-in song data stored 51 * in a data object such as a {@link Sequence}. 52 * </ul> 53 * Synthesizers that use wavetable synthesis or related techniques play back the 54 * audio in a sample when synthesizing notes, often when emulating the 55 * real-world instrument that was originally recorded. However, there is not 56 * necessarily a one-to-one correspondence between the {@code Instruments} and 57 * samples in a {@code Soundbank}. A single {@code Instrument} can use multiple 58 * SoundbankResources (typically for notes of dissimilar pitch or brightness). 59 * Also, more than one {@code Instrument} can use the same sample. 60 * 61 * @author Kara Kytle 62 */ 63 public abstract class SoundbankResource { 64 65 /** 66 * The sound bank that contains the {@code SoundbankResources}. 67 */ 68 private final Soundbank soundBank; 69 70 /** 71 * The name of the {@code SoundbankResource}. |