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

java.lang.Object
  extended by com.vwp.sound.mod.modplay.module.Module

public class Module
extends java.lang.Object

A module. Should be generic enough to support all module formats. A module contains a set of patterns and instruments, Each pattern contains several tracks (often 4), and each instrument contain several samples.


Field Summary
static int INSTRUMENT_PANNING
          indicates that the panning of a sample is decided by the panning value of the instrument that this sample is a part of
static int SAMPLE_PANNING
          indicates that the panning of a sample is decided by the panning value of that sample (This is uses by XMs)
static int TRACK_PANNING
          Indicates that the panning of a sample is decided by which track it is played in (This is used by MODs.)
 
Constructor Summary
Module(java.lang.String name, java.lang.String id, java.lang.String tracker, Instrument[] instruments, Pattern[] patterns, int[] patternOrder, int restartPos, int initialBPM, int initialSpeed, double initialVolume, int panningType, double[] initialTrackVolume, double[] initialPanning)
           
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getId()
           
 java.lang.String getInfo()
           
 int getInitialBpm()
           
 double getInitialPanning(int track)
           
 int getInitialSpeed()
           
 double getInitialVolume()
           
 double getInitialVolume(int track)
          get the value of the initial relative volume of a track.
 Instrument getInstrument(int n)
           
 Instrument[] getInstruments()
           
 java.lang.String getName()
           
 int getNumberOfInstruments()
           
 int getNumberOfPatterns()
           
 int getNumberOfPositions()
           
 int getPanningType()
           
 Pattern getPattern(int n)
           
 Pattern getPatternAtPos(int n)
           
 int getPatternIndexAtPos(int n)
           
 int getRestartPos()
           
 int getTrackCount()
          utility method for finding the number of tracks (channels) in the module.
 java.lang.String getTracker()
           
 void setDescription(java.lang.String description)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACK_PANNING

public static final int TRACK_PANNING
Indicates that the panning of a sample is decided by which track it is played in (This is used by MODs.)

See Also:
Constant Field Values

SAMPLE_PANNING

public static final int SAMPLE_PANNING
indicates that the panning of a sample is decided by the panning value of that sample (This is uses by XMs)

See Also:
Constant Field Values

INSTRUMENT_PANNING

public static final int INSTRUMENT_PANNING
indicates that the panning of a sample is decided by the panning value of the instrument that this sample is a part of

See Also:
Constant Field Values
Constructor Detail

Module

public Module(java.lang.String name,
              java.lang.String id,
              java.lang.String tracker,
              Instrument[] instruments,
              Pattern[] patterns,
              int[] patternOrder,
              int restartPos,
              int initialBPM,
              int initialSpeed,
              double initialVolume,
              int panningType,
              double[] initialTrackVolume,
              double[] initialPanning)
Parameters:
name - the name of the module
id - the id (type) ofthis module
tracker - the tracker this module was made with
instruments - the instruments that this module will play
patterns - the patterns of this instrument
patternOrder - the order the patterns is to be played in
restartPos - the position to restart the module at when it is finnished
initialBPM - the speed in Beats Per Minute to start playing this module in
initialSpeed - the initial speed in ticks per division to play this module in
initialVolume - the initial volume
initialPanning - the initial panning of each track
Method Detail

getInfo

public java.lang.String getInfo()
Returns:
info about this module in human readable form

getName

public java.lang.String getName()
Returns:
the name of the module

getId

public java.lang.String getId()
Returns:
the id of the module

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getTracker

public java.lang.String getTracker()
Returns:
the tracker used to make the module

getNumberOfInstruments

public int getNumberOfInstruments()
Returns:
the number of instruments in the module

getInstrument

public Instrument getInstrument(int n)
Returns:
the n'th instrument

getInstruments

public Instrument[] getInstruments()
Returns:
all the instruments used by the module

getNumberOfPatterns

public int getNumberOfPatterns()
Returns:
the number of patterns in the module

getNumberOfPositions

public int getNumberOfPositions()
Returns:
the number of positions in the module (the length of the module).

getPatternIndexAtPos

public int getPatternIndexAtPos(int n)
Returns:
the pattern number at position n

getPattern

public Pattern getPattern(int n)
Returns:
the n'th pattern

getPatternAtPos

public Pattern getPatternAtPos(int n)
Returns:
the pattern at position n

getRestartPos

public int getRestartPos()
Returns:
the restart position

getInitialBpm

public int getInitialBpm()
Returns:
the initial speed (in BPM) of this module

getInitialSpeed

public int getInitialSpeed()
Returns:
the initial speed (in ticks per division) of this module

getInitialVolume

public double getInitialVolume()
Returns:
the initial volume of this module

getPanningType

public int getPanningType()
Returns:
the panning type (track, sample or instrument) of this module

getInitialVolume

public double getInitialVolume(int track)
get the value of the initial relative volume of a track.

Parameters:
track -
Returns:

getInitialPanning

public double getInitialPanning(int track)
Returns:
the initial panning of the given track

getTrackCount

public int getTrackCount()
utility method for finding the number of tracks (channels) in the module. Note that this isn't reliable if you've managed to construct a module that has a different number of tracks per pattern. That's pretty unlikely though... It also doesn't work unless you have atleast one pattern.

Returns: