Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.9 #21

Merged
merged 20 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
if: ${{ contains(github.event.head_commit.message, 'bump version') }}
run: grep "<version>" pom.xml | head -1 | grep -v SNAPSHOT

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
87 changes: 46 additions & 41 deletions README.md

Large diffs are not rendered by default.

70 changes: 49 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-sound-sandbox</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>

<name>Vavi Sound API (Sandbox)</name>
<url>https://github.com/umjammer/vavi-sound-sandbox</url>
Expand Down Expand Up @@ -42,7 +42,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.1.0</version>
<version>1.2.1</version>
<executions>
<execution>
<id>read-properties</id>
Expand Down Expand Up @@ -99,36 +99,69 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.12.1</version>
<configuration>
<source>17</source> <!-- TODO release causes compilation failure why? -->
<target>17</target>
<source>21</source> <!-- TODO release causes compilation failure why? -->
<target>21</target>
<compilerArgs>
<arg>--add-modules=jdk.incubator.vector</arg>
<arg>--add-exports</arg>
<arg>java.desktop/com.sun.media.sound=ALL-UNNAMED</arg>
</compilerArgs>
<!-- https://stackoverflow.com/a/30472473 -->
<fork>true</fork>
<showWarnings>true</showWarnings>
<excludes>
<exclude>vavi/sound/twinvq/*.java</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>generate-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/samples/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>generate-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/samples/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.2</version>
<version>3.2.5</version>
<configuration>
<argLine>
-Xmx4G
--add-modules jdk.incubator.vector
--add-exports java.desktop/com.sun.media.sound=ALL-UNNAMED
-javaagent:${project.build.directory}/vavi-instrumentation.jar
-Dvavix.lang.instrumentation.VaviInstrumentation.1=vavix.lang.instrumentation.PropertiesClassFileTransformer
-Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties
-Dvavi.test.volume=${vavi.test.volume}
-Dvavi.test.volume.midi=${vavi.test.volume.midi}
-Dvavi.test.volume=@{vavi.test.volume}
-Dvavi.test.volume.midi=@{vavi.test.volume.midi}
-Dvavi.test.version=${project.version}
</argLine>
<trimStackTrace>false</trimStackTrace>
Expand Down Expand Up @@ -199,19 +232,14 @@
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>maven_central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.2</version>
<version>5.10.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -222,12 +250,12 @@
<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>vavi-commons</artifactId>
<version>1.1.12</version>
<version>1.1.14</version>
</dependency>
<dependency>
<groupId>com.github.umjammer</groupId> <!-- vavi / com.github.umjammer -->
<artifactId>vavi-sound</artifactId>
<version>1.0.18</version>
<version>1.0.19</version>
<exclusions>
<exclusion>
<groupId>com.github.umjammer</groupId>
Expand Down Expand Up @@ -420,9 +448,9 @@
</dependency>

<dependency>
<groupId>com.github.umjammer</groupId>
<groupId>com.github.umjammer</groupId> <!-- com.github.umjammer -->
<artifactId>vavi-util-screenscraping</artifactId>
<version>1.0.13</version>
<version>1.0.14</version>
<scope>test</scope>
</dependency>

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/jp/or/rim/kt/kemusiro/sound/MMLCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public class MMLCompiler {

private MusicScore score;
private int tickPerBeat = 240;
private final int maxAmplitude = 127;
private final int currentTempo = 60;
private final int initialOctave = 4;
private static final int maxAmplitude = 127;
private static final int currentTempo = 60;
private static final int initialOctave = 4;
private final int[] currentOctave;
private int currentVolume = 8;
private int currentTick = tickPerBeat;
private final int initialQuantity = 8;
private static final int initialQuantity = 8;
private final int[] currentQuantity;
private int tick = 0;
private String mml;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
public class MMLPlayerApplication extends JFrame {

Container container;
JDesktopPane desktop;
final Container container;
final JDesktopPane desktop;

public MMLPlayerApplication() {
super("MML Player");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jp/or/rim/kt/kemusiro/sound/MusicScore.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void add(MusicEvent event) {
return;
}
}
eventList.add(0, event);
eventList.addFirst(event);
}

public void dump(OutputStream output) {
Expand Down
32 changes: 18 additions & 14 deletions src/main/java/jp/or/rim/kt/kemusiro/sound/WaveInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class WaveInputStream extends InputStream {
private final Instrument[] insts;
private final NoteOn[] notes;
private int currentTick = 0;
private final double currentTime = 0.0;
private static final double currentTime = 0.0;
private final double[] time;
private int currentTempo = 60;
private int pos = 0;
Expand Down Expand Up @@ -66,19 +66,23 @@ private void processEvent() {
while (e != null && e.getTick() == currentTick) {
int ch = e.getChannel();

if (e instanceof ChangeInstrument) {
insts[ch] = ((ChangeInstrument) e).getInstrument();
insts[ch].setTimeStep(1.0 / (double) samplingRate);
} else if (e instanceof ChangeTempo) {
currentTempo = ((ChangeTempo) e).getTempo();
} else if (e instanceof NoteOn) {
notes[ch] = (NoteOn) e;
insts[ch].press();
} else if (e instanceof NoteOff) {
// notes[ch] = null;
insts[ch].release();
switch (e) {
case ChangeInstrument changeInstrument -> {
insts[ch] = changeInstrument.getInstrument();
insts[ch].setTimeStep(1.0 / (double) samplingRate);
}
case ChangeTempo changeTempo -> currentTempo = changeTempo.getTempo();
case NoteOn noteOn -> {
notes[ch] = noteOn;
insts[ch].press();
}
case NoteOff noteOff ->
// notes[ch] = null;
insts[ch].release();
default -> {
}
}
events.remove(0);
events.removeFirst();
if (events.isEmpty()) {
break;
}
Expand Down Expand Up @@ -119,7 +123,7 @@ private int fillBuffer() {
if (events.isEmpty()) {
break;
}
if (events.get(0).getTick() == currentTick) {
if (events.getFirst().getTick() == currentTick) {
processEvent();
}

Expand Down
102 changes: 51 additions & 51 deletions src/main/java/unknown/sound/MTMWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -701,60 +701,60 @@ public void paint(Graphics g) {
super.paint(g);
}

MenuBar bar;
Menu fileMenu;
MenuItem file_Open;
MenuItem file_Exchange;
MenuItem file_Pref_Open;
final MenuBar bar;
final Menu fileMenu;
final MenuItem file_Open;
final MenuItem file_Exchange;
final MenuItem file_Pref_Open;
MenuItem file_Pref_Close;
MenuItem file_Quit;
Checkbox titleCheckbox;
final MenuItem file_Quit;
final Checkbox titleCheckbox;
Checkbox titleFileCheckbox;
Checkbox titleUserCheckbox;
CheckboxGroup titleGroup;
final CheckboxGroup titleGroup;
TextField titleUserText;
Checkbox volumeCheckbox;
Checkbox volumeVelocityCheckbox;
Checkbox volumeConstCheckbox;
CheckboxGroup volumeGroup;
Checkbox volumeCh1Checkbox;
Checkbox volumeCh2Checkbox;
Checkbox volumeCh3Checkbox;
Checkbox volumeCh4Checkbox;
TextField volumeCh1Text;
TextField volumeCh2Text;
TextField volumeCh3Text;
TextField volumeCh4Text;
Label fileLabel;
TextArea filePathText;
Button fileButton;
final Checkbox volumeCheckbox;
final Checkbox volumeVelocityCheckbox;
final Checkbox volumeConstCheckbox;
final CheckboxGroup volumeGroup;
final Checkbox volumeCh1Checkbox;
final Checkbox volumeCh2Checkbox;
final Checkbox volumeCh3Checkbox;
final Checkbox volumeCh4Checkbox;
final TextField volumeCh1Text;
final TextField volumeCh2Text;
final TextField volumeCh3Text;
final TextField volumeCh4Text;
final Label fileLabel;
final TextArea filePathText;
final Button fileButton;
File midiFile;
Checkbox fileCheckbox;
Button mldButton;
Label prefLabel;
Label resolutionLabel;
Choice resolutionChoice;
Checkbox dateCheckbox;
Checkbox dateTodayCheckbox;
Checkbox dateFileCheckbox;
Checkbox dateUserCheckbox;
CheckboxGroup dateGroup;
TextField dateUserText;
Checkbox rightCheckbox;
Checkbox rightNoneCheckbox;
Checkbox rightIsCheckbox;
Checkbox rightOtherCheckbox;
CheckboxGroup rightGroup;
TextField rightOtherText;
Checkbox informationCheckbox;
Checkbox informationFileCheckbox;
Checkbox informationUserCheckbox;
CheckboxGroup informationGroup;
TextArea informationUserText;
Checkbox versionCheckbox;
Checkbox versionDefaultCheckbox;
Checkbox versionUserCheckbox;
CheckboxGroup versionGroup;
TextField versionUserText;
Checkbox fullCheckbox;
final Checkbox fileCheckbox;
final Button mldButton;
final Label prefLabel;
final Label resolutionLabel;
final Choice resolutionChoice;
final Checkbox dateCheckbox;
final Checkbox dateTodayCheckbox;
final Checkbox dateFileCheckbox;
final Checkbox dateUserCheckbox;
final CheckboxGroup dateGroup;
final TextField dateUserText;
final Checkbox rightCheckbox;
final Checkbox rightNoneCheckbox;
final Checkbox rightIsCheckbox;
final Checkbox rightOtherCheckbox;
final CheckboxGroup rightGroup;
final TextField rightOtherText;
final Checkbox informationCheckbox;
final Checkbox informationFileCheckbox;
final Checkbox informationUserCheckbox;
final CheckboxGroup informationGroup;
final TextArea informationUserText;
final Checkbox versionCheckbox;
final Checkbox versionDefaultCheckbox;
final Checkbox versionUserCheckbox;
final CheckboxGroup versionGroup;
final TextField versionUserText;
final Checkbox fullCheckbox;
}
Loading