Wire Tutorial - Exporting and Importing Java Classes

The Wire software and documentation is Copyright 2000-2008 by SoftSynth.com, All Rights Reserved

Once you have a patch that you like, you may want to use it in other JSyn programs besides Wire. Wire allows you to export the patch as Java source code and compile it.
 

Note that the Export feature is only available to registered JSyn developers. It is disabled in the demo version. Click here to learn about registering your JSyn SDK.

Exporting Java Source for a Circuit

  1. Load a predefined patch by selecting "Patch from File..." from the Add menu. Load the "DrumWoodFMTest.xml" patch file.
  2. Double click the patch module to edit the tester.
  3. Click on PlayKeys button and play the ASCII keyboard to hear the drum.
  4. Double click the patch module to edit the drum patch.
  5. Select "Export and Java Source..." from the File menu.
  6. Save the file as DrumWoodFM.java in one of your source directories.
  7. Open the source file in your test editor and notice the package name on the first line.
  8. Compile the exported Java source file using your Java compiler.

Importing a Compiled Circuit

Wire can import SynthCircuit or SynthNote classes. It will automatically create Wire jacks for the SynthPorts on the circuit. This feature is supported in the demo version.
  1. Go to the DrumWoodFMTest patch and delete the drum patch.
  2. Make sure that the class you want to import is in the CLASSPATH.
  3. Select "Circuit by Name..." from the Add menu.
  4. Type in a class name, for example "patches.DrumWoodFM" without the quotes. Upper and Lower case is important because it is a Java class name and Java is case-sensitive.
  5. Hit OK. A "circuit" module should appear with the same jacks as the original drum.
  6. Connect the drum to the lineOut and use the PlayKeys button to play the drum using the ASCII keyboard.
  7. Double click on the circuit and notice that it does not open an editor. This is because it is a compiled class, not an editable patch.
Previous | Top | Next