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
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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)
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)