Search in sources :

Example 21 with Parameter

use of blue.automation.Parameter in project blue by kunstmusik.

the class ParameterHelper method getAllParameters.

public static ArrayList<Parameter> getAllParameters(Arrangement arr, Mixer mixer) {
    ArrayList<Parameter> params = new ArrayList<>();
    for (int i = 0; i < arr.size(); i++) {
        InstrumentAssignment ia = arr.getInstrumentAssignment(i);
        if (ia.enabled) {
            Instrument instr = ia.instr;
            if (instr instanceof Automatable) {
                Automatable auto = (Automatable) instr;
                ParameterList list = auto.getParameterList();
                params.addAll(list);
            }
        }
    }
    if (mixer != null && mixer.isEnabled()) {
        List<Channel> channels = mixer.getAllSourceChannels();
        for (Channel channel : channels) {
            appendAllParametersFromChannel(params, channel);
        }
        ChannelList subChannels = mixer.getSubChannels();
        for (Channel channel : subChannels) {
            appendAllParametersFromChannel(params, channel);
        }
        appendAllParametersFromChannel(params, mixer.getMaster());
    }
    return params;
}
Also used : Channel(blue.mixer.Channel) ArrayList(java.util.ArrayList) Instrument(blue.orchestra.Instrument) Parameter(blue.automation.Parameter) InstrumentAssignment(blue.InstrumentAssignment) ParameterList(blue.automation.ParameterList) ChannelList(blue.mixer.ChannelList) Automatable(blue.automation.Automatable)

Example 22 with Parameter

use of blue.automation.Parameter in project blue by kunstmusik.

the class SoundEditor method editScoreObject.

@Override
public final void editScoreObject(ScoreObject sObj) {
    if (sObj == null) {
        this.sObj = null;
        editorLabel.setText("no editor available");
        editor.editInstrument(null);
        return;
    }
    if (!(sObj instanceof Sound)) {
        this.sObj = null;
        editorLabel.setText("no editor available");
        editor.editInstrument(null);
        return;
    }
    if (this.sObj != null) {
        final Sound temp = this.sObj;
        BlueFX.runOnFXThread(() -> {
            temp.commentProperty().unbind();
            temp.removeScoreObjectListener(sObjListener);
        });
    }
    this.sObj = (Sound) sObj;
    editor.editInstrument(this.sObj.getBlueSynthBuilder());
    BlueFX.runOnFXThread(() -> {
        lineList.clear();
        int colorCount = 0;
        for (Parameter p : this.sObj.getBlueSynthBuilder().getParameterList().sorted()) {
            if (p.isAutomationEnabled()) {
                p.getLine().setVarName(p.getName());
                p.getLine().setColor(LineColors.getColor(colorCount++));
                List<LinePoint> points = p.getLine().getObservableList();
                if (points.size() < 2) {
                    LinePoint lp = new LinePoint();
                    lp.setLocation(1.0, points.get(0).getY());
                    points.add(lp);
                }
                lineList.add(p.getLine());
            }
        }
        lineView.setStartTime(this.sObj.getStartTime());
        lineView.setDuration(this.sObj.getSubjectiveDuration());
        commentTextArea.setText(this.sObj.getComment());
        this.sObj.commentProperty().bind(commentTextArea.textProperty());
        this.sObj.addScoreObjectListener(sObjListener);
    });
}
Also used : LinePoint(blue.components.lines.LinePoint) Parameter(blue.automation.Parameter) Sound(blue.soundObject.Sound) LinePoint(blue.components.lines.LinePoint)

Example 23 with Parameter

use of blue.automation.Parameter in project blue by kunstmusik.

the class SoundLayerPanel method paramColorSelectPropertyChange.

// GEN-LAST:event_otherMenuButtonActionPerformed
private void paramColorSelectPropertyChange(java.beans.PropertyChangeEvent evt) {
    // GEN-FIRST:event_paramColorSelectPropertyChange
    if (sLayer == null || paramIdList == null || updating) {
        return;
    }
    int index = paramIdList.getSelectedIndex();
    if (index < 0) {
        return;
    }
    String id = paramIdList.getParameterId(index);
    Parameter param = AutomationManager.getInstance().getParameter(id);
    if (param != null) {
        param.getLine().setColor(paramColorSelect.getColor());
    }
}
Also used : Parameter(blue.automation.Parameter)

Example 24 with Parameter

use of blue.automation.Parameter in project blue by kunstmusik.

the class MixerTest method testSaveParam.

public void testSaveParam() {
    Parameter p = new Parameter();
    Parameter clone = new Parameter(p);
    System.out.println(p + ":" + clone);
    assertEquals(p, clone);
}
Also used : Parameter(blue.automation.Parameter)

Example 25 with Parameter

use of blue.automation.Parameter in project blue by kunstmusik.

the class BSBVSliderBank method setupForCompilation.

/*
     * (non-Javadoc)
     * 
     * @see blue.orchestra.blueSynthBuilder.BSBObject#setupForCompilation(blue.orchestra.blueSynthBuilder.BSBCompilationUnit)
     */
@Override
public void setupForCompilation(BSBCompilationUnit compilationUnit) {
    Object[] vals = new Object[2];
    vals[0] = getObjectName();
    for (int i = 0; i < sliders.size(); i++) {
        BSBVSlider slider = sliders.get(i);
        vals[1] = new Integer(i);
        String key = KEY_FMT.format(vals);
        if (parameters != null) {
            Parameter param = parameters.getParameter(key);
            if (param != null && param.getCompilationVarName() != null) {
                compilationUnit.addReplacementValue(key, param.getCompilationVarName());
                continue;
            }
        }
        compilationUnit.addReplacementValue(key, NumberUtilities.formatDouble(slider.getValue()));
    }
}
Also used : Parameter(blue.automation.Parameter)

Aggregations

Parameter (blue.automation.Parameter)47 LinePoint (blue.components.lines.LinePoint)6 ParameterList (blue.automation.ParameterList)5 BigDecimal (java.math.BigDecimal)5 ArrayList (java.util.ArrayList)5 Automatable (blue.automation.Automatable)4 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)4 Instrument (blue.orchestra.Instrument)3 StrBuilder (org.apache.commons.lang3.text.StrBuilder)3 InstrumentAssignment (blue.InstrumentAssignment)2 Channel (blue.mixer.Channel)2 ChannelList (blue.mixer.ChannelList)2 GenericInstrument (blue.orchestra.GenericInstrument)2 NoteParseException (blue.soundObject.NoteParseException)2 Sound (blue.soundObject.Sound)2 Arrangement (blue.Arrangement)1 BlueData (blue.BlueData)1 CompileData (blue.CompileData)1 GlobalOrcSco (blue.GlobalOrcSco)1 SoundLayer (blue.SoundLayer)1