Using JSynthLib

Notice:

If you happen to have one of the already supported synths, you're lucky and can get started
using JSynthLib as an editor and librarian for your synth's presets.
If you're looking for information about how to use JSynthLib, use the JSynthLib Users Guide. (or click Help)
This page is not about how to use JSynthLib.

So, what is this page about ?

This page is about how the functions when using JSynthLib are described in the code,
meant for research when thinking about the structure of a new driver.

JSynthLib's main menu:

File
Library
Patch
Window
Help
Open ...
Transfer Scene
Copy
Preferences ...
Help ...
Save
Update Scene
Cut
MIDI Monitor
License
Save As ...
_
Paste
_
About
_
Sort ...
Delete
Close

Import ...
Search ...
_
_

Export ...
Cross Breed ...
Send
anOpenLibray

Import All ...
Delete Dups ...
Update
anOpenScene

_
_
Send To ...
anOpenEditor

Exit
New Library
Store ...



New Scene
Get ...




_




Edit ...




Print




Play




_




Reassign ...




Extract




_




New Patch ...




Upload ...



Library >> New Library (Ctrl-L)

Creates a new LibraryFrame with String[] columNames: "Synth", "Type", "Patch Name", "Field 1", "Field 2", "Comment"
Each of these names also is the name of an integer: int SYNTH = 0; int TYPE = 1; PATCH_NAME=2, FIELD1=3, FIELD2=4, COMMENT=5.
and LibraryFrame also constructs a new PatchTableModel "myModel" of type PatchListModel which has the same String Array "columNames" , and an important method to read the values from a loaded patch: GetValueAt(int col, int row)
which uses these getter methods from Patch to get the info that was stored there by the used device and writer for that patch:
myPatch.getDevice().getSynthName() : Name of Synth
myPatch.getType() : Type of patch
myPatch.getName() : Name of patch
myPatch.getDate() : Field 1
myPatch.getAuthor() : Field 2
myPatch.getComment() : comment

The LibraryFrame also has a PatchListTransferHandler named "pth" and the LibraryFrame constructors call AbstractLibraryFrame with this PatchListTransferHandler pth.

to be continued...

Patch >> Store...

storePatch(IPatch p, JComponent c) is defined in BankEditorFrame, SceneFrame and LibraryFrame, so the action depends on the active (focused) window.
BankEditorFrame: calls eventually the putPatch(Patch bank, Patch singlePatch, int PatchNum) from the appropriate BankDriver.
protected boolean storePatch(IPatch p, JComponent c) {
    JTable t = (JTable) c;
    PatchGridModel m = (PatchGridModel) t.getModel();
    m.setPatchAt(p, t.getSelectedRow(), t.getSelectedColumn());
    return true;
}
void setPatchAt(IPatch p, int row, int col) {
    bankData.put(p, getPatchNum(row, col));
}

SceneFrame:
protected boolean storePatch(IPatch p, JComponent c) {
    SceneListModel model = (SceneListModel) ((JTable) c).getModel();
    model.addPatch(p);
    // TODO This method shouldn't have to worry about calling fireTableDataChanged(). Find a better way.
    model.fireTableDataChanged();
    return true;
}
LibraryFrame:
protected boolean storePatch(IPatch p, JComponent c) {
    PatchTableModel model = (PatchTableModel) ((JTable) c).getModel();
    model.addPatch(p);
    // TODO This method shouldn't have to worry about calling fireTableDataChanged(). Find a better way.
    model.fireTableDataChanged();
    return true;
}


Patch >> Get... (Ctrl-G)

Opens a window titled "Get Sysex data" with four comboboxes:
Device: Displays all Devices that were added in the User Preferences.
Driver: Displays all drivers that were added to the chosen Device with the addDriver method, (first added driver is on top of the list). Choose one to work with.
Bank: Displays the values of the chosen Driver's String array bankNumbers. You pick one, and the Driver's bankNum gets the value of that String's index in bankNumbers.
Patch: Displays the values of the chosen Driver's String array patchNumbers. You pick one, and the Driver's patchNum gets the value of that String's index in patchNumbers.

Get a patch or a bank, choose a driver and call its requestPatchdump method.


Window >> Preferences

After running DeviceListWriter, your new device should be in the list that you get when you click on the
Add Device button from the Tab "Synth Driver".