Search in sources :

Example 6 with Automatable

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

the class CompileData method addInstrument.

/**
 * Adds and instrument to the Arrangement
 * @return instrument id that was assigned
 */
public int addInstrument(Instrument instrument) {
    if (handleParametersAndChannels && stringChannels != null && originalParameters != null) {
        if (instrument instanceof Automatable) {
            Automatable auto = (Automatable) instrument;
            ArrayList<StringChannel> tempStringChannels = auto.getStringChannels();
            if (tempStringChannels != null) {
                stringChannels.addAll(tempStringChannels);
                for (StringChannel sChan : tempStringChannels) {
                    sChan.setChannelName(scnm.getUniqueStringChannel());
                }
            }
            ParameterList paramList = auto.getParameterList();
            if (paramList != null) {
                originalParameters.addAll(paramList);
                for (Parameter param : paramList) {
                    param.setCompilationVarName(pnm.getUniqueParamName());
                }
            }
        }
    }
    return arrangement.addInstrument(instrument);
}
Also used : StringChannel(blue.orchestra.blueSynthBuilder.StringChannel) ParameterList(blue.automation.ParameterList) Parameter(blue.automation.Parameter) Automatable(blue.automation.Automatable)

Example 7 with Automatable

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

the class ParameterHelper method appendAllParametersFromChannel.

private static void appendAllParametersFromChannel(ArrayList<Parameter> params, Channel channel) {
    EffectsChain pre = channel.getPreEffects();
    for (int i = 0; i < pre.size(); i++) {
        ParameterList list = ((Automatable) pre.getElementAt(i)).getParameterList();
        params.addAll(list);
    }
    EffectsChain post = channel.getPostEffects();
    for (int i = 0; i < post.size(); i++) {
        ParameterList list = ((Automatable) post.getElementAt(i)).getParameterList();
        params.addAll(list);
    }
    Parameter levelParameter = channel.getLevelParameter();
    // if(!levelParameter.isAutomationEnabled()) {
    // levelParameter.setCompilationVarName(channel.getName());
    // }
    params.add(levelParameter);
}
Also used : EffectsChain(blue.mixer.EffectsChain) ParameterList(blue.automation.ParameterList) Parameter(blue.automation.Parameter) Automatable(blue.automation.Automatable)

Example 8 with Automatable

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

the class ParameterHelper method clearChannelCompilationVar.

private static void clearChannelCompilationVar(Channel channel) {
    channel.getLevelParameter().setCompilationVarName(null);
    EffectsChain preEffectsChain = channel.getPreEffects();
    for (int j = 0; j < preEffectsChain.size(); j++) {
        Automatable automatable = (Automatable) preEffectsChain.getElementAt(j);
        automatable.getParameterList().clearCompilationVarNames();
    }
    EffectsChain postEffectsChain = channel.getPostEffects();
    for (int j = 0; j < postEffectsChain.size(); j++) {
        Automatable automatable = (Automatable) postEffectsChain.getElementAt(j);
        automatable.getParameterList().clearCompilationVarNames();
    }
}
Also used : EffectsChain(blue.mixer.EffectsChain) Automatable(blue.automation.Automatable)

Aggregations

Automatable (blue.automation.Automatable)8 ParameterList (blue.automation.ParameterList)5 Parameter (blue.automation.Parameter)4 Instrument (blue.orchestra.Instrument)4 InstrumentAssignment (blue.InstrumentAssignment)3 Channel (blue.mixer.Channel)3 ChannelList (blue.mixer.ChannelList)3 EffectsChain (blue.mixer.EffectsChain)3 ArrayList (java.util.ArrayList)3 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)2 Arrangement (blue.Arrangement)1 LinePoint (blue.components.lines.LinePoint)1 Mixer (blue.mixer.Mixer)1 GenericInstrument (blue.orchestra.GenericInstrument)1