How to ...

1. How to read from a default .syx file ?
2. How to use Jackd with JSynthLib (Linux) ?
3. How to calculate a two's complement ?
4. How to use bitwise operations ?
5. How to get JSynthLib working on Mac OS X ?
6. How to generate an array of formatted numbers?
7. How to make tabs in an editorFrame?
8. How to test sequencer support ?
9. How to put JSynthLib back in a jar ?
10. How to make two SysexWidgets work together ?
11. How to set the preferred size or background color of a Widget ?
12. How to ?
13. How to ?
How_to_Compile_Files_and_Check_Out_from_CVS


1. How to read from a default .syx file ?

example : WaldorfMW2SingleDriver.java -> 154 createNewPatch()

2. How to use Jackd with JSynthLib (Linux) ?

load the virmidi module:
sudo modprobe snd_virmidi
or
gksu "modprobe snd_virmidi"

3. How to calculate a two's complement ?


See wikipedia article .

4. How to use bitwise operations ?


See wikipedia article .

5. How to get JSynthLib working on Mac OS X ?

In this topic at GearSlutz forums I found something about Mandolane ... "Enables Pure Java programs to access external MIDI devices on Mac OS X" - but I don't have a Mac so I'm not sure.

6. How to generate an array of formatted numbers?

String[] PatchNumbers = DriverUtil.generateNumbers(int min, int max, "Patch ##");

7. How to make tabs in an editorFrame?

Look at CasioCZ1000SingleEditor for an expample, or better, make one for all of us.
The code should be something like this: (see SPD11PatchEditor)
package synthdrivers.RolandSPD11;
import core.*;
 
import javax.swing.*;
import java.awt.*;
import javax.swing.border.*;
import javax.swing.event.*;
class RolandSPD11PatchEditor extends PatchEditorFrame
{
  public RolandSPD11PatchEditor(Patch patch)
  {
    super ("Roland SPD11 Patch Editor",patch);
  JTabbedPane patchPane = new JTabbedPane(); // the main container
  JPanel ptchstPane = new JPanel(); // patchsettings tab
  ptchstPane.setLayout(new GridBagLayout());
     patchPane.addTab("PatchSettings",ptchstPane);
       addWidget(ptchfdrPane,new ScrollBarWidget(" Fx Time", //the label
        patch, //always "patch"
        0,31, //min & max values for fader
        0, //offset value
        new ParamModel(patch,100),
        new VcedSender(21)),
        1,1, // horizontal/vertical location
        3,1, //horizontal/vertical size
        1); //unique fader number
       addWidget... for each setting
  JTabbedPane pdstPane = new JTabbedPane(); //padsettings tab
     patchPane.addTab("PadSettings",pdstPane);
       Jpanel pd1to8 = new JPanel(); //pads 1 to 8
         pdstPane.addTab("1>8",pd1to8);
       Jpanel pd9to16 = new JPanel(); //pads 9 to 16
         pdstPane.addTab("9>16",pd9to16);
       Jpanel pd17to24 = new JPanel(); //pads 17 to 24
         pdstPane.addTab("17>24",pd17to24);
       Jpanel pd25to32 = new JPanel(); //pads 25 to 32
         pdstPane.addTab("25>32",pd25to32);
 
p

8. How to test sequencer support?

Here's a quote from Torsten about it:
USE ONLY JAVA SDK >=1.5
 
set "useSequencer" in core.NoteChooserConfigPanel to "true", recompile and
make the corresponding settings in the config panel.
BTW, the function isn't reentrant save and you can't stop the sequencer. So don't play a very long song.
(some of the things I have to do).
 
Maybe the javasound part of the Java 1.4 version isn't generally able to make what I want.
But maybe only the Linux port is buggy.


9. How to put JSynthLib back in a jar ?

In the terminal, you can type
 jar cfe ../JSynthLib.jar JSynthLib */*/*/*/*.* */*/*/*.* */*/*.* */*.* *.*
to put all files in JSynthLib.jar, with JSynthLib set as the main class.

10. How to make two SysexWidgets works together ?

You can make two SysexWidgets work together using an event listener.
final ScrollBarWidget fxParam = new ScrollBarWidget(SPD11_Constants.FX_PARAMS[patch.sysex[12]],
        patch,0,31,1,
        new ParamModel(patch, 13),
        new SPD11PadParamSender(ptchNum,pdNum,4));
 
ComboBoxWidget fxType = new ComboBoxWidget("FxType",patch,new ParamModel(patch,12),
        new SPD11PadParamSender(ptchNum,pdNum,3),
        SPD11_Constants.SPD11_FXTYPES);
 
fxType.addEventListener(new ItemListener() {
    public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
    int i = ((JComboBox) e.getSource()).getSelectedIndex();
    fxParam.setLabel(SPD11_Constants.FX_PARAMS[i]);
        }
    }
});
 
addWidget(fxPane,fxType,0,0,1,1,9);
addWidget(fxPane,fxParam,0,1,1,1,10);
 
To find out what methods are available for the Sysex Widget you need to modify, type the name of the object (fxParam in this example) with ".set" appended in your Java IDE. All methods will be listed, choose one, hit "enter" and you're one step further again.

11. How to set the preferred size or background color of a Widget ?

First instantiate a widget, then modify the size using the method setPreferredSize(new Dimension(width, height)
and set the background color using the method setBackground(Color.blue);
final ScrollBarWidget fxParam = new ScrollBarWidget("Fx Parameter ",
        patch,0,31,1,
        new ParamModel(patch, 13),
        new SPD11PadParamSender(ptchNum,pdNum,4));
fxPane.setBackground(Color.red);
fxParam.setPreferredSize(new Dimension(520,25));


12. How to ?



13. How to ?


Fill in any questions ;-)