Search in sources :

Example 1 with Automatable

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

the class CSDRender method getStringChannels.

private ArrayList<StringChannel> getStringChannels(Arrangement arrangement, StringChannelNameManager scnm) {
    ArrayList<StringChannel> params = new ArrayList<>();
    for (int i = 0; i < arrangement.size(); i++) {
        InstrumentAssignment ia = arrangement.getInstrumentAssignment(i);
        if (ia.enabled) {
            Instrument instr = ia.instr;
            if (instr instanceof Automatable) {
                Automatable auto = (Automatable) instr;
                ArrayList<StringChannel> stringChannels = auto.getStringChannels();
                if (stringChannels != null) {
                    params.addAll(stringChannels);
                }
            }
        }
    }
    for (StringChannel strChannel : params) {
        strChannel.setChannelName(scnm.getUniqueStringChannel());
    }
    return params;
}
Also used : StringChannel(blue.orchestra.blueSynthBuilder.StringChannel) ArrayList(java.util.ArrayList) Instrument(blue.orchestra.Instrument) GenericInstrument(blue.orchestra.GenericInstrument) InstrumentAssignment(blue.InstrumentAssignment) LinePoint(blue.components.lines.LinePoint) Automatable(blue.automation.Automatable)

Example 2 with Automatable

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

the class ParameterHelper method clearCompilationVarNames.

public static void clearCompilationVarNames(BlueData data) {
    Arrangement arrangement = data.getArrangement();
    for (int i = 0; i < arrangement.size(); i++) {
        Instrument instr = arrangement.getInstrument(i);
        if (instr instanceof Automatable) {
            Automatable temp = (Automatable) instr;
            temp.getParameterList().clearCompilationVarNames();
        }
    }
    Mixer mixer = data.getMixer();
    List<Channel> channels = mixer.getAllSourceChannels();
    for (Channel channel : channels) {
        clearChannelCompilationVar(channel);
    }
    ChannelList subChannels = mixer.getSubChannels();
    for (Channel subChannel : subChannels) {
        clearChannelCompilationVar(subChannel);
    }
    clearChannelCompilationVar(mixer.getMaster());
}
Also used : Mixer(blue.mixer.Mixer) Channel(blue.mixer.Channel) Instrument(blue.orchestra.Instrument) ChannelList(blue.mixer.ChannelList) Arrangement(blue.Arrangement) Automatable(blue.automation.Automatable)

Example 3 with Automatable

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

the class ParameterHelper method getActiveParameters.

public static List<Parameter> getActiveParameters(Arrangement arr, Mixer mixer) {
    List<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();
                addActiveParametersFromList(params, list);
            }
        }
    }
    if (mixer != null && mixer.isEnabled()) {
        List<Channel> channels = mixer.getAllSourceChannels();
        for (Channel channel : channels) {
            appendParametersFromChannel(params, channel);
        }
        ChannelList subChannels = mixer.getSubChannels();
        for (Channel subChannel : subChannels) {
            appendParametersFromChannel(params, subChannel);
        }
        appendParametersFromChannel(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 4 with Automatable

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

the class ParameterHelper method appendParametersFromChannel.

private static void appendParametersFromChannel(List<Parameter> params, Channel channel) {
    EffectsChain pre = channel.getPreEffects();
    for (int i = 0; i < pre.size(); i++) {
        ParameterList list = ((Automatable) pre.getElementAt(i)).getParameterList();
        addActiveParametersFromList(params, list);
    }
    EffectsChain post = channel.getPostEffects();
    for (int i = 0; i < post.size(); i++) {
        ParameterList list = ((Automatable) post.getElementAt(i)).getParameterList();
        addActiveParametersFromList(params, list);
    }
    if (channel.getLevelParameter().isAutomationEnabled()) {
        params.add(channel.getLevelParameter());
    }
}
Also used : EffectsChain(blue.mixer.EffectsChain) ParameterList(blue.automation.ParameterList) Automatable(blue.automation.Automatable)

Example 5 with Automatable

use of blue.automation.Automatable 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)

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