/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A abstract class used to simplify creating custom ModelOscillator.
*
* @author Karl Helgason
*/
public abstract class ModelAbstractOscillator
protected float samplerate;
protected int noteNumber;
protected int velocity;
protected boolean on = false;
public void init() {
}
}
on = false;
}
int velocity) {
this.noteNumber = noteNumber;
on = true;
}
return -1;
}
return channel;
}
return voice;
}
public int getNoteNumber() {
return noteNumber;
}
public int getVelocity() {
return velocity;
}
public boolean isOn() {
return on;
}
}
public float getPitch() {
return pitch;
}
this.samplerate = samplerate;
}
public float getSampleRate() {
return samplerate;
}
public float getAttenuation() {
return 0;
}
public int getChannels() {
return 1;
}
}
}
try {
} catch (InstantiationException e) {
throw new IllegalArgumentException(e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException(e);
}
return oscs;
}
// Create performer for my custom oscillirator
return performer;
}
// Create Instrument object around my performer
return ins;
}
// Create Soundbank object around the instrument
return sbk;
}
return getName();
}
return null;
return null;
if (((ModelPatch)p).isPercussion()
return null;
}
}
return ins;
}
return new Instrument[]{getInstrument()};
}
return new SoundbankResource[0];
}
return null;
}
return null;
}
}