use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class ScoreUtilitiesTest method testNGenScore.
public void testNGenScore() {
String testScore = ";I-block #1 (i1):\n" + "i1 0.000 0.010 0.000 100.000\n" + "i1 0.010 0.010 0.111 100.000\n" + "i1 0.020 0.010 0.222 100.000\n" + "i1 0.030 0.010 0.333 100.000\n" + "i1 0.040 0.010 0.444 100.000\n" + "i1 0.050 0.010 0.556 100.000\n" + "i1 0.060 0.010 0.667 100.000\n" + "i1 0.070 0.010 0.778 100.000\n" + "i1 0.080 0.010 0.889 100.000\n" + "i1 0.090 0.010 1.000 100.000\n" + "\n" + "e\n";
NoteList nl = null;
try {
nl = ScoreUtilities.getNotes(testScore);
} catch (NoteParseException ex) {
ex.printStackTrace();
}
assertNotNull(nl);
assertEquals(10, nl.size());
assertEquals(5, nl.get(0).getPCount());
}
use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class ClojureObject method generateNotes.
protected final NoteList generateNotes(double renderStart, double renderEnd) throws SoundObjectException {
String tempScore = null;
File currentDirFile = BlueSystem.getCurrentProjectDirectory();
HashMap<String, Object> initObjects = new HashMap<>();
initObjects.put("score", "");
initObjects.put("blueDuration", getSubjectiveDuration());
initObjects.put("blueProjectDir", currentDirFile);
try {
tempScore = BlueClojureEngine.getInstance().processScript(clojureCode, initObjects, "score");
} catch (ScriptException scriptEx) {
String msg = "Clojure Error:\n" + getRootCauseException(scriptEx).toString();
throw new SoundObjectException(this, msg);
}
NoteList nl;
try {
nl = ScoreUtilities.getNotes(tempScore);
} catch (NoteParseException e) {
throw new SoundObjectException(this, e);
}
try {
ScoreUtilities.applyNoteProcessorChain(nl, this.npc);
} catch (NoteProcessorException e) {
throw new SoundObjectException(this, e);
}
ScoreUtilities.applyTimeBehavior(nl, this.getTimeBehavior(), this.getSubjectiveDuration(), this.getRepeatPoint());
ScoreUtilities.setScoreStart(nl, startTime);
return nl;
}
use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class EqualsProcessor 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 * 2) + " 2 3 4"));
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("before: \n\n" + n + "\n\n");
EqualsProcessor ep = new EqualsProcessor();
ep.setPfield("4");
ep.setVal("17");
try {
ep.processNotes(n);
} catch (NoteProcessorException ex) {
System.out.println("Error: " + ex.getMessage());
}
System.out.println("a after: \n\n" + n + "\n\n");
}
use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class PchInversionProcessor 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 + " 2 6.0" + i + " 4"));
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("before: \n\n" + n + "\n\n");
PchInversionProcessor ap = new PchInversionProcessor();
ap.setPfield("4");
ap.setVal("5.00");
try {
ap.processNotes(n);
} catch (NoteProcessorException ex) {
System.out.println("Exception: " + ex.getMessage());
}
System.out.println("after: \n\n" + n + "\n\n");
}
use of blue.soundObject.NoteParseException 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");
}
Aggregations