Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.desktop.jmod - Desktop Module
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.
JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.
JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/media/sound/SoftEnvelopeGenerator.java
/* * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.media.sound; /** * AHDSR control signal envelope generator. * * @author Karl Helgason */ public final class SoftEnvelopeGenerator implements SoftProcess { public static final int EG_OFF = 0; public static final int EG_DELAY = 1; public static final int EG_ATTACK = 2; public static final int EG_HOLD = 3; public static final int EG_DECAY = 4; public static final int EG_SUSTAIN = 5; public static final int EG_RELEASE = 6; public static final int EG_SHUTDOWN = 7; public static final int EG_END = 8; int max_count = 10; int used_count = 0; private final int[] stage = new int[max_count]; private final int[] stage_ix = new int[max_count]; private final double[] stage_v = new double[max_count]; private final int[] stage_count = new int[max_count]; private final double[][] on = new double[max_count][1]; private final double[][] active = new double[max_count][1]; private final double[][] out = new double[max_count][1]; private final double[][] delay = new double[max_count][1]; private final double[][] attack = new double[max_count][1]; private final double[][] hold = new double[max_count][1]; private final double[][] decay = new double[max_count][1]; private final double[][] sustain = new double[max_count][1]; private final double[][] release = new double[max_count][1]; private final double[][] shutdown = new double[max_count][1]; private final double[][] release2 = new double[max_count][1]; private final double[][] attack2 = new double[max_count][1]; private final double[][] decay2 = new double[max_count][1]; private double control_time = 0; @Override public void reset() { for (int i = 0; i < used_count; i++) { stage[i] = 0; on[i][0] = 0; out[i][0] = 0; delay[i][0] = 0; attack[i][0] = 0; hold[i][0] = 0; decay[i][0] = 0; sustain[i][0] = 0; release[i][0] = 0; shutdown[i][0] = 0; attack2[i][0] = 0; decay2[i][0] = 0; release2[i][0] = 0; } used_count = 0; } @Override public void init(SoftSynthesizer synth) { control_time = 1.0 / synth.getControlRate(); processControlLogic(); } @Override public double[] get(int instance, String name) { if (instance >= used_count) used_count = instance + 1; if (name == null) return out[instance]; if (name.equals("on")) return on[instance]; if (name.equals("active")) return active[instance]; if (name.equals("delay")) return delay[instance]; if (name.equals("attack")) return attack[instance]; if (name.equals("hold")) return hold[instance]; if (name.equals("decay")) return decay[instance]; if (name.equals("sustain")) return sustain[instance]; if (name.equals("release")) return release[instance]; if (name.equals("shutdown")) return shutdown[instance]; if (name.equals("attack2")) return attack2[instance]; if (name.equals("decay2")) return decay2[instance]; if (name.equals("release2")) return release2[instance]; return null; } @Override @SuppressWarnings("fallthrough") public void processControlLogic() { for (int i = 0; i < used_count; i++) { if (stage[i] == EG_END) continue; if ((stage[i] > EG_OFF) && (stage[i] < EG_RELEASE)) { if (on[i][0] < 0.5) { if (on[i][0] < -0.5) { stage_count[i] = (int)(Math.pow(2, this.shutdown[i][0] / 1200.0) / control_time); if (stage_count[i] < 0) stage_count[i] = 0; stage_v[i] = out[i][0]; stage_ix[i] = 0; stage[i] = EG_SHUTDOWN; } else { if ((release2[i][0] < 0.000001) && release[i][0] < 0 && Double.isInfinite(release[i][0])) { out[i][0] = 0; active[i][0] = 0; stage[i] = EG_END; continue; } stage_count[i] = (int)(Math.pow(2, this.release[i][0] / 1200.0) / control_time); stage_count[i] += (int)(this.release2[i][0]/(control_time * 1000)); if (stage_count[i] < 0) stage_count[i] = 0; // stage_v[i] = out[i][0]; stage_ix[i] = 0; double m = 1 - out[i][0]; stage_ix[i] = (int)(stage_count[i] * m); stage[i] = EG_RELEASE; } } } switch (stage[i]) { case EG_OFF: active[i][0] = 1; if (on[i][0] < 0.5) break; stage[i] = EG_DELAY; stage_ix[i] = (int)(Math.pow(2, this.delay[i][0] / 1200.0) / control_time); if (stage_ix[i] < 0) stage_ix[i] = 0; // Fallthrough case EG_DELAY: if (stage_ix[i] == 0) { double attack = this.attack[i][0]; double attack2 = this.attack2[i][0]; if (attack2 < 0.000001 && (attack < 0 && Double.isInfinite(attack))) { out[i][0] = 1; stage[i] = EG_HOLD; stage_count[i] = (int)(Math.pow(2, this.hold[i][0] / 1200.0) / control_time); stage_ix[i] = 0; } else { stage[i] = EG_ATTACK; stage_count[i] = (int)(Math.pow(2, attack / 1200.0) / control_time); stage_count[i] += (int)(attack2 / (control_time * 1000)); if (stage_count[i] < 0) stage_count[i] = 0; stage_ix[i] = 0; } } else stage_ix[i]--; break; case EG_ATTACK: stage_ix[i]++; if (stage_ix[i] >= stage_count[i]) { out[i][0] = 1; stage[i] = EG_HOLD; } else { // CONVEX attack double a = ((double)stage_ix[i]) / ((double)stage_count[i]); a = 1 + ((40.0 / 96.0) / Math.log(10)) * Math.log(a); if (a < 0) a = 0; else if (a > 1) a = 1; out[i][0] = a; } break; case EG_HOLD: stage_ix[i]++; if (stage_ix[i] >= stage_count[i]) { stage[i] = EG_DECAY; stage_count[i] = (int)(Math.pow(2, this.decay[i][0] / 1200.0) / control_time); stage_count[i] += (int)(this.decay2[i][0]/(control_time*1000)); if (stage_count[i] < 0) stage_count[i] = 0; stage_ix[i] = 0; } break; case EG_DECAY: stage_ix[i]++; double sustain = this.sustain[i][0] * (1.0 / 1000.0); if (stage_ix[i] >= stage_count[i]) { out[i][0] = sustain; stage[i] = EG_SUSTAIN; if (sustain < 0.001) { out[i][0] = 0; active[i][0] = 0; stage[i] = EG_END; } } else { double m = ((double)stage_ix[i]) / ((double)stage_count[i]); out[i][0] = (1 - m) + sustain * m; } break; case EG_SUSTAIN: break; case EG_RELEASE: stage_ix[i]++; if (stage_ix[i] >= stage_count[i]) { out[i][0] = 0; active[i][0] = 0; stage[i] = EG_END; } else { double m = ((double)stage_ix[i]) / ((double)stage_count[i]); out[i][0] = (1 - m); // *stage_v[i]; if (on[i][0] < -0.5) { stage_count[i] = (int)(Math.pow(2, this.shutdown[i][0] / 1200.0) / control_time); if (stage_count[i] < 0) stage_count[i] = 0; stage_v[i] = out[i][0]; stage_ix[i] = 0; stage[i] = EG_SHUTDOWN; } // re-damping if (on[i][0] > 0.5) { sustain = this.sustain[i][0] * (1.0 / 1000.0); if (out[i][0] > sustain) { stage[i] = EG_DECAY; stage_count[i] = (int)(Math.pow(2, this.decay[i][0] / 1200.0) / control_time); stage_count[i] += (int)(this.decay2[i][0]/(control_time*1000)); if (stage_count[i] < 0) stage_count[i] = 0; m = (out[i][0] - 1) / (sustain - 1); stage_ix[i] = (int) (stage_count[i] * m); } } } break; case EG_SHUTDOWN: stage_ix[i]++; if (stage_ix[i] >= stage_count[i]) { out[i][0] = 0; active[i][0] = 0; stage[i] = EG_END; } else { double m = ((double)stage_ix[i]) / ((double)stage_count[i]); out[i][0] = (1 - m) * stage_v[i]; } break; default: break; } } } }
⏎ com/sun/media/sound/SoftEnvelopeGenerator.java
Or download all of them as a single archive file:
File name: java.desktop-17.0.5-src.zip File size: 9152233 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.instrument.jmod - Instrument Module
2023-09-16, 33751👍, 0💬
Popular Posts:
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...
JDK 11 java.base.jmod is the JMOD file for JDK 11 Base module. JDK 11 Base module compiled class fil...
How to read XML document with XML Schema validation from socket connections with the socket\DelayedI...
JDK 11 jdk.aot.jmod is the JMOD file for JDK 11 Ahead-of-Time (AOT) Compiler module. JDK 11 AOT Comp...
How to download and install ojdbc11.jar for Oracle 21c? ojdbc11.jar for Oracle 21c is a Java JDBC Dr...