com.vwp.sound.mod.modplay.player.autoeffect
Class Fadeout

java.lang.Object
  extended by com.vwp.sound.mod.modplay.player.autoeffect.Fadeout
All Implemented Interfaces:
AutoEffect

public class Fadeout
extends java.lang.Object
implements AutoEffect

an effect controlling how an instrument gradually fades out when it is released (key off) This effect maintains a fadeout value and a counter. The volume is calculated by: new_vol = vol * (1 - fadeout * counter) The counter is increased each tick after the effect is activated.


Constructor Summary
Fadeout(double fadeout)
          cerates an fadeout effect with a given fadeout level
 
Method Summary
 void activate()
          The fadeout effect should only be active if the instrument has an active volume envelope
 void deActivate()
          The fadeout effect should only be active if the instrument has an active volume envelope
 void doEffect(TrackState state, int track)
          perform the effect
 void keyOff(int track)
          signal to the autoeffect that a key-off note/effect was played
 void newNote(double note, int track)
          tells the autoeffect that a new note is played.
 void reset(int track)
          reset the effect in the given track
 void setNumberOfTracks(int tracks)
          sets the number of track in a module
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fadeout

public Fadeout(double fadeout)
cerates an fadeout effect with a given fadeout level

Parameters:
fadeout -
Method Detail

setNumberOfTracks

public void setNumberOfTracks(int tracks)
Description copied from interface: AutoEffect
sets the number of track in a module

Specified by:
setNumberOfTracks in interface AutoEffect
Parameters:
tracks - the number of tracks in a module

doEffect

public void doEffect(TrackState state,
                     int track)
Description copied from interface: AutoEffect
perform the effect

Specified by:
doEffect in interface AutoEffect
Parameters:
state - the state of the track where the effect is used
track - the number of the track where effect is used

keyOff

public void keyOff(int track)
Description copied from interface: AutoEffect
signal to the autoeffect that a key-off note/effect was played

Specified by:
keyOff in interface AutoEffect

newNote

public void newNote(double note,
                    int track)
Description copied from interface: AutoEffect
tells the autoeffect that a new note is played.

Specified by:
newNote in interface AutoEffect
Parameters:
note - the new note
track - the track where the note is played

reset

public void reset(int track)
Description copied from interface: AutoEffect
reset the effect in the given track

Specified by:
reset in interface AutoEffect

activate

public void activate()
The fadeout effect should only be active if the instrument has an active volume envelope


deActivate

public void deActivate()
The fadeout effect should only be active if the instrument has an active volume envelope