src/java.desktop/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java

Print this page




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.media.sound;
  26 
  27 /**
  28  * AHDSR control signal envelope generator.
  29  *
  30  * @author Karl Helgason
  31  */
  32 public final class SoftEnvelopeGenerator implements SoftProcess {
  33 
  34     public final static int EG_OFF = 0;
  35     public final static int EG_DELAY = 1;
  36     public final static int EG_ATTACK = 2;
  37     public final static int EG_HOLD = 3;
  38     public final static int EG_DECAY = 4;
  39     public final static int EG_SUSTAIN = 5;
  40     public final static int EG_RELEASE = 6;
  41     public final static int EG_SHUTDOWN = 7;
  42     public final static int EG_END = 8;
  43     int max_count = 10;
  44     int used_count = 0;
  45     private final int[] stage = new int[max_count];
  46     private final int[] stage_ix = new int[max_count];
  47     private final double[] stage_v = new double[max_count];
  48     private final int[] stage_count = new int[max_count];
  49     private final double[][] on = new double[max_count][1];
  50     private final double[][] active = new double[max_count][1];
  51     private final double[][] out = new double[max_count][1];
  52     private final double[][] delay = new double[max_count][1];
  53     private final double[][] attack = new double[max_count][1];
  54     private final double[][] hold = new double[max_count][1];
  55     private final double[][] decay = new double[max_count][1];
  56     private final double[][] sustain = new double[max_count][1];
  57     private final double[][] release = new double[max_count][1];
  58     private final double[][] shutdown = new double[max_count][1];
  59     private final double[][] release2 = new double[max_count][1];
  60     private final double[][] attack2 = new double[max_count][1];
  61     private final double[][] decay2 = new double[max_count][1];
  62     private double control_time = 0;




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.media.sound;
  26 
  27 /**
  28  * AHDSR control signal envelope generator.
  29  *
  30  * @author Karl Helgason
  31  */
  32 public final class SoftEnvelopeGenerator implements SoftProcess {
  33 
  34     public static final int EG_OFF = 0;
  35     public static final int EG_DELAY = 1;
  36     public static final int EG_ATTACK = 2;
  37     public static final int EG_HOLD = 3;
  38     public static final int EG_DECAY = 4;
  39     public static final int EG_SUSTAIN = 5;
  40     public static final int EG_RELEASE = 6;
  41     public static final int EG_SHUTDOWN = 7;
  42     public static final int EG_END = 8;
  43     int max_count = 10;
  44     int used_count = 0;
  45     private final int[] stage = new int[max_count];
  46     private final int[] stage_ix = new int[max_count];
  47     private final double[] stage_v = new double[max_count];
  48     private final int[] stage_count = new int[max_count];
  49     private final double[][] on = new double[max_count][1];
  50     private final double[][] active = new double[max_count][1];
  51     private final double[][] out = new double[max_count][1];
  52     private final double[][] delay = new double[max_count][1];
  53     private final double[][] attack = new double[max_count][1];
  54     private final double[][] hold = new double[max_count][1];
  55     private final double[][] decay = new double[max_count][1];
  56     private final double[][] sustain = new double[max_count][1];
  57     private final double[][] release = new double[max_count][1];
  58     private final double[][] shutdown = new double[max_count][1];
  59     private final double[][] release2 = new double[max_count][1];
  60     private final double[][] attack2 = new double[max_count][1];
  61     private final double[][] decay2 = new double[max_count][1];
  62     private double control_time = 0;