Search in sources :

Example 6 with StringChannel

use of blue.orchestra.blueSynthBuilder.StringChannel in project blue by kunstmusik.

the class CSDRender method handleParametersForBlueLive.

private void handleParametersForBlueLive(ArrayList parameters, ArrayList<StringChannel> stringChannels, GlobalOrcSco globalOrcSco, NoteList notes, Arrangement arrangement, boolean useAPI) {
    Object[] varNum = new Object[1];
    StrBuilder initStatements = new StrBuilder();
    StrBuilder paramScore = new StrBuilder();
    for (StringChannel strChannel : stringChannels) {
        String varName = strChannel.getChannelName();
        initStatements.append(varName);
        initStatements.append(" = ");
        initStatements.append("\"").append(strChannel.getValue()).append("\"\n");
        if (useAPI) {
            initStatements.append(varName).append(" chnexport \"");
            initStatements.append(varName).append("\", 3\n");
        }
    }
    for (int i = 0; i < parameters.size(); i++) {
        Parameter param = (Parameter) parameters.get(i);
        varNum[0] = new Integer(i);
        String varName = param.getCompilationVarName();
        // param.setCompilationVarName(varName);
        double initialVal = param.getFixedValue();
        // init statements
        initStatements.append(varName);
        initStatements.append(" init ");
        initStatements.append(NumberUtilities.formatDouble(initialVal));
        initStatements.append("\n");
        if (useAPI) {
            initStatements.append(varName).append(" chnexport \"");
            initStatements.append(varName).append("\", 3\n");
        }
    }
    globalOrcSco.appendGlobalOrc(initStatements.toString());
    try {
        notes.addAll(ScoreUtilities.getNotes(paramScore.toString()));
    } catch (NoteParseException ex) {
        ex.printStackTrace();
    }
// globalOrcSco.appendGlobalSco(paramScore.toString());
}
Also used : NoteParseException(blue.soundObject.NoteParseException) StringChannel(blue.orchestra.blueSynthBuilder.StringChannel) Parameter(blue.automation.Parameter) StrBuilder(org.apache.commons.lang3.text.StrBuilder) LinePoint(blue.components.lines.LinePoint)

Aggregations

StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)6 LinePoint (blue.components.lines.LinePoint)5 Parameter (blue.automation.Parameter)4 GenericInstrument (blue.orchestra.GenericInstrument)4 StrBuilder (org.apache.commons.lang3.text.StrBuilder)4 Instrument (blue.orchestra.Instrument)3 NoteParseException (blue.soundObject.NoteParseException)3 ArrayList (java.util.ArrayList)3 Arrangement (blue.Arrangement)2 CompileData (blue.CompileData)2 GlobalOrcSco (blue.GlobalOrcSco)2 Tables (blue.Tables)2 Automatable (blue.automation.Automatable)2 ParameterNameManager (blue.automation.ParameterNameManager)2 Mixer (blue.mixer.Mixer)2 TempoMapper (blue.noteProcessor.TempoMapper)2 StringChannelNameManager (blue.orchestra.blueSynthBuilder.StringChannelNameManager)2 CsdRenderResult (blue.services.render.CsdRenderResult)2 NoteList (blue.soundObject.NoteList)2 OpcodeList (blue.udo.OpcodeList)2