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();
}
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();
}
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;
}
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();
}
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();
}
Aggregations