use of blue.soundObject.Note in project blue by kunstmusik.
the class CommandlineRunner method passToStdin.
@Override
public void passToStdin(String text) {
NoteList nl = null;
try {
nl = ScoreUtilities.getNotes(text);
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
nl = null;
}
if (nl == null) {
return;
}
for (Iterator iter = nl.iterator(); iter.hasNext(); ) {
Note note = (Note) iter.next();
console.passToStdin(note.toString());
}
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class CybilOperator method divide.
/**
* @param cybNoteList
* @param startIndex
* @param endIndex
* @param arg
*/
private static void divide(CybilNoteList cybNoteList, int startIndex, int endIndex, CybilArg arg) {
int pfield = cybNoteList.pfield;
cybNoteList.index = startIndex;
for (int i = startIndex; i < endIndex; i++) {
Note note = cybNoteList.notes.get(i);
double val = Double.parseDouble(note.getPField(pfield));
val = val / arg.getValue(cybNoteList)[0];
note.setPField(Double.toString(val), pfield);
cybNoteList.index++;
}
cybNoteList.index = endIndex;
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class CybilOperator method subtract.
/**
* @param cybNoteList
* @param startIndex
* @param endIndex
* @param arg
*/
private static void subtract(CybilNoteList cybNoteList, int startIndex, int endIndex, CybilArg arg) {
int pfield = cybNoteList.pfield;
cybNoteList.index = startIndex;
for (int i = startIndex; i < endIndex; i++) {
Note note = cybNoteList.notes.get(i);
double val = Double.parseDouble(note.getPField(pfield));
val = val - arg.getValue(cybNoteList)[0];
note.setPField(Double.toString(val), pfield);
cybNoteList.index++;
}
cybNoteList.index = endIndex;
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class CybilOperator method add.
/**
* @param cybNoteList
* @param startIndex
* @param endIndex
* @param arg
*/
private static void add(CybilNoteList cybNoteList, int startIndex, int endIndex, CybilArg arg) {
int pfield = cybNoteList.pfield;
cybNoteList.index = startIndex;
for (int i = startIndex; i < endIndex; i++) {
Note note = cybNoteList.notes.get(i);
double val = Double.parseDouble(note.getPField(pfield));
val = val + arg.getValue(cybNoteList)[0];
note.setPField(Double.toString(val), pfield);
cybNoteList.index++;
}
cybNoteList.index = endIndex;
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class lo method getValue.
@Override
public double[] getValue(CybilNoteList cybilNoteList) {
double start = getDoubleValue(args.get(0));
double end = getDoubleValue(args.get(1));
double diff = end / start;
double timeValue = getTimeValue(args.get(2));
boolean isTime = isTime(args.get(2));
NoteList notes = cybilNoteList.notes;
if (cybilNoteList.pfield == 2) {
if (isTime) {
} else {
}
} else {
if (isTime) {
} else {
for (int i = 0; i < timeValue; i++) {
double x = i / (timeValue - 1);
double val = Math.pow(diff, x) * start;
Note currentNote = notes.get(cybilNoteList.index);
String strVal = Double.toString(val);
currentNote.setPField(strVal, cybilNoteList.pfield);
cybilNoteList.index++;
if (cybilNoteList.index >= notes.size()) {
break;
}
}
}
}
return null;
}
Aggregations