gr.teicrete.mta.synthesizer
Class SynthParameter

java.lang.Object
  extended by gr.teicrete.mta.synthesizer.SynthParameter
All Implemented Interfaces:
Mappable

public class SynthParameter
extends java.lang.Object
implements Mappable

The default parameter class

Author:
zavi

Field Summary
static int EXPONENTIAL_REPRESENTATION
           
static int LINEAR_REPRESENTATION
           
 
Constructor Summary
SynthParameter(java.lang.String name, double defaultValue, int synth, int parameterNumber)
          Constructs a new SynthParameter object
 
Method Summary
 double getMax()
          Get maximum value for this SynthParameter
 double getMin()
          Get minimum value for this SynthParameter
 java.lang.String getName()
          Method to obtain the SynthParameter's name
 int getNumber()
          Method to obtain the parameter number
 java.lang.String getParameterName()
          Method to obtain the parameter's name
 int getRepresentation()
          Method to obtain the SynthParameter's representation
 int getSynth()
          Method to obtain the SynthParameter's synthesizer number
 double getValue()
          Method to obtain the parameter's value
 void setRange(double min, double max)
          Sets the parameter's possible range of values
 void setRepresentation(int rep)
          Sets the SynthParameter's representation to linear or exponential
 void setValue(double val)
          Method that updates the current value of the SynthParameter
 java.lang.String toString()
          Method to represent the SynthParameter in String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LINEAR_REPRESENTATION

public static final int LINEAR_REPRESENTATION
See Also:
Constant Field Values

EXPONENTIAL_REPRESENTATION

public static final int EXPONENTIAL_REPRESENTATION
See Also:
Constant Field Values
Constructor Detail

SynthParameter

public SynthParameter(java.lang.String name,
                      double defaultValue,
                      int synth,
                      int parameterNumber)
Constructs a new SynthParameter object

Parameters:
name - The name of the parameter
defaultValue - The default value of the parameter
synth - The synthesizer number of the SynthParameter
Method Detail

setRepresentation

public void setRepresentation(int rep)
                       throws BadRepresentationException
Sets the SynthParameter's representation to linear or exponential

Parameters:
rep - The integer representing the representation
Throws:
BadRepresentationException

setRange

public void setRange(double min,
                     double max)
Sets the parameter's possible range of values

Parameters:
min - The minimum value
max - The maximum value

getParameterName

public java.lang.String getParameterName()
Method to obtain the parameter's name

Returns:
A String representing the parameter's name

getValue

public double getValue()
Method to obtain the parameter's value

Returns:
A double value representing the parameter's value

getName

public java.lang.String getName()
Method to obtain the SynthParameter's name

Returns:
A string representing the name of the SynthParameter

setValue

public void setValue(double val)
              throws BadSynthValueException
Method that updates the current value of the SynthParameter

Parameters:
val - The value to be assigned in the SynthParameter
Throws:
BadSynthValueException - If the value specified is not in the SynthParameter range

getMin

public double getMin()
Get minimum value for this SynthParameter

Returns:
The minimum value

getMax

public double getMax()
Get maximum value for this SynthParameter

Returns:
The maximum value

getSynth

public int getSynth()
Method to obtain the SynthParameter's synthesizer number

Returns:
An integer representing the synthesizer's number

getNumber

public int getNumber()
Method to obtain the parameter number

Returns:
An integer representing the parameter's number

getRepresentation

public int getRepresentation()
Method to obtain the SynthParameter's representation

Returns:
An integer representing the type of the SynthParameter's representation

toString

public java.lang.String toString()
Method to represent the SynthParameter in String

Overrides:
toString in class java.lang.Object