Subversion Repositories svn.mios

Compare Revisions

Ignore whitespace Rev 737 → Rev 738

/trunk/java/org/midibox/midi/gui/MidiFilterGUI.java
283,8 → 283,10
channels = new JTable(channelsModel);
 
for (int i = 0; i < 16; i++) {
channelsModel.addRow(new Object[] {
new Boolean(midiFilter.getChannel(i)), "Channel " + (i + 1) });
channelsModel
.addRow(new Object[] {
new Boolean(midiFilter.getChannel(i)),
"Channel " + (i + 1) });
}
 
JScrollPane channelsScroll = new JScrollPane(channels);
642,8 → 644,8
.booleanValue());
} else {
 
midiFilter.setChannel(row, ((Boolean) value)
.booleanValue());
midiFilter
.setChannel(row, ((Boolean) value).booleanValue());
}
} else {
 
/trunk/java/org/midibox/midi/xml/MidiDeviceManagerXML.java
49,7 → 49,6
 
} else if (name == TAG_DESELECTED_MIDI_READ_DEVICES) {
 
 
} else if (name == TAG_DESELECTED_MIDI_READ_DEVICE) {
 
int hash = Integer.parseInt(element
/trunk/java/org/midibox/apps/miosstudio/MIOSStudio.java
232,6 → 232,7
* miosTerminalFiltered.getMidiFilter().setSystemCommonMessages(false);
*
*
*
* miosTerminalFiltered.getMidiFilter().setSystemRealtimeMessages(false);
*/
 
/trunk/java/org/midibox/apps/virtualkeyboard/xml/VirtualKeyboardXML.java
New file
0,0 → 1,69
package org.midibox.apps.virtualkeyboard.xml;
 
import org.midibox.apps.virtualkeyboard.VirtualKeyboard;
import org.midibox.midi.xml.MidiDeviceRoutingXML;
import org.midibox.midi.xml.MidiKeyboardControllerDeviceXML;
import org.midibox.utils.xml.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
public class VirtualKeyboardXML extends XMLUtils {
 
public final static String TAG_ROOT_ELEMENT = "virtualKeyboard";
 
protected VirtualKeyboard virtualKeyboard;
 
public VirtualKeyboardXML(VirtualKeyboard virtualKeyboard,
String rootElementTag) {
 
super(rootElementTag);
 
this.virtualKeyboard = virtualKeyboard;
 
tags.add(MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
tags.add(MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
}
 
protected void parseElement(Element element) {
 
super.parseElement(element);
 
String name = element.getNodeName();
 
if (name == rootElementTag) {
 
} else if (name == MidiDeviceRoutingXML.TAG_ROOT_ELEMENT) {
 
MidiDeviceRoutingXML midiDeviceRoutingXML = new MidiDeviceRoutingXML(
virtualKeyboard.getMidiDeviceRouting(),
MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
 
midiDeviceRoutingXML.loadXML(element);
 
} else if (name == MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT) {
 
MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
virtualKeyboard.getMidiKeyboardControllerDevice(),
MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
 
midiKeyboardControllerDeviceXML.loadXML(element);
}
}
 
public void saveXML(Node node) {
 
super.saveXML(node);
 
MidiDeviceRoutingXML midiDeviceRoutingXML = new MidiDeviceRoutingXML(
virtualKeyboard.getMidiDeviceRouting(),
MidiDeviceRoutingXML.TAG_ROOT_ELEMENT);
 
midiDeviceRoutingXML.saveXML(rootElement);
 
MidiKeyboardControllerDeviceXML midiKeyboardControllerDeviceXML = new MidiKeyboardControllerDeviceXML(
virtualKeyboard.getMidiKeyboardControllerDevice(),
MidiKeyboardControllerDeviceXML.TAG_ROOT_ELEMENT);
 
midiKeyboardControllerDeviceXML.saveXML(rootElement);
}
}
/trunk/java/org/midibox/apps/virtualkeyboard/gui/VirtualKeyboardGUI.java
108,11 → 108,11
 
menuBar.add(fileMenu);
 
fileMenu.removeAll();
JMenu optionsMenu = new JMenu("Options");
 
showConnectionsItem = new JCheckBoxMenuItem("Show Connections",
isShowConnections());
fileMenu.add(showConnectionsItem);
 
showConnectionsItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
setShowConnections(showConnectionsItem.isSelected());
119,9 → 119,10
}
});
 
JMenu optionsMenu = new JMenu("Options");
optionsMenu.add(showConnectionsItem);
 
lookAndFeelMenu = new JMenu("Look & Feel");
 
lookAndFeelMenu.addMenuListener(new MenuListener() {
 
public void menuCanceled(MenuEvent arg0) {
/trunk/java/org/midibox/apps/sidv2editor/gui/SIDV2EditorGUI.java
56,19 → 56,18
import org.midibox.sidlibr.gui.LibraryGUI;
import org.midibox.utils.gui.DialogOwner;
import org.midibox.utils.gui.ImageLoader;
import org.midibox.utils.gui.MyButtonUI;
import org.midibox.utils.gui.MyColoredButtonUI;
import org.midibox.utils.gui.SplitButton;
 
public class SIDV2EditorGUI extends JPanel implements Observer,
ActionListener, ItemListener {
public class SIDV2EditorGUI extends JPanel implements Observer, ActionListener,
ItemListener {
 
JCheckBoxMenuItem cbMenuItem1, cbMenuItem2, cbMenuItem3, cbMenuItem4;
JToggleButton b1, b2, b3, b4;
 
JMenuItem initL, initB, initD, initM, initE;
JButton initButL, initButB, initButD, initButM, initButE;
 
private SIDV2Editor sidv2librarian;
private SIDLibController sidLibController;
 
96,11 → 95,12
// Setup Librarian GUI (table view)
libraryGUI = new LibraryGUI(sidLibController);
add(libraryGUI, BorderLayout.CENTER);
 
sidLibController.addObserver(this);
 
mbsidV2EditorGUI = new MBSIDV2EditorGUI();
mbsidV2EditorGUIDialog = new JDialog(DialogOwner.getFrame(),"MidiBox SID V2 Editor - no patch selected", true);
mbsidV2EditorGUIDialog = new JDialog(DialogOwner.getFrame(),
"MidiBox SID V2 Editor - no patch selected", true);
 
mbsidV2EditorGUIDialog
.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
136,9 → 136,11
 
if (sidv2librarian.getMidiDeviceRouting() != null) {
// Setup midiDevice routing GUI
midiDeviceRoutingGUI = new SIDV2EditorMidiDeviceRoutingGUI(sidv2librarian);
midiDeviceRoutingGUI = new SIDV2EditorMidiDeviceRoutingGUI(
sidv2librarian);
// Setup Midi Routing Dialog
midiRoutingDialog = new JDialog(DialogOwner.getFrame(),"Midi Routing", true);
midiRoutingDialog = new JDialog(DialogOwner.getFrame(),
"Midi Routing", true);
midiRoutingDialog.setContentPane(midiDeviceRoutingGUI);
midiRoutingDialog.pack();
}
149,26 → 151,33
}
 
private void showEditGUI() {
SIDEditController sidEditController = mbsidV2EditorGUI.getSIDEditController();
SIDEditController sidEditController = mbsidV2EditorGUI
.getSIDEditController();
if (sidEditController != null) {
sidEditController.deleteObserver(this);
}
sidv2librarian.reconnectAllDevices(); // java.sound.midi SysEx bug workaround
sidv2librarian.reconnectAllDevices(); // java.sound.midi SysEx bug
// workaround
 
sidEditController = new SIDEditController(sidLibController.getCurrentPatch());
sidEditController = new SIDEditController(sidLibController
.getCurrentPatch());
sidEditController.addObserver(this);
mbsidV2EditorGUI.editThis(sidEditController, sidLibController.getCores());
mbsidV2EditorGUI.editThis(sidEditController, sidLibController
.getCores());
Patch p = mbsidV2EditorGUI.getSIDEditController().getPatch();
if (p.isEnsemble()) {
mbsidV2EditorGUIDialog.setTitle("MidiBox SID V2 Editor - " + "Ensemble " + intToStr3(sidLibController.getCurrentPatchNumber()+1));
mbsidV2EditorGUIDialog.setTitle("MidiBox SID V2 Editor - "
+ "Ensemble "
+ intToStr3(sidLibController.getCurrentPatchNumber() + 1));
} else {
mbsidV2EditorGUIDialog.setTitle("MidiBox SID V2 Editor - " + p.getEngineStr() + " engine: " + p.getPatchName());
mbsidV2EditorGUIDialog.setTitle("MidiBox SID V2 Editor - "
+ p.getEngineStr() + " engine: " + p.getPatchName());
}
mbsidV2EditorGUIDialog.pack();
mbsidV2EditorGUIDialog.setLocationRelativeTo(this);
mbsidV2EditorGUIDialog.setVisible(true);
}
 
private String intToStr3(int i) {
String s = Integer.toString(i);
switch (s.length()) {
190,26 → 199,28
if (object == "Edit") {
showEditGUI();
} else if (object == "Save editor patch") {
sidLibController.setPatchAt(mbsidV2EditorGUI.getSIDEditController().getPatch(), sidLibController.getCurrentPatchNumber(),sidLibController.getCurrentBankNumber());
sidLibController.setPatchAt(mbsidV2EditorGUI.getSIDEditController()
.getPatch(), sidLibController.getCurrentPatchNumber(),
sidLibController.getCurrentBankNumber());
} else if (object == "Cores changes") {
updateCoreEnabling();
updateCoreEnabling();
} else if (object == "Bank changed") {
updateInitEnabling();
}
}
}
 
public void updateCoreEnabling() {
int cores = sidLibController.getCores();
int cores = sidLibController.getCores();
cbMenuItem1.setSelected((cores & 0x01) > 0);
cbMenuItem2.setSelected((cores & 0x02) > 0);
cbMenuItem3.setSelected((cores & 0x04) > 0);
cbMenuItem4.setSelected((cores & 0x08) > 0);
cbMenuItem4.setSelected((cores & 0x08) > 0);
b1.setSelected((cores & 0x01) > 0);
b2.setSelected((cores & 0x02) > 0);
b3.setSelected((cores & 0x04) > 0);
b4.setSelected((cores & 0x08) > 0);
}
 
public void updateInitEnabling() {
boolean b = sidLibController.isEnsembleBank();
initL.setEnabled(!b);
216,7 → 227,7
initB.setEnabled(!b);
initD.setEnabled(!b);
initM.setEnabled(!b);
initE.setEnabled(b);
initE.setEnabled(b);
initButL.setEnabled(!b);
initButB.setEnabled(!b);
initButD.setEnabled(!b);
225,20 → 236,38
}
 
public void itemStateChanged(ItemEvent e) {
if ((e.getItem() == cbMenuItem1) || (e.getItem() == cbMenuItem2) || (e.getItem() == cbMenuItem3) || (e.getItem() == cbMenuItem4)) {
if ((e.getItem() == cbMenuItem1) || (e.getItem() == cbMenuItem2)
|| (e.getItem() == cbMenuItem3) || (e.getItem() == cbMenuItem4)) {
int tempVal = 0;
if (cbMenuItem1.isSelected()) {tempVal += 1;}
if (cbMenuItem2.isSelected()) {tempVal += 2;}
if (cbMenuItem3.isSelected()) {tempVal += 4;}
if (cbMenuItem4.isSelected()) {tempVal += 8;}
if (cbMenuItem1.isSelected()) {
tempVal += 1;
}
if (cbMenuItem2.isSelected()) {
tempVal += 2;
}
if (cbMenuItem3.isSelected()) {
tempVal += 4;
}
if (cbMenuItem4.isSelected()) {
tempVal += 8;
}
sidLibController.setCores(tempVal);
updateCoreEnabling();
} else if ((e.getItem() == b1) || (e.getItem() == b2) || (e.getItem() == b3) || (e.getItem() == b4)) {
} else if ((e.getItem() == b1) || (e.getItem() == b2)
|| (e.getItem() == b3) || (e.getItem() == b4)) {
int tempVal = 0;
if (b1.isSelected()) {tempVal += 1;}
if (b2.isSelected()) {tempVal += 2;}
if (b3.isSelected()) {tempVal += 4;}
if (b4.isSelected()) {tempVal += 8;}
if (b1.isSelected()) {
tempVal += 1;
}
if (b2.isSelected()) {
tempVal += 2;
}
if (b3.isSelected()) {
tempVal += 4;
}
if (b4.isSelected()) {
tempVal += 8;
}
sidLibController.setCores(tempVal);
updateCoreEnabling();
}
335,7 → 364,7
initB.setActionCommand("Init BASSLINE patch");
initB.addActionListener(this);
submenu.add(initB);
 
initD = new JMenuItem("DRUM engine", KeyEvent.VK_P);
initD.setActionCommand("Init DRUM patch");
initD.addActionListener(this);
345,12 → 374,12
initM.setActionCommand("Init MULTI patch");
initM.addActionListener(this);
submenu.add(initM);
 
initE = new JMenuItem("ENSEMBLE", KeyEvent.VK_P);
initE.setActionCommand("Init ensemble");
initE.addActionListener(this);
submenu.add(initE);
 
menuItem = new JMenuItem("Init current bank", KeyEvent.VK_N);
menuItem.setActionCommand("Init current bank");
menuItem.addActionListener(this);
426,18 → 455,16
cbMenuItem4.setMnemonic(KeyEvent.VK_4);
cbMenuItem4.addItemListener(this);
menu.add(cbMenuItem4);
 
/*
menu.addSeparator();
menuItem = new JMenuItem("Scan hardware", KeyEvent.VK_S);
menuItem.setActionCommand("Scan hardware");
menuItem.addActionListener(this);
menu.add(menuItem);
*/
* menu.addSeparator(); menuItem = new JMenuItem("Scan hardware",
* KeyEvent.VK_S); menuItem.setActionCommand("Scan hardware");
* menuItem.addActionListener(this); menu.add(menuItem);
*/
 
updateCoreEnabling();
updateInitEnabling();
 
return menuBar;
}
 
445,30 → 472,37
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
initButL = makeButton("init_lead.png", "Init LEAD patch", "Init LEAD");
initButB = makeButton("init_bassline.png", "Init BASSLINE patch", "Init BASSLINE");
initButB = makeButton("init_bassline.png", "Init BASSLINE patch",
"Init BASSLINE");
initButD = makeButton("init_drum.png", "Init DRUM patch", "Init DRUM");
initButM = makeButton("init_multi.png", "Init MULTI patch", "Init MULTI");
initButE = makeButton("init_ensemble.png", "Init ensemble", "Init ENSEMBLE");
initButM = makeButton("init_multi.png", "Init MULTI patch",
"Init MULTI");
initButE = makeButton("init_ensemble.png", "Init ensemble",
"Init ENSEMBLE");
toolBar.add(initButL);
toolBar.add(initButB);
toolBar.add(initButD);
toolBar.add(initButM);
toolBar.add(initButE);
//toolBar.addSeparator()
 
// toolBar.addSeparator()
toolBar.add(makeButton("cut.png", "Cut", "Cut"));
toolBar.add(makeButton("copy.png", "Copy", "Copy"));
toolBar.add(makeButton("paste.png", "Paste", "Paste"));
//toolBar.addSeparator();
toolBar.add(new SplitButton(makeButton("transmit.png","Transmit patch to buffer", "Transmit patch to buffer"), dropTransmit()));
toolBar.add(new SplitButton(makeButton("receive.png","Receive patch from buffer", "Receive patch from buffer"), dropReceive()));
// toolBar.addSeparator();
toolBar.add(new SplitButton(makeButton("transmit.png",
"Transmit patch to buffer", "Transmit patch to buffer"),
dropTransmit()));
toolBar.add(new SplitButton(makeButton("receive.png",
"Receive patch from buffer", "Receive patch from buffer"),
dropReceive()));
 
// Create and initialize the button.
b1 = new JToggleButton();
b2 = new JToggleButton();
b3 = new JToggleButton();
b4 = new JToggleButton();
 
b1.setUI(new MyColoredButtonUI(ImageLoader
.getImageIcon("pushButton_on.png"), ImageLoader
.getImageIcon("pushButton_off.png"),
489,25 → 523,24
.getImageIcon("pushButton_off.png"),
MyColoredButtonUI.RECTANGLE, Color.GREEN));
 
b1.setToolTipText("Enable core 1");
b2.setToolTipText("Enable core 2");
b3.setToolTipText("Enable core 3");
b4.setToolTipText("Enable core 4");
 
b1.addItemListener(this);
b2.addItemListener(this);
b3.addItemListener(this);
b4.addItemListener(this);
 
toolBar.add(b1);
toolBar.add(b2);
toolBar.add(b3);
toolBar.add(b4);
toolBar.add(b4);
 
return toolBar;
}
 
public JMenu getFileMenu() {
return fileMenu;
}
520,7 → 553,8
midiRoutingDialog.setVisible(true);
}
 
protected JButton makeButton(String imageName, String actionCommand, String toolTipText) {
protected JButton makeButton(String imageName, String actionCommand,
String toolTipText) {
// Create and initialize the button.
ImageIcon icon = ImageLoader.getImageIcon(imageName);
int s = Math.max(icon.getIconWidth(), icon.getIconHeight()) + 4;
533,7 → 567,7
button.setFocusPainted(false);
return button;
}
 
protected JPopupMenu dropTransmit() {
JPopupMenu toolbarMenu = new JPopupMenu();
 
/trunk/java/org/midibox/apps/sidv2editor/SIDV2Editor.java
109,8 → 109,10
// SysEx (string length doesn't reset)
// bug in the javax.sound.midi class
if (midiDeviceRouting != null) {
midiDeviceRouting.disconnectDevices(inputMidiDevice, localMidiDevice);
midiDeviceRouting.disconnectDevices(localMidiDevice, outputMidiDevice);
midiDeviceRouting.disconnectDevices(inputMidiDevice,
localMidiDevice);
midiDeviceRouting.disconnectDevices(localMidiDevice,
outputMidiDevice);
midiDeviceRouting.connectDevices(inputMidiDevice, localMidiDevice);
midiDeviceRouting.connectDevices(localMidiDevice, outputMidiDevice);
}
/trunk/java/org/midibox/sidedit/EngineSpecs.java
37,10 → 37,18
public static Vector getEngine(Patch patch) {
Vector engine = new Vector();
if (patch.isEnsemble()) {
engine.add(EnsembleSpecs.createENSSID(patch, 0)); // 1: Ensemble settings for SID1
engine.add(EnsembleSpecs.createENSSID(patch, 64)); // 2: Ensemble settings for SID2
engine.add(EnsembleSpecs.createENSSID(patch, 128)); // 3: Ensemble settings for SID3
engine.add(EnsembleSpecs.createENSSID(patch, 192)); // 4: Ensemble settings for SID4
engine.add(EnsembleSpecs.createENSSID(patch, 0)); // 1: Ensemble
// settings for
// SID1
engine.add(EnsembleSpecs.createENSSID(patch, 64)); // 2: Ensemble
// settings for
// SID2
engine.add(EnsembleSpecs.createENSSID(patch, 128)); // 3: Ensemble
// settings for
// SID3
engine.add(EnsembleSpecs.createENSSID(patch, 192)); // 4: Ensemble
// settings for
// SID4
} else {
if (patch.getEngine() == patch.LEAD) {
// Lead engine
57,29 → 65,40
engine.add(createVoice(patch, 48)); // 8: Voice 4 Right
engine.add(createVoice(patch, 64)); // 9: Voice 5 Right
engine.add(createVoice(patch, 80)); // 10: Voice 6 Right
engine.add(LeadSpecs.createLFO(patch)); // 11: LFO's
engine.add(LeadSpecs.createENV(patch, 0)); // 12: Envelope 1
engine.add(LeadSpecs.createLFO(patch)); // 11: LFO's
engine.add(LeadSpecs.createENV(patch, 0)); // 12: Envelope 1
engine.add(LeadSpecs.createENV(patch, 16)); // 13: Envelope 2
engine.add(LeadSpecs.createMOD(patch)); // 14: Modulation paths
engine.add(LeadSpecs.createTRIG(patch)); // 15: Trigger matrix
engine.add(LeadSpecs.createWT(patch)); // 16: Wavetable sequencer
engine.add(LeadSpecs.createMOD(patch)); // 14: Modulation paths
engine.add(LeadSpecs.createTRIG(patch)); // 15: Trigger matrix
engine.add(LeadSpecs.createWT(patch)); // 16: Wavetable
// sequencer
} else if (patch.getEngine() == patch.BASSLINE) {
// Bassline
engine.add(createGlobal(patch, SIDSysexInfo.basslineParams));// 0: Global parameters
engine.add(createExt(patch)); // 1: External parameters
engine.add(createFilter(patch, 0)); // 2: Filter Left
engine.add(createFilter(patch, 6)); // 3: Filter right
engine.add(createVoice(patch, 0)); // 4: Left Oscillator
engine.add(createVoice(patch, 80)); // 5: Right Oscillator
engine.add(BasslineSpecs.createMSTRBOTH(patch));// 6: Right Oscillator
engine.add(BasslineSpecs.createMSTR(patch, 0)); // 7: Left master set
engine.add(BasslineSpecs.createMSTR(patch, 80));// 8: Right master set
engine.add(BasslineSpecs.createLFO(patch, 0)); // 9: Left LFO's
engine.add(BasslineSpecs.createLFO(patch, 80)); // 10: Right LFO's
engine.add(BasslineSpecs.createENV(patch, 0)); // 11: Left Envelope
engine.add(BasslineSpecs.createENV(patch, 80)); // 12: Right Envelope
engine.add(BasslineSpecs.createSEQ(patch, 0)); // 13: Left Sequencer
engine.add(BasslineSpecs.createSEQ(patch, 80)); // 14: Right Sequencer
engine.add(createGlobal(patch, SIDSysexInfo.basslineParams));// 0:
// Global
// parameters
engine.add(createExt(patch)); // 1: External parameters
engine.add(createFilter(patch, 0)); // 2: Filter Left
engine.add(createFilter(patch, 6)); // 3: Filter right
engine.add(createVoice(patch, 0)); // 4: Left Oscillator
engine.add(createVoice(patch, 80)); // 5: Right Oscillator
engine.add(BasslineSpecs.createMSTRBOTH(patch));// 6: Right
// Oscillator
engine.add(BasslineSpecs.createMSTR(patch, 0)); // 7: Left
// master set
engine.add(BasslineSpecs.createMSTR(patch, 80));// 8: Right
// master set
engine.add(BasslineSpecs.createLFO(patch, 0)); // 9: Left LFO's
engine.add(BasslineSpecs.createLFO(patch, 80)); // 10: Right
// LFO's
engine.add(BasslineSpecs.createENV(patch, 0)); // 11: Left
// Envelope
engine.add(BasslineSpecs.createENV(patch, 80)); // 12: Right
// Envelope
engine.add(BasslineSpecs.createSEQ(patch, 0)); // 13: Left
// Sequencer
engine.add(BasslineSpecs.createSEQ(patch, 80)); // 14: Right
// Sequencer
engine.add(BasslineSpecs.createSEQData(patch)); // 15: Sequencer
// data
} else if (patch.getEngine() == patch.DRUM) {
90,7 → 109,8
engine.add(createExt(patch)); // 1: External parameters
engine.add(createFilter(patch, 0)); // 2: Filter Left
engine.add(createFilter(patch, 6)); // 3: Filter right
engine.add(DrumSpecs.createDrumInstr(patch)); // 4: Drum Instruments
engine.add(DrumSpecs.createDrumInstr(patch)); // 4: Drum
// Instruments
engine.add(DrumSpecs.createSEQ(patch)); // 5: Sequencer
engine.add(DrumSpecs.createSEQData(patch)); // 6: Sequencer data
} else if (patch.getEngine() == patch.MULTI) {
109,37 → 129,58
engine.add(createVoice(patch, 240)); // 9: Inst.6 Voice
engine.add(MultiSpecs.createInstrument(patch, 0)); // 10: Inst.1
// Rest
engine.add(MultiSpecs.createInstrument(patch, 48)); // 11: Inst.2
engine.add(MultiSpecs.createInstrument(patch, 48)); // 11:
// Inst.2
// Rest
engine.add(MultiSpecs.createInstrument(patch, 96)); // 12: Inst.3
engine.add(MultiSpecs.createInstrument(patch, 96)); // 12:
// Inst.3
// Rest
engine.add(MultiSpecs.createInstrument(patch, 144)); // 13: Inst.4
engine.add(MultiSpecs.createInstrument(patch, 144)); // 13:
// Inst.4
// Rest
engine.add(MultiSpecs.createInstrument(patch, 192)); // 14: Inst.5
engine.add(MultiSpecs.createInstrument(patch, 192)); // 14:
// Inst.5
// Rest
engine.add(MultiSpecs.createInstrument(patch, 240)); // 15: Inst.6
engine.add(MultiSpecs.createInstrument(patch, 240)); // 15:
// Inst.6
// Rest
engine.add(MultiSpecs.createWTdata(patch)); // 16: Wavetable data
engine.add(MultiSpecs.createWTdata(patch)); // 16: Wavetable
// data
}
}
return engine;
}
 
private static Vector createGlobal(Patch patch, String[] engineParams) {
Vector globalControl = new Vector();
 
globalControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.sidRestrict, 0, patch, 17, 0, 2, "SID type", "SID chip type to be used"));
globalControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.monoStereo, 0, patch, 17, 3, 1, "Stereo", "To be used in stereo"));
globalControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.caps, 0, patch, 17, 4, 4, "Filter caps", "Type of filter capacitors to be used"));
globalControl.add(new SIDSysexParameterControl(button, null, 0, patch, 18, 0, 1, "ABW", "Workaround for the SID's ADSR-bug"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 82, 0, 7, "Volume"));
globalControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.sidRestrict, 0, patch, 17, 0, 2, "SID type",
"SID chip type to be used"));
globalControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.monoStereo, 0, patch, 17, 3, 1, "Stereo",
"To be used in stereo"));
globalControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.caps, 0, patch, 17, 4, 4, "Filter caps",
"Type of filter capacitors to be used"));
globalControl.add(new SIDSysexParameterControl(button, null, 0, patch,
18, 0, 1, "ABW", "Workaround for the SID's ADSR-bug"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
82, 0, 7, "Volume"));
 
for (int c = 0; c < 8; c++) {
globalControl.add(new SIDSysexParameterControl(combo, engineParams, 0, patch, 24 + (5 * c), 0, 8, "Assign 1", "Assign this control to a parameter"));
globalControl.add(new SIDSysexParameterControl(combo, engineParams, 0, patch, 25 + (5 * c), 0, 8, "Assign 2", "Assign this control to a parameter"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 26 + (5 * c), 0, 8, "Init.", "Initial value"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 27 + (5 * c), 0, 8, "Min.", "Minimum value"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 28 + (5 * c), 0, 8, "Max.", "Maximum value"));
globalControl.add(new SIDSysexParameterControl(combo, engineParams,
0, patch, 24 + (5 * c), 0, 8, "Assign 1",
"Assign this control to a parameter"));
globalControl.add(new SIDSysexParameterControl(combo, engineParams,
0, patch, 25 + (5 * c), 0, 8, "Assign 2",
"Assign this control to a parameter"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 26 + (5 * c), 0, 8, "Init.", "Initial value"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 27 + (5 * c), 0, 8, "Min.", "Minimum value"));
globalControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 28 + (5 * c), 0, 8, "Max.", "Maximum value"));
}
 
return globalControl;
148,56 → 189,108
private static Vector createVoice(Patch patch, int offset) {
Vector voiceControl = new Vector();
// Single voice
voiceControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.porta, 0, patch, 96 + offset, 0, 2, "Portamento", "Portamento type"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 96 + offset, 2, 1, "GAE", "Gate Always Enabled"));
voiceControl.add(new SIDSysexParameterControl(waveselect, null, 0, patch, 97 + offset, 0, 8, "Waveform", "Select a waveform"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 98 + offset, 4, 4, "Attack", "SID's DCA Attack rate"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 98 + offset, 0, 4, "Decay", "SID's DCA Decay rate"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 99 + offset, 4, 4, "Sustain", "SID's DCA Sustain level"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 99 + offset, 0, 4, "Release", "SID's DCA Release rate"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 100 + offset, 0, 12, "Pulse Width", "Pulse Width"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 102 + offset, 0, 8, "Accent", "Bassline Accent")); // SwinSID
voiceControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.porta, 0, patch, 96 + offset, 0, 2, "Portamento",
"Portamento type"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
96 + offset, 2, 1, "GAE", "Gate Always Enabled"));
voiceControl.add(new SIDSysexParameterControl(waveselect, null, 0,
patch, 97 + offset, 0, 8, "Waveform", "Select a waveform"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
98 + offset, 4, 4, "Attack", "SID's DCA Attack rate"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
98 + offset, 0, 4, "Decay", "SID's DCA Decay rate"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
99 + offset, 4, 4, "Sustain", "SID's DCA Sustain level"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
99 + offset, 0, 4, "Release", "SID's DCA Release rate"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
100 + offset, 0, 12, "Pulse Width", "Pulse Width"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
102 + offset, 0, 8, "Accent", "Bassline Accent")); // SwinSID
// Phase...
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 103 + offset, 0, 8, "Delay", "DCA Envelope delay"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, -64, patch, 104 + offset, 0, 7, "Transpose"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 105 + offset, 0, 8, "Finetune"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 106 + offset, 0, 7, "Pitchrange", "Range of the Pitch Bender"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 107 + offset, 0, 8, "Porta. Rate", "Portamento speed"));
voiceControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
103 + offset, 0, 8, "Delay", "DCA Envelope delay"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, -64, patch,
104 + offset, 0, 7, "Transpose"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 105 + offset, 0, 8, "Finetune"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
106 + offset, 0, 7, "Pitchrange", "Range of the Pitch Bender"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
107 + offset, 0, 8, "Porta. Rate", "Portamento speed"));
// Arpeggiator
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 108 + offset, 0, 1, "Arp On/Off", "Enables/disables the arpeggiator"));
voiceControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.direction, 0,patch, 108 + offset, 1, 3, "Direction", "Direction of the arpeggio"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 108 + offset, 4, 1, "Sorted", "Sort notes"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 108 + offset, 5, 1, "Hold", "Hold the last arpeggio"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 108 + offset, 6, 1, "Key Sync", "Synchronize with key presses"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 108 + offset, 7, 1, "Constant Cycle", "Constant arpeggiator cycle"));
voiceControl.add(new SIDSysexParameterControl(rotary, createDividers(), 0, patch, 109 + offset, 0, 6, "Speed Divider", "Speed divider (sets the tempo)"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 109 + offset, 6, 1, "Easy Chord")); // 21
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 109 + offset, 7, 1, "Oneshot")); // 22
voiceControl.add(new SIDSysexParameterControl(rotary, createGatelength(), 0, patch, 110 + offset, 0, 5, "Gatelength")); // 23
voiceControl.add(new SIDSysexParameterControl(rotary, null, 1, patch, 110 + offset, 5, 3, "Octave Range")); // 24
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
108 + offset, 0, 1, "Arp On/Off",
"Enables/disables the arpeggiator"));
voiceControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.direction, 0, patch, 108 + offset, 1, 3,
"Direction", "Direction of the arpeggio"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
108 + offset, 4, 1, "Sorted", "Sort notes"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
108 + offset, 5, 1, "Hold", "Hold the last arpeggio"));
voiceControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
108 + offset, 6, 1, "Key Sync",
"Synchronize with key presses"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
108 + offset, 7, 1, "Constant Cycle",
"Constant arpeggiator cycle"));
voiceControl.add(new SIDSysexParameterControl(rotary, createDividers(),
0, patch, 109 + offset, 0, 6, "Speed Divider",
"Speed divider (sets the tempo)"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
109 + offset, 6, 1, "Easy Chord")); // 21
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
109 + offset, 7, 1, "Oneshot")); // 22
voiceControl
.add(new SIDSysexParameterControl(rotary, createGatelength(),
0, patch, 110 + offset, 0, 5, "Gatelength")); // 23
voiceControl.add(new SIDSysexParameterControl(rotary, null, 1, patch,
110 + offset, 5, 3, "Octave Range")); // 24
// SwinSID
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 111 + offset, 0, 4, "Waveform OSC2", "Waveform of second oscillator"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 111 + offset, 4, 1, "Enable OSC2", "Enable second oscillator"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 111 + offset, 5, 1, "x2 pitch", "scale pitch"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch, 111 + offset, 6, 1, "Rev. Waveform", "Reverse Waveform"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 102 + offset, 0, 8, "Phase"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
111 + offset, 0, 4, "Waveform OSC2",
"Waveform of second oscillator"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
111 + offset, 4, 1, "Enable OSC2", "Enable second oscillator"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
111 + offset, 5, 1, "x2 pitch", "scale pitch"));
voiceControl.add(new SIDSysexParameterControl(button, null, 0, patch,
111 + offset, 6, 1, "Rev. Waveform", "Reverse Waveform"));
voiceControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
102 + offset, 0, 8, "Phase"));
return voiceControl;
}
 
private static Vector createFilter(Patch patch, int offset) {
Vector filterControl = new Vector();
filterControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 85 + offset, 0, 12, "Cutoff", "Cutoff frequency"));
filterControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 87 + offset, 0, 8, "Resonance"));
filterControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 88 + offset, 0, 8, "Keytrack", "Key tracking"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 0, 1, "OSC1->Filt", "OSC1 routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 1, 1, "OSC2->Filt", "OSC2 routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 2, 1, "OSC3->Filt", "OSC3 routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 3, 1, "EXT->Filter", "External input routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 4, 1, "Low Pass", "Low pass filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 5, 1, "Band Pass", "Band pass filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 6, 1, "High Pass", "High pass filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 84 + offset, 7, 1, "OSC3 off", "Turn off oscillator 3"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch, 86 + offset, 7, 1, "FIP", "Filter Interpolation"));
filterControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
85 + offset, 0, 12, "Cutoff", "Cutoff frequency"));
filterControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
87 + offset, 0, 8, "Resonance"));
filterControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
88 + offset, 0, 8, "Keytrack", "Key tracking"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 0, 1, "OSC1->Filt", "OSC1 routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 1, 1, "OSC2->Filt", "OSC2 routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 2, 1, "OSC3->Filt", "OSC3 routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 3, 1, "EXT->Filter",
"External input routed through filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 4, 1, "Low Pass", "Low pass filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 5, 1, "Band Pass", "Band pass filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 6, 1, "High Pass", "High pass filter"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
84 + offset, 7, 1, "OSC3 off", "Turn off oscillator 3"));
filterControl.add(new SIDSysexParameterControl(button, null, 0, patch,
86 + offset, 7, 1, "FIP", "Filter Interpolation"));
return filterControl;
}
 
204,23 → 297,39
private static Vector createExt(Patch patch) {
Vector extControl = new Vector();
// External switches 1-8
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 7, 1, "Switch 1", "External Switch 1"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 6, 1, "Switch 2", "External Switch 2"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 5, 1, "Switch 3", "External Switch 3"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 4, 1, "Switch 4", "External Switch 4"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 3, 1, "Switch 5", "External Switch 5"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 2, 1, "Switch 6", "External Switch 6"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 1, 1, "Switch 7", "External Switch 7"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20, 0, 1, "Switch 8", "External Switch 8"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
7, 1, "Switch 1", "External Switch 1"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
6, 1, "Switch 2", "External Switch 2"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
5, 1, "Switch 3", "External Switch 3"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
4, 1, "Switch 4", "External Switch 4"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
3, 1, "Switch 5", "External Switch 5"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
2, 1, "Switch 6", "External Switch 6"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
1, 1, "Switch 7", "External Switch 7"));
extControl.add(new SIDSysexParameterControl(button, null, 0, patch, 20,
0, 1, "Switch 8", "External Switch 8"));
// External Parameter CV 1-8
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 64, 0, 16, "Ext.CV 1", "External Parameter CV 1"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 66, 0, 16, "Ext.CV 2", "External Parameter CV 2"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 68, 0, 16, "Ext.CV 3", "External Parameter CV 3"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 70, 0, 16, "Ext.CV 4", "External Parameter CV 4"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 72, 0, 16, "Ext.CV 5", "External Parameter CV 5"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 74, 0, 16, "Ext.CV 6", "External Parameter CV 6"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 76, 0, 16, "Ext.CV 7", "External Parameter CV 7"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 78, 0, 16, "Ext.CV 8", "External Parameter CV 8"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 64,
0, 16, "Ext.CV 1", "External Parameter CV 1"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 66,
0, 16, "Ext.CV 2", "External Parameter CV 2"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 68,
0, 16, "Ext.CV 3", "External Parameter CV 3"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 70,
0, 16, "Ext.CV 4", "External Parameter CV 4"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 72,
0, 16, "Ext.CV 5", "External Parameter CV 5"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 74,
0, 16, "Ext.CV 6", "External Parameter CV 6"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 76,
0, 16, "Ext.CV 7", "External Parameter CV 7"));
extControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 78,
0, 16, "Ext.CV 8", "External Parameter CV 8"));
return extControl;
}
 
/trunk/java/org/midibox/sidedit/LeadSpecs.java
36,11 → 36,16
 
public static Vector createMSTR(Patch patch) {
Vector leadControl = new Vector();
leadControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 0, 1, "Legato"));
leadControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 2, 1, "Fingered Portamento"));
leadControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 1, 1, "Wavetable only"));
leadControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 81, 0, 8, "Detune", "Detune oscillators"));
leadControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 83, 0, 8, "Phase Offset", "Oscillators phase offset "));
leadControl.add(new SIDSysexParameterControl(button, null, 0, patch,
80, 0, 1, "Legato"));
leadControl.add(new SIDSysexParameterControl(button, null, 0, patch,
80, 2, 1, "Fingered Portamento"));
leadControl.add(new SIDSysexParameterControl(button, null, 0, patch,
80, 1, 1, "Wavetable only"));
leadControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
81, 0, 8, "Detune", "Detune oscillators"));
leadControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
83, 0, 8, "Phase Offset", "Oscillators phase offset "));
return leadControl;
}
 
48,15 → 53,27
Vector lfoControl = new Vector();
// LFO
for (int c = 0; c < 6; c++) {
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 192 + (5 * c), 0, 1, "On/Off", "Enable/disable LFO"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 192 + (5 * c), 2, 1, "MIDI Sync", "Global clock synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 192 + (5 * c), 3, 1, "Oneshot", "Oneshot mode"));
lfoControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch, 192 + (5 * c), 4, 4, "Waveform", "Select a waveform"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 193 + (5 * c), 0, 8, "Depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 194 + (5 * c), 0, 8, "Rate"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 195 + (5 * c), 0, 8, "Delay"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 196 + (5 * c), 0, 8, "Phase"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 321, (2 + c), 1, "Key Sync", "Reset LFO at key press"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
192 + (5 * c), 0, 1, "On/Off", "Enable/disable LFO"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
192 + (5 * c), 2, 1, "MIDI Sync",
"Global clock synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
192 + (5 * c), 3, 1, "Oneshot", "Oneshot mode"));
lfoControl
.add(new SIDSysexParameterControl(lfoselect, null, 0,
patch, 192 + (5 * c), 4, 4, "Waveform",
"Select a waveform"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 193 + (5 * c), 0, 8, "Depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
194 + (5 * c), 0, 8, "Rate"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
195 + (5 * c), 0, 8, "Delay"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
196 + (5 * c), 0, 8, "Phase"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
321, (2 + c), 1, "Key Sync", "Reset LFO at key press"));
}
return lfoControl;
}
64,24 → 81,46
public static Vector createENV(Patch patch, int offset) {
Vector envControl = new Vector();
// Envelope
envControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.loop, 0, patch, 224 + offset, 0, 3, "Loop Begin", "Envelope loop begin point"));
envControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.loop, 0, patch, 224 + offset, 4, 3, "Loop End", "Envelope loop end point"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch, 224 + offset, 7, 1, "MIDI Sync", "Global clock synchronisation"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 225 + offset, 0, 8, "Depth"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 226 + offset, 0, 8, "Delay"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 227 + offset, 0, 8, "Attack1", "Attack1 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 228 + offset, 0, 8, "Attack Lvl", "Attack Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 229 + offset, 0, 8, "Attack2", "Attack2 Rate"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 230 + offset, 0, 8, "Decay1", "Decay1 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 231 + offset, 0, 8, "Decay Lvl", "Decay Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 232 + offset, 0, 8, "Decay2", "Decay2 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 233 + offset, 0, 8, "Sustain Lvl", "Sustain Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 234 + offset, 0, 8, "Release1", "Release1 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 235 + offset, 0, 8, "Release Lvl", "Release Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 236 + offset, 0, 8, "Release2", "Release2 Rate"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 237 + offset, 0, 8, "Att.Curve", "Attack Curve"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 238 + offset, 0, 8, "Dec.Curve", "Decay Curve"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 239 + offset, 0, 8, "Rel.Curve", "Release Curve"));
envControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.loop,
0, patch, 224 + offset, 0, 3, "Loop Begin",
"Envelope loop begin point"));
envControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.loop,
0, patch, 224 + offset, 4, 3, "Loop End",
"Envelope loop end point"));
envControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
224 + offset, 7, 1, "MIDI Sync",
"Global clock synchronisation"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
225 + offset, 0, 8, "Depth"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
226 + offset, 0, 8, "Delay"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
227 + offset, 0, 8, "Attack1", "Attack1 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
228 + offset, 0, 8, "Attack Lvl", "Attack Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
229 + offset, 0, 8, "Attack2", "Attack2 Rate"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
230 + offset, 0, 8, "Decay1", "Decay1 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
231 + offset, 0, 8, "Decay Lvl", "Decay Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
232 + offset, 0, 8, "Decay2", "Decay2 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
233 + offset, 0, 8, "Sustain Lvl", "Sustain Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
234 + offset, 0, 8, "Release1", "Release1 Rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
235 + offset, 0, 8, "Release Lvl", "Release Level"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
236 + offset, 0, 8, "Release2", "Release2 Rate"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
237 + offset, 0, 8, "Att.Curve", "Attack Curve"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
238 + offset, 0, 8, "Dec.Curve", "Decay Curve"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
239 + offset, 0, 8, "Rel.Curve", "Release Curve"));
return envControl;
}
 
89,30 → 128,73
Vector modControl = new Vector();
// Modulation paths
for (int c = 0; c < 8; c++) {
modControl.add(new SIDSysexParameterControl(combo, createSrcStr(), 0, patch, 256 + (8 * c), 0, 8, "Source 1"));
modControl.add(new SIDSysexParameterControl(combo, createSrcStr(), 0, patch, 257 + (8 * c), 0, 8, "Source 2"));
modControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.operatorNames, 0, patch, 258 + (8 * c), 0, 4, "Operator"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 258 + (8 * c), 6, 1, "Invert 1/L", "Invert target 1/L"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 258 + (8 * c), 7, 1, "Invert 2/R", "Invert target 2/R"));
modControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 259 + (8 * c), 0, 8, "Depth"));
modControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.tgtNames, 0, patch, 262 + (8 * c), 0, 8, "Target 1"));
modControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.tgtNames, 0, patch, 263 + (8 * c), 0, 8, "Target 2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 0, 1, "V1 Pitch", "Direct assignment to pitch of left OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 1, 1, "V2 Pitch", "Direct assignment to pitch of left OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 2, 1, "V3 Pitch", "Direct assignment to pitch of left OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 3, 1, "V1 PWM", "Direct assignment to pulse width of left OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 4, 1, "V2 PWM", "Direct assignment to pulse width of left OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 5, 1, "V3 PWM", "Direct assignment to pulse width of left OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 6, 1, "Cutoff L", "Direct assignment to filter cutoff of left SID"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 7, 1, "Volume L", "Direct assignment to volume of left SID"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 0, 1, "V4 Pitch", "Direct assignment to pitch of right OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 1, 1, "V5 Pitch", "Direct assignment to pitch of right OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 2, 1, "V6 Pitch", "Direct assignment to pitch of right OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 3, 1, "V4 PW", "Direct assignment to pulse width of right OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 4, 1, "V5 PW", "Direct assignment to pulse width of right OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 5, 1, "V6 PW", "Direct assignment to pulse width of right OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 6, 1, "Cutoff R", "Direct assignment to filter cutoff of right SID"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 7, 1, "Volume R", "Direct assignment to volume of right SID"));
modControl.add(new SIDSysexParameterControl(combo, createSrcStr(),
0, patch, 256 + (8 * c), 0, 8, "Source 1"));
modControl.add(new SIDSysexParameterControl(combo, createSrcStr(),
0, patch, 257 + (8 * c), 0, 8, "Source 2"));
modControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.operatorNames, 0, patch, 258 + (8 * c), 0, 4,
"Operator"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
258 + (8 * c), 6, 1, "Invert 1/L", "Invert target 1/L"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
258 + (8 * c), 7, 1, "Invert 2/R", "Invert target 2/R"));
modControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 259 + (8 * c), 0, 8, "Depth"));
modControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.tgtNames, 0, patch, 262 + (8 * c), 0, 8,
"Target 1"));
modControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.tgtNames, 0, patch, 263 + (8 * c), 0, 8,
"Target 2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 0, 1, "V1 Pitch",
"Direct assignment to pitch of left OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 1, 1, "V2 Pitch",
"Direct assignment to pitch of left OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 2, 1, "V3 Pitch",
"Direct assignment to pitch of left OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 3, 1, "V1 PWM",
"Direct assignment to pulse width of left OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 4, 1, "V2 PWM",
"Direct assignment to pulse width of left OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 5, 1, "V3 PWM",
"Direct assignment to pulse width of left OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 6, 1, "Cutoff L",
"Direct assignment to filter cutoff of left SID"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
260 + (8 * c), 7, 1, "Volume L",
"Direct assignment to volume of left SID"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 0, 1, "V4 Pitch",
"Direct assignment to pitch of right OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 1, 1, "V5 Pitch",
"Direct assignment to pitch of right OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 2, 1, "V6 Pitch",
"Direct assignment to pitch of right OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 3, 1, "V4 PW",
"Direct assignment to pulse width of right OSC1"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 4, 1, "V5 PW",
"Direct assignment to pulse width of right OSC2"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 5, 1, "V6 PW",
"Direct assignment to pulse width of right OSC3"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 6, 1, "Cutoff R",
"Direct assignment to filter cutoff of right SID"));
modControl.add(new SIDSysexParameterControl(button, null, 0, patch,
261 + (8 * c), 7, 1, "Volume R",
"Direct assignment to volume of right SID"));
}
return modControl;
}
121,30 → 203,54
Vector trigControl = new Vector();
// Trigger matrix
for (int c = 0; c < 14; c++) {
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 0, 1, "OSC1 Left Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 1, 1, "OSC2 Left Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 2, 1, "OSC3 Left Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 3, 1, "OSC1 Right Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 4, 1, "OSC2 Right Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 5, 1, "OSC3 Right Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 6, 1, "ENV1 Attack"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 7, 1, "ENV2 Attack"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 0, 1, "ENV1 Release"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 1, 1, "ENV2 Release"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 2, 1, "LFO1 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 3, 1, "LFO2 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 4, 1, "LFO3 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 5, 1, "LFO4 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 6, 1, "LFO5 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 7, 1, "LFO6 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 0, 1, "WT1 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 1, 1, "WT2 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 2, 1, "WT3 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 3, 1, "WT4 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 4, 1, "WT1 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 5, 1, "WT2 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 6, 1, "WT3 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 7, 1, "WT4 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 0, 1, "OSC1 Left Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 1, 1, "OSC2 Left Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 2, 1, "OSC3 Left Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 3, 1, "OSC1 Right Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 4, 1, "OSC2 Right Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 5, 1, "OSC3 Right Ch"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 6, 1, "ENV1 Attack"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 320 + (3 * c), 7, 1, "ENV2 Attack"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 0, 1, "ENV1 Release"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 1, 1, "ENV2 Release"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 2, 1, "LFO1 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 3, 1, "LFO2 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 4, 1, "LFO3 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 5, 1, "LFO4 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 6, 1, "LFO5 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 321 + (3 * c), 7, 1, "LFO6 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 0, 1, "WT1 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 1, 1, "WT2 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 2, 1, "WT3 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 3, 1, "WT4 Reset"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 4, 1, "WT1 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 5, 1, "WT2 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 6, 1, "WT3 Step"));
trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0,
patch, 322 + (3 * c), 7, 1, "WT4 Step"));
}
return trigControl;
}
153,19 → 259,38
Vector wtControl = new Vector();
// Wavetable sequencer
for (int c = 0; c < 4; c++) {
wtControl.add(new SIDSysexParameterControl(rotary, createDividers(), 0, patch, 364 + (5 * c), 0, 6, "Clock Divider", "Clock divider (sets tempo)"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch, 364 + (5 * c), 6, 1, "To Left Ch", "Parameter forwarded to left channel"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch, 364 + (5 * c), 7, 1, "To Right Ch", "Parameter forwarded to right channel"));
wtControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.leadParams, 0, patch, 365 + (5 * c), 0, 8, "Assign", "Parameter assignment"));
wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 366 + (5 * c), 0, 7, "Start Pos", "Start position in wavetable"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch, 366 + (5 * c), 7, 1, "Pos Ctrl by MP", "Position controlled by modulation path"));
wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 367 + (5 * c), 0, 7, "End Pos", "End position in wavetable"));
wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 368 + (5 * c), 0, 7, "Loop Pos", "Loop position in wavetable"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch, 368 + (5 * c), 7, 1, "Oneshot"));
wtControl.add(new SIDSysexParameterControl(rotary,
createDividers(), 0, patch, 364 + (5 * c), 0, 6,
"Clock Divider", "Clock divider (sets tempo)"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,
364 + (5 * c), 6, 1, "To Left Ch",
"Parameter forwarded to left channel"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,
364 + (5 * c), 7, 1, "To Right Ch",
"Parameter forwarded to right channel"));
wtControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.leadParams, 0, patch, 365 + (5 * c), 0, 8,
"Assign", "Parameter assignment"));
wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
366 + (5 * c), 0, 7, "Start Pos",
"Start position in wavetable"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,
366 + (5 * c), 7, 1, "Pos Ctrl by MP",
"Position controlled by modulation path"));
wtControl
.add(new SIDSysexParameterControl(rotary, null, 0, patch,
367 + (5 * c), 0, 7, "End Pos",
"End position in wavetable"));
wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
368 + (5 * c), 0, 7, "Loop Pos",
"Loop position in wavetable"));
wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,
368 + (5 * c), 7, 1, "Oneshot"));
}
// Wavetable data
for (int c = 0; c < 128; c++) {
wtControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 384 + c, 0, 8, Integer.toString(c)));
wtControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
384 + c, 0, 8, Integer.toString(c)));
}
return wtControl;
}
/trunk/java/org/midibox/sidedit/gui/bassline/SequencerGUI.java
25,7 → 25,6
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;
37,7 → 36,6
import javax.swing.JPanel;
import javax.swing.JRadioButton;
 
import org.midibox.sidedit.SIDSysexInfo;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlKnob;
 
63,7 → 61,9
JPanel comboPanel = new JPanel();
comboPanel.setLayout(new BoxLayout(comboPanel, BoxLayout.Y_AXIS));
comboPanel.setOpaque(false);
String[] s = { "Sequence #1", "Sequence #2", "Sequence #3", "Sequence #4", "Sequence #5", "Sequence #6", "Sequence #7", "Sequence #8" };
String[] s = { "Sequence #1", "Sequence #2", "Sequence #3",
"Sequence #4", "Sequence #5", "Sequence #6", "Sequence #7",
"Sequence #8" };
ButtonGroup bg = new ButtonGroup();
radioButtons = new JRadioButton[s.length];
for (int i = 0; i < s.length; i++) {
109,8 → 109,8
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
configPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(0), c);
c.gridy = 0;
configPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(0), c);
c.gridx = 1;
c.gridy = 0;
c.gridwidth = 2;
120,7 → 120,7
c.gridwidth = 1;
configPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(1), c);
c.gridx = 0;
c.gridy = 1;
c.gridy = 1;
configPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(3), c);
c.gridx = 1;
c.gridy = 1;
165,8 → 165,13
seqPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(row
+ (6 * col) + offset), c);
if (row == 0) {
((SIDSysexParameterControlKnob) vGUI.elementAt(row + (6 * col) + offset)).setSnapVals(new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12},new String[]{"C","C#","D","D#","E","F","F#","G","G#","A","A#","B","C+"});
((SIDSysexParameterControlKnob) vGUI.elementAt(row + (6 * col) + offset)).setSnap(true);
((SIDSysexParameterControlKnob) vGUI.elementAt(row
+ (6 * col) + offset)).setSnapVals(new int[] { 0,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 },
new String[] { "C", "C#", "D", "D#", "E", "F",
"F#", "G", "G#", "A", "A#", "B", "C+" });
((SIDSysexParameterControlKnob) vGUI.elementAt(row
+ (6 * col) + offset)).setSnap(true);
}
}
}
/trunk/java/org/midibox/sidedit/gui/bassline/OscillatorGUI.java
63,7 → 63,7
JPanel panel4 = new JPanel();
panel4.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
panel4.setOpaque(false);
 
panel1.add(panel2);
panel1.add(panel3);
 
91,7 → 91,7
subPanelL.add((SIDSysexParameterControlGUI) vGUIL.elementAt(2));
subPanelL.add((SIDSysexParameterControlGUI) vGUIL.elementAt(3));
globPanel.add(subPanelL);
 
JPanel subPanelC = new JPanel();
subPanelC.setLayout(new GridLayout(1, 2));
subPanelC.setOpaque(false);
/trunk/java/org/midibox/sidedit/gui/bassline/BasslineGUI.java
23,7 → 23,6
import java.awt.BorderLayout;
import java.awt.Color;
import java.util.Vector;
import org.midibox.sidlibr.Patch;
 
import javax.swing.BorderFactory;
import javax.swing.JComboBox;
45,6 → 44,7
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlSlider;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlToggleButton;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlWaveSelect;
import org.midibox.sidlibr.Patch;
import org.midibox.utils.gui.ImageLoader;
import org.midibox.utils.gui.Knob;
import org.midibox.utils.gui.MyButtonUI;
60,12 → 60,20
GUIs = createGUIs(sidEditController);
createLinkGroups();
JTabbedPane tabbedPane = new JTabbedPane();
JPanel t1 = new GlobalGUI((Vector) GUIs.elementAt(0), (Vector) GUIs.elementAt(1));
JPanel t2 = new OscillatorGUI((Vector) GUIs.elementAt(4), (Vector) GUIs.elementAt(5), (Vector) GUIs.elementAt(7), (Vector) GUIs.elementAt(8),(Vector) GUIs.elementAt(6));
JPanel t3 = new FilterGUI((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3));
JPanel t4 = new LfoGUI((Vector) GUIs.elementAt(9), (Vector) GUIs.elementAt(10), (Vector) GUIs.elementAt(11), (Vector) GUIs.elementAt(12));
JPanel t6 = new SequencerGUI((Vector) GUIs.elementAt(15), (Vector) GUIs.elementAt(13), (Vector) GUIs.elementAt(14));
JPanel t7 = new ArpGUI((Vector) GUIs.elementAt(4), (Vector) GUIs.elementAt(5));
JPanel t1 = new GlobalGUI((Vector) GUIs.elementAt(0), (Vector) GUIs
.elementAt(1));
JPanel t2 = new OscillatorGUI((Vector) GUIs.elementAt(4), (Vector) GUIs
.elementAt(5), (Vector) GUIs.elementAt(7), (Vector) GUIs
.elementAt(8), (Vector) GUIs.elementAt(6));
JPanel t3 = new FilterGUI((Vector) GUIs.elementAt(2), (Vector) GUIs
.elementAt(3));
JPanel t4 = new LfoGUI((Vector) GUIs.elementAt(9), (Vector) GUIs
.elementAt(10), (Vector) GUIs.elementAt(11), (Vector) GUIs
.elementAt(12));
JPanel t6 = new SequencerGUI((Vector) GUIs.elementAt(15), (Vector) GUIs
.elementAt(13), (Vector) GUIs.elementAt(14));
JPanel t7 = new ArpGUI((Vector) GUIs.elementAt(4), (Vector) GUIs
.elementAt(5));
 
tabbedPane.addTab("Global", t1);
tabbedPane.addTab("Oscillator", t2);
74,7 → 82,8
tabbedPane.addTab("Sequencer", t6);
tabbedPane.addTab("Arpeggiator", t7);
 
tabbedPane.setUI(new MBSIDV2EditorTabbedPaneUI(new Color(245, 245, 245), new Color(200, 200, 200)));
tabbedPane.setUI(new MBSIDV2EditorTabbedPaneUI(
new Color(245, 245, 245), new Color(200, 200, 200)));
 
add(tabbedPane, BorderLayout.NORTH);
setOpaque(false);
161,7 → 170,8
break;
case 8:
// Radio button list
midiParameterGUIs.add(new SIDSysexParameterControlRadio(midiParameter, true, BorderLayout.NORTH, true, false));
midiParameterGUIs.add(new SIDSysexParameterControlRadio(
midiParameter, true, BorderLayout.NORTH, true, false));
break;
default:
midiParameterGUIs.add(midiParameter);
184,7 → 194,7
 
public void stereoLink(boolean b) {
if (b) {
((Patch)sidEditController.getPatch()).setStereoLink(true);
((Patch) sidEditController.getPatch()).setStereoLink(true);
linkPar(EXT_L, EXT_R); // Link external outputs 2 by 2
linkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Link
// filter
207,7 → 217,7
linkPar((Vector) GUIs.elementAt(13), (Vector) GUIs.elementAt(14)); // Link
// Sequencers
} else {
((Patch)sidEditController.getPatch()).setStereoLink(false);
((Patch) sidEditController.getPatch()).setStereoLink(false);
unlinkPar(EXT_L, EXT_R); // Unlink external outputs 2 by 2
unlinkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Link
// filter
/trunk/java/org/midibox/sidedit/gui/bassline/LfoGUI.java
25,11 → 25,12
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.util.Vector;
import org.midibox.sidedit.SIDSysexInfo;
 
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
 
import org.midibox.sidedit.SIDSysexInfo;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlKnob;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlSlider;
146,8 → 147,11
lfoPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(8 + offset), c);
 
// Setup the 'rate'-knob behavior to be depending on the 'master sync' switch
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(6 + offset)).setSnapVals(new int[]{245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255},SIDSysexInfo.rates);
// Setup the 'rate'-knob behavior to be depending on the 'master sync'
// switch
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(6 + offset))
.setSnapVals(new int[] { 245, 246, 247, 248, 249, 250, 251,
252, 253, 254, 255 }, SIDSysexInfo.rates);
((SIDSysexParameterControlToggleButton) midiParameterGUI
.elementAt(2 + offset))
.setSnapParameter((SIDSysexParameterControlGUI) midiParameterGUI
/trunk/java/org/midibox/sidedit/gui/MBSIDV2EditorGUI.java
26,10 → 26,10
import java.awt.event.ActionListener;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JButton;
 
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
38,9 → 38,9
import org.midibox.sidedit.SIDEditController;
import org.midibox.sidedit.gui.bassline.BasslineGUI;
import org.midibox.sidedit.gui.drum.DrumGUI;
import org.midibox.sidedit.gui.ensemble.EnsembleGUI;
import org.midibox.sidedit.gui.lead.LeadGUI;
import org.midibox.sidedit.gui.multi.MultiGUI;
import org.midibox.sidedit.gui.ensemble.EnsembleGUI;
import org.midibox.sidlibr.Patch;
import org.midibox.utils.gui.ImageLoader;
import org.midibox.utils.gui.MyButtonUI;
54,7 → 54,8
 
private JLabel tooltipLabel;
 
private JToggleButton stereoLink, oscillatorLink, core1Button, core2Button, core3Button, core4Button;
private JToggleButton stereoLink, oscillatorLink, core1Button, core2Button,
core3Button, core4Button;
private JButton playButton, panicButton;
 
public MBSIDV2EditorGUI() {
79,11 → 80,11
 
sidEditController.addObserver(this);
remove(editPanel);
 
if (sidEditController.getPatch().isEnsemble()) {
editPanel = new EnsembleGUI(sidEditController);
editPanel = new EnsembleGUI(sidEditController);
} else {
Patch p = (Patch)sidEditController.getPatch();
Patch p = (Patch) sidEditController.getPatch();
if (p.getEngine() == p.LEAD) {
editPanel = new LeadGUI(sidEditController);
stereoLink.setSelected(true);
97,7 → 98,7
editPanel = new MultiGUI(sidEditController);
stereoLink.setSelected(false);
}
}
}
add(editPanel);
repaint();
setVisible(true);
122,22 → 123,26
 
stereoLink = new JToggleButton();
stereoLink.setIcon(ImageLoader.getImageIcon("stereo.png"));
stereoLink.setPreferredSize(new Dimension(stereoLink.getPreferredSize().width, 20));
stereoLink.setPreferredSize(new Dimension(
stereoLink.getPreferredSize().width, 20));
stereoLink.addActionListener(this);
 
oscillatorLink = new JToggleButton();
oscillatorLink.setIcon(ImageLoader.getImageIcon("link.png"));
oscillatorLink.setPreferredSize(new Dimension(oscillatorLink.getPreferredSize().width, 20));
oscillatorLink.setPreferredSize(new Dimension(oscillatorLink
.getPreferredSize().width, 20));
oscillatorLink.addActionListener(this);
 
playButton = new JButton();
playButton.setIcon(ImageLoader.getImageIcon("play.png"));
playButton.setPreferredSize(new Dimension(playButton.getPreferredSize().width, 14));
playButton.setPreferredSize(new Dimension(
playButton.getPreferredSize().width, 14));
playButton.addActionListener(this);
 
panicButton = new JButton();
panicButton.setIcon(ImageLoader.getImageIcon("panic.png"));
panicButton.setPreferredSize(new Dimension(panicButton.getPreferredSize().width, 14));
panicButton.setPreferredSize(new Dimension(panicButton
.getPreferredSize().width, 14));
panicButton.addActionListener(this);
 
JPanel buttonPanel = new JPanel();
150,7 → 155,8
ImageLoader.getImageIcon("txOff.png")));
core1Button.setEnabled(false);
core2Button = new JToggleButton();
core2Button.setUI(new MyButtonUI(ImageLoader.getImageIcon("txOn.png"),ImageLoader.getImageIcon("txOff.png")));
core2Button.setUI(new MyButtonUI(ImageLoader.getImageIcon("txOn.png"),
ImageLoader.getImageIcon("txOff.png")));
core2Button.setEnabled(false);
core3Button = new JToggleButton();
core3Button.setUI(new MyButtonUI(ImageLoader.getImageIcon("txOn.png"),
167,10 → 173,12
buttonPanel.add(core4Button);
 
JLabel empty1Label = new JLabel();
empty1Label.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
empty1Label.setBorder(BorderFactory
.createBevelBorder(BevelBorder.LOWERED));
 
tooltipLabel = new JLabel("");
tooltipLabel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
tooltipLabel.setBorder(BorderFactory
.createBevelBorder(BevelBorder.LOWERED));
 
JPanel linkPanel = new JPanel();
linkPanel.setLayout(new BoxLayout(linkPanel, BoxLayout.X_AXIS));
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlSlider.java
80,7 → 80,11
}
 
public void mouseWheelMoved(MouseWheelEvent mwe) {
slider.setValue((int) (slider.getValue() - ((mwe.getWheelRotation() * Math.max(mouseWheelResolution * (slider.getMaximum() - slider.getMinimum()),1)))));
slider
.setValue((int) (slider.getValue() - ((mwe.getWheelRotation() * Math
.max(mouseWheelResolution
* (slider.getMaximum() - slider.getMinimum()),
1)))));
}
 
public void stateChanged(ChangeEvent ce) {
87,7 → 91,9
if (update) {
update = false;
int newval;
if (midiParameter.snap) {int index = (int) (((float) slider.getValue() / (float) slider.getMaximum()) * (midiParameter.snapVals.length - 1));
if (midiParameter.snap) {
int index = (int) (((float) slider.getValue() / (float) slider
.getMaximum()) * (midiParameter.snapVals.length - 1));
newval = midiParameter.snapVals[index];
} else {
newval = slider.getValue();
96,7 → 102,8
midiParameter.setMidiValue(newval, true);
 
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.setMidiValue(newval, false);
}
update = true;
105,13 → 112,15
 
public void updateGraphics() {
super.updateGraphics();
 
if (update) {
update = false;
int newval;
if (midiParameter.snap) {
float ratio = (float) midiParameter.getMidiValSnapIndex() / (float) (midiParameter.snapVals.length - 1);
newval = (int)((float)(slider.getMaximum()-slider.getMinimum())* ratio);
float ratio = (float) midiParameter.getMidiValSnapIndex()
/ (float) (midiParameter.snapVals.length - 1);
newval = (int) ((float) (slider.getMaximum() - slider
.getMinimum()) * ratio);
} else {
newval = midiParameter.getMidiValue();
}
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlGUI.java
160,29 → 160,35
updateValueField();
}
}
 
public void setSnapVals(int[] vals, String[] alias) {
midiParameter.snapVals = vals;
midiParameter.snapAlias = alias;
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.snapVals = vals;
mp.snapAlias = alias;
}
}
 
public void setSnap(boolean b) {
if (b) { // Turn on snap
midiParameter.snap = true;
if (Arrays.binarySearch(midiParameter.snapVals,midiParameter.getMidiValue()) == -1) { // If current midi value is not part of the snap values reset to snapvals[0];
midiParameter.snap = true;
if (Arrays.binarySearch(midiParameter.snapVals, midiParameter
.getMidiValue()) == -1) { // If current midi value is not
// part of the snap values reset
// to snapvals[0];
midiParameter.setMidiValue(midiParameter.snapVals[0], true);
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.snap = true;
}
} else { // Keep current midi value, only update labels
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.snap = true;
}
updateGraphics();
191,7 → 197,8
} else { // Turn off snap
midiParameter.snap = false;
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.snap = false;
}
updateGraphics();
205,9 → 212,10
public void actionPerformed(ActionEvent ae) {
Object source = ae.getSource();
if (source == valueField) {
midiParameter.SetMidiValueWithAlias(valueField.getText());
midiParameter.SetMidiValueWithAlias(valueField.getText());
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.setMidiValue(midiParameter.getMidiValue(), false);
}
}
217,7 → 225,8
if (observable == midiParameter) {
if (object != SIDSysexParameter.VALUE) {
if (showLabel) {
midiParameterLabel.setText(midiParameter.getMidiName().toUpperCase());
midiParameterLabel.setText(midiParameter.getMidiName()
.toUpperCase());
}
}
updateGraphics();
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlKnob.java
24,7 → 24,6
import java.awt.FlowLayout;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.util.Arrays;
 
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
70,7 → 69,9
if (update) {
update = false;
int newval;
if (midiParameter.snap) {int index = (int) (((float) knob.getValue() / (float) knob.getMaximum()) * (midiParameter.snapVals.length - 1));
if (midiParameter.snap) {
int index = (int) (((float) knob.getValue() / (float) knob
.getMaximum()) * (midiParameter.snapVals.length - 1));
newval = midiParameter.snapVals[index];
} else {
newval = knob.getValue();
79,7 → 80,8
midiParameter.setMidiValue(newval, true);
 
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.setMidiValue(newval, false);
}
update = true;
92,8 → 94,9
update = false;
int newval;
if (midiParameter.snap) {
float ratio = (float) midiParameter.getMidiValSnapIndex() / (float) (midiParameter.snapVals.length - 1);
newval = (int)((float)(knob.getMaximum()-knob.getMinimum())* ratio);
float ratio = (float) midiParameter.getMidiValSnapIndex()
/ (float) (midiParameter.snapVals.length - 1);
newval = (int) ((float) (knob.getMaximum() - knob.getMinimum()) * ratio);
} else {
newval = midiParameter.getMidiValue();
}
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlRadio.java
22,9 → 22,10
 
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
 
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
 
37,7 → 38,8
private JRadioButton[] radioButtons;
 
public SIDSysexParameterControlRadio(
SIDSysexParameterControl midiParameter, boolean showLabel, String labelLocation, boolean valueBelow, boolean showValue) {
SIDSysexParameterControl midiParameter, boolean showLabel,
String labelLocation, boolean valueBelow, boolean showValue) {
super(midiParameter, showLabel, labelLocation, valueBelow, showValue);
 
JPanel panel = new JPanel();
50,12 → 52,12
JPanel temp = new JPanel();
temp.setLayout(new BorderLayout());
temp.setOpaque(false);
JLabel lab = new JLabel(str[i]);
JLabel lab = new JLabel(str[i]);
lab.setFont(FontLoader.getFont("uni05_53.ttf", 8f));
temp.add(lab,BorderLayout.NORTH);
temp.add(lab, BorderLayout.NORTH);
radioButtons[i] = new JRadioButton("", false);
radioButtons[i].addActionListener(this);
radioButtons[i].setOpaque(false);
radioButtons[i].setOpaque(false);
bg.add(radioButtons[i]);
temp.add(radioButtons[i]);
panel.add(temp);
64,17 → 66,19
add(panel, BorderLayout.CENTER);
updateGraphics();
}
 
public void actionPerformed(ActionEvent ae) {
super.actionPerformed(ae);
for (int i = 0; i < radioButtons.length; i++) {
if ((ae.getSource() == radioButtons[i]) && (radioButtons[i].isSelected())) {
if ((ae.getSource() == radioButtons[i])
&& (radioButtons[i].isSelected())) {
if (update) {
update = false;
midiParameter.setMidiValueWithSparse(i);
 
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.setMidiValue(midiParameter.getMidiValue(), false);
}
update = true;
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlCombo.java
36,7 → 36,10
public static float mouseWheelResolution = 10.0f;
private JComboBox combo;
 
public SIDSysexParameterControlCombo(SIDSysexParameterControl midiParameter, JComboBox combo, boolean showLabel, String labelLocation, boolean valueBelow, boolean showValue) {
public SIDSysexParameterControlCombo(
SIDSysexParameterControl midiParameter, JComboBox combo,
boolean showLabel, String labelLocation, boolean valueBelow,
boolean showValue) {
super(midiParameter, showLabel, labelLocation, valueBelow, showValue);
this.combo = combo;
combo.setPreferredSize(new Dimension(110, 20));
55,9 → 58,10
if (ae.getSource() == combo) {
if (update) {
update = false;
midiParameter.setMidiValueWithSparse(combo.getSelectedIndex());
midiParameter.setMidiValueWithSparse(combo.getSelectedIndex());
for (int c = 0; c < midiParameters.size(); c++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(c);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(c);
mp.setMidiValue(midiParameter.getMidiValue(), false);
}
update = true;
/trunk/java/org/midibox/sidedit/gui/controls/SIDSysexParameterControlLFOSelect.java
79,7 → 79,8
}
midiParameter.setMidiValue(newval, true);
for (int d = 0; d < midiParameters.size(); d++) {
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters.elementAt(d);
SIDSysexParameterControl mp = (SIDSysexParameterControl) midiParameters
.elementAt(d);
mp.setMidiValue(newval, false);
}
update = true;
92,7 → 93,8
super.updateGraphics();
if (update) {
update = false;
((JToggleButton) buttonVec.elementAt(midiParameter.getMidiValue())).setSelected(true);
((JToggleButton) buttonVec.elementAt(midiParameter.getMidiValue()))
.setSelected(true);
update = true;
}
}
/trunk/java/org/midibox/sidedit/gui/lead/LfoGUI.java
138,8 → 138,13
 
// Setup the 'rate'-knob behavior to be depending on the 'master sync'
// switch
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(5 + offset)).setSnapVals(new int[]{245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255},SIDSysexInfo.rates);
((SIDSysexParameterControlToggleButton) midiParameterGUI.elementAt(1 + offset)).setSnapParameter((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(5 + offset));
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(5 + offset))
.setSnapVals(new int[] { 245, 246, 247, 248, 249, 250, 251,
252, 253, 254, 255 }, SIDSysexInfo.rates);
((SIDSysexParameterControlToggleButton) midiParameterGUI
.elementAt(1 + offset))
.setSnapParameter((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(5 + offset));
 
return lfoPanel;
}
/trunk/java/org/midibox/sidedit/gui/lead/LeadGUI.java
279,7 → 279,7
 
public void oscLink(boolean b) {
if (b) {
((Patch)sidEditController.getPatch()).setOscillatorLink(true);
((Patch) sidEditController.getPatch()).setOscillatorLink(true);
linkPar((Vector) GUIs.elementAt(5), (Vector) GUIs.elementAt(6)); // Link
// V1
// &
305,7 → 305,7
// &
// V4
} else {
((Patch)sidEditController.getPatch()).setOscillatorLink(false);
((Patch) sidEditController.getPatch()).setOscillatorLink(false);
unlinkPar((Vector) GUIs.elementAt(5), (Vector) GUIs.elementAt(6)); // Unlink
// V1
// &
339,7 → 339,7
 
public void stereoLink(boolean b) {
if (b) {
((Patch)sidEditController.getPatch()).setStereoLink(true);
((Patch) sidEditController.getPatch()).setStereoLink(true);
linkPar(EXT_L, EXT_R); // Link external outputs 2 by 2
linkPar(MP_L, MP_R); // Link MP direct assign left & right
linkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Link
360,7 → 360,7
// &
// V6
} else {
((Patch)sidEditController.getPatch()).setStereoLink(false);
((Patch) sidEditController.getPatch()).setStereoLink(false);
unlinkPar(EXT_L, EXT_R); // Unlink external outputs 2 by 2
unlinkPar(MP_L, MP_R); // Unlink MP direct assign left & right
unlinkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Unlink
/trunk/java/org/midibox/sidedit/gui/drum/SequencerGUI.java
22,7 → 22,6
 
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
33,7 → 32,6
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
46,7 → 44,7
private JPanel seqPanel, currentPanel, seq1, seq2, seq3, seq4, seq5, seq6,
seq7, seq8;
private JRadioButton radioButtons[];
 
protected SequencerGUI(Vector V1GUIv, Vector V2GUIv) {
setLayout(new BorderLayout());
this.setOpaque(false);
64,7 → 62,9
JPanel comboPanel = new JPanel();
comboPanel.setLayout(new BoxLayout(comboPanel, BoxLayout.Y_AXIS));
comboPanel.setOpaque(false);
String[] s = { "Sequence #1", "Sequence #2", "Sequence #3", "Sequence #4", "Sequence #5", "Sequence #6", "Sequence #7", "Sequence #8" };
String[] s = { "Sequence #1", "Sequence #2", "Sequence #3",
"Sequence #4", "Sequence #5", "Sequence #6", "Sequence #7",
"Sequence #8" };
ButtonGroup bg = new ButtonGroup();
radioButtons = new JRadioButton[s.length];
for (int i = 0; i < s.length; i++) {
75,7 → 75,7
bg.add(radioButtons[i]);
comboPanel.add(radioButtons[i]);
}
 
seqPanel.add(comboPanel);
 
seq1 = createSeqData(V2GUIv, 0);
/trunk/java/org/midibox/sidedit/gui/drum/DrumInstrumentGUI.java
90,7 → 90,8
voicePanel.add(
(SIDSysexParameterControlGUI) vGUI.elementAt(0 + offset), c);
((SIDSysexParameterControlKnob) vGUI.elementAt(0 + offset))
.setSnapVals(new int[]{0,1,2,3,4,5,6,7,8}, SIDSysexInfo.voiceAssign);
.setSnapVals(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
SIDSysexInfo.voiceAssign);
((SIDSysexParameterControlKnob) vGUI.elementAt(0 + offset))
.setSnap(true);
c.gridx = 1;
100,7 → 101,9
voicePanel.add(
(SIDSysexParameterControlGUI) vGUI.elementAt(1 + offset), c);
((SIDSysexParameterControlKnob) vGUI.elementAt(1 + offset))
.setSnapVals(new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},SIDSysexInfo.drumModel);
.setSnapVals(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19 },
SIDSysexInfo.drumModel);
((SIDSysexParameterControlKnob) vGUI.elementAt(1 + offset))
.setSnap(true);
c.gridx = 2;
/trunk/java/org/midibox/sidedit/gui/drum/DrumGUI.java
148,8 → 148,10
break;
case 6:
// Normal combo
JComboBox combo = new JComboBox(midiParameter.getSparseValAlias());
midiParameterGUIs.add(new SIDSysexParameterControlCombo(midiParameter, combo, true, BorderLayout.NORTH, false,
JComboBox combo = new JComboBox(midiParameter
.getSparseValAlias());
midiParameterGUIs.add(new SIDSysexParameterControlCombo(
midiParameter, combo, true, BorderLayout.NORTH, false,
false));
break;
case 7:
162,7 → 164,8
break;
case 8:
// Radio button list
midiParameterGUIs.add(new SIDSysexParameterControlRadio(midiParameter, true, BorderLayout.NORTH, true, false));
midiParameterGUIs.add(new SIDSysexParameterControlRadio(
midiParameter, true, BorderLayout.NORTH, true, false));
break;
default:
midiParameterGUIs.add(midiParameter);
185,7 → 188,7
 
public void stereoLink(boolean b) {
if (b) {
((Patch)sidEditController.getPatch()).setStereoLink(true);
((Patch) sidEditController.getPatch()).setStereoLink(true);
linkPar(EXT_L, EXT_R); // Link external outputs 2 by 2
linkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Link
// filter
193,7 → 196,7
// &
// right
} else {
((Patch)sidEditController.getPatch()).setStereoLink(false);
((Patch) sidEditController.getPatch()).setStereoLink(false);
unlinkPar(EXT_L, EXT_R); // Unlink external outputs 2 by 2
unlinkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Link
// filter
/trunk/java/org/midibox/sidedit/gui/ensemble/EnsembleGUI.java
33,16 → 33,13
 
import org.midibox.sidedit.SIDEditController;
import org.midibox.sidedit.SIDSysexParameterControl;
import org.midibox.sidedit.gui.FilterGUI;
import org.midibox.sidedit.gui.MBSIDV2EditorTabbedPaneUI;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlCombo;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlKnob;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlLFOSelect;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlSlider;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlToggleButton;
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlWaveSelect;
import org.midibox.sidlibr.Patch;
import org.midibox.utils.gui.ImageLoader;
import org.midibox.utils.gui.Knob;
import org.midibox.utils.gui.MyButtonUI;
56,22 → 53,23
public EnsembleGUI(SIDEditController sidEditController) {
this.sidEditController = sidEditController;
setLayout(new BorderLayout());
 
GUIs = createGUIs(sidEditController);
 
JTabbedPane tabbedPane = new JTabbedPane();
JPanel t1 = new SIDGUI((Vector) GUIs.elementAt(0));
JPanel t2 = new SIDGUI((Vector) GUIs.elementAt(1));
JPanel t3 = new SIDGUI((Vector) GUIs.elementAt(2));
JPanel t4 = new SIDGUI((Vector) GUIs.elementAt(3));
 
tabbedPane.addTab("SID1", t1);
tabbedPane.addTab("SID2", t2);
tabbedPane.addTab("SID3", t3);
tabbedPane.addTab("SID4", t4);
tabbedPane.setUI(new MBSIDV2EditorTabbedPaneUI(new Color(245, 245, 245), new Color(200, 200, 200)));
 
tabbedPane.setUI(new MBSIDV2EditorTabbedPaneUI(
new Color(245, 245, 245), new Color(200, 200, 200)));
 
add(tabbedPane, BorderLayout.NORTH);
setOpaque(false);
setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
160,5 → 158,5
}
}
return midiParameterGUIs;
}
}
}
/trunk/java/org/midibox/sidedit/gui/ensemble/SIDGUI.java
1,10 → 1,9
package org.midibox.sidedit.gui.ensemble;
 
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.util.Vector;
 
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
24,8 → 23,8
panel1.add(createMain(sidGUIv));
panel1.add(createFlag(sidGUIv));
panel1.add(createInv(sidGUIv));
panel1.add(createFilCal(sidGUIv));
panel1.add(createKnobs(sidGUIv));
panel1.add(createFilCal(sidGUIv));
panel1.add(createKnobs(sidGUIv));
 
panel1.setOpaque(false);
this.add(panel1, BorderLayout.NORTH);
37,58 → 36,82
mainPanel.setBorder(BorderFactory.createEtchedBorder());
mainPanel.setBorder(BorderFactory.createTitledBorder("General"));
mainPanel.setOpaque(false);
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(0));
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(1));
 
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(0));
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(1));
int[] snapvals = new int[206];
for(int i=50;i<256;i++) {
snapvals[i-50] = i;
for (int i = 50; i < 256; i++) {
snapvals[i - 50] = i;
}
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(11)).setSnapVals(snapvals,null);
((SIDSysexParameterControlGUI)midiParameterGUI.elementAt(11)).setSnap(true);
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(11));
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(12)).setSnapVals(new int[]{0, 1, 2, 3, 4},new String[]{"OFF","1","2","3","4"});
((SIDSysexParameterControlGUI)midiParameterGUI.elementAt(12)).setSnap(true);
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(12));
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(2));
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(11))
.setSnapVals(snapvals, null);
((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(11))
.setSnap(true);
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(11));
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(12))
.setSnapVals(new int[] { 0, 1, 2, 3, 4 }, new String[] { "OFF",
"1", "2", "3", "4" });
((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(12))
.setSnap(true);
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(12));
mainPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(2));
 
return mainPanel;
}
 
protected JPanel createFilCal(Vector midiParameterGUI) {
JPanel filPanel = new JPanel();
filPanel.setLayout(new GridLayout(2, 2));
filPanel.setBorder(BorderFactory.createEtchedBorder());
filPanel.setBorder(BorderFactory.createTitledBorder("Filter calibration"));
filPanel.setBorder(BorderFactory
.createTitledBorder("Filter calibration"));
filPanel.setOpaque(false);
 
// Filter calibration
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(21));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(23));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(22));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(24));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(21));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(23));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(22));
filPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(24));
return filPanel;
}
 
protected JPanel createInv(Vector midiParameterGUI) {
JPanel invPanel = new JPanel();
invPanel.setLayout(new GridLayout(1, 8));
invPanel.setBorder(BorderFactory.createEtchedBorder());
invPanel.setBorder(BorderFactory.createTitledBorder("Invert analog outputs"));
invPanel.setBorder(BorderFactory
.createTitledBorder("Invert analog outputs"));
invPanel.setOpaque(false);
 
// AOUT inversion flags
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(13));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(14));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(15));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(16));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(17));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(18));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(19));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(20));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(13));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(14));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(15));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(16));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(17));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(18));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(19));
invPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(20));
return invPanel;
}
 
protected JPanel createFlag(Vector midiParameterGUI) {
JPanel flagPanel = new JPanel();
flagPanel.setLayout(new GridLayout(1, 8));
95,16 → 118,24
flagPanel.setBorder(BorderFactory.createEtchedBorder());
flagPanel.setBorder(BorderFactory.createTitledBorder("Flags"));
flagPanel.setOpaque(false);
//Flags
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(3));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(4));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(5));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(6));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(7));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(8));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(9));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(10));
 
// Flags
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(3));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(4));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(5));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(6));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(7));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(8));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(9));
flagPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(10));
return flagPanel;
}
 
127,11 → 158,16
knobPanel.setBorder(BorderFactory.createTitledBorder(s));
knobPanel.setOpaque(false);
 
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(25 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(26 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(27 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(28 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI.elementAt(29 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(25 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(26 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(27 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(28 + offset));
knobPanel.add((SIDSysexParameterControlGUI) midiParameterGUI
.elementAt(29 + offset));
 
return knobPanel;
}
/trunk/java/org/midibox/sidedit/gui/multi/MultiGUI.java
316,7 → 316,7
 
public void oscLink(boolean b) {
if (b) {
((Patch)sidEditController.getPatch()).setOscillatorLink(true);
((Patch) sidEditController.getPatch()).setOscillatorLink(true);
linkPar((Vector) GUIs.elementAt(4), (Vector) GUIs.elementAt(5)); // Link
// V1
// &
372,7 → 372,7
// V4
// rest
} else {
((Patch)sidEditController.getPatch()).setOscillatorLink(false);
((Patch) sidEditController.getPatch()).setOscillatorLink(false);
unlinkPar((Vector) GUIs.elementAt(4), (Vector) GUIs.elementAt(5)); // Unlink
// V1
// &
436,7 → 436,7
 
public void stereoLink(boolean b) {
if (b) {
((Patch)sidEditController.getPatch()).setStereoLink(true);
((Patch) sidEditController.getPatch()).setStereoLink(true);
linkPar(EXT_L, EXT_R); // Link external outputs 2 by 2
linkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Link
// filter
471,7 → 471,7
// V6
// rest
} else {
((Patch)sidEditController.getPatch()).setStereoLink(false);
((Patch) sidEditController.getPatch()).setStereoLink(false);
unlinkPar(EXT_L, EXT_R); // Unlink external outputs 2 by 2
unlinkPar((Vector) GUIs.elementAt(2), (Vector) GUIs.elementAt(3)); // Unlink
// filter
/trunk/java/org/midibox/sidedit/gui/multi/InstrumentGUI.java
68,7 → 68,7
panel.add(panel3);
this.add(panel, BorderLayout.NORTH);
}
 
protected JPanel createDummy() {
JPanel globPanel = new JPanel();
globPanel.setOpaque(false);
87,8 → 87,9
globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(2));
globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(3));
globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(4));
((SIDSysexParameterControlKnob) vGUI.elementAt(4))
.setSnapVals(new int[]{0,1,2,3,4,5,6,7,8},SIDSysexInfo.voiceAssign);
((SIDSysexParameterControlKnob) vGUI.elementAt(4)).setSnapVals(
new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
SIDSysexInfo.voiceAssign);
((SIDSysexParameterControlKnob) vGUI.elementAt(4)).setSnap(true);
globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(5));
globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(6));
236,7 → 237,8
// Setup the 'rate'-knob behavior to be depending on the 'master sync'
// switch
((SIDSysexParameterControlKnob) midiParameterGUI.elementAt(6 + offset))
.setSnapVals(new int[]{245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255},SIDSysexInfo.rates);
.setSnapVals(new int[] { 245, 246, 247, 248, 249, 250, 251,
252, 253, 254, 255 }, SIDSysexInfo.rates);
((SIDSysexParameterControlToggleButton) midiParameterGUI
.elementAt(2 + offset))
.setSnapParameter((SIDSysexParameterControlGUI) midiParameterGUI
/trunk/java/org/midibox/sidedit/DrumSpecs.java
40,17 → 40,34
Vector drumInstrControl = new Vector();
 
for (int i = 0; i < 16; i++) {
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 96 + (10 * i), 4, 4, "Voice Assign", "Voice assignment"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 97 + (10 * i), 0, 8, "Drum Model"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 98 + (10 * i), 4, 4, "Attack", "DCA Attack Rate"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 98 + (10 * i), 0, 4, "Decay", "DCA Decay Rate"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 99 + (10 * i), 4, 4, "Sustain", "DCA Sustain Level"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 99 + (10 * i), 0, 4, "Release", "DCA Release Rate"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 100 + (10 * i), 0, 8, "Tune"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 101 + (10 * i), 0, 8, "Gatelength", "Parameter #1: Gatelength"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 102 + (10 * i), 0, 8, "Speed", "Parameter #2: Speed"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 103 + (10 * i), 0, 8, "Param #3", "Parameter #3: depends on Drum Model"));
drumInstrControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.drumParams, 0, patch, 104 + (10 * i), 0, 8, "Velocity Assign", "Velocity parameter assignment"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 96 + (10 * i), 4, 4, "Voice Assign",
"Voice assignment"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 97 + (10 * i), 0, 8, "Drum Model"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0,
patch, 98 + (10 * i), 4, 4, "Attack", "DCA Attack Rate"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0,
patch, 98 + (10 * i), 0, 4, "Decay", "DCA Decay Rate"));
drumInstrControl
.add(new SIDSysexParameterControl(slider, null, 0, patch,
99 + (10 * i), 4, 4, "Sustain", "DCA Sustain Level"));
drumInstrControl.add(new SIDSysexParameterControl(slider, null, 0,
patch, 99 + (10 * i), 0, 4, "Release", "DCA Release Rate"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null,
-128, patch, 100 + (10 * i), 0, 8, "Tune"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null,
-128, patch, 101 + (10 * i), 0, 8, "Gatelength",
"Parameter #1: Gatelength"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null,
-128, patch, 102 + (10 * i), 0, 8, "Speed",
"Parameter #2: Speed"));
drumInstrControl.add(new SIDSysexParameterControl(rotary, null,
-128, patch, 103 + (10 * i), 0, 8, "Param #3",
"Parameter #3: depends on Drum Model"));
drumInstrControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.drumParams, 0, patch, 104 + (10 * i), 0, 8,
"Velocity Assign", "Velocity parameter assignment"));
}
return drumInstrControl;
}
58,11 → 75,20
public static Vector createSEQ(Patch patch) {
Vector seqControl = new Vector();
// Sequencer
seqControl.add(new SIDSysexParameterControl(rotary, createDividers(), 0, patch, 80, 0, 6, "Clock Divider", "Clock divider (sets tempo)"));
seqControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 6, 1, "Manual/Seq", "MIDI Note playing/Sequencer mode"));
seqControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 7, 1, "Pattern Sync", "Pattern changes synchronised to measure"));
seqControl.add(new SIDSysexParameterControl(radio, new String[]{"#1","#2","#3","#4","#5","#6","#7","#8","OFF"}, 0, patch, 81, 0, 4, "Sequence", "Sequencer number"));
seqControl.add(new SIDSysexParameterControl(rotary, null, 1, patch, 83, 0, 4, "Steps", "Number of steps"));
seqControl.add(new SIDSysexParameterControl(rotary, createDividers(),
0, patch, 80, 0, 6, "Clock Divider",
"Clock divider (sets tempo)"));
seqControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80,
6, 1, "Manual/Seq", "MIDI Note playing/Sequencer mode"));
seqControl
.add(new SIDSysexParameterControl(button, null, 0, patch, 80,
7, 1, "Pattern Sync",
"Pattern changes synchronised to measure"));
seqControl.add(new SIDSysexParameterControl(radio, new String[] { "#1",
"#2", "#3", "#4", "#5", "#6", "#7", "#8", "OFF" }, 0, patch,
81, 0, 4, "Sequence", "Sequencer number"));
seqControl.add(new SIDSysexParameterControl(rotary, null, 1, patch, 83,
0, 4, "Steps", "Number of steps"));
return seqControl;
}
 
76,16 → 102,28
// Steps: 1-16
for (int s = 0; s < 16; s++) {
if (s < 8) {
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 256 + offset, s, 1, "Gate" + Integer.toString(s) + Integer.toString(ch)));
seqDataControl.add(new SIDSysexParameterControl(
simplebutton, null, 0, patch, 256 + offset, s,
1, "Gate" + Integer.toString(s)
+ Integer.toString(ch)));
} else {
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 258 + offset, s - 8, 1, "Gate" + Integer.toString(s) + Integer.toString(ch)));
seqDataControl.add(new SIDSysexParameterControl(
simplebutton, null, 0, patch, 258 + offset,
s - 8, 1, "Gate" + Integer.toString(s)
+ Integer.toString(ch)));
}
}
for (int s = 0; s < 16; s++) {
if (s < 8) {
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 257 + offset, s, 1, "Accent" + Integer.toString(s)+ Integer.toString(ch)));
seqDataControl.add(new SIDSysexParameterControl(
simplebutton, null, 0, patch, 257 + offset, s,
1, "Accent" + Integer.toString(s)
+ Integer.toString(ch)));
} else {
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 259 + offset, s - 8, 1, "Accent" + Integer.toString(s) + Integer.toString(ch)));
seqDataControl.add(new SIDSysexParameterControl(
simplebutton, null, 0, patch, 259 + offset,
s - 8, 1, "Accent" + Integer.toString(s)
+ Integer.toString(ch)));
}
}
 
92,9 → 130,8
}
}
return seqDataControl;
}
}
 
 
public static String[] createDividers() {
String[] s = new String[64];
for (int i = 0; i < s.length; i++) {
/trunk/java/org/midibox/sidedit/SIDSysexInfo.java
22,38 → 22,292
public class SIDSysexInfo {
 
// Patch/Ensemble Request commands
public static String hardPatchRequestSysex = "F000007E4B<device>0100<bank><patch>F7"; // Request a dump of <patch> in <bank>
public static String editPatchRequestSysex = "F000007E4B<device>01080000F7"; // Request the current patch edit buffer (direct read from RAM)
public static String hardEnsembleRequestSysex = "F000007E4B<device>017000<ensemble>F7"; // Request a dump of <ensemble>
public static String editEnsembleRequestSysex = "F000007E4B<device>01780000F7"; // Request the current ensemble edit buffer (direct read from RAM) The locations of unavailable SID slaves will be read from EEPROM/BankStick, therefore the "default" <ensemble> number has to be specified as well.
public static String hardPatchRequestSysex = "F000007E4B<device>0100<bank><patch>F7"; // Request
// a
// dump
// of
// <patch>
// in
// <bank>
public static String editPatchRequestSysex = "F000007E4B<device>01080000F7"; // Request
// the
// current
// patch
// edit
// buffer
// (direct
// read
// from
// RAM)
public static String hardEnsembleRequestSysex = "F000007E4B<device>017000<ensemble>F7"; // Request
// a
// dump
// of
// <ensemble>
public static String editEnsembleRequestSysex = "F000007E4B<device>01780000F7"; // Request
// the
// current
// ensemble
// edit
// buffer
// (direct
// read
// from
// RAM)
// The
// locations
// of
// unavailable
// SID
// slaves
// will
// be
// read
// from
// EEPROM/BankStick,
// therefore
// the
// "default"
// <ensemble>
// number
// has
// to
// be
// specified
// as
// well.
// Patch/Ensemble Dump commands
public static String hardPatchDumpSysex = "F000007E4B<device>0200<bank><patch><data><checksum>F7"; // Write a dump to <patch> in <bank>. Checksum is 2s complement over the 1024 bytes dump. The actual patch size is only 512 bytes - the 8bit values are divided into low- and high-nibble (low-nibble is sent first), therefore 1024 bytes have to be sent
public static String editPatchDumpSysex = "F000007E4B<device>02080000<data><checksum>F7"; // Write a patch dump into edit buffer (direct write into RAM)
public static String hardEnsembleDumpSysex = "F000007E4B<device>027000<ensemble><data><checksum>F7"; // Write a dump to <ensemble>. Checksum is 2s/ complement over the 512 bytes dump. The actual ensemble size is only 256 bytes - the 8bit values are divided into low- and high-nibble (low-nibble is sent first), therefore 512 bytes have to be sent
public static String editEnsembleDumpSysex = "F000007E4B<device>02780000<data><checksum>F7"; // Write an ensemble dump into edit buffer (direct write into RAM)
public static String hardPatchDumpSysex = "F000007E4B<device>0200<bank><patch><data><checksum>F7"; // Write
// a
// dump
// to
// <patch>
// in
// <bank>.
// Checksum
// is
// 2s
// complement
// over
// the
// 1024
// bytes
// dump.
// The
// actual
// patch
// size
// is
// only
// 512
// bytes
// -
// the
// 8bit
// values
// are
// divided
// into
// low-
// and
// high-nibble
// (low-nibble
// is
// sent
// first),
// therefore
// 1024
// bytes
// have
// to
// be
// sent
public static String editPatchDumpSysex = "F000007E4B<device>02080000<data><checksum>F7"; // Write
// a
// patch
// dump
// into
// edit
// buffer
// (direct
// write
// into
// RAM)
public static String hardEnsembleDumpSysex = "F000007E4B<device>027000<ensemble><data><checksum>F7"; // Write
// a
// dump
// to
// <ensemble>.
// Checksum
// is
// 2s/
// complement
// over
// the
// 512
// bytes
// dump.
// The
// actual
// ensemble
// size
// is
// only
// 256
// bytes
// -
// the
// 8bit
// values
// are
// divided
// into
// low-
// and
// high-nibble
// (low-nibble
// is
// sent
// first),
// therefore
// 512
// bytes
// have
// to
// be
// sent
public static String editEnsembleDumpSysex = "F000007E4B<device>02780000<data><checksum>F7"; // Write
// an
// ensemble
// dump
// into
// edit
// buffer
// (direct
// write
// into
// RAM)
 
// Bank Request commands
public static String bankRequestSysex = "F000007E4B<device>0300<bank>F7"; // Request a dump of the whole patch <bank> (128 patches).Only 64 patches are sent when a 32k BankStick is accessed
public static String ensembleBankRequestSysex = "F000007E4B<device>037000F7"; // Request a dump of all ensembles (128 ensembles)
public static String bankRequestSysex = "F000007E4B<device>0300<bank>F7"; // Request
// a
// dump
// of
// the
// whole
// patch
// <bank>
// (128
// patches).Only
// 64
// patches
// are
// sent
// when
// a
// 32k
// BankStick
// is
// accessed
public static String ensembleBankRequestSysex = "F000007E4B<device>037000F7"; // Request
// a
// dump
// of
// all
// ensembles
// (128
// ensembles)
 
// Parameter write
public static String editPatchParameterSysex = "F000007E4B<device>06<wopt><address><value>F7"; // Direct Write of parameter into patch buffer (<AH> = 0..3, <AL> = 0..7F). Patch address: (<AH> << 7) | <AL>
public static String editEnsembleParameterSysex = "F000007E4B<device>0670<address><value>F7";// Direct Write of parameter into ensemble buffer (<AH> = 0..1, <AL> = 0..7F). Ensemble address: (<AH> << 7) | <AL>
//Miscellaneous
public static String pingSysex = "F000007E4B<device>0FF7"; // Ping (just sends back the same SysEx string)
public static String panicSysex = "F000007E4B<device>0C08F7"; // All notes/sequences off
public static String forwardSysex = "F000007E4B<device>0C00<sids>F7"; // Sets SysEx forwarding from master to slaves
public static String playSysex = "F000007E4B<device>0C0900F7"; //Plays the current patch
public static String editPatchParameterSysex = "F000007E4B<device>06<wopt><address><value>F7"; // Direct
// Write
// of
// parameter
// into
// patch
// buffer
// (<AH>
// =
// 0..3,
// <AL>
// =
// 0..7F).
// Patch
// address:
// (<AH>
// <<
// 7)
// |
// <AL>
public static String editEnsembleParameterSysex = "F000007E4B<device>0670<address><value>F7";// Direct
// Write
// of
// parameter
// into
// ensemble
// buffer
// (<AH>
// =
// 0..1,
// <AL>
// =
// 0..7F).
// Ensemble
// address:
// (<AH>
// <<
// 7)
// |
// <AL>
 
// Miscellaneous
public static String pingSysex = "F000007E4B<device>0FF7"; // Ping (just
// sends back
// the same
// SysEx string)
public static String panicSysex = "F000007E4B<device>0C08F7"; // All
// notes/sequences
// off
public static String forwardSysex = "F000007E4B<device>0C00<sids>F7"; // Sets
// SysEx
// forwarding
// from
// master
// to
// slaves
public static String playSysex = "F000007E4B<device>0C0900F7"; // Plays the
// current
// patch
 
// Feedback from core
public static String acknowledgedSysex = "F000007E4B<device>0F"; // Acknowledged, TK: "<sids>F7" part removed for more flexibility
public static String error1Sysex = "F000007E4B<device>0E01F7"; // received less bytes then expected
public static String error2Sysex = "F000007E4B<device>0E03F7"; // wrong checksum
public static String error3Sysex = "F000007E4B<device>0E0AF7"; // bankstick or patch/drumset/ensemble not available
public static String error4Sysex = "F000007E4B<device>0E0BF7"; // parameter not available
public static String error5Sysex = "F000007E4B<device>0E10F7"; // RAM access not supported
public static String error6Sysex = "F000007E4B<device>0E11F7"; // BankStick too small
public static String acknowledgedSysex = "F000007E4B<device>0F"; // Acknowledged,
// TK:
// "<sids>F7"
// part
// removed
// for
// more
// flexibility
public static String error1Sysex = "F000007E4B<device>0E01F7"; // received
// less
// bytes
// then
// expected
public static String error2Sysex = "F000007E4B<device>0E03F7"; // wrong
// checksum
public static String error3Sysex = "F000007E4B<device>0E0AF7"; // bankstick
// or
// patch/drumset/ensemble
// not
// available
public static String error4Sysex = "F000007E4B<device>0E0BF7"; // parameter
// not
// available
public static String error5Sysex = "F000007E4B<device>0E10F7"; // RAM access
// not
// supported
public static String error6Sysex = "F000007E4B<device>0E11F7"; // BankStick
// too small
 
public static String[] leadParams = { "===None===", "Volume", "Osc Phase",
"Osc Detune", "Filter Cutoff", "Filter Res.", "Filter Chan.",
361,5 → 615,6
public static String[] drumModel = { "BD1", "BD2", "BD3", "SD1", "SD2",
"SD3", "HH1", "HH2", "TOM1", "TOM2", "CLAP", "FX1", "FX2", "FX3",
"FX4", "FX5", "FX6", "FX7", "FX8", "FX9" };
public static String[] bassOctaves = {"OFF","+1","+2","+3","-4","-3","-2","-1"};
public static String[] bassOctaves = { "OFF", "+1", "+2", "+3", "-4", "-3",
"-2", "-1" };
}
/trunk/java/org/midibox/sidedit/EnsembleSpecs.java
35,45 → 35,79
private static int combo = 6;
 
public static Vector createENSSID(Patch patch, int offset) {
Vector ensControl = new Vector();
ensControl.add(new SIDSysexParameterControl(rotary, new String[]{"A","B","C","D","E","F","G","H"}, 0, patch, 0+offset, 0, 3, "Bank"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 1, patch, 1+offset, 0, 7, "Patch"));
ensControl.add(new SIDSysexParameterControl(combo, new String[]{"Master","Slave","Auto",""}, 0, patch, 2+offset, 0, 2, "BPM generator mode"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 2+offset, 4, 1, "LogFilter","Logarithmic filter cutoff"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 2+offset, 6, 1, "Mono"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 2+offset, 7, 1, "DOR","Disable automatic Oscillator Reset during patch change"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 3+offset, 0, 1, "F2A","Filter to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 3+offset, 1, 1, "V2A","Volume to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 3+offset, 2, 1, "P2A","Pulsewidth to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 3+offset, 3, 1, "K2A","Key to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 3+offset, 4, 1, "O2A","Oscillator Frequency to Analog"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 5+offset, 0, 8, "BPM rate"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 6+offset, 0, 3, "SPM","Super Poly Mode"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 0, 1, "AOUT1"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 1, 1, "AOUT2"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 2, 1, "AOUT3"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 3, 1, "AOUT4"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 4, 1, "AOUT5"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 5, 1, "AOUT6"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 6, 1, "AOUT7"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 7+offset, 7, 1, "AOUT8"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 8+offset, 0, 16, "Filter Lmin"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 10+offset, 0, 16, "Filter Lmax"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 12+offset, 0, 16, "Filter Rmin"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 14+offset, 0, 16, "Filter Rmax"));
for(int i=0;i<6;i++) {
ensControl.add(new SIDSysexParameterControl(rotary, null, 1, patch, 16+offset+(i*8), 0, 4, "MIDI chan"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch, 16+offset+(i*8), 4, 1, "Disable"));
ensControl.add(new SIDSysexParameterControl(rotary, createNotes(), 0, patch, 17+offset+(i*8), 0, 7, "LowerSplit"));
ensControl.add(new SIDSysexParameterControl(rotary, createNotes(), 0, patch, 18+offset+(i*8), 0, 7, "UpperSplit"));
ensControl.add(new SIDSysexParameterControl(rotary, null, -64, patch, 19+offset+(i*8), 0, 7, "Transpose"));
}
Vector ensControl = new Vector();
ensControl.add(new SIDSysexParameterControl(rotary, new String[] { "A",
"B", "C", "D", "E", "F", "G", "H" }, 0, patch, 0 + offset, 0,
3, "Bank"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 1, patch,
1 + offset, 0, 7, "Patch"));
ensControl.add(new SIDSysexParameterControl(combo, new String[] {
"Master", "Slave", "Auto", "" }, 0, patch, 2 + offset, 0, 2,
"BPM generator mode"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
2 + offset, 4, 1, "LogFilter", "Logarithmic filter cutoff"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
2 + offset, 6, 1, "Mono"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
2 + offset, 7, 1, "DOR",
"Disable automatic Oscillator Reset during patch change"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
3 + offset, 0, 1, "F2A", "Filter to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
3 + offset, 1, 1, "V2A", "Volume to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
3 + offset, 2, 1, "P2A", "Pulsewidth to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
3 + offset, 3, 1, "K2A", "Key to Analog"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
3 + offset, 4, 1, "O2A", "Oscillator Frequency to Analog"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
5 + offset, 0, 8, "BPM rate"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
6 + offset, 0, 3, "SPM", "Super Poly Mode"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 0, 1, "AOUT1"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 1, 1, "AOUT2"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 2, 1, "AOUT3"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 3, 1, "AOUT4"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 4, 1, "AOUT5"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 5, 1, "AOUT6"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 6, 1, "AOUT7"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
7 + offset, 7, 1, "AOUT8"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
8 + offset, 0, 16, "Filter Lmin"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
10 + offset, 0, 16, "Filter Lmax"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
12 + offset, 0, 16, "Filter Rmin"));
ensControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
14 + offset, 0, 16, "Filter Rmax"));
for (int i = 0; i < 6; i++) {
ensControl.add(new SIDSysexParameterControl(rotary, null, 1, patch,
16 + offset + (i * 8), 0, 4, "MIDI chan"));
ensControl.add(new SIDSysexParameterControl(button, null, 0, patch,
16 + offset + (i * 8), 4, 1, "Disable"));
ensControl.add(new SIDSysexParameterControl(rotary, createNotes(),
0, patch, 17 + offset + (i * 8), 0, 7, "LowerSplit"));
ensControl.add(new SIDSysexParameterControl(rotary, createNotes(),
0, patch, 18 + offset + (i * 8), 0, 7, "UpperSplit"));
ensControl.add(new SIDSysexParameterControl(rotary, null, -64,
patch, 19 + offset + (i * 8), 0, 7, "Transpose"));
}
return ensControl;
}
public static String[] createNotes() {
}
 
public static String[] createNotes() {
String[] staticStr = new String[128];
String[] notes = { "c-", "c#", "d-", "d#", "e-", "f-", "f#", "g-", "g#", "a-", "a#", "b-" };
String[] notes = { "c-", "c#", "d-", "d#", "e-", "f-", "f#", "g-",
"g#", "a-", "a#", "b-" };
 
for (int i = 0; i < 128; i++) {
int octave = (int) Math.floor((i) / 12) - 2;
82,7 → 116,7
} else {
staticStr[i] = notes[(i) % 12].toUpperCase() + Math.abs(octave);
}
}
}
return staticStr;
}
}
/trunk/java/org/midibox/sidedit/MultiSpecs.java
37,7 → 37,8
 
public static Vector createMSTR(Patch patch) {
Vector drumControl = new Vector();
drumControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 82, 0, 7, "Volume"));
drumControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
82, 0, 7, "Volume"));
return drumControl;
}
 
44,53 → 45,113
public static Vector createInstrument(Patch patch, int offset) {
Vector multiControl = new Vector();
// Master
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 3, 1, "Poly", "Switches between Poly/Mono mode"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 0, 1, "Legato"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 2, 1, "Fingered Portamento"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 1, 1, "Wavetable only"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 113 + offset, 0, 4, "Voice Assign", "Voice assignment"));
multiControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.multiParams, 0, patch, 114 + offset, 0, 8, "Velocity Assign", "Velocity parameter assignment"));
multiControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.multiParams, 0, patch, 115 + offset, 0, 8, "PitchB. Assign", "Pitch Bender assignment"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
112 + offset, 3, 1, "Poly", "Switches between Poly/Mono mode"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
112 + offset, 0, 1, "Legato"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
112 + offset, 2, 1, "Fingered Portamento"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
112 + offset, 1, 1, "Wavetable only"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
113 + offset, 0, 4, "Voice Assign", "Voice assignment"));
multiControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.multiParams, 0, patch, 114 + offset, 0, 8,
"Velocity Assign", "Velocity parameter assignment"));
multiControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.multiParams, 0, patch, 115 + offset, 0, 8,
"PitchB. Assign", "Pitch Bender assignment"));
 
// LFO 1&2
for (int i = 0; i < 2; i++) {
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + (7 * i) + offset, 0, 1, "On/Off", "Enable/disable LFO"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + (7 * i) + offset, 1, 1, "Key Sync", "Key synchronisation"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + (7 * i) + offset, 2, 1, "MIDI Sync", "Global clock synchronisation"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + (7 * i) + offset, 3, 1, "Oneshot", "Oneshot mode"));
multiControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch, 116 + (7 * i) + offset, 4, 4, "Waveform"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 117 + (7 * i) + offset, 0, 8, "Pitch Depth", "Pitch modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 118 + (7 * i) + offset, 0, 8, "Rate"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 119 + (7 * i) + offset, 0, 8, "Delay"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 120 + (7 * i) + offset, 0, 8, "Phase"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 121 + (7 * i) + offset, 0, 8, "PWM Depth", "Pulse width modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 122 + (7 * i) + offset, 0, 8, "Cutoff Depth", "Filter cutoff modulation depth"));
multiControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 116 + (7 * i) + offset, 0, 1, "On/Off",
"Enable/disable LFO"));
multiControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 116 + (7 * i) + offset, 1, 1, "Key Sync",
"Key synchronisation"));
multiControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 116 + (7 * i) + offset, 2, 1, "MIDI Sync",
"Global clock synchronisation"));
multiControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 116 + (7 * i) + offset, 3, 1, "Oneshot",
"Oneshot mode"));
multiControl.add(new SIDSysexParameterControl(lfoselect, null, 0,
patch, 116 + (7 * i) + offset, 4, 4, "Waveform"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 117 + (7 * i) + offset, 0, 8, "Pitch Depth",
"Pitch modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 118 + (7 * i) + offset, 0, 8, "Rate"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 119 + (7 * i) + offset, 0, 8, "Delay"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 120 + (7 * i) + offset, 0, 8, "Phase"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 121 + (7 * i) + offset, 0, 8, "PWM Depth",
"Pulse width modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 122 + (7 * i) + offset, 0, 8, "Cutoff Depth",
"Filter cutoff modulation depth"));
}
 
// Envelope
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 4, 1, "Curve to Attack", "Curve assigned to Attack rate"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 5, 1, "Curve to Decay", "Curve assigned to Decay rate"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 6, 1, "Curve to Sustain", "Curve assigned to Sustain rate"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 7, 1, "MIDI Sync", "Global clock synchronisation"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 131 + offset, 0, 8, "Depth Pitch", "Pitch modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 132 + offset, 0, 8, "Depth PWM", "Pulse width modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 133 + offset, 0, 8, "Depth Cutoff", "Filter cutoff modulation depth"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 134 + offset, 0, 8, "Attack", "Attack rate"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 135 + offset, 0, 8, "Decay", "Decay rate"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 136 + offset, 0, 8, "Sustain", "Sustain level"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 137 + offset, 0, 8, "Release", "Release rate"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 138 + offset, 0, 8, "Curve"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 4, 1, "Curve to Attack",
"Curve assigned to Attack rate"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 5, 1, "Curve to Decay",
"Curve assigned to Decay rate"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 6, 1, "Curve to Sustain",
"Curve assigned to Sustain rate"));
multiControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 7, 1, "MIDI Sync",
"Global clock synchronisation"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 131 + offset, 0, 8, "Depth Pitch",
"Pitch modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 132 + offset, 0, 8, "Depth PWM",
"Pulse width modulation depth"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 133 + offset, 0, 8, "Depth Cutoff",
"Filter cutoff modulation depth"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
134 + offset, 0, 8, "Attack", "Attack rate"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
135 + offset, 0, 8, "Decay", "Decay rate"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
136 + offset, 0, 8, "Sustain", "Sustain level"));
multiControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
137 + offset, 0, 8, "Release", "Release rate"));
multiControl.add(new SIDSysexParameterControl(rotary, null, -128,
patch, 138 + offset, 0, 8, "Curve"));
 
// Wavetable
multiControl.add(new SIDSysexParameterControl(rotary, createDividers(), 0, patch, 139 + offset, 0, 6, "Clock Divider", "Clock divider (sets tempo)"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 139 + offset, 6, 1, "reserved", "Reserved"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 139 + offset, 7, 1, "reserved", "Reserved"));
multiControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.multiParams, 0, patch, 140 + offset, 0, 8, "Assign", "Parameter assignment"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 141 + offset, 0, 7, "Start Pos", "Start position in wavetable"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 141 + offset, 7, 1, "reserved", "reserved flag"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 142 + offset, 0, 7, "End Pos", "End position in wavetable"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 143 + offset, 0, 7, "Loop Pos", "Loop position in wavetable"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch, 143 + offset, 7, 1, "Oneshot"));
multiControl.add(new SIDSysexParameterControl(rotary, createDividers(),
0, patch, 139 + offset, 0, 6, "Clock Divider",
"Clock divider (sets tempo)"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
139 + offset, 6, 1, "reserved", "Reserved"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
139 + offset, 7, 1, "reserved", "Reserved"));
multiControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.multiParams, 0, patch, 140 + offset, 0, 8,
"Assign", "Parameter assignment"));
multiControl
.add(new SIDSysexParameterControl(rotary, null, 0, patch,
141 + offset, 0, 7, "Start Pos",
"Start position in wavetable"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
141 + offset, 7, 1, "reserved", "reserved flag"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
142 + offset, 0, 7, "End Pos", "End position in wavetable"));
multiControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
143 + offset, 0, 7, "Loop Pos", "Loop position in wavetable"));
multiControl.add(new SIDSysexParameterControl(button, null, 0, patch,
143 + offset, 7, 1, "Oneshot"));
 
return multiControl;
}
99,7 → 160,8
Vector wtControl = new Vector();
// Wavetable data
for (int c = 0; c < 128; c++) {
wtControl.add(new SIDSysexParameterControl(slider, createWTStr(), 0, patch, 384 + c, 0, 8, Integer.toString(c)));
wtControl.add(new SIDSysexParameterControl(slider, createWTStr(),
0, patch, 384 + c, 0, 8, Integer.toString(c)));
}
return wtControl;
}
/trunk/java/org/midibox/sidedit/SIDEditController.java
30,8 → 30,8
 
public SIDEditController(Patch p) {
super(p.getReceiver());
this.patch = (Patch)p.clone();
engine = EngineSpecs.getEngine((Patch)patch);
this.patch = (Patch) p.clone();
engine = EngineSpecs.getEngine((Patch) patch);
 
for (int b = 0; b < engine.size(); b++) {
Vector v = (Vector) engine.elementAt(b);
41,7 → 41,7
addSIDSysexParameter(midiParameter);
}
}
}
}
 
public Vector getEngine() {
return engine;
61,7 → 61,7
public Patch getPatch() {
return patch;
}
 
public void Save() {
setChanged();
notifyObservers("Save editor patch");
/trunk/java/org/midibox/sidedit/SIDSysexParameter.java
82,10 → 82,10
 
public void setMidiMaxMinValues(int reso) {
/*
if (reso < 0) {
midimax = (int) Math.floor((Math.pow(2, Math.abs(reso)) - 1) / 2);
midimin = -((int) Math.ceil((Math.pow(2, Math.abs(reso)) - 1) / 2));
*/
* if (reso < 0) { midimax = (int) Math.floor((Math.pow(2,
* Math.abs(reso)) - 1) / 2); midimin = -((int) Math.ceil((Math.pow(2,
* Math.abs(reso)) - 1) / 2));
*/
midimax = (int) Math.pow(2, reso) - 1;
midimin = 0;
resolution = reso;
/trunk/java/org/midibox/sidedit/SIDSysexParameterControl.java
19,12 → 19,12
*/
package org.midibox.sidedit;
 
import java.util.Arrays;
 
import javax.sound.midi.MidiMessage;
 
import org.midibox.midi.MidiUtils;
import org.midibox.sidlibr.Patch;
import java.util.Arrays;
import java.util.Vector;
 
public class SIDSysexParameterControl extends SIDSysexParameter {
 
41,16 → 41,18
private String[] valAlias;
private int[] sparseMatrix;
private int valueOffset;
 
public int[] snapVals;
public String[] snapAlias;
public boolean snap = false;
 
protected String tooltip;
 
protected Object tooltipListener;
 
public SIDSysexParameterControl(int type, String[] valAlias, int offset, Patch patch, int addres, int start_bit, int reso, String name, String tooltip) {
public SIDSysexParameterControl(int type, String[] valAlias, int offset,
Patch patch, int addres, int start_bit, int reso, String name,
String tooltip) {
super(patch, addres, start_bit, reso, name);
setReceive(true);
setSend(true);
57,13 → 59,14
this.tooltip = tooltip;
this.type = type;
this.valueOffset = offset;
if (valAlias!=null) {
if (valAlias != null) {
this.valAlias = valAlias;
sparseMatrix = generateSparseMatrix(valAlias);
}
}
}
 
public SIDSysexParameterControl(int type, String[] valAlias, int offset, Patch patch, int addres, int start_bit, int reso, String name) {
public SIDSysexParameterControl(int type, String[] valAlias, int offset,
Patch patch, int addres, int start_bit, int reso, String name) {
super(patch, addres, start_bit, reso, name);
setReceive(true);
setSend(true);
70,10 → 73,10
this.tooltip = name;
this.type = type;
this.valueOffset = offset;
if (valAlias!=null) {
if (valAlias != null) {
this.valAlias = valAlias;
sparseMatrix = generateSparseMatrix(valAlias);
}
}
}
 
public boolean isReceive() {
121,47 → 124,52
public String[] getValAlias() {
return valAlias;
}
 
public String getMidiValueWithAlias() {
if (snap) {
if (snapAlias==null) {
return Integer.toString(snapVals[getMidiValSnapIndex()]+valueOffset);
if (snapAlias == null) {
return Integer.toString(snapVals[getMidiValSnapIndex()]
+ valueOffset);
} else {
return snapAlias[getMidiValSnapIndex()];
}
} else {
if (valAlias==null) {
return Integer.toString(getMidiValue()+valueOffset);
if (valAlias == null) {
return Integer.toString(getMidiValue() + valueOffset);
} else {
return valAlias[getMidiValue()];
}
}
}
}
 
public void SetMidiValueWithAlias(String s) {
int val = getMidiValue();
if (snap) {
if ((snapAlias==null) && (Arrays.binarySearch(snapVals,Integer.valueOf(s)-valueOffset)!=-1)) {
val = Integer.valueOf(s)-valueOffset;
if ((snapAlias == null)
&& (Arrays.binarySearch(snapVals, Integer.valueOf(s)
- valueOffset) != -1)) {
val = Integer.valueOf(s) - valueOffset;
} else {
val = snapVals[searchStringArray(snapAlias,s,val)];
val = snapVals[searchStringArray(snapAlias, s, val)];
}
} else {
if (valAlias==null) {
val = Integer.valueOf(s)-valueOffset;
if (valAlias == null) {
val = Integer.valueOf(s) - valueOffset;
} else {
val = searchStringArray(valAlias,s,val);
}
val = searchStringArray(valAlias, s, val);
}
}
setMidiValue(val,true);
setMidiValue(val, true);
}
 
public int getMidiValSnapIndex() {
int i = Arrays.binarySearch(snapVals,getMidiValue());
if (i==-1) {i = 0;}
return i;
int i = Arrays.binarySearch(snapVals, getMidiValue());
if (i == -1) {
i = 0;
}
return i;
}
 
private int searchStringArray(String[] sarray, String s, int def) {
int val = def;
for (int j = 0; j < sarray.length; j++) {
172,29 → 180,29
}
return val;
}
 
public String[] getSparseValAlias() {
String[] s = new String[sparseMatrix.length];
for(int i=0;i<sparseMatrix.length;i++) {
for (int i = 0; i < sparseMatrix.length; i++) {
s[i] = valAlias[sparseMatrix[i]];
}
return s;
}
private String[] generateAlias () {
String[] s = new String[midimax-midimin+1];
for (int i=midimin;i<=midimax;i++) {
s[i-midimin] = Integer.toString(i+valueOffset);
 
private String[] generateAlias() {
String[] s = new String[midimax - midimin + 1];
for (int i = midimin; i <= midimax; i++) {
s[i - midimin] = Integer.toString(i + valueOffset);
}
return s;
}
 
public int getMidiValueWithSparse() {
return Arrays.binarySearch(sparseMatrix,getMidiValue());
}
return Arrays.binarySearch(sparseMatrix, getMidiValue());
}
 
public void setMidiValueWithSparse(int i) {
setMidiValue(sparseMatrix[i],true);
setMidiValue(sparseMatrix[i], true);
}
 
public int[] generateSparseMatrix(String[] in) {
204,7 → 212,7
temp = temp + 1;
}
}
 
int[] sparseMat = new int[temp];
temp = 0;
for (int i = 0; i < in.length; i++) {
214,9 → 222,10
}
return sparseMat;
}
 
public void send(MidiMessage message, long lTimeStamp) {
String m = MidiUtils.getHexString(message.getMessage()).replace(" ", "");
String m = MidiUtils.getHexString(message.getMessage())
.replace(" ", "");
if (m.indexOf(SIDSysexInfo.acknowledgedSysex.replace("<device>", "00")) == 0) {
// System.out.println("MBSID: Acknowdledged!");
} else if (m.equals(SIDSysexInfo.error1Sysex.replace("<device>", "00"))) {
224,7 → 233,8
} else if (m.equals(SIDSysexInfo.error2Sysex.replace("<device>", "00"))) {
System.out.println("MBSID: Wrong checksum");
} else if (m.equals(SIDSysexInfo.error3Sysex.replace("<device>", "00"))) {
System.out.println("MBSID: Bankstick or patch/drumset/ensemble not available");
System.out
.println("MBSID: Bankstick or patch/drumset/ensemble not available");
} else if (m.equals(SIDSysexInfo.error4Sysex.replace("<device>", "00"))) {
System.out.println("MBSID: Parameter not available");
} else if (m.equals(SIDSysexInfo.error5Sysex.replace("<device>", "00"))) {
/trunk/java/org/midibox/sidedit/BasslineSpecs.java
38,28 → 38,47
 
public static Vector createMSTR(Patch patch, int offset) {
Vector basslineControl = new Vector();
basslineControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 0, 1, "Legato"));
basslineControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 2, 1, "Fing.Porta","Fingered Portamento"));
basslineControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 1, 1, "Manual/Seq", "MIDI Note playing/Sequencer mode"));
basslineControl.add(new SIDSysexParameterControl(button, null, 0, patch, 112 + offset, 3, 1, "Phase Sync", "Oscillator phase synchronisation"));
basslineControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 112 + offset, 0, 1, "Legato"));
basslineControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
112 + offset, 2, 1, "Fing.Porta", "Fingered Portamento"));
basslineControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 112 + offset, 1, 1, "Manual/Seq",
"MIDI Note playing/Sequencer mode"));
basslineControl.add(new SIDSysexParameterControl(button, null, 0,
patch, 112 + offset, 3, 1, "Phase Sync",
"Oscillator phase synchronisation"));
// OSC2
basslineControl.add(new SIDSysexParameterControl(waveselect, null, 0, patch, 160 + offset, 0, 8, "Waveform", "Select a waveform"));
basslineControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 161 + offset, 0, 12, "Pulse Width", "Pulse Width"));
basslineControl.add(new SIDSysexParameterControl(rotary, SIDSysexInfo.bassOctaves, 0, patch, 163 + offset, 0, 3, "Octave"));
basslineControl.add(new SIDSysexParameterControl(rotary, createStatic(), 0, patch, 164 + offset, 0, 7, "Static note"));
basslineControl.add(new SIDSysexParameterControl(waveselect, null, 0,
patch, 160 + offset, 0, 8, "Waveform", "Select a waveform"));
basslineControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 161 + offset, 0, 12, "Pulse Width", "Pulse Width"));
basslineControl.add(new SIDSysexParameterControl(rotary,
SIDSysexInfo.bassOctaves, 0, patch, 163 + offset, 0, 3,
"Octave"));
basslineControl.add(new SIDSysexParameterControl(rotary,
createStatic(), 0, patch, 164 + offset, 0, 7, "Static note"));
// OSC3
basslineControl.add(new SIDSysexParameterControl(waveselect, null, 0, patch, 168 + offset, 0, 8, "Waveform", "Select a waveform"));
basslineControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 169 + offset, 0, 12, "Pulse Width", "Pulse Width"));
basslineControl.add(new SIDSysexParameterControl(rotary, SIDSysexInfo.bassOctaves, 0, patch, 171 + offset, 0, 3, "Octave"));
basslineControl.add(new SIDSysexParameterControl(rotary, createStatic(), 0, patch, 172 + offset, 0, 7, "Static note"));
basslineControl.add(new SIDSysexParameterControl(waveselect, null, 0,
patch, 168 + offset, 0, 8, "Waveform", "Select a waveform"));
basslineControl.add(new SIDSysexParameterControl(rotary, null, 0,
patch, 169 + offset, 0, 12, "Pulse Width", "Pulse Width"));
basslineControl.add(new SIDSysexParameterControl(rotary,
SIDSysexInfo.bassOctaves, 0, patch, 171 + offset, 0, 3,
"Octave"));
basslineControl.add(new SIDSysexParameterControl(rotary,
createStatic(), 0, patch, 172 + offset, 0, 7, "Static note"));
 
return basslineControl;
}
 
public static Vector createMSTRBOTH(Patch patch) {
Vector masterBoth = new Vector();
masterBoth.add(new SIDSysexParameterControl(rotary, null, 0, patch, 81, 0, 8, "Detune","Oscillators Detune"));
masterBoth.add(new SIDSysexParameterControl(rotary, null, 0, patch, 83, 0, 8, "Phase Offset", "Oscillators Phase Offset"));
masterBoth.add(new SIDSysexParameterControl(rotary, null, 0, patch, 81,
0, 8, "Detune", "Oscillators Detune"));
masterBoth.add(new SIDSysexParameterControl(rotary, null, 0, patch, 83,
0, 8, "Phase Offset", "Oscillators Phase Offset"));
return masterBoth;
}
 
66,29 → 85,61
public static Vector createLFO(Patch patch, int offset) {
Vector lfoControl = new Vector();
// LFO1
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + offset, 2, 1, "MIDI Sync", "Global clock synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + offset, 3, 1, "Oneshot", "Oneshot mode"));
lfoControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch, 116 + offset, 4, 4, "Waveform"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 117 + offset, 0, 8, "Pitch Depth", "Pitch modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 118 + offset, 0, 8, "Rate")); // Let op CSn flag!
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 119 + offset, 0, 8, "Delay"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 120 + offset, 0, 8, "Phase"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 121 + offset, 0, 8, "PWM depth", "Pulse width modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 122 + offset, 0, 8, "Cutoff depth","Filter cutoff modulation depth"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
116 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
lfoControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
116 + offset, 2, 1, "MIDI Sync",
"Global clock synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
116 + offset, 3, 1, "Oneshot", "Oneshot mode"));
lfoControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch,
116 + offset, 4, 4, "Waveform"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
117 + offset, 0, 8, "Pitch Depth", "Pitch modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
118 + offset, 0, 8, "Rate")); // Let op CSn flag!
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
119 + offset, 0, 8, "Delay"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
120 + offset, 0, 8, "Phase"));
lfoControl
.add(new SIDSysexParameterControl(rotary, null, -128, patch,
121 + offset, 0, 8, "PWM depth",
"Pulse width modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
122 + offset, 0, 8, "Cutoff depth",
"Filter cutoff modulation depth"));
// LFO2
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 123 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 123 + offset, 2, 1, "MIDI Sync", "Global clock synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 123 + offset, 3, 1, "Oneshot", "One shot mode"));
lfoControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch, 123 + offset, 4, 4, "Waveform"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 124 + offset, 0, 8, "Pitch Depth", "Pitch modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 125 + offset, 0, 8, "Rate"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 126 + offset, 0, 8, "Delay"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 127 + offset, 0, 8, "Phase"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 128 + offset, 0, 8, "PWM Depth", "Pulse width modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 129 + offset, 0, 8, "Cutoff Depth", "Filter cutoff modulation depth"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
123 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
lfoControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
123 + offset, 2, 1, "MIDI Sync",
"Global clock synchronisation"));
lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch,
123 + offset, 3, 1, "Oneshot", "One shot mode"));
lfoControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch,
123 + offset, 4, 4, "Waveform"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
124 + offset, 0, 8, "Pitch Depth", "Pitch modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
125 + offset, 0, 8, "Rate"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
126 + offset, 0, 8, "Delay"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
127 + offset, 0, 8, "Phase"));
lfoControl
.add(new SIDSysexParameterControl(rotary, null, -128, patch,
128 + offset, 0, 8, "PWM Depth",
"Pulse width modulation depth"));
lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
129 + offset, 0, 8, "Cutoff Depth",
"Filter cutoff modulation depth"));
return lfoControl;
}
 
95,19 → 146,41
public static Vector createENV(Patch patch, int offset) {
Vector envControl = new Vector();
// Envelope
envControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 4, 1, "Curve to Attack", "Curve assigned to Attack rate"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 5, 1, "Curve to Decay", "Curve assigned to Decay rate"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 6, 1, "Curve to Sustain", "Curve assigned to Sustain rate"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch, 130 + offset, 7, 1, "MIDI Sync", "Global clock synchronisation"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 131 + offset, 0, 8, "Depth Pitch", "Pitch modulation depth"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 132 + offset, 0, 8, "Depth PWM", "Pulse width modulation depth"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 133 + offset, 0, 8, "Depth Cutoff", "Filter cutoff modulation depth"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 134 + offset, 0, 8, "Attack", "Attack rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 135 + offset, 0, 8, "Decay", "Decay rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 136 + offset, 0, 8, "Sustain", "Sustain level"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 137 + offset, 0, 8, "Release", "Release rate"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 138 + offset, 0, 8, "Curve"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 144 + offset, 0, 8, "Accent Decay","Decay rate used on accented notes"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 4, 1, "Curve to Attack",
"Curve assigned to Attack rate"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 5, 1, "Curve to Decay",
"Curve assigned to Decay rate"));
envControl.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 6, 1, "Curve to Sustain",
"Curve assigned to Sustain rate"));
envControl
.add(new SIDSysexParameterControl(button, null, 0, patch,
130 + offset, 7, 1, "MIDI Sync",
"Global clock synchronisation"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
131 + offset, 0, 8, "Depth Pitch", "Pitch modulation depth"));
envControl
.add(new SIDSysexParameterControl(rotary, null, -128, patch,
132 + offset, 0, 8, "Depth PWM",
"Pulse width modulation depth"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
133 + offset, 0, 8, "Depth Cutoff",
"Filter cutoff modulation depth"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
134 + offset, 0, 8, "Attack", "Attack rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
135 + offset, 0, 8, "Decay", "Decay rate"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
136 + offset, 0, 8, "Sustain", "Sustain level"));
envControl.add(new SIDSysexParameterControl(slider, null, 0, patch,
137 + offset, 0, 8, "Release", "Release rate"));
envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch,
138 + offset, 0, 8, "Curve"));
envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,
144 + offset, 0, 8, "Accent Decay",
"Decay rate used on accented notes"));
return envControl;
}
 
114,11 → 187,20
public static Vector createSEQ(Patch patch, int offset) {
Vector seqControl = new Vector();
// Sequencer
seqControl.add(new SIDSysexParameterControl(rotary, createDividers(), 0, patch, 139 + offset, 0, 6, "Clock Divider", "Clock divider (sets tempo)"));
seqControl.add(new SIDSysexParameterControl(button, null, 0, patch, 139 + offset, 7, 1, "Pattern Sync", "Pattern changes synchronised to measure"));
seqControl.add(new SIDSysexParameterControl(radio, new String[]{"#1","#2","#3","#4","#5","#6","#7","#8","OFF"}, 0, patch, 140 + offset, 0, 4, "Sequence", "Sequencer number"));
seqControl.add(new SIDSysexParameterControl(rotary, createSteps(), 0, patch, 141 + offset, 0, 4, "Steps", "Number of steps"));
seqControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.basslineParams, 0, patch, 142 + offset, 0, 8, "Assign"));
seqControl.add(new SIDSysexParameterControl(rotary, createDividers(),
0, patch, 139 + offset, 0, 6, "Clock Divider",
"Clock divider (sets tempo)"));
seqControl.add(new SIDSysexParameterControl(button, null, 0, patch,
139 + offset, 7, 1, "Pattern Sync",
"Pattern changes synchronised to measure"));
seqControl.add(new SIDSysexParameterControl(radio, new String[] { "#1",
"#2", "#3", "#4", "#5", "#6", "#7", "#8", "OFF" }, 0, patch,
140 + offset, 0, 4, "Sequence", "Sequencer number"));
seqControl.add(new SIDSysexParameterControl(rotary, createSteps(), 0,
patch, 141 + offset, 0, 4, "Steps", "Number of steps"));
seqControl.add(new SIDSysexParameterControl(combo,
SIDSysexInfo.basslineParams, 0, patch, 142 + offset, 0, 8,
"Assign"));
return seqControl;
}
 
126,19 → 208,27
Vector seqDataControl = new Vector();
// Sequencer data
for (int i = 0; i < 16 * 8; i++) {
seqDataControl.add(new SIDSysexParameterControl(simplerotary, null, 0, patch, 256 + i, 0, 4, "Note"));
seqDataControl.add(new SIDSysexParameterControl(simplerotary, SIDSysexInfo.octaves, 0, patch, 256 + i, 4, 2, "Oct", "Octave"));
seqDataControl.add(new SIDSysexParameterControl(simplerotary, null, 0, patch, 384 + i, 0, 7, "Par", "Parameter value"));
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 256 + i, 6, 1, "Glide"));
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 384 + i, 7, 1, "Acc", "Accent"));
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 256 + i, 7, 1, "Gate"));
seqDataControl.add(new SIDSysexParameterControl(simplerotary, null,
0, patch, 256 + i, 0, 4, "Note"));
seqDataControl.add(new SIDSysexParameterControl(simplerotary,
SIDSysexInfo.octaves, 0, patch, 256 + i, 4, 2, "Oct",
"Octave"));
seqDataControl.add(new SIDSysexParameterControl(simplerotary, null,
0, patch, 384 + i, 0, 7, "Par", "Parameter value"));
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
0, patch, 256 + i, 6, 1, "Glide"));
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
0, patch, 384 + i, 7, 1, "Acc", "Accent"));
seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
0, patch, 256 + i, 7, 1, "Gate"));
}
return seqDataControl;
}
public static String[] createStatic() {
 
public static String[] createStatic() {
String[] staticStr = new String[128];
String[] notes = { "c-", "c#", "d-", "d#", "e-", "f-", "f#", "g-", "g#", "a-", "a#", "b-" };
String[] notes = { "c-", "c#", "d-", "d#", "e-", "f-", "f#", "g-",
"g#", "a-", "a#", "b-" };
 
for (int i = 0; i < 128; i++) {
int octave = (int) Math.floor((i) / 12) - 2;
147,11 → 237,11
} else {
staticStr[i] = notes[(i) % 12].toUpperCase() + Math.abs(octave);
}
}
}
staticStr[0] = "OFF";
return staticStr;
}
 
public static String[] createSteps() {
String[] s = new String[16];
for (int i = 0; i < s.length; i++) {
/trunk/java/org/midibox/mios/gui/DebugFunctionGUI.java
199,7 → 199,8
deviceIDPanel.add(deviceIDLabel, gbc);
gbc.gridx++;
 
deviceIDSpinner = new JSpinner(new SpinnerNumberModel(debugFunction.getDeviceID(), 0, 127, 1));
deviceIDSpinner = new JSpinner(new SpinnerNumberModel(debugFunction
.getDeviceID(), 0, 127, 1));
deviceIDSpinner.addChangeListener(this);
JSpinner.DefaultEditor editor = (JSpinner.DefaultEditor) deviceIDSpinner
.getEditor();
333,7 → 334,8
toolBar.add(delayTimeLabel, gbc);
gbc.gridx++;
 
delayTimeSpinner = new JSpinner(new SpinnerNumberModel(debugFunction.getDelayTime(), 0, 2000, 1));
delayTimeSpinner = new JSpinner(new SpinnerNumberModel(debugFunction
.getDelayTime(), 0, 2000, 1));
delayTimeSpinner.addChangeListener(this);
toolBar.add(delayTimeSpinner, gbc);
 
1021,12 → 1023,12
showHelp();
 
} else if (source == sramReadAddress) {
debugFunction.setSramReadAddress(decodeString(
sramReadAddress.getText(), displayHexButton.isSelected()));
debugFunction.setSramReadAddress(decodeString(sramReadAddress
.getText(), displayHexButton.isSelected()));
 
} else if (source == sramReadCounter) {
debugFunction.setSramReadCounter(decodeString(
sramReadCounter.getText(), displayHexButton.isSelected()));
debugFunction.setSramReadCounter(decodeString(sramReadCounter
.getText(), displayHexButton.isSelected()));
 
} else if (source == sramWriteAddress) {
debugFunction.setSramWriteAddress(decodeString(sramWriteAddress
1033,8 → 1035,8
.getText(), displayHexButton.isSelected()));
 
} else if (source == sramWriteData) {
debugFunction.setSramWriteData(decodeString(sramWriteData.getText(),
displayHexButton.isSelected()));
debugFunction.setSramWriteData(decodeString(
sramWriteData.getText(), displayHexButton.isSelected()));
}
}
 
1047,12 → 1049,12
Object source = fe.getSource();
 
if (source == sramReadAddress) {
debugFunction.setSramReadAddress(decodeString(
sramReadAddress.getText(), displayHexButton.isSelected()));
debugFunction.setSramReadAddress(decodeString(sramReadAddress
.getText(), displayHexButton.isSelected()));
 
} else if (source == sramReadCounter) {
debugFunction.setSramReadCounter(decodeString(
sramReadCounter.getText(), displayHexButton.isSelected()));
debugFunction.setSramReadCounter(decodeString(sramReadCounter
.getText(), displayHexButton.isSelected()));
 
} else if (source == sramWriteAddress) {
debugFunction.setSramWriteAddress(decodeString(sramWriteAddress
1059,8 → 1061,8
.getText(), displayHexButton.isSelected()));
 
} else if (source == sramWriteData) {
debugFunction.setSramWriteData(decodeString(sramWriteData.getText(),
displayHexButton.isSelected()));
debugFunction.setSramWriteData(decodeString(
sramWriteData.getText(), displayHexButton.isSelected()));
}
}
 
1077,7 → 1079,7
updateDebugControls();
 
} else if (object == DebugFunction.DEVICE_ID) {
 
deviceIDSpinner.setValue(new Integer(debugFunction.getDeviceID()));
 
} else if (object == DebugFunction.DELAY_TIME) {
1111,7 → 1113,7
} else if (object == DebugFunction.SRAM_WRITE_DATA) {
sramWriteData.setText(changeBase(debugFunction.getSramWriteData(),
showHex));
 
} else if (object == DebugFunction.DEBUG_FUNCTION_PARAMETERS) {
debugFunctionsDataModel.fireTableDataChanged();
checkRows();
/trunk/java/org/midibox/mios/gui/LCDMessageGUI.java
124,7 → 124,7
 
lcdTextArea = new JTextArea(lcdMessage.getLcdHeight(), lcdMessage
.getLcdWidth());
 
lcdTextArea.setBackground(Color.GREEN);
lcdTextArea.setForeground(Color.BLACK);
lcdTextArea.setBorder(new BevelBorder(BevelBorder.LOWERED));
131,7 → 131,7
lcdTextArea.setFont(new Font("Monospaced", Font.BOLD, 20));
lcdTextArea.setLineWrap(false);
lcdTextArea.setWrapStyleWord(false);
 
lcdTextArea.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent fe) {
lcdMessage.setMessageText(lcdTextArea.getText());
192,13 → 192,11
lcdTextArea.setCaretPosition(offs);
}
});
 
String message = lcdMessage.getMessageText();
 
if (message != null) {
 
lcdTextArea.setText(message);
}
 
/trunk/java/org/midibox/mios/gui/HexFileUploadGUI.java
117,12 → 117,11
 
fileName = new JTextField();
fileName.setEditable(false);
 
File file = hexFileUpload.getFile();
 
if (file != null) {
 
fileName.setText(file.getPath());
}
 
/trunk/java/org/midibox/mios/LCDMessage.java
87,7 → 87,7
 
public void setLcdHeight(int lcdHeight) {
this.lcdHeight = lcdHeight;
 
setChanged();
notifyObservers(LCD_HEIGHT);
clearChanged();
/trunk/java/org/midibox/mios/xml/HexFileUploadDeviceManagerXML.java
3,7 → 3,6
import java.util.Iterator;
import java.util.Vector;
 
import org.midibox.midi.MidiFilterDevice;
import org.midibox.mios.HexFileUploadDevice;
import org.midibox.mios.HexFileUploadDeviceManager;
import org.midibox.utils.xml.XMLUtils;
27,7 → 26,7
super(rootElementTag);
 
this.hexFileUploadDeviceManager = hexFileUploadDeviceManager;
 
tags.add(TAG_HEX_FILE_UPLOAD_DEVICES);
tags.add(HexFileUploadDeviceXML.TAG_ROOT_ELEMENT);
}
65,9 → 64,10
HexFileUploadDeviceXML hexFileUploadDeviceXML = new HexFileUploadDeviceXML(
hexFileUploadDevice,
HexFileUploadDeviceXML.TAG_ROOT_ELEMENT);
hexFileUploadDeviceManager.addHexFileUploadDevice(hexFileUploadDevice);
 
hexFileUploadDeviceManager
.addHexFileUploadDevice(hexFileUploadDevice);
 
hexFileUploadDeviceXML.loadXML(element);
}
}
/trunk/java/org/midibox/mios/xml/LCDMessageXML.java
29,36 → 29,41
super(lcdMessage, rootElementTag);
 
this.lcdMessage = lcdMessage;
 
tags.add(TAG_MESSAGE_TEXT);
}
 
protected void parseElement(Element element) {
 
super.parseElement(element);
 
String name = element.getNodeName();
 
if (name == rootElementTag) {
lcdMessage.setDeviceID(stringToInt(element.getAttribute(ATTR_DEVICE_ID)));
lcdMessage.setMIOS32Mode(stringToBoolean(element.getAttribute(ATTR_MIOS32_MODE)));
lcdMessage.setLcdWidth(stringToInt(element.getAttribute(ATTR_LCD_WIDTH)));
lcdMessage.setLcdHeight(stringToInt(element.getAttribute(ATTR_LCD_HEIGHT)));
 
lcdMessage.setDeviceID(stringToInt(element
.getAttribute(ATTR_DEVICE_ID)));
 
lcdMessage.setMIOS32Mode(stringToBoolean(element
.getAttribute(ATTR_MIOS32_MODE)));
 
lcdMessage.setLcdWidth(stringToInt(element
.getAttribute(ATTR_LCD_WIDTH)));
 
lcdMessage.setLcdHeight(stringToInt(element
.getAttribute(ATTR_LCD_HEIGHT)));
 
lcdMessage.setMode(stringToInt(element.getAttribute(ATTR_MODE)));
 
lcdMessage.setPosX(stringToInt(element.getAttribute(ATTR_POS_X)));
 
lcdMessage.setPosY(stringToInt(element.getAttribute(ATTR_POS_Y)));
lcdMessage.setLoop(stringToBoolean(element.getAttribute(ATTR_LOOP)));
 
lcdMessage
.setLoop(stringToBoolean(element.getAttribute(ATTR_LOOP)));
 
} else if (name == TAG_MESSAGE_TEXT) {
 
lcdMessage.setMessageText(element.getTextContent());
}
}
/trunk/java/org/midibox/mios/xml/HexFileUploadDeviceXML.java
17,7 → 17,7
super(hexFileUploadDevice, rootElementTag);
 
this.hexFileUploadDevice = hexFileUploadDevice;
 
tags.add(HexFileUploadXML.TAG_ROOT_ELEMENT);
}
 
32,7 → 32,7
HexFileUploadXML hexFileUploadXML = new HexFileUploadXML(
hexFileUploadDevice.getHexFileUpload(),
HexFileUploadXML.TAG_ROOT_ELEMENT);
 
hexFileUploadXML.loadXML(element);
}
}
/trunk/java/org/midibox/mios/xml/HexFileUploadXML.java
11,9 → 11,9
protected HexFileUpload hexFileUpload;
 
public final static String TAG_ROOT_ELEMENT = "hexFileUpload";
 
public final static String TAG_FILE = "hexFile";
 
public final static String ATTR_WAIT_FOR_UPLOAD_REQUEST = "waitForUploadRequest";
 
public final static String ATTR_UPLOAD_MODE = "uploadMode";
25,34 → 25,40
super(hexFileUpload, rootElementTag);
 
this.hexFileUpload = hexFileUpload;
 
tags.add(TAG_FILE);
}
 
protected void parseElement(Element element) {
 
super.parseElement(element);
 
String name = element.getNodeName();
 
if (name == rootElementTag) {
hexFileUpload.setMIOS32Mode(stringToBoolean(element.getAttribute(ATTR_MIOS32_MODE)));
hexFileUpload.setDeviceID(stringToInt(element.getAttribute(ATTR_DEVICE_ID)));
hexFileUpload.setDelayTime(stringToInt(element.getAttribute(ATTR_DELAY_TIME)));
hexFileUpload.setUploadMode(stringToInt(element.getAttribute(ATTR_UPLOAD_MODE)));
hexFileUpload.setWaitForUploadRequest(stringToBoolean(element.getAttribute(ATTR_WAIT_FOR_UPLOAD_REQUEST)));
} if (name == TAG_FILE) {
 
hexFileUpload.setMIOS32Mode(stringToBoolean(element
.getAttribute(ATTR_MIOS32_MODE)));
 
hexFileUpload.setDeviceID(stringToInt(element
.getAttribute(ATTR_DEVICE_ID)));
 
hexFileUpload.setDelayTime(stringToInt(element
.getAttribute(ATTR_DELAY_TIME)));
 
hexFileUpload.setUploadMode(stringToInt(element
.getAttribute(ATTR_UPLOAD_MODE)));
 
hexFileUpload.setWaitForUploadRequest(stringToBoolean(element
.getAttribute(ATTR_WAIT_FOR_UPLOAD_REQUEST)));
 
}
if (name == TAG_FILE) {
 
File file = new File(element.getTextContent());
 
if (file.exists()) {
 
hexFileUpload.setFile(file);
}
}
61,7 → 67,7
public void saveXML(Node node) {
 
super.saveXML(node);
 
rootElement.setAttribute(ATTR_WAIT_FOR_UPLOAD_REQUEST,
booleanToString(hexFileUpload.isWaitForUploadRequest()));
 
72,14 → 78,14
.getDelayTime()));
 
File file = hexFileUpload.getFile();
 
if (file != null) {
 
Element fileElement = document.createElement(TAG_FILE);
 
rootElement.appendChild(fileElement);
fileElement.setTextContent(file.getAbsolutePath());
 
fileElement.setTextContent(file.getAbsolutePath());
}
}
}
/trunk/java/org/midibox/mios/xml/DebugFunctionDeviceXML.java
34,7 → 34,7
DebugFunctionXML debugFunctionXML = new DebugFunctionXML(
debugFunctionDevice.getDebugFunction(),
DebugFunctionXML.TAG_ROOT_ELEMENT);
 
debugFunctionXML.loadXML(element);
}
}
/trunk/java/org/midibox/mios/xml/DebugFunctionXML.java
1,7 → 1,6
package org.midibox.mios.xml;
 
import java.util.Iterator;
import java.util.Vector;
 
import org.midibox.mios.DebugFunction;
import org.midibox.mios.DebugFunctionParameters;
72,24 → 71,25
} else if (name == TAG_DEBUG_FUNCTION_PARAMETERS_LIST) {
 
debugFunction.getDebugFunctionParameters().removeAllElements();
 
NodeList children = element.getChildNodes();
DebugFunctionParameters[] params = new DebugFunctionParameters[children.getLength()];
 
DebugFunctionParameters[] params = new DebugFunctionParameters[children
.getLength()];
 
for (int p = 0; p < children.getLength(); p++) {
 
DebugFunctionParameters debugFunctionParameters = new DebugFunctionParameters();
 
DebugFunctionParametersXML debugFunctionParametersXML = new DebugFunctionParametersXML(
debugFunctionParameters,
DebugFunctionParametersXML.TAG_ROOT_ELEMENT);
 
debugFunctionParametersXML.loadXML(children.item(p));
 
params[p] = debugFunctionParameters;
}
 
debugFunction.insertDebugFunctionParameters(params, 0);
}
}
/trunk/java/org/midibox/sidlibr/Patch.java
20,21 → 20,11
 
package org.midibox.sidlibr;
 
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URISyntaxException;
 
import javax.sound.midi.MidiMessage;
import javax.sound.midi.Receiver;
import javax.sound.midi.SysexMessage;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
 
import org.midibox.midi.MidiUtils;
import org.midibox.sidedit.SIDSysexInfo;
import org.midibox.utils.gui.ImageLoader;
 
public class Patch implements Receiver {
public static Object LEAD = new Object();
54,7 → 44,7
this.receiver = receiver;
this.patchSize = patchSize;
this.initPatches = initPatches;
if (patchSize==256) {
if (patchSize == 256) {
isEnsemble = true;
} else {
isEnsemble = false;
63,7 → 53,7
initPatch();
}
 
private void initPatch() {
private void initPatch() {
if (isEnsemble) {
patch = initPatches.getInitEnsemble();
} else {
158,27 → 148,27
}
return (s + checksum);
}
 
public byte[] getSysex(String pre, String post) {
byte[] preByte = toByteArray(pre);
byte[] postByte = toByteArray(post);
int pr = preByte.length;
int po = postByte.length;
byte[] data = new byte[(2*patch.length)+1+pr+po];
System.arraycopy(preByte, 0, data, 0, pr);
System.arraycopy(postByte, 0, data, data.length-po, po);
 
byte[] data = new byte[(2 * patch.length) + 1 + pr + po];
System.arraycopy(preByte, 0, data, 0, pr);
System.arraycopy(postByte, 0, data, data.length - po, po);
 
int sum = 0;
for (int i = 0; i < patch.length; i++) {
data[(2*i)+pr] = (byte)((patch[i] & 0xF0) >> 4);
data[(2*i)+pr+1] = (byte)(patch[i] & 0x0F);
data[(2 * i) + pr] = (byte) ((patch[i] & 0xF0) >> 4);
data[(2 * i) + pr + 1] = (byte) (patch[i] & 0x0F);
sum = sum + (patch[i] & 0x0F) + ((patch[i] & 0xF0) >> 4);
}
data[2*patch.length+pr] = (byte)(-sum & 0x7F); // Checksum
data[2 * patch.length + pr] = (byte) (-sum & 0x7F); // Checksum
return data;
}
 
public String parsePatch(String d) {
String status;
int dsi = 20; // Index where real patch data starts
191,12 → 181,13
int temp = Integer.parseInt(s1 + s2, 16);
patch[i] = temp;
}
int chk = Integer.parseInt(d.substring((4 * patchSize) + dsi, (4 * patchSize) + dsi + 2), 16);
int chk = Integer.parseInt(d.substring((4 * patchSize) + dsi,
(4 * patchSize) + dsi + 2), 16);
if (chk != (-checksum & 0x7F)) {
status = "checksum error";
} else {
status = "succesful";
}
}
return status;
}
 
207,7 → 198,7
public int[] getPatch() {
return patch;
}
 
public void setEngine(Object object) {
if (object == LEAD) {
setParameter(16, 0, 0, 2, false);
218,12 → 209,12
} else if (object == MULTI) {
setParameter(16, 3, 0, 2, false);
}
initPatch();
initPatch();
}
 
public int getParameter(int address, int start_bit, int resolution) {
int value = 0;
 
// resolution < 8 bit: gets value of bit length 'resolution' starting on
// the start_bit
if (resolution < 8) {
255,10 → 246,10
 
return value;
}
 
public void setParameter(int address, int value, int start_bit,
int resolution, boolean forward) {
 
// resolution < 8 bit: sets value of bit length 'resolution' starting on
// the start_bit
if (resolution < 8) {
337,49 → 328,52
WOPT = WOPT & 0x01;
}
}
 
public boolean isEnsemble() {
return isEnsemble;
}
 
public void sysexSend(int addr, int value, int bytes) {
public void sysexSend(int addr, int value, int bytes) {
String strMessage;
if (isEnsemble) {
strMessage = SIDSysexInfo.editEnsembleParameterSysex;
strMessage = SIDSysexInfo.editEnsembleParameterSysex;
} else {
strMessage = SIDSysexInfo.editPatchParameterSysex;
strMessage = strMessage.replace("<wopt>", "0" + Integer.toHexString(WOPT));
}
strMessage = strMessage.replace("<wopt>", "0"
+ Integer.toHexString(WOPT));
}
strMessage = strMessage.replace("<device>", "00");
strMessage = strMessage.replace("<address>", calcAddr(addr));
strMessage = strMessage.replace("<value>", calcValue(value, bytes));
 
sendString(strMessage);
}
 
public void sendPlay() {
String strMessage = SIDSysexInfo.playSysex;
strMessage = strMessage.replace("<device>", "00");
sendString(strMessage);
}
 
public void sendPanic() {
String strMessage = SIDSysexInfo.panicSysex;
strMessage = strMessage.replace("<device>", "00");
sendString(strMessage);
}
 
private byte[] toByteArray(String s) {
int nLengthInBytes = s.length() / 2;
byte[] abMessage = new byte[nLengthInBytes];
for (int i = 0; i < nLengthInBytes; i++) {
abMessage[i] = (byte) Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16);
abMessage[i] = (byte) Integer.parseInt(s
.substring(i * 2, i * 2 + 2), 16);
}
return abMessage;
}
 
private void sendString(String strMessage) {
// When the length of the Sysex String is shorter than any previous strings, pad the end with F7 bytes to make it identical in size
// When the length of the Sysex String is shorter than any previous
// strings, pad the end with F7 bytes to make it identical in size
// This is yet another workaround for the freakin' Java Sysex bug!
if (strMessage.length() > maxSysExLength) {
maxSysExLength = strMessage.length();
386,9 → 380,9
} else {
while (strMessage.length() < maxSysExLength) {
strMessage = strMessage + "F7";
}
}
//System.out.println(strMessage);
}
}
// System.out.println(strMessage);
SysexMessage sysexMessage = new SysexMessage();
try {
byte[] abMessage = toByteArray(strMessage);
447,5 → 441,5
p.setPatch(patch.clone());
return p;
}
 
}
/trunk/java/org/midibox/sidlibr/SysExController.java
41,7 → 41,7
public Object pickMeUp;
 
private InitPatches initPatches;
 
private Timer timer;
private int timeOut = 2000;
 
74,11 → 74,11
timer.setInitialDelay(timeOut);
STATE = IDLE;
}
 
public void setInitPatches(InitPatches initPatches) {
this.initPatches = initPatches;
}
 
public Receiver getReceiver() {
return receiver;
}
134,7 → 134,7
if (isDone()) {
resetForwarding();
requestPatch = patchNumber;
if (bankNumber==-1) {
if (bankNumber == -1) {
requestBank = bankNumber;
startRequest(ENSEMBLE);
} else {
143,17 → 143,18
}
}
}
 
public void requestPatchBuffer(int coreNumber, int patch, int bank) {
if (isDone()) {
resetForwarding();
requestPatch = new int[]{patch};
progress = new ProgressMonitor(null, "", "Receiving SysEx data...", 0, requestPatch.length);
requestPatch = new int[] { patch };
progress = new ProgressMonitor(null, "", "Receiving SysEx data...",
0, requestPatch.length);
STATE = COLLECTING;
timer.start();
requestCount = 0;
requestCount = 0;
String message;
if (bank==-1) {
if (bank == -1) {
requestBank = bank;
tempSyxType = ENSEMBLE;
message = SIDSysexInfo.editEnsembleRequestSysex;
161,25 → 162,27
requestBank = bank;
tempSyxType = PATCH;
message = SIDSysexInfo.editPatchRequestSysex;
}
}
message = message.replace("<device>", zeroPadToHex(coreNumber));
sendSyx(message);
}
}
 
private void requestNext() {
requestCount++;
if (requestCount < requestPatch.length) {
timer.restart();
String message = "";
if (tempSyxType==ENSEMBLE) {
message = SIDSysexInfo.hardEnsembleRequestSysex;
message = message.replace("<ensemble>", zeroPadToHex(requestPatch[requestCount]));
} else if (tempSyxType==PATCH){
if (tempSyxType == ENSEMBLE) {
message = SIDSysexInfo.hardEnsembleRequestSysex;
message = message.replace("<ensemble>",
zeroPadToHex(requestPatch[requestCount]));
} else if (tempSyxType == PATCH) {
message = SIDSysexInfo.hardPatchRequestSysex;
message = message.replace("<bank>", zeroPadToHex(requestBank));
message = message.replace("<patch>", zeroPadToHex(requestPatch[requestCount]));
}
message = message.replace("<patch>",
zeroPadToHex(requestPatch[requestCount]));
}
message = message.replace("<device>", "00");
sendSyx(message);
} else {
206,7 → 209,8
}
 
private void scanSyx(String m) {
if (progress.isCanceled() || (tempResponse.substring(0, 5).equals("ERROR"))) {
if (progress.isCanceled()
|| (tempResponse.substring(0, 5).equals("ERROR"))) {
stopScan();
} else if (tempResponse.substring(0, 12).equals("ACKNOWLEDGED")) {
stopScan();
223,10 → 227,20
} else {
if (!(m.indexOf(SIDSysexInfo.acknowledgedSysex.replace("<device>",
"00")) == 0)) {
if (m.substring(0, 2).equalsIgnoreCase("F0")) { // select next array item with each F0
if (m.substring(0, 2).equalsIgnoreCase("F0")) { // select next
// array item
// with each F0
tempSyx = m;
} else {
if (m.substring(0, 2).equalsIgnoreCase("F7")) { // for windows (1024 byte limit, F7 added at beginning of next chunk)
if (m.substring(0, 2).equalsIgnoreCase("F7")) { // for
// windows
// (1024
// byte
// limit, F7
// added at
// beginning
// of next
// chunk)
m = m.substring(2);
}
tempSyx += m;
242,7 → 256,7
 
private void parseSysex() {
if (tempSyxType == PATCH) {
Patch tempPatch = new Patch(receiver,512,initPatches);
Patch tempPatch = new Patch(receiver, 512, initPatches);
String status = tempPatch.parsePatch(tempSyx);
if (statusCheck(status)) {
pickMeUp = tempPatch;
254,7 → 268,7
stopRequest();
}
} else if (tempSyxType == ENSEMBLE) {
Patch tempEnsemble = new Patch(receiver,256,initPatches);
Patch tempEnsemble = new Patch(receiver, 256, initPatches);
String status = tempEnsemble.parsePatch(tempSyx);
if (statusCheck(status)) {
pickMeUp = tempEnsemble;
293,13 → 307,17
String strMessage;
if (p[0].isEnsemble()) {
strMessage = SIDSysexInfo.hardEnsembleDumpSysex;
strMessage = strMessage.replace("<ensemble>", zeroPadToHex(patchNumber[i]));
strMessage = strMessage.replace("<ensemble>",
zeroPadToHex(patchNumber[i]));
} else {
strMessage = SIDSysexInfo.hardPatchDumpSysex;
strMessage = strMessage.replace("<bank>", zeroPadToHex(bankNumber));
strMessage = strMessage.replace("<patch>", zeroPadToHex(patchNumber[i]));
}
strMessage = strMessage.replace("<device>", zeroPadToHex(masterCore));
strMessage = strMessage.replace("<bank>",
zeroPadToHex(bankNumber));
strMessage = strMessage.replace("<patch>",
zeroPadToHex(patchNumber[i]));
}
strMessage = strMessage.replace("<device>",
zeroPadToHex(masterCore));
strMessage = strMessage.replace("<data><checksum>", dataStr);
s[i + 1] = strMessage;
}
306,7 → 324,7
startDump(s);
}
}
 
public void dumpPatchToBuffer(Patch p, int cores) {
if (isDone() && cores != 0) {
String strMessage;
315,12 → 333,14
} else {
strMessage = SIDSysexInfo.editPatchDumpSysex;
}
strMessage = strMessage.replace("<device>", zeroPadToHex(masterCore));
strMessage = strMessage.replace("<data><checksum>", p.getSysexString());
strMessage = strMessage.replace("<device>",
zeroPadToHex(masterCore));
strMessage = strMessage.replace("<data><checksum>", p
.getSysexString());
startDump(new String[] { getForwardSyx(cores), strMessage });
}
}
 
public void dumpPatchBank(Bank b, int bankNumber) {
if (isDone()) {
Patch[] p = new Patch[b.bankSize - 1];
332,7 → 352,7
dumpPatch(p, pNr, bankNumber);
}
}
 
private void startDump(String[] s) {
dumpStack = s;
dumpCount = 0;
384,7 → 404,7
if (syxErrorChk) {
checkError(m);
}
 
if (STATE == COLLECTING) {
collectSyx(m);
}
/trunk/java/org/midibox/sidlibr/gui/BankTable.java
32,7 → 32,6
import java.util.Observable;
import java.util.Observer;
 
import javax.swing.JList;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
59,7 → 58,7
JMenuItem m1, m2, m3, m4, m5;
int bankNumber;
int selectedBeforeDrag = 0;
 
public BankTable(SIDLibController sidLibController, int bankNumber) {
this.sidLibController = sidLibController;
this.bankNumber = bankNumber;
135,18 → 134,17
}
 
private void maybeShowPopup(MouseEvent e) {
 
if (e.getButton() == MouseEvent.BUTTON3) {
 
JTable source = (JTable) e.getSource();
 
int index = source.rowAtPoint(e.getPoint());
int [] selectedRows = source.getSelectedRows();
 
int[] selectedRows = source.getSelectedRows();
 
boolean rowSelected = false;
 
for (int r = 0; r < selectedRows.length; r++) {
if (selectedRows[r] == index) {
rowSelected = true;
153,12 → 151,12
break;
}
}
 
if (!rowSelected) {
source.setRowSelectionInterval(index, index);
}
}
 
if (e.isPopupTrigger()) {
if (sidLibController.getBank(bankNumber).isEnsembleBank()) {
m1.setEnabled(false);
181,7 → 179,7
if (e.getButton() == MouseEvent.BUTTON1 && e.isControlDown()) {
// selectedBeforeDrag = table.getSelectedRow();
}
 
maybeShowPopup(e);
}
 
283,13 → 281,13
m4.setActionCommand("Init MULTI patch");
m4.addActionListener(this);
submenu.add(m4);
 
m5 = new JMenuItem("ENSEMBLE", KeyEvent.VK_S);
m5.setFont(m5.getFont().deriveFont(Font.PLAIN));
m5.setActionCommand("Init ensemble");
m5.addActionListener(this);
submenu.add(m5);
 
menuItem = new JMenuItem("Init current bank", KeyEvent.VK_N);
menuItem.setFont(menuItem.getFont().deriveFont(Font.PLAIN));
menuItem.setActionCommand("Init current bank");
364,15 → 362,20
}
 
public void keyPressed(KeyEvent e) {
if ((e.getKeyCode() == KeyEvent.VK_E) && (e.getModifiers() == ActionEvent.CTRL_MASK)) {
if ((e.getKeyCode() == KeyEvent.VK_E)
&& (e.getModifiers() == ActionEvent.CTRL_MASK)) {
sidLibController.editCurrentPatch();
} else if ((e.getKeyCode() == KeyEvent.VK_R) && (e.getModifiers() == ActionEvent.CTRL_MASK)) {
} else if ((e.getKeyCode() == KeyEvent.VK_R)
&& (e.getModifiers() == ActionEvent.CTRL_MASK)) {
sidLibController.editRename();
} else if ((e.getKeyCode() == KeyEvent.VK_X) && (e.getModifiers() == ActionEvent.CTRL_MASK)) {
} else if ((e.getKeyCode() == KeyEvent.VK_X)
&& (e.getModifiers() == ActionEvent.CTRL_MASK)) {
sidLibController.editCut();
} else if ((e.getKeyCode() == KeyEvent.VK_C) && (e.getModifiers() == ActionEvent.CTRL_MASK)) {
} else if ((e.getKeyCode() == KeyEvent.VK_C)
&& (e.getModifiers() == ActionEvent.CTRL_MASK)) {
sidLibController.editCopy();
} else if ((e.getKeyCode() == KeyEvent.VK_V) && (e.getModifiers() == ActionEvent.CTRL_MASK)) {
} else if ((e.getKeyCode() == KeyEvent.VK_V)
&& (e.getModifiers() == ActionEvent.CTRL_MASK)) {
sidLibController.editPaste();
}
}
/trunk/java/org/midibox/sidlibr/gui/BankTableModel.java
26,7 → 26,7
 
public class BankTableModel extends AbstractTableModel {
private String[] patchColumnNames = { "#", "Patch Name", "Engine" };
private String[] ensembleColumnNames = { "#", "Ensemble Name"};
private String[] ensembleColumnNames = { "#", "Ensemble Name" };
private Object[][] data;
private boolean isEnsembleBank;
 
/trunk/java/org/midibox/sidlibr/gui/LibraryGUI.java
33,7 → 33,8
private SIDLibController sidLibController;
private JTabbedPane tabbedPane = new JTabbedPane();
private BankTable[] bankTables = new BankTable[8];
private static String[] bankNames = {"ENS", "A", "B", "C", "D", "E", "F", "G" };
private static String[] bankNames = { "ENS", "A", "B", "C", "D", "E", "F",
"G" };
 
public LibraryGUI(SIDLibController sidLibController) {
this.sidLibController = sidLibController;
48,10 → 49,11
 
public void stateChanged(javax.swing.event.ChangeEvent e) {
sidLibController.setCurrentBankNumber(tabbedPane.getSelectedIndex());
int[] patchNumber = bankTables[tabbedPane.getSelectedIndex()].getSelectedRows();
if (patchNumber.length==0) {
bankTables[tabbedPane.getSelectedIndex()].resetSelection();
patchNumber = new int[]{0};
int[] patchNumber = bankTables[tabbedPane.getSelectedIndex()]
.getSelectedRows();
if (patchNumber.length == 0) {
bankTables[tabbedPane.getSelectedIndex()].resetSelection();
patchNumber = new int[] { 0 };
}
sidLibController.setCurrentPatchNumber(patchNumber);
}
/trunk/java/org/midibox/sidlibr/SIDLibController.java
22,43 → 22,38
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Observable;
import java.util.Observer;
 
import javax.swing.JOptionPane;
 
import org.midibox.midi.MidiUtils;
 
public class SIDLibController extends Observable implements Observer,
ActionListener {
private Patch[] copyPasteBuffer;
private Patch[] copyPasteBuffer;
private InitPatches initPatches = new InitPatches();
private FileHandler fileHandler = new FileHandler(initPatches);
private int[] currentPatchNumber = new int[]{0};
private int[] currentPatchNumber = new int[] { 0 };
private int currentBankNumber = 1;
private int[] requestBankIndices;
private Bank[] patchBanks = new Bank[8];
private Bank[] patchBanks = new Bank[8];
private Boolean openEditor = false;
private int coresHardware = 15; // AND mask for selected cores --- we assume, that all cores are available by default
private int coresHardware = 15; // AND mask for selected cores --- we
// assume, that all cores are available by
// default
private int coresSelected = 1;
 
private SysExController sysexController;
 
public SIDLibController(SysExController sysexController) {
public SIDLibController(SysExController sysexController) {
this.sysexController = sysexController;
sysexController.addObserver(this);
sysexController.setInitPatches(initPatches);
patchBanks[0] = new Bank(sysexController.getReceiver(),true, initPatches);
 
patchBanks[0] = new Bank(sysexController.getReceiver(), true,
initPatches);
for (int i = 1; i < patchBanks.length; i++) {
patchBanks[i] = new Bank(sysexController.getReceiver(),false, initPatches);
patchBanks[i] = new Bank(sysexController.getReceiver(), false,
initPatches);
}
 
requestBankIndices = new int[128];
for (int i = 0; i < requestBankIndices.length; i++) {
requestBankIndices[i] = i;
79,7 → 74,7
public int getCores() {
return coresSelected & coresHardware;
}
 
public int getCoresHardware() {
return coresHardware;
}
94,21 → 89,22
if (sysexController.isDone()) {
// Sends notification to SIDV2librarianGUI when done...
openEditor = true;
sysexController.dumpPatchToBuffer(patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[0]), getCores());
sysexController.dumpPatchToBuffer(patchBanks[currentBankNumber]
.getPatchAt(currentPatchNumber[0]), getCores());
}
}
}
 
public Patch getCurrentPatch() {
return patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[0]);
return patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[0]);
}
 
public Bank getBank(int bankNumber) {
return patchBanks[bankNumber];
}
 
public void setCurrentBankNumber(int i) {
currentBankNumber = i;
currentBankNumber = i;
setChanged();
notifyObservers("Bank changed");
clearChanged();
129,23 → 125,28
public void setPatchAt(Patch p, int patchNumber, int bankNumber) {
patchBanks[bankNumber].setPatchAt(patchNumber, p);
}
 
public boolean isEnsembleBank() {
return currentBankNumber==0;
return currentBankNumber == 0;
}
 
// ****************** Edit functions ***********************
public void editCopy() {
copyPasteBuffer = patchBanks[currentBankNumber].getPatchesAt(currentPatchNumber);
copyPasteBuffer = patchBanks[currentBankNumber]
.getPatchesAt(currentPatchNumber);
}
 
public void editPaste() {
if ((copyPasteBuffer!=null) && patchBanks[currentBankNumber].isEnsembleBank() == copyPasteBuffer[0].isEnsemble()){
for (int i=0;i<copyPasteBuffer.length;i++) {
if (currentPatchNumber[0]+i > patchBanks[currentBankNumber].bankSize-1) {
if ((copyPasteBuffer != null)
&& patchBanks[currentBankNumber].isEnsembleBank() == copyPasteBuffer[0]
.isEnsemble()) {
for (int i = 0; i < copyPasteBuffer.length; i++) {
if (currentPatchNumber[0] + i > patchBanks[currentBankNumber].bankSize - 1) {
break;
} else {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[0]+i,copyPasteBuffer[i].clone());
patchBanks[currentBankNumber].setPatchAt(
currentPatchNumber[0] + i, copyPasteBuffer[i]
.clone());
}
}
setChanged();
155,7 → 156,8
}
 
public void editCut() {
copyPasteBuffer = patchBanks[currentBankNumber].getPatchesAt(currentPatchNumber);
copyPasteBuffer = patchBanks[currentBankNumber]
.getPatchesAt(currentPatchNumber);
editClear();
}
 
166,8 → 168,9
} else {
s = 512;
}
for (int i=0;i < currentPatchNumber.length;i++) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[i], new Patch(sysexController.getReceiver(),s, initPatches));
for (int i = 0; i < currentPatchNumber.length; i++) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[i],
new Patch(sysexController.getReceiver(), s, initPatches));
}
setChanged();
notifyObservers("Data changed");
181,11 → 184,13
}
 
public void initCurrentBank() {
if (currentBankNumber==0) {
patchBanks[currentBankNumber] = new Bank(sysexController.getReceiver(),true, initPatches);
if (currentBankNumber == 0) {
patchBanks[currentBankNumber] = new Bank(sysexController
.getReceiver(), true, initPatches);
} else {
patchBanks[currentBankNumber] = new Bank(sysexController.getReceiver(),false, initPatches);
}
patchBanks[currentBankNumber] = new Bank(sysexController
.getReceiver(), false, initPatches);
}
setChanged();
notifyObservers("Data changed");
clearChanged();
193,13 → 198,18
 
public void initCurrentPatch(Object object) {
if (patchBanks[currentBankNumber].isEnsembleBank()) {
for(int i=0;i<currentPatchNumber.length;i++) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[i], new Patch(sysexController.getReceiver(),256, initPatches));
for (int i = 0; i < currentPatchNumber.length; i++) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[i],
new Patch(sysexController.getReceiver(), 256,
initPatches));
}
} else if (object!=null) {
for(int i=0;i<currentPatchNumber.length;i++) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[i], new Patch(sysexController.getReceiver(),512, initPatches));
patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[i]).setEngine(object);
} else if (object != null) {
for (int i = 0; i < currentPatchNumber.length; i++) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[i],
new Patch(sysexController.getReceiver(), 512,
initPatches));
patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[i])
.setEngine(object);
}
}
setChanged();
213,9 → 223,11
coresHardware = (Integer) sysexController.pickMeUp;
setChanged();
notifyObservers("Cores changed");
clearChanged();
clearChanged();
} else if (object == "Patch ready") {
patchBanks[sysexController.requestBank+1].setPatchAt(sysexController.requestPatch[sysexController.requestCount],(Patch) sysexController.pickMeUp);
patchBanks[sysexController.requestBank + 1].setPatchAt(
sysexController.requestPatch[sysexController.requestCount],
(Patch) sysexController.pickMeUp);
setChanged();
notifyObservers("Data changed");
clearChanged();
229,7 → 241,9
 
public void actionPerformed(ActionEvent ae) {
if (ae.getActionCommand().equals("Load bank")) {
Bank tempBank = fileHandler.loadPatchBank(sysexController.getReceiver(),patchBanks[currentBankNumber].isEnsembleBank());
Bank tempBank = fileHandler.loadPatchBank(sysexController
.getReceiver(), patchBanks[currentBankNumber]
.isEnsembleBank());
if (tempBank != null) {
patchBanks[currentBankNumber] = tempBank;
setChanged();
237,17 → 251,23
clearChanged();
}
} else if (ae.getActionCommand().equals("Save bank")) {
fileHandler.savePatchBank(patchBanks[currentBankNumber],currentBankNumber-1);
fileHandler.savePatchBank(patchBanks[currentBankNumber],
currentBankNumber - 1);
} else if (ae.getActionCommand().equals("Load patch")) {
Patch tempPatch = fileHandler.loadPatch(sysexController.getReceiver(),patchBanks[currentBankNumber].isEnsembleBank());
Patch tempPatch = fileHandler.loadPatch(sysexController
.getReceiver(), patchBanks[currentBankNumber]
.isEnsembleBank());
if (tempPatch != null) {
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[0],tempPatch);
patchBanks[currentBankNumber].setPatchAt(currentPatchNumber[0],
tempPatch);
setChanged();
notifyObservers("Data changed");
clearChanged();
}
} else if (ae.getActionCommand().equals("Save patch")) {
fileHandler.savePatch(patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[0]), currentBankNumber-1,currentPatchNumber[0]);
fileHandler.savePatch(patchBanks[currentBankNumber]
.getPatchAt(currentPatchNumber[0]), currentBankNumber - 1,
currentPatchNumber[0]);
} else if (ae.getActionCommand().equals("Edit")) {
editCurrentPatch();
} else if (ae.getActionCommand().equals("Rename")) {
275,21 → 295,28
} else if (ae.getActionCommand().equals("Scan hardware")) {
sysexController.scanHardware();
} else if (ae.getActionCommand().equals("Transmit patch to buffer")) {
sysexController.dumpPatchToBuffer(patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[0]), getCores());
sysexController.dumpPatchToBuffer(patchBanks[currentBankNumber]
.getPatchAt(currentPatchNumber[0]), getCores());
} else if (ae.getActionCommand().equals("Transmit patch to memory")) {
Patch[] p = new Patch[currentPatchNumber.length];
for(int i=0;i<currentPatchNumber.length;i++) {
p[i] = patchBanks[currentBankNumber].getPatchAt(currentPatchNumber[i]);
for (int i = 0; i < currentPatchNumber.length; i++) {
p[i] = patchBanks[currentBankNumber]
.getPatchAt(currentPatchNumber[i]);
}
sysexController.dumpPatch(p,currentPatchNumber, currentBankNumber-1);
sysexController.dumpPatch(p, currentPatchNumber,
currentBankNumber - 1);
} else if (ae.getActionCommand().equals("Transmit bank to memory")) {
sysexController.dumpPatchBank(patchBanks[currentBankNumber],currentBankNumber-1);
sysexController.dumpPatchBank(patchBanks[currentBankNumber],
currentBankNumber - 1);
} else if (ae.getActionCommand().equals("Receive patch from buffer")) {
sysexController.requestPatchBuffer(0, currentPatchNumber[0],currentBankNumber-1);
sysexController.requestPatchBuffer(0, currentPatchNumber[0],
currentBankNumber - 1);
} else if (ae.getActionCommand().equals("Receive patch from memory")) {
sysexController.requestPatch(currentPatchNumber, currentBankNumber-1);
sysexController.requestPatch(currentPatchNumber,
currentBankNumber - 1);
} else if (ae.getActionCommand().equals("Receive bank from memory")) {
sysexController.requestPatch(requestBankIndices, currentBankNumber-1);
sysexController.requestPatch(requestBankIndices,
currentBankNumber - 1);
}
}
}
/trunk/java/org/midibox/sidlibr/Bank.java
31,7 → 31,8
private InitPatches initPatches;
private Receiver receiver;
 
public Bank(Receiver receiver, boolean isEnsembleBank, InitPatches initPatches) {
public Bank(Receiver receiver, boolean isEnsembleBank,
InitPatches initPatches) {
this.initPatches = initPatches;
this.receiver = receiver;
this.isEnsembleBank = isEnsembleBank;
42,9 → 43,9
bank = new Patch[bankSize];
for (int c = 0; c < bankSize; c++) {
if (isEnsembleBank) {
bank[c] = new Patch(receiver,256,initPatches);
bank[c] = new Patch(receiver, 256, initPatches);
} else {
bank[c] = new Patch(receiver,512,initPatches);
bank[c] = new Patch(receiver, 512, initPatches);
}
}
}
56,15 → 57,15
public Patch getPatchAt(int i) {
return bank[i];
}
 
public Patch[] getPatchesAt(int[] iarray) {
Patch[] patchset = new Patch[iarray.length];
for (int i=0;i< iarray.length;i++) {
for (int i = 0; i < iarray.length; i++) {
patchset[i] = bank[iarray[i]];
}
return patchset;
}
 
public boolean isEnsembleBank() {
return isEnsembleBank;
}
80,8 → 81,9
parsesize = patchSize;
}
for (int i = 0; i < syx.length() / parsesize; i++) {
bank[i] = new Patch(receiver,512, initPatches);
String stat = bank[i].parsePatch(syx.substring(i * parsesize, (i + 1) * parsesize));
bank[i] = new Patch(receiver, 512, initPatches);
String stat = bank[i].parsePatch(syx.substring(i * parsesize,
(i + 1) * parsesize));
if (status == "checksum error") {
status = stat;
break;
/trunk/java/org/midibox/sidlibr/InitPatches.java
1,13 → 1,8
package org.midibox.sidlibr;
 
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
 
import javax.sound.midi.Receiver;
import javax.swing.JOptionPane;
 
import org.midibox.midi.MidiUtils;
19,55 → 14,59
private int[] drum;
private int[] multi;
private int[] ensemble;
 
public InitPatches() {
lead = loadPatch("lead.syx",512);
bassline = loadPatch("bassline.syx",512);
drum = loadPatch("drum.syx",512);
multi = loadPatch("multi.syx",512);
ensemble = loadPatch("ensemble.syx",256);
lead = loadPatch("lead.syx", 512);
bassline = loadPatch("bassline.syx", 512);
drum = loadPatch("drum.syx", 512);
multi = loadPatch("multi.syx", 512);
ensemble = loadPatch("ensemble.syx", 256);
}
 
public int[] getInitLead() {
return lead.clone();
}
 
public int[] getInitBassline() {
return bassline.clone();
}
 
public int[] getInitDrum() {
return drum.clone();
}
 
public int[] getInitMulti() {
return multi.clone();
}
 
public int[] getInitEnsemble() {
return ensemble.clone();
}
 
public int[] loadPatch(String filename, int patchSize) {
int[] patch = new int[patchSize];
try {
byte[] data = loadData(filename);
if (data != null) {
String s = MidiUtils.getHexString(data).replace(" ", "");
String s = MidiUtils.getHexString(data).replace(" ", "");
int dsi = 20; // Index where real patch data starts
for (int i = 0; i < patchSize; i++) {
String s1 = s.substring((4 * i) + dsi + 1, (4 * i) + dsi + 2);
String s2 = s.substring((4 * i) + dsi + 3, (4 * i) + dsi + 4);
String s1 = s.substring((4 * i) + dsi + 1, (4 * i) + dsi
+ 2);
String s2 = s.substring((4 * i) + dsi + 3, (4 * i) + dsi
+ 4);
int temp = Integer.parseInt(s1 + s2, 16);
patch[i] = temp;
}
}
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "An error has occurred while reading built-in init patch!", "Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null,
"An error has occurred while reading built-in init patch!",
"Error", JOptionPane.ERROR_MESSAGE);
}
return patch;
}
 
private byte[] loadData(String s) throws IOException {
byte[] b = null;
b = new byte[65536];
74,15 → 73,16
int numBytes = 0;
InputStream in = null;
try {
in = ResourceLoader.getResourceAsStream("patches/" + s);
numBytes = in.read(b, 0, 65536);
in = ResourceLoader.getResourceAsStream("patches/" + s);
numBytes = in.read(b, 0, 65536);
} finally {
if (in != null) {
in.close();
}
if (in != null) {
in.close();
}
}
// TODO: we return an array with 65536 members...
// it would be better to extract [0:numBytes], but I don't know how to do this w/o creating a new array...
// it would be better to extract [0:numBytes], but I don't know how to
// do this w/o creating a new array...
return b;
}
}
/trunk/java/org/midibox/sidlibr/FileHandler.java
36,6 → 36,7
public class FileHandler {
final JFileChooser fc = new JFileChooser();
private InitPatches initPatches;
 
public FileHandler(InitPatches initPatches) {
fc.addChoosableFileFilter(new SysExFilter());
this.initPatches = initPatches;
45,7 → 46,9
try {
saveData(getBankDumpSysex(b, bankNumber));
} catch (IOException e) {
JOptionPane.showMessageDialog(null,"An error has occurred while writing the file!", "Error",JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null,
"An error has occurred while writing the file!", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
 
65,8 → 68,11
byte[] data = loadData();
if (data != null) {
String s = MidiUtils.getHexString(data).replace(" ", "");
if ((isEnsemble && (s.length() == 128 * Bank.ensembleSize || s.length() == 64 * Bank.ensembleSize)) || (!isEnsemble && (s.length() == 128 * Bank.patchSize || s.length() == 64 * Bank.patchSize))) {
Bank tempBank = new Bank(receiver,isEnsemble, initPatches);
if ((isEnsemble && (s.length() == 128 * Bank.ensembleSize || s
.length() == 64 * Bank.ensembleSize))
|| (!isEnsemble && (s.length() == 128 * Bank.patchSize || s
.length() == 64 * Bank.patchSize))) {
Bank tempBank = new Bank(receiver, isEnsemble, initPatches);
String status = tempBank.parseBankSyx(s);
if (statusCheck(status)) {
b = tempBank;
73,9 → 79,17
}
} else {
if (isEnsemble) {
JOptionPane.showMessageDialog(null, "This file does not contain a bank with 64 or 128 valid ensembles!","Error", JOptionPane.ERROR_MESSAGE);
JOptionPane
.showMessageDialog(
null,
"This file does not contain a bank with 64 or 128 valid ensembles!",
"Error", JOptionPane.ERROR_MESSAGE);
} else {
JOptionPane.showMessageDialog(null, "This file does not contain a bank with 64 or 128 valid patches!","Error", JOptionPane.ERROR_MESSAGE);
JOptionPane
.showMessageDialog(
null,
"This file does not contain a bank with 64 or 128 valid patches!",
"Error", JOptionPane.ERROR_MESSAGE);
}
}
}
92,17 → 106,21
try {
byte[] data = loadData();
if (data != null) {
String s = MidiUtils.getHexString(data).replace(" ", "");
String s = MidiUtils.getHexString(data).replace(" ", "");
if (isEnsemble && (s.length() != Bank.ensembleSize)) {
JOptionPane.showMessageDialog(null,"This file does not contain a valid ensemble!", "Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null,
"This file does not contain a valid ensemble!",
"Error", JOptionPane.ERROR_MESSAGE);
} else if (!isEnsemble && (s.length() != Bank.patchSize)) {
JOptionPane.showMessageDialog(null,"This file does not contain a valid patch!", "Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null,
"This file does not contain a valid patch!",
"Error", JOptionPane.ERROR_MESSAGE);
} else {
Patch tempPatch;
if (isEnsemble) {
tempPatch = new Patch(receiver,256, initPatches);
tempPatch = new Patch(receiver, 256, initPatches);
} else {
tempPatch = new Patch(receiver,512, initPatches);
tempPatch = new Patch(receiver, 512, initPatches);
}
String status = tempPatch.parsePatch(s);
if (statusCheck(status)) {
154,13 → 172,13
}
}
}
 
private File fixExtension(File f) {
if (f.getName().lastIndexOf(".syx")==-1) {
f = new File(f.getPath() + ".syx");
}
return f;
}
if (f.getName().lastIndexOf(".syx") == -1) {
f = new File(f.getPath() + ".syx");
}
return f;
}
 
private byte[] loadData() throws IOException {
byte[] b = null;
186,14 → 204,14
private byte[] getBankDumpSysex(Bank b, int bankNumber) {
int s;
if (b.isEnsembleBank()) {
s = Bank.ensembleSize/2;
s = Bank.ensembleSize / 2;
} else {
s = Bank.patchSize/2;
s = Bank.patchSize / 2;
}
byte[] bankData = new byte[b.bankSize*s];
byte[] bankData = new byte[b.bankSize * s];
for (int i = 0; i < b.bankSize; i++) {
byte[] d = getPatchDumpSysex(b.getPatchAt(i), bankNumber, i);
System.arraycopy(d, 0, bankData, i*s, d.length);
System.arraycopy(d, 0, bankData, i * s, d.length);
}
return bankData;
}
204,19 → 222,21
patchStr = "0" + patchStr;
}
String strMessage;
if (bankNumber==-1) {
if (bankNumber == -1) {
strMessage = SIDSysexInfo.hardEnsembleDumpSysex;
strMessage = strMessage.replace("<ensemble>", patchStr);
strMessage = strMessage.replace("<ensemble>", patchStr);
} else {
strMessage = SIDSysexInfo.hardPatchDumpSysex;
strMessage = strMessage.replace("<bank>", "0" + Integer.toHexString(bankNumber));
strMessage = strMessage.replace("<bank>", "0"
+ Integer.toHexString(bankNumber));
strMessage = strMessage.replace("<patch>", patchStr);
}
strMessage = strMessage.replace("<device>", "00");
}
strMessage = strMessage.replace("<device>", "00");
String s = "<data><checksum>";
return p.getSysex(strMessage.substring(0, strMessage.indexOf(s)),strMessage.substring(strMessage.lastIndexOf(s)+s.length()));
return p.getSysex(strMessage.substring(0, strMessage.indexOf(s)),
strMessage.substring(strMessage.lastIndexOf(s) + s.length()));
}
 
private boolean statusCheck(String status) {
boolean b = false;
if (status == "succesful") {