com.vwp.sound.mod.modplay.module
Class Instrument

java.lang.Object
  extended by 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)
           
 
Method Summary
 AutoEffect getAutoEffect(int num)
           
 AutoEffect[] getAutoEffects()
           
 java.lang.String getInfo()
           
 java.lang.String getName()
           
 int getNumberOfAutoEffects()
           
 int getNumberOfSamples()
           
 double getPanning()
           
 Sample getSampleByNote(int note)
           
 Sample getSampleByNum(int num)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

Instrument

public Instrument(java.lang.String name,
                  int[] note2sample,
                  Sample[] samples,
                  AutoEffect[] autoEffects,
                  double panning)
Parameters:
name - the name of the instrument
note2sample - 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 samples
samples - the samples that correspond to this instrument
autoEffects - a collection of effects that works on this instrument each time it is played (panning and volume envelopes, fadeout etc.) Can be null
panning - panning for this instrument (ignored by the mixer if Module.panningType != Module.INSTRUMENT_PANNING) (0.0 - 1.0)
Method Detail

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