use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class LineAddProcessor 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 + " 1 3 4"));
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("before: \n\n" + n + "\n\n");
LineAddProcessor lap = new LineAddProcessor();
lap.setLineAddString("0 0 3 -3 6 0");
try {
lap.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 MultiplyProcessor 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");
MultiplyProcessor mp = new MultiplyProcessor();
mp.setPfield("2");
mp.setVal("2.2f");
try {
mp.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 ImportMidiAction method importMidiFile.
public void importMidiFile() {
final Frame mainWindow = WindowManager.getDefault().getMainWindow();
List<File> rValue = FileChooserManager.getDefault().showOpenDialog(this.getClass(), mainWindow);
if (rValue.size() == 0) {
StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.actionCancelled"));
return;
}
File midiFile = rValue.get(0);
BlueData tempData = new BlueData();
try {
PolyObject pObj = MidiImportUtilities.convertMidiFile(mainWindow, midiFile);
if (pObj == null) {
JOptionPane.showMessageDialog(mainWindow, BlueSystem.getString("message.file.couldNotImport"), BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
}
tempData.getScore().clear();
tempData.getScore().add(pObj);
} catch (NoteParseException e) {
JOptionPane.showMessageDialog(mainWindow, BlueSystem.getString("message.file.couldNotImport"), BlueSystem.getString("message.error"), JOptionPane.ERROR_MESSAGE);
return;
}
BlueProject project = new BlueProject(tempData, null);
BlueProjectManager.getInstance().setCurrentProject(project);
}
use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class CybilNoteList method createDefaultNote.
public Note createDefaultNote() {
Note retVal = null;
// Lazy initialization and caching
if (defaultNote == null) {
StringBuffer buffer = new StringBuffer();
buffer.append("i");
buffer.append(instrumentId);
for (int i = 0; i < numPfields - 1; i++) {
buffer.append(" 0");
}
try {
defaultNote = Note.createNote(buffer.toString());
} catch (NoteParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.err.println("Default Note: " + defaultNote.toString());
// System.err.println("Num Pfields: " + numPfields);
}
retVal = new Note(defaultNote);
return retVal;
}
use of blue.soundObject.NoteParseException in project blue by kunstmusik.
the class CSDRender method getGlobalDuration.
/**
* @param globalSco
* @return
* @throws SoundObjectException
*/
private double getGlobalDuration(String globalSco) throws SoundObjectException {
NoteList globalNotes;
try {
globalNotes = ScoreUtilities.getNotes(globalSco);
} catch (NoteParseException e) {
GenericScore gs = new GenericScore();
gs.setName("Global Orchestra Text");
throw new SoundObjectException(gs, e);
}
double globalDur = ScoreUtilities.getTotalDuration(globalNotes);
return globalDur;
}
Aggregations