use of electric.xml.Elements in project blue by kunstmusik.
the class Operator method loadFromXML.
public static Operator loadFromXML(Element data) {
Operator op = new Operator();
op.mode = XMLUtilities.readInt(data, "mode");
op.sync = XMLUtilities.readInt(data, "sync");
op.freqCoarse = XMLUtilities.readInt(data, "freqCoarse");
op.freqFine = XMLUtilities.readInt(data, "freqFine");
op.detune = XMLUtilities.readInt(data, "detune");
op.breakpoint = XMLUtilities.readInt(data, "breakpoint");
op.curveLeft = XMLUtilities.readInt(data, "curveLeft");
op.curveRight = XMLUtilities.readInt(data, "curveRight");
op.depthLeft = XMLUtilities.readInt(data, "depthLeft");
op.depthRight = XMLUtilities.readInt(data, "depthRight");
op.keyboardRateScaling = XMLUtilities.readInt(data, "keyboardRateScaling");
op.outputLevel = XMLUtilities.readInt(data, "outputLevel");
op.velocitySensitivity = XMLUtilities.readInt(data, "velocitySensitivity");
op.modulationAmplitude = XMLUtilities.readInt(data, "modulationAmplitude");
op.modulationPitch = XMLUtilities.readInt(data, "modulationPitch");
Elements envPoints = data.getElements("envelopePoint");
int counter = 0;
while (envPoints.hasMoreElements()) {
op.envelopePoints[counter] = EnvelopePoint.loadFromXML(envPoints.next());
counter++;
}
return op;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class Scale method loadFromXML.
/* SERIALIZATION */
public static Scale loadFromXML(Element data) {
Scale scale = new Scale();
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "scaleName":
scale.scaleName = node.getTextString();
break;
case "baseFrequency":
scale.baseFrequency = Double.parseDouble(node.getTextString());
break;
case "octave":
scale.octave = Double.parseDouble(node.getTextString());
break;
case "ratios":
Elements ratioNodes = node.getElements();
scale.ratios = new double[ratioNodes.size()];
int i = 0;
while (ratioNodes.hasMoreElements()) {
Element ratioNode = ratioNodes.next();
scale.ratios[i] = Double.parseDouble(ratioNode.getTextString());
i++;
}
break;
}
}
return scale;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class Track method loadFromXML.
public static Track loadFromXML(Element data) {
Track retVal = new Track(false);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "name":
retVal.name = node.getTextString();
if (retVal.name == null) {
retVal.name = "";
}
break;
case "noteTemplate":
retVal.noteTemplate = node.getTextString();
if (retVal.noteTemplate == null) {
retVal.noteTemplate = "";
}
break;
case "instrumentId":
retVal.instrumentId = node.getTextString();
if (retVal.instrumentId == null) {
retVal.instrumentId = "";
}
break;
case "columns":
{
Elements nodes2 = node.getElements();
while (nodes2.hasMoreElements()) {
retVal.addColumn(Column.loadFromXML(nodes2.next()));
}
break;
}
case "trackerNotes":
{
Elements nodes2 = node.getElements();
while (nodes2.hasMoreElements()) {
retVal.trackerNotes.add(TrackerNote.loadFromXML(nodes2.next()));
}
break;
}
}
}
return retVal;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class OpcodeList method loadFromXML.
/* SAVE/LOAD METHODS */
public static OpcodeList loadFromXML(Element data) {
OpcodeList retVal = new OpcodeList();
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
UserDefinedOpcode udo = UserDefinedOpcode.loadFromXML(node);
retVal.addOpcode(udo);
}
return retVal;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class Field method loadFromXML.
public static Field loadFromXML(Element data) throws Exception {
Field field = new Field(false);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
if (nodeName.equals("parameter")) {
field.parameters.add(Parameter.loadFromXML(node));
}
}
return field;
}
Aggregations