jazz.core
Class DeviceManipulation

java.lang.Object
  |
  +--jazz.core.DeviceManipulation
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class DeviceManipulation
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
protected  Device device
           
protected  int direction
           
static int DIRECTION_ASCENDING
           
static int DIRECTION_DESCENDING
           
protected  int minSize
           
protected  java.lang.String name
           
static int PITCH_NOT_FOUND
           
protected  java.util.Vector pitches
           
 
Constructor Summary
DeviceManipulation(Device device)
           
DeviceManipulation(Device device, java.lang.String name)
           
DeviceManipulation(Device device, java.lang.String name, int minSize)
           
 
Method Summary
 void addPitch(ManipulationPitch mp)
           
static DeviceManipulation ascendingApeggiosManipulations(Device d)
           
static DeviceManipulation ascendingScaleManipulation(Device d)
           
static DeviceManipulation ascendingSurroundingManipulation(Device d, int interval)
           
static DeviceManipulation ascendingThirdsManipulation(Device d)
           
 java.lang.Object clone()
           
static DeviceManipulation decendingScaleManipulation(Device d)
           
static DeviceManipulation decendingThirdsManipulation(Device d)
           
static DeviceManipulation descendingApeggiosManipulations(Device d)
           
static DeviceManipulation descendingSurroundingManipulation(Device d, int interval)
           
protected  int findStartingPitchIndex(Pitch p)
          Find the index of a given pitch within the device manipulation.
 ManipulationPitch getCyclicalManipulationPitch(int index)
          Return the pitch at a given index.
 Device getDevice()
           
 int getDirection()
          Return the direction as DIRECTION_ASCENDING or DIRECTION_DESCENDING
 ManipulationPitch getManipulationPitch(int i)
           
 int getMinSize()
           
 java.lang.String getName()
           
 java.util.Vector getPitchSeries(Pitch start, int numPitches)
          Return the number of pitches requested starting at a given pitch, or an empty vector if the pitch number isn't valid at a given pitch
 void insertPitchAt(ManipulationPitch mp, int i)
           
 void removePitch(int i)
           
 void setDevice(Device d)
           
 void setDirection(int direction)
          Set the direction as DIRECTION_ASCENDING or DIRECTION_DESCENDING
 void setMinSize(int minSize)
           
 void setName(java.lang.String name)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION_ASCENDING

public static final int DIRECTION_ASCENDING

DIRECTION_DESCENDING

public static final int DIRECTION_DESCENDING

PITCH_NOT_FOUND

public static final int PITCH_NOT_FOUND

direction

protected int direction

device

protected Device device

name

protected java.lang.String name

minSize

protected int minSize

pitches

protected java.util.Vector pitches
Constructor Detail

DeviceManipulation

public DeviceManipulation(Device device)

DeviceManipulation

public DeviceManipulation(Device device,
                          java.lang.String name)

DeviceManipulation

public DeviceManipulation(Device device,
                          java.lang.String name,
                          int minSize)
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getMinSize

public int getMinSize()

setMinSize

public void setMinSize(int minSize)

setDevice

public void setDevice(Device d)

getDevice

public Device getDevice()

setDirection

public void setDirection(int direction)
Set the direction as DIRECTION_ASCENDING or DIRECTION_DESCENDING

getDirection

public int getDirection()
Return the direction as DIRECTION_ASCENDING or DIRECTION_DESCENDING

size

public int size()

addPitch

public void addPitch(ManipulationPitch mp)

removePitch

public void removePitch(int i)

insertPitchAt

public void insertPitchAt(ManipulationPitch mp,
                          int i)

getManipulationPitch

public ManipulationPitch getManipulationPitch(int i)

findStartingPitchIndex

protected int findStartingPitchIndex(Pitch p)
Find the index of a given pitch within the device manipulation. Return PITCH_NOT_FOUND if the pitch is not in the device manipulation or is not a starting pitch.

getPitchSeries

public java.util.Vector getPitchSeries(Pitch start,
                                       int numPitches)
Return the number of pitches requested starting at a given pitch, or an empty vector if the pitch number isn't valid at a given pitch

getCyclicalManipulationPitch

public ManipulationPitch getCyclicalManipulationPitch(int index)
Return the pitch at a given index. Note that if you "run off the end" of the internal pitch vector, pitches are just bumped up or down by the appropriate number of octaves. (i.e. the pattern is cyclical).

clone

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

ascendingScaleManipulation

public static DeviceManipulation ascendingScaleManipulation(Device d)

decendingScaleManipulation

public static DeviceManipulation decendingScaleManipulation(Device d)

ascendingThirdsManipulation

public static DeviceManipulation ascendingThirdsManipulation(Device d)

decendingThirdsManipulation

public static DeviceManipulation decendingThirdsManipulation(Device d)

ascendingApeggiosManipulations

public static DeviceManipulation ascendingApeggiosManipulations(Device d)

descendingApeggiosManipulations

public static DeviceManipulation descendingApeggiosManipulations(Device d)

ascendingSurroundingManipulation

public static DeviceManipulation ascendingSurroundingManipulation(Device d,
                                                                  int interval)

descendingSurroundingManipulation

public static DeviceManipulation descendingSurroundingManipulation(Device d,
                                                                   int interval)