envelopeSpec.setUuid(generateUuid());
Node[] nodes = envWidget.getNodes();
for (Node node : nodes) {
EnvelopeNodeSpec nodeSpec = envelopeSpec.addNewEnvelopeNodeSpec();
XEnvelopeParamSpec xParam = nodeSpec.addNewXParam();
YEnvelopeParamSpec yParam = nodeSpec.addNewYParam();
xParam.setInvert(node.isInvertX());
xParam.setMax(node.getMaxX());
if (node.getSenderX() != null) {
MidiSender midiSenderX = xParam.addNewMidiSender();
setSender(midiSenderX, node.getSenderX());
}
xParam.setMin(node.getMinX());
xParam.setName(node.getNameX());
if (node.getPmodelX() != null) {
ParamModel paramModelX = xParam.addNewParamModel();
setParamModel(paramModelX, node.getPmodelX());
}
xParam.setUuid(generateUuid());
yParam.setBase(node.getBaseY());
yParam.setMax(node.getMaxY());
if (node.getSenderY() != null) {
MidiSender midiSenderY = yParam.addNewMidiSender();