0N/A/*
2362N/A * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.sound.midi;
0N/A
0N/Aimport java.net.URL;
0N/A
0N/A
0N/A/**
0N/A * A <code>Soundbank</code> contains a set of <code>Instruments</code>
0N/A * that can be loaded into a <code>Synthesizer</code>.
0N/A * Note that a Java Sound <code>Soundbank</code> is different from a MIDI bank.
0N/A * MIDI permits up to 16383 banks, each containing up to 128 instruments
0N/A * (also sometimes called programs, patches, or timbres).
0N/A * However, a <code>Soundbank</code> can contain 16383 times 128 instruments,
0N/A * because the instruments within a <code>Soundbank</code> are indexed by both
0N/A * a MIDI program number and a MIDI bank number (via a <code>Patch</code>
0N/A * object). Thus, a <code>Soundbank</code> can be thought of as a collection
0N/A * of MIDI banks.
0N/A * <p>
0N/A * <code>Soundbank</code> includes methods that return <code>String</code>
0N/A * objects containing the sound bank's name, manufacturer, version number, and
0N/A * description. The precise content and format of these strings is left
0N/A * to the implementor.
0N/A * <p>
0N/A * Different synthesizers use a variety of synthesis techniques. A common
0N/A * one is wavetable synthesis, in which a segment of recorded sound is
0N/A * played back, often with looping and pitch change. The Downloadable Sound
0N/A * (DLS) format uses segments of recorded sound, as does the Headspace Engine.
0N/A * <code>Soundbanks</code> and <code>Instruments</code> that are based on
0N/A * wavetable synthesis (or other uses of stored sound recordings) should
0N/A * typically implement the <code>getResources()</code>
0N/A * method to provide access to these recorded segments. This is optional,
0N/A * however; the method can return an zero-length array if the synthesis technique
0N/A * doesn't use sampled sound (FM synthesis and physical modeling are examples
0N/A * of such techniques), or if it does but the implementor chooses not to make the
0N/A * samples accessible.
0N/A *
0N/A * @see Synthesizer#getDefaultSoundbank
0N/A * @see Synthesizer#isSoundbankSupported
0N/A * @see Synthesizer#loadInstruments(Soundbank, Patch[])
0N/A * @see Patch
0N/A * @see Instrument
0N/A * @see SoundbankResource
0N/A *
0N/A * @author David Rivas
0N/A * @author Kara Kytle
0N/A */
0N/A
0N/Apublic interface Soundbank {
0N/A
0N/A
0N/A /**
0N/A * Obtains the name of the sound bank.
0N/A * @return a <code>String</code> naming the sound bank
0N/A */
0N/A public String getName();
0N/A
0N/A /**
0N/A * Obtains the version string for the sound bank.
0N/A * @return a <code>String</code> that indicates the sound bank's version
0N/A */
0N/A public String getVersion();
0N/A
0N/A /**
0N/A * Obtains a <code>string</code> naming the company that provides the
0N/A * sound bank
0N/A * @return the vendor string
0N/A */
0N/A public String getVendor();
0N/A
0N/A /**
0N/A * Obtains a textual description of the sound bank, suitable for display.
0N/A * @return a <code>String</code> that describes the sound bank
0N/A */
0N/A public String getDescription();
0N/A
0N/A
0N/A /**
0N/A * Extracts a list of non-Instrument resources contained in the sound bank.
0N/A * @return an array of resources, exclusing instruments. If the sound bank contains
0N/A * no resources (other than instruments), returns an array of length 0.
0N/A */
0N/A public SoundbankResource[] getResources();
0N/A
0N/A
0N/A /**
0N/A * Obtains a list of instruments contained in this sound bank.
0N/A * @return an array of the <code>Instruments</code> in this
0N/A * <code>SoundBank</code>
0N/A * If the sound bank contains no instruments, returns an array of length 0.
0N/A *
0N/A * @see Synthesizer#getLoadedInstruments
0N/A * @see #getInstrument(Patch)
0N/A */
0N/A public Instrument[] getInstruments();
0N/A
0N/A /**
0N/A * Obtains an <code>Instrument</code> from the given <code>Patch</code>.
0N/A * @param patch a <code>Patch</code> object specifying the bank index
0N/A * and program change number
0N/A * @return the requested instrument, or <code>null</code> if the
0N/A * sound bank doesn't contain that instrument
0N/A *
0N/A * @see #getInstruments
0N/A * @see Synthesizer#loadInstruments(Soundbank, Patch[])
0N/A */
0N/A public Instrument getInstrument(Patch patch);
0N/A
0N/A
0N/A}