JVST
VST Interface for Java
About
JVST provides an interface to VST plugins (effects and instruments) for use in Java. It allows the developer to interact with a plugin, process samples and use any built in GUIs.

JVST is licensed under the Common Public License (CPL).
Download
The latest download is available from the Project Page.
Usage
Example code that loads a VST plugin and interacts with it:
import org.boris.jvst.*;

public class JVSTExample
{
    public static void main(String[] args) throws Exception {
        AEffect a = VST.load("F:/VST/mda Delay.dll");
        a.open();
        a.setSampleRate(44100.0f);
        a.setBlockSize(512);

        // attempt some processing
        int blocksize = 512;
        float[][] inputs = new float[a.numInputs][];
        for (int i = 0; i < a.numInputs; i++) {
            inputs[i] = new float[blocksize];
            for (int j = 0; j < blocksize; j++)
                inputs[i][j] = (float) Math
                        .sin(j * Math.PI * 2 * 440 / 44100.0);
        }
        float[][] outputs = new float[a.numOutputs][];
        for (int i = 0; i < a.numOutputs; i++) {
            outputs[i] = new float[blocksize];
            for (int j = 0; j < blocksize; j++)
                outputs[i][j] = 0;
        }

        a.processReplacing(inputs, outputs, blocksize);

        VST.dispose(a);
    }
}
GUI Example
Example code that loads a VST plugin and displays it's GUI:
package org.boris.jvst;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;

public class MiniHost extends ApplicationWindow
{
    public static void main(String[] args) throws Exception {
        AEffect effect = VST.load("F:/VST/LiveCut.dll");
        MiniHost m = new MiniHost(effect);
        m.setBlockOnOpen(true);
        m.open();
    }

    private AEffect effect;

    protected Control createContents(Composite parent) {
        // Startup the plugin
        effect.open();
        // Ask the plugin to display its GUI using the SWT window handle
        effect.editOpen(parent.handle);
        // Get the size of the GUI
        ERect r = effect.editGetRect();
        // Reconfigure our shell to fit the size
        setShellSize(r, parent.getShell());
        return null;
    }

    public static void setShellSize(ERect r, Shell shell) {
        int trim = shell.getSize().y - shell.getClientArea().height;
        shell.setSize(r.right - r.left + 5, r.bottom - r.top + trim);
    }

    public MiniHost(AEffect effect) {
        super(null);
        this.effect = effect;
    }

    protected void configureShell(Shell shell) {
        super.configureShell(shell);
        shell.setBounds(100, 100, 640, 400);
        shell.setImage(ImageDescriptor.createFromFile(null, "site/logo.gif")
                .createImage());
        shell.setText("JVST MiniHost Example");
    }
}
The output screenshot looks like:
Change History
V0.0.1
  • Initial version.