package jmsltestsuite; import java.awt.event.*; import com.didkovsky.portview.PVFrame; import com.softsynth.jmsl.*; import com.softsynth.jmsl.util.SimplePrintingInterpreter; import com.softsynth.jmsl.view.*; /** A simple JMSL class to test JMSL installation. If you can compile and run this, you're good
You should see a Frame open with the JMSL MusicShape Editor. Watch the console; you should see a MusicShape printing itself out on schedule. @author Nick Didkovsky 6/30/01 12:43AM */ public class HelloJMSL { public static void main(String args[]) { JMSLRandom.randomize(); MusicShape s = new MusicShape(2); for (int i = 0; i < 50; i++) { s.add(JMSLRandom.choose(), i); } s.getInstrument().setInterpreter(new SimplePrintingInterpreter()); s.setRepeats(100); MusicShapeEditor se = new MusicShapeEditor(); se.addMusicShape(s); PVFrame f = new PVFrameAdapter("Hello JMSL."); f.add(se.getComponent()); f.pack(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); f.setVisible(true); System.out.println("If you can see the Music Shape Editor, "); System.out.println("and if you see durations being printed out below, "); System.out.println("you can compile and run JMSL applications!\n\n"); s.launch(JMSL.now()); } }