use of blue.soundObject.pianoRoll.Scale in project blue by kunstmusik.
the class TuningProcessor method loadFromXML.
public static NoteProcessor loadFromXML(Element data) {
TuningProcessor tp = new TuningProcessor();
Elements nodes = data.getElements();
double baseFreq = -1;
while (nodes.hasMoreElements()) {
Element node = nodes.next();
switch(node.getName()) {
case "baseFrequency":
baseFreq = Double.parseDouble(node.getTextString());
break;
case "pfield":
tp.setPfield(node.getTextString());
break;
case "scale":
Scale scale;
if (node.getElements().size() == 0) {
String scaleDir = BlueSystem.getUserConfigurationDirectory() + File.separator + "scl";
String scalePath = scaleDir + File.separator + node.getTextString();
File scaleFile = new File(scalePath);
scale = Scale.loadScale(scaleFile);
} else {
scale = Scale.loadFromXML(node);
}
tp.setScale(scale);
break;
}
}
if (baseFreq > 0) {
tp.getScale().setBaseFrequency(baseFreq);
}
// tp.setFileName(data.getElement("fileName").getTextString());
return tp;
}
use of blue.soundObject.pianoRoll.Scale in project blue by kunstmusik.
the class TrackEditor method scaleChooserButtonActionPerformed.
// GEN-LAST:event_outputFreqCheckBoxActionPerformed
private void scaleChooserButtonActionPerformed(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_scaleChooserButtonActionPerformed
if (selectedColumn == null) {
return;
}
List<File> rValue = FileChooserManager.getDefault().showOpenDialog(FILE_CHOOSER_ID, null);
if (!rValue.isEmpty()) {
File f = rValue.get(0);
if (!f.exists()) {
return;
}
Scale scale = Scale.loadScale(f);
selectedColumn.setScale(scale);
scaleNameTextField.setText(scale.getScaleName());
}
}
use of blue.soundObject.pianoRoll.Scale in project blue by kunstmusik.
the class ScaleEditor method selectScale.
protected void selectScale() {
List<File> rValue = FileChooserManager.getDefault().showOpenDialog(ScaleSelectionPanel.FILE_CHOOSER_ID, null);
if (!rValue.isEmpty()) {
File f = rValue.get(0);
if (!f.exists()) {
return;
}
Scale scale = Scale.loadScale(f);
if (scale != null) {
scale.setBaseFrequency(this.scale.getBaseFrequency());
this.scale.copyValues(scale);
}
}
fireActionPerformed();
}