/** ShapeToot04.java Fill a MusicShape with random numbers with increasing variance. * @author Phil Burk and Nick Didkovsky */ /* * (C) 1997 Phil Burk and Nick Didkovsky, All Rights Reserved * JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom. */ package jmsltutorial; import com.softsynth.jmsl.JMSLRandom; import com.softsynth.jmsl.MusicShape; import com.softsynth.jmsl.view.MusicShapeEditor; public class ShapeToot04 extends java.applet.Applet { MusicShape myMusicShape; MusicShapeEditor myShapeEditor; /* Build our data when the applet initializes */ public void init() { myMusicShape = new MusicShape(1); double centralValue = 300.0; for (int i = 0; i < 200; i++) { double value = centralValue + JMSLRandom.choosePlusMinus(i); myMusicShape.add(value); } // Now let's name the dimensions with human-friendly monikers myMusicShape.setDimensionName(0, "jitter"); myShapeEditor = new MusicShapeEditor(); myShapeEditor.addMusicShape(myMusicShape); add(myShapeEditor.getComponent()); } }