tactu5
Class Sequence

java.lang.Object
  extended by tactu5.Sequence
All Implemented Interfaces:
java.lang.Cloneable, T5Containers

public class Sequence
extends java.lang.Object
implements java.lang.Cloneable, T5Containers

Sequence class allows to create musical phrases or patterns with Tactu5. It's possible to pass an array of Note to the constructor or to add Note objects afterwards. This class automatically clones the Note objects passed.

Author:
Alessandro Capozzo - www.abstract-codex.net - summer - autumn 2007

Constructor Summary
Sequence()
           
Sequence(Note[] inseq)
           
 
Method Summary
 void addNote(Note inote)
          Add a note to Sequence internal array.
 java.lang.Object clone()
           
 int getContainerNum()
           
 float[] getDuration()
          Return a float array with all duration values in the sequence.
 float[] getFrequency()
          Rreturn a float array with all frequency values in the sequence.
 Note getNote(int index)
          return a specific note of the sequence
 float[] getPan()
          Return a float array with all pan values in the sequence.
 Note[] getSequence()
          Return the internal array of Note objects.
 int getSequenceLength()
          Return the number of sequence notes.
 float getSequenceMilliSec()
          Return the sequence duration in milliseconds.
 float[] getSustain()
          Return a float array with all sustain values in the sequence.
 float getTimeAtStep(int n)
          Return the time in milliseconds of a specific elements of the internal array.
 float[] getVelocity()
          Return a float array with all velocity values in the sequence.
 void scaleDuration(float coeficent)
          This method modifies all events duration in the sequence
 void scaleSustain(float coeficent)
          This method modifies all events duration in the sequence
 void setChannel(int inValue)
           
 void setChannel(int[] inArray)
          Set all the channel values of internal Note array.
 void setDuration(float inValue)
           
 void setDuration(float[] inArray)
          Set all the duration values of internal Note array.
 void setFrequency(float inValue)
           
 void setFrequency(float[] inArray)
          Set all the frequency values of internal Note array.
 void setPan(float inValue)
           
 void setPan(float[] inArray)
          Set all the pan values of internal Note array.
 void setSustain(float inValue)
           
 void setSustain(float[] inArray)
          Set all the sustain values of internal Note array.
 void setVelocity(float inValue)
           
 void setVelocity(float[] inArray)
          Set all the velocity values of internal Note array.
 void updateTime(float t)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sequence

public Sequence()

Sequence

public Sequence(Note[] inseq)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

addNote

public void addNote(Note inote)
Add a note to Sequence internal array.

Specified by:
addNote in interface T5Containers

updateTime

public void updateTime(float t)

getTimeAtStep

public float getTimeAtStep(int n)
Return the time in milliseconds of a specific elements of the internal array.

Returns:
float

getSequence

public Note[] getSequence()
Return the internal array of Note objects.

Returns:
Note[]

setDuration

public void setDuration(float[] inArray)
Set all the duration values of internal Note array. It's posible to pass a single float value or an array.


setDuration

public void setDuration(float inValue)

setSustain

public void setSustain(float[] inArray)
Set all the sustain values of internal Note array.


setSustain

public void setSustain(float inValue)

setPan

public void setPan(float[] inArray)
Set all the pan values of internal Note array.


setPan

public void setPan(float inValue)

setVelocity

public void setVelocity(float[] inArray)
Set all the velocity values of internal Note array.


setVelocity

public void setVelocity(float inValue)

setFrequency

public void setFrequency(float[] inArray)
Set all the frequency values of internal Note array.


setFrequency

public void setFrequency(float inValue)

setChannel

public void setChannel(int[] inArray)
Set all the channel values of internal Note array.


setChannel

public void setChannel(int inValue)

scaleDuration

public void scaleDuration(float coeficent)
This method modifies all events duration in the sequence

Parameters:
coeficent - a float value

scaleSustain

public void scaleSustain(float coeficent)
This method modifies all events duration in the sequence

Parameters:
coeficent - a float value

getVelocity

public float[] getVelocity()
Return a float array with all velocity values in the sequence.


getPan

public float[] getPan()
Return a float array with all pan values in the sequence.

Returns:
float[]

getSustain

public float[] getSustain()
Return a float array with all sustain values in the sequence.

Returns:
float[]

getDuration

public float[] getDuration()
Return a float array with all duration values in the sequence.

Returns:
float[]

getFrequency

public float[] getFrequency()
Rreturn a float array with all frequency values in the sequence.

Returns:
float[]

getSequenceLength

public int getSequenceLength()
Return the number of sequence notes.

Returns:
float[]

getContainerNum

public int getContainerNum()
Specified by:
getContainerNum in interface T5Containers

getSequenceMilliSec

public float getSequenceMilliSec()
Return the sequence duration in milliseconds.

Returns:
float[]

getNote

public Note getNote(int index)
return a specific note of the sequence

Specified by:
getNote in interface T5Containers