Search in sources :

Example 6 with SoundObjectException

use of blue.soundObject.SoundObjectException in project blue by kunstmusik.

the class RealtimeRenderManager method renderProject.

protected void renderProject(BlueData data, boolean auditioning) {
    if (isRendering()) {
        stopRendering();
    }
    if (data == null) {
        this.auditioning = false;
        return;
    }
    this.auditioning = auditioning;
    StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));
    RealtimeRenderServiceFactory factory = RealtimeRenderSettings.getInstance().renderServiceFactory;
    if (currentRenderServiceFactory != factory || currentRenderService == null || currentRenderService.getClass() != factory.getRenderServiceClass()) {
        if (currentRenderService != null) {
            currentRenderService.removePlayModeListener(realtimeListener);
        }
        currentRenderServiceFactory = factory;
        currentRenderService = factory.createInstance();
        currentRenderService.addPlayModeListener(realtimeListener);
    }
    currentRenderService.setData(data);
    try {
        currentRenderService.render();
    } catch (SoundObjectException soe) {
        ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), soe);
    }
}
Also used : SoundObjectException(blue.soundObject.SoundObjectException) RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory)

Example 7 with SoundObjectException

use of blue.soundObject.SoundObjectException in project blue by kunstmusik.

the class RealtimeRenderManager method renderForBlueLive.

public void renderForBlueLive(BlueData data) {
    if (currentBlueLiveRenderService != null && currentBlueLiveRenderService.isRunning()) {
        currentBlueLiveRenderService.stop();
    }
    if (data == null) {
        return;
    }
    StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));
    RealtimeRenderServiceFactory factory = RealtimeRenderSettings.getInstance().renderServiceFactory;
    if (currentRenderServiceFactory != factory || currentBlueLiveRenderService == null || currentBlueLiveRenderService.getClass() != factory.getRenderServiceClass()) {
        if (currentBlueLiveRenderService != null) {
            currentBlueLiveRenderService.removePlayModeListener(blueLiveListener);
        }
        currentRenderServiceFactory = factory;
        currentBlueLiveRenderService = factory.createInstance();
        currentBlueLiveRenderService.addPlayModeListener(blueLiveListener);
    }
    currentBlueLiveRenderService.addBinding(new BlueLiveBinding(data));
    currentBlueLiveRenderService.setData(data);
    try {
        currentBlueLiveRenderService.renderForBlueLive();
    } catch (SoundObjectException soe) {
        ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), soe);
    }
}
Also used : SoundObjectException(blue.soundObject.SoundObjectException) RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory)

Example 8 with SoundObjectException

use of blue.soundObject.SoundObjectException 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)

Aggregations

SoundObjectException (blue.soundObject.SoundObjectException)8 NoteParseException (blue.soundObject.NoteParseException)4 CsdRenderResult (blue.services.render.CsdRenderResult)3 NoteList (blue.soundObject.NoteList)3 File (java.io.File)3 ScoreGenerationException (blue.score.ScoreGenerationException)2 RealtimeRenderServiceFactory (blue.services.render.RealtimeRenderServiceFactory)2 RenderTimeManager (blue.services.render.RenderTimeManager)2 Arrangement (blue.Arrangement)1 CompileData (blue.CompileData)1 GlobalOrcSco (blue.GlobalOrcSco)1 Tables (blue.Tables)1 ParameterNameManager (blue.automation.ParameterNameManager)1 LinePoint (blue.components.lines.LinePoint)1 Mixer (blue.mixer.Mixer)1 NoteProcessorException (blue.noteProcessor.NoteProcessorException)1 TempoMapper (blue.noteProcessor.TempoMapper)1 GenericInstrument (blue.orchestra.GenericInstrument)1 Instrument (blue.orchestra.Instrument)1 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)1