|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.softsynth.jmsl.score.UnaryCopyBufferTransform
jmsltutorial.ConvergeToMeanTransform
public class ConvergeToMeanTransform
Calculate the mean pitch of all notes in the copy buffer.
Set the pitch of each according to the position in the buffer: early notes changed minimally,
later notes attracted maximally to mean.
| Field Summary |
|---|
| Fields inherited from class com.softsynth.jmsl.score.UnaryCopyBufferTransform |
|---|
copyright |
| Constructor Summary | |
|---|---|
ConvergeToMeanTransform()
|
|
| Method Summary | |
|---|---|
void |
operate(CopyBuffer copyBuffer)
Implement this method to do whatever you want to the Vector of Note in copyBuffer |
| Methods inherited from class com.softsynth.jmsl.score.UnaryCopyBufferTransform |
|---|
getName, setName |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConvergeToMeanTransform()
| Method Detail |
|---|
public void operate(CopyBuffer copyBuffer)
UnaryCopyBufferTransform
Example:
// retrograde
public void operate(CopyBuffer copyBuffer) {
int start =0;
int end = copyBuffer.size()-1;
while (start < end) {
Object temp = copyBuffer.elementAt(start);
copyBuffer.setElementAt(copyBuffer.elementAt(end), start);
copyBuffer.setElementAt(temp, end);
start++;
end--;
}
}
operate in class UnaryCopyBufferTransform
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||