Search in sources :

Example 11 with CsdRenderResult

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();
    }
}
Also used : RenderTimeManager(blue.services.render.RenderTimeManager) SoundObjectException(blue.soundObject.SoundObjectException) File(java.io.File) NoteParseException(blue.soundObject.NoteParseException) IOException(java.io.IOException) SoundObjectException(blue.soundObject.SoundObjectException) CsdRenderResult(blue.services.render.CsdRenderResult)

Example 12 with CsdRenderResult

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);
}
Also used : LiveData(blue.LiveData) File(java.io.File) CsdRenderResult(blue.services.render.CsdRenderResult)

Aggregations

CsdRenderResult (blue.services.render.CsdRenderResult)12 File (java.io.File)8 BlueData (blue.BlueData)5 ScoreGenerationException (blue.score.ScoreGenerationException)5 SoundObjectException (blue.soundObject.SoundObjectException)3 IOException (java.io.IOException)3 Arrangement (blue.Arrangement)2 CompileData (blue.CompileData)2 GlobalOrcSco (blue.GlobalOrcSco)2 LiveData (blue.LiveData)2 Tables (blue.Tables)2 ParameterNameManager (blue.automation.ParameterNameManager)2 LinePoint (blue.components.lines.LinePoint)2 Mixer (blue.mixer.Mixer)2 TempoMapper (blue.noteProcessor.TempoMapper)2 GenericInstrument (blue.orchestra.GenericInstrument)2 Instrument (blue.orchestra.Instrument)2 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)2 StringChannelNameManager (blue.orchestra.blueSynthBuilder.StringChannelNameManager)2 RenderTimeManager (blue.services.render.RenderTimeManager)2