use of blue.services.render.CsdRenderResult in project blue by kunstmusik.
the class CS6RealtimeRenderService method render.
@Override
public void render() throws SoundObjectException {
if (this.data == null) {
return;
}
// csnd6.csoundInitialize(csnd6.CSOUNDINIT_NO_SIGNAL_HANDLER);
shouldStop = false;
String command;
try {
command = ProjectPropertiesUtil.getRealtimeCommandLine(data.getProjectProperties());
String globalSco = data.getGlobalOrcSco().getGlobalSco();
globalSco = TextUtilities.stripMultiLineComments(globalSco);
globalSco = TextUtilities.stripSingleLineComments(globalSco);
double startTime = data.getRenderStartTime();
double endTime = data.getRenderEndTime();
CsdRenderResult result = CSDRenderService.getDefault().generateCSD(data, startTime, endTime, true, true);
RenderTimeManager timeManager = Lookup.getDefault().lookup(RenderTimeManager.class);
timeManager.setTempoMapper(result.getTempoMapper());
String csd = result.getCsdText();
File temp = FileUtilities.createTempTextFile("tempCsd", ".csd", BlueSystem.getCurrentProjectDirectory(), csd);
String[] args = command.split("\\s+");
String[] args2 = new String[args.length + 1];
System.arraycopy(args, 0, args2, 0, args.length);
args2[args.length] = temp.getAbsolutePath();
play(null, result, args2, BlueSystem.getCurrentProjectDirectory(), startTime);
} catch (SoundObjectException soe) {
throw soe;
} catch (Exception ex) {
StatusDisplayer.getDefault().setStatusText("[" + BlueSystem.getString("message.error") + "] " + BlueSystem.getString("message.generateScore.error"));
ex.printStackTrace();
}
}
use of blue.services.render.CsdRenderResult in project blue by kunstmusik.
the class CS6RealtimeRenderService method renderForBlueLive.
@Override
public void renderForBlueLive() throws SoundObjectException {
// csnd6.csoundInitialize(csnd6.CSOUNDINIT_NO_SIGNAL_HANDLER);
CsdRenderResult result = CSDRenderService.getDefault().generateCSDForBlueLive(this.data, true);
String tempCSD = result.getCsdText();
File temp = FileUtilities.createTempTextFile("tempCsd", ".csd", BlueSystem.getCurrentProjectDirectory(), tempCSD);
String osName = System.getProperty("os.name");
String command;
LiveData liveData = data.getLiveData();
if (liveData.isCommandLineEnabled()) {
if (liveData.isCommandLineOverride()) {
command = liveData.getCommandLine();
} else {
command = ProjectPropertiesUtil.getRealtimeCommandLine(data.getProjectProperties());
command += liveData.getCommandLine();
}
} else {
command = ProjectPropertiesUtil.getRealtimeCommandLine(data.getProjectProperties());
}
command += " --omacro:BLUE_LIVE=1 --smacro:BLUE_LIVE=1 ";
String[] args = command.split("\\s+");
String[] args2 = new String[args.length + 1];
System.arraycopy(args, 0, args2, 0, args.length);
args2[args.length] = temp.getAbsolutePath();
play(this.data, result, args2, BlueSystem.getCurrentProjectDirectory(), -1.0f);
}
Aggregations