use of blue.soundObject.NoteList in project blue by kunstmusik.
the class RetrogradeProcessor method main.
public static void main(String[] args) {
NoteList n = new NoteList();
for (int i = 0; i < 10; i++) {
try {
n.add(Note.createNote("i1 " + i + " " + i + " 6." + i + " 4"));
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("before: \n\n" + n + "\n\n");
RetrogradeProcessor retro = new RetrogradeProcessor();
retro.processNotes(n);
System.out.println("after: \n\n" + n + "\n\n");
}
use of blue.soundObject.NoteList in project blue by kunstmusik.
the class SubListProcessor method processNotes.
@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
NoteList tempList = new NoteList();
if (end < 1) {
throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.noteListEnd"));
}
for (int i = 0; i < in.size(); i++) {
if (i >= (start - 1) && i <= (end - 1)) {
tempList.add(in.get(i));
}
}
in.clear();
in.merge(tempList);
blue.utility.ScoreUtilities.normalizeNoteList(in);
}
use of blue.soundObject.NoteList in project blue by kunstmusik.
the class TuningProcessor method main.
public static void main(String[] args) {
NoteList n = new NoteList();
for (int i = 0; i < 30; i++) {
try {
n.add(Note.createNote("i1 " + i + " " + i + " 6." + i + " 4"));
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("before: \n\n" + n + "\n\n");
TuningProcessor tp = new TuningProcessor();
tp.setPfield("4");
try {
tp.processNotes(n);
} catch (NoteProcessorException ex) {
System.out.println("Exception: " + ex.getMessage());
}
System.out.println("after: \n\n" + n + "\n\n");
}
use of blue.soundObject.NoteList in project blue by kunstmusik.
the class Field method generateNotes.
public NoteList generateNotes(final double duration, java.util.Random rnd) {
NoteList nl = new NoteList();
double xt = 0.0;
int numFields = parameters.size();
for (int i = 0; i < parameters.size(); i++) {
getParameter(i).initialize(duration);
}
while (xt < duration) {
Note n = Note.createNote(numFields);
double p1 = getParameter(0).getValue(xt, rnd);
p1 = p1 < 1.0 ? 1.0 : Utilities.round(p1, 0);
n.setPField(NumberUtilities.formatDouble(p1), 1);
n.setPField(NumberUtilities.formatDouble(xt), 2);
for (int i = 3; i < numFields + 1; i++) {
double val = getParameter(i - 1).getValue(xt, rnd);
if (i == 3 && val < 0) {
n.setPField(NumberUtilities.formatDouble(-val), i);
n.setTied(true);
} else {
n.setPField(NumberUtilities.formatDouble(val), i);
}
}
double p2 = getParameter(1).getValue(xt, rnd);
if (p2 == 0.0) {
System.err.println("[JMask] - WARNING: p2 = 0 !");
}
xt += p2;
nl.add(n);
}
return nl;
}
use of blue.soundObject.NoteList in project blue by kunstmusik.
the class BlueLiveTopComponent method triggerLiveObject.
protected void triggerLiveObject(LiveObject liveObject) {
NoteList nl = null;
try {
SoundObject sObj = liveObject.getSoundObject();
if (sObj.getTimeBehavior() != SoundObject.TIME_BEHAVIOR_NOT_SUPPORTED) {
sObj.setTimeBehavior(SoundObject.TIME_BEHAVIOR_NONE);
}
nl = sObj.generateForCSD(compileData, 0.0f, -1.0f);
} catch (Exception e) {
Exceptions.printStackTrace(e);
}
if (nl == null) {
return;
}
int tempo = (Integer) tempoSpinner.getValue();
ScoreUtilities.scaleScore(nl, 60.0f / tempo);
String scoreText = nl.toString();
if (scoreText != null && scoreText.length() > 0) {
RealtimeRenderManager.getInstance().passToStdin(scoreText);
}
}
Aggregations