Search in sources :

Example 21 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.

the class NoteList method toString.

@Override
public final String toString() {
    if (this.size() == 0) {
        return "";
    }
    StrBuilder tempScore = new StrBuilder();
    String firstNote = this.get(0).toString();
    if (this.size() == 1) {
        return firstNote + "\n";
    }
    String[] str = new String[this.size()];
    str[0] = firstNote;
    int strSize = str[0].length();
    for (int i = 1; i < this.size(); i++) {
        str[i] = this.get(i).toString();
        strSize += str[i].length() + 1;
    }
    tempScore.ensureCapacity(strSize);
    tempScore.appendWithSeparators(str, "\n");
    // return "";
    return tempScore.toString();
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 22 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.

the class Operator method toString.

@Override
public String toString() {
    StrBuilder buffer = new StrBuilder();
    buffer.append("[operator]\n");
    buffer.append("mode: " + mode + "\n");
    buffer.append("sync: " + sync + "\n");
    buffer.append("freqCoarse: " + freqCoarse + "\n");
    buffer.append("freqFine: " + freqFine + "\n");
    buffer.append("detune: " + detune + "\n");
    return buffer.toString();
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 23 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.

the class Arrangement method generateOrchestra.

public String generateOrchestra(CompileData data, Mixer mixer, int nchnls) {
    StrBuilder buffer;
    if (preGenerationCache == null) {
        buffer = new StrBuilder();
    } else {
        buffer = preGenerationCache;
    }
    for (Iterator<InstrumentAssignment> iter = arrangement.iterator(); iter.hasNext(); ) {
        InstrumentAssignment ia = iter.next();
        if (!preGenList.contains(ia)) {
            if (!ia.enabled) {
                continue;
            }
            appendInstrumentText(data, buffer, ia, mixer, nchnls);
        }
    }
    String retVal = buffer.toString();
    preGenerationCache = null;
    preGenList = null;
    return retVal;
}
Also used : StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 24 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.

the class Arrangement method generateGlobalOrc.

public String generateGlobalOrc(CompileData data) {
    StrBuilder retVal = new StrBuilder();
    ArrayList<Instrument> instruments = new ArrayList<>();
    for (Iterator<InstrumentAssignment> iter = arrangement.iterator(); iter.hasNext(); ) {
        InstrumentAssignment ia = iter.next();
        if (!ia.enabled) {
            continue;
        }
        Instrument instr = ia.instr;
        if (!instruments.contains(instr)) {
            String globalOrc = instr.generateGlobalOrc();
            if (globalOrc != null) {
                String assignmentId;
                if ((assignmentId = data.getInstrSourceId(instr)) == null) {
                    assignmentId = ia.arrangementId;
                }
                String transformed = replaceInstrumentId(assignmentId, globalOrc);
                retVal.append(transformed);
                retVal.append("\n");
            }
            instruments.add(instr);
        }
    }
    return retVal.toString();
}
Also used : GenericInstrument(blue.orchestra.GenericInstrument) Instrument(blue.orchestra.Instrument) StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Example 25 with StrBuilder

use of org.apache.commons.lang3.text.StrBuilder in project blue by kunstmusik.

the class Arrangement method generateGlobalSco.

public String generateGlobalSco(CompileData data) {
    StrBuilder retVal = new StrBuilder();
    for (Iterator<InstrumentAssignment> iter = arrangement.iterator(); iter.hasNext(); ) {
        InstrumentAssignment ia = iter.next();
        if (!ia.enabled) {
            continue;
        }
        Instrument instr = ia.instr;
        String globalSco = instr.generateGlobalSco();
        if (globalSco != null) {
            String assignmentId;
            if ((assignmentId = data.getInstrSourceId(instr)) == null) {
                assignmentId = ia.arrangementId;
            }
            String transformed = replaceInstrumentId(assignmentId, globalSco);
            retVal.append(transformed);
            retVal.append("\n");
        }
    }
    return retVal.toString();
}
Also used : GenericInstrument(blue.orchestra.GenericInstrument) Instrument(blue.orchestra.Instrument) StrBuilder(org.apache.commons.lang3.text.StrBuilder)

Aggregations

StrBuilder (org.apache.commons.lang3.text.StrBuilder)44 GenericInstrument (blue.orchestra.GenericInstrument)9 LinePoint (blue.components.lines.LinePoint)8 Instrument (blue.orchestra.Instrument)5 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)4 Parameter (blue.automation.Parameter)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 ParameterNameManager (blue.automation.ParameterNameManager)2 Line (blue.components.lines.Line)2 SoundObjectParameterLine (blue.components.lines.SoundObjectParameterLine)2 Mixer (blue.mixer.Mixer)2 TempoMapper (blue.noteProcessor.TempoMapper)2 StringChannelNameManager (blue.orchestra.blueSynthBuilder.StringChannelNameManager)2 EnvelopePoint (blue.orchestra.blueX7.EnvelopePoint)2 CsdRenderResult (blue.services.render.CsdRenderResult)2