com.vwp.sound.mod.modplay.module
Class Instrument
java.lang.Object
com.vwp.sound.mod.modplay.module.Instrument
public class Instrument
- extends java.lang.Object
An instrument. Should be generic enough to support all module formats
Field Summary |
static int |
NO_NOTE
note number representing no spesific note
Playing this note has no effect. |
Constructor Summary |
Instrument(java.lang.String name,
int[] note2sample,
Sample[] samples,
AutoEffect[] autoEffects,
double panning)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_NOTE
public static final int NO_NOTE
- note number representing no spesific note
Playing this note has no effect. Any previously playing note should
continue playing
- See Also:
- Constant Field Values
Instrument
public Instrument(java.lang.String name,
int[] note2sample,
Sample[] samples,
AutoEffect[] autoEffects,
double panning)
- Parameters:
name
- the name of the instrumentnote2sample
- for each note it is possible to play
(excluding KEY_OFF and NO_NOTE) this table tells which sample should be
played. This can be null if this is an empty instrument without any samplessamples
- the samples that correspond to this instrumentautoEffects
- a collection of effects that works on this
instrument each time it is played (panning and volume envelopes,
fadeout etc.) Can be nullpanning
- panning for this instrument (ignored by the mixer if
Module.panningType != Module.INSTRUMENT_PANNING) (0.0 - 1.0)
getInfo
public java.lang.String getInfo()
- Returns:
- human readable info about this instrument
getName
public java.lang.String getName()
- Returns:
- the name of this instrument
getSampleByNum
public Sample getSampleByNum(int num)
- Returns:
- the num'th sample of this intrument
getSampleByNote
public Sample getSampleByNote(int note)
- Returns:
- the sample corresponding to the given note
getNumberOfSamples
public int getNumberOfSamples()
- Returns:
- the number of samples in this instrument
getNumberOfAutoEffects
public int getNumberOfAutoEffects()
- Returns:
- the number of instrument effects assosiated with this instrument
getAutoEffect
public AutoEffect getAutoEffect(int num)
- Returns:
- the num'th instrument effect of this intrument
getAutoEffects
public AutoEffect[] getAutoEffects()
- Returns:
- all the instrument effects of this effects
getPanning
public double getPanning()
- Returns:
- this instruments panning