use of blue.orchestra.Instrument in project blue by kunstmusik.
the class InstrumentExportPane method jbInit.
private void jbInit() throws Exception {
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
instrumentListPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
categoryPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
cateogriesLabel.setText(BlueSystem.getString("common.categories"));
categoryPanel.setLayout(new BorderLayout());
this.add(namePasswordPanel, BorderLayout.NORTH);
this.add(mainSplitPane, BorderLayout.CENTER);
this.add(jPanel2, BorderLayout.SOUTH);
descriptionText.setText(BlueSystem.getString("blueShare.enterDescription"));
descriptionText.setLineWrap(true);
descriptionScrollPane.setBorder(new TitledBorder(null, BlueSystem.getString("blueShare.instrDescription")));
submitButton.setText(BlueSystem.getString("common.submit"));
instrumentListPanel.setLayout(new BorderLayout());
iLabel.setText(BlueSystem.getString("blueShare.instrumentsFromCurrentProject"));
// instrumentLibraryTree.setSelectionModel(TreeSelectionModel.SINGLE_TREE_SELECTION);
topSplitPane.add(instrumentListPanel, JSplitPane.LEFT);
instrumentListPanel.add(instrumentListScrollPane, BorderLayout.CENTER);
instrumentListPanel.add(iLabel, BorderLayout.NORTH);
instrumentListScrollPane.getViewport().add(instrumentLibraryTree, null);
descriptionScrollPane.getViewport().add(descriptionText, null);
jPanel2.add(submitButton, null);
topSplitPane.setDividerLocation(300);
mainSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
mainSplitPane.add(topSplitPane, JSplitPane.TOP);
mainSplitPane.add(descriptionScrollPane, JSplitPane.BOTTOM);
topSplitPane.add(categoryPanel, JSplitPane.RIGHT);
categoryPanel.add(cateogriesLabel, BorderLayout.NORTH);
categoryPanel.add(categoryScrollPane, BorderLayout.CENTER);
categoryScrollPane.getViewport().add(categoryTree, null);
mainSplitPane.setDividerLocation(200);
submitButton.addActionListener((ActionEvent e) -> {
submitInstrument();
});
instrumentLibraryTree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
TreePath path = instrumentLibraryTree.getSelectionPath();
if (path == null) {
descriptionText.setText(SELECT_INSTR_TEXT);
descriptionText.setEnabled(false);
return;
}
Object userObj = path.getLastPathComponent();
if (!(userObj instanceof Instrument)) {
descriptionText.setText(SELECT_INSTR_TEXT);
descriptionText.setEnabled(false);
return;
}
Instrument instr = (Instrument) userObj;
descriptionText.setText(instr.getComment());
descriptionText.setEnabled(true);
}
});
}
use of blue.orchestra.Instrument in project blue by kunstmusik.
the class AudioFile method generateForCSD.
@Override
public NoteList generateForCSD(CompileData compileData, double startTime, double endTime) throws SoundObjectException {
Instrument instr = this.generateInstrument();
if (instr == null) {
throw new RuntimeException(new SoundObjectException(this, BlueSystem.getString("audioFile.couldNotGenerate") + " " + getSoundFileName()));
}
int instrNum = compileData.addInstrument(instr);
NoteList nl = this.generateNotes(instrNum, startTime, endTime);
return nl;
}
use of blue.orchestra.Instrument 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 blue.orchestra.Instrument 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();
}
use of blue.orchestra.Instrument in project blue by kunstmusik.
the class AutomationManager method setData.
public void setData(BlueData data) {
if (this.data != null) {
Arrangement arrangement = this.data.getArrangement();
arrangement.removeAutomatableCollectionListener(this);
for (int i = 0; i < arrangement.size(); i++) {
Instrument instr = arrangement.getInstrument(i);
if (instr instanceof Automatable) {
Automatable temp = (Automatable) instr;
ParameterList parameters = temp.getParameterList();
// parameterMap.put(temp, parameters);
parameters.removeListener(parameterListListener);
}
}
Mixer mixer = this.data.getMixer();
mixer.getChannelListGroups().removeListener(channelListListener);
for (ChannelList list : mixer.getChannelListGroups()) {
list.removeListener(this);
for (Channel c : list) {
removeListenerFromChannel(c);
}
}
ChannelList channels = mixer.getChannels();
channels.removeListener(this);
for (Channel c : channels) {
removeListenerFromChannel(c);
}
ChannelList subChannels = mixer.getSubChannels();
subChannels.removeListener(this);
for (int i = 0; i < subChannels.size(); i++) {
removeListenerFromChannel(subChannels.get(i));
}
removeListenerFromChannel(mixer.getMaster());
if (this.score != null) {
for (LayerGroup<? extends Layer> layerGroup : score) {
layerGroup.removeLayerGroupListener(this);
}
}
this.data.removePropertyChangeListener(renderTimeListener);
}
// menu = null;
// dirty = false;
allParameters.clear();
if (data == null) {
return;
}
// Build Map from Instruments
Arrangement arrangement = data.getArrangement();
for (int i = 0; i < arrangement.size(); i++) {
Instrument instr = arrangement.getInstrument(i);
if (instr instanceof Automatable) {
Automatable temp = (Automatable) instr;
ParameterList parameters = temp.getParameterList();
allParameters.addAll(parameters);
parameters.addListener(parameterListListener);
}
}
arrangement.addAutomatableCollectionListener(this);
Mixer mixer = data.getMixer();
mixer.getChannelListGroups().addListener(channelListListener);
for (ChannelList list : mixer.getChannelListGroups()) {
list.addListener(this);
for (Channel c : list) {
addListenerToChannel(c);
}
}
ChannelList channels = mixer.getChannels();
channels.addListener(this);
for (Channel c : channels) {
addListenerToChannel(c);
}
ChannelList subChannels = mixer.getSubChannels();
subChannels.addListener(this);
for (int i = 0; i < subChannels.size(); i++) {
addListenerToChannel(subChannels.get(i));
}
addListenerToChannel(mixer.getMaster());
// System.err.println(this);
this.data = data;
this.score = data.getScore();
for (LayerGroup<? extends Layer> layerGroup : this.score) {
layerGroup.addLayerGroupListener(this);
}
this.data.addPropertyChangeListener(renderTimeListener);
// Build Map from Mixer Channels
}
Aggregations