use of blue.soundObject.Note in project blue by kunstmusik.
the class PchAddProcessor method processNotes.
@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
Note temp;
String val;
for (int i = 0; i < in.size(); i++) {
temp = in.get(i);
try {
val = temp.getPField(pfield).trim();
Double.parseDouble(val);
} catch (NumberFormatException ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
} catch (Exception ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
}
double baseTen = blue.utility.ScoreUtilities.getBaseTen(val);
baseTen += value;
int octave = (int) (baseTen / 12);
double strPch = (baseTen % 12) / 100;
temp.setPField(Double.toString(octave + strPch), pfield);
}
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class RandomMultiplyProcessor method processNotes.
@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
Note temp;
double range = max - min;
double fieldVal = 0f;
Random r = seedUsed ? new Random(seed) : new Random();
for (int i = 0; i < in.size(); i++) {
temp = in.get(i);
try {
fieldVal = Double.parseDouble(temp.getPField(pfield));
} catch (NumberFormatException ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
} catch (Exception ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
}
double randVal = (double) ((r.nextDouble() * range) + min);
temp.setPField(Double.toString(fieldVal * randVal), pfield);
}
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class AddProcessor method processNotes.
@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
Note temp;
double fieldVal = 0.0;
for (int i = 0; i < in.size(); i++) {
temp = in.get(i);
try {
fieldVal = Double.parseDouble(temp.getPField(pfield));
} catch (NumberFormatException ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
} catch (Exception ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
}
temp.setPField(Double.toString(fieldVal + value), pfield);
}
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class InversionProcessor method processNotes.
@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
Note temp;
for (int i = 0; i < in.size(); i++) {
temp = in.get(i);
try {
double fieldVal = Double.parseDouble(temp.getPField(pfield));
double addVal = -1 * (fieldVal - this.value);
temp.setPField(Double.toString(this.value + addVal), pfield);
} catch (NumberFormatException ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
} catch (Exception ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
}
}
}
use of blue.soundObject.Note in project blue by kunstmusik.
the class PchInversionProcessor method processNotes.
@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
Note temp;
String val;
for (int i = 0; i < in.size(); i++) {
temp = in.get(i);
try {
val = temp.getPField(pfield).trim();
Double.parseDouble(val);
} catch (NumberFormatException ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
} catch (Exception ex) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
}
double baseTen = blue.utility.ScoreUtilities.getBaseTen(val);
double baseTenAxis = blue.utility.ScoreUtilities.getBaseTen(this.getVal());
double addVal = -1 * (baseTen - baseTenAxis);
baseTen = baseTenAxis + addVal;
int octave = (int) (baseTen / 12);
double strPch = (baseTen % 12) / 100;
temp.setPField(Double.toString(octave + strPch), pfield);
}
}
Aggregations