diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c42152a..251b82c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index da4b1e9..4140083 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -22,10 +22,10 @@ jobs: if: ${{ contains(github.event.head_commit.message, 'bump version') }} run: grep "" 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 diff --git a/README.md b/README.md index a279431..aee05a6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Release](https://jitpack.io/v/umjammer/vavi-sound-sandbox.svg)](https://jitpack.io/#umjammer/vavi-sound-sandbox) [![Java CI](https://github.com/umjammer/vavi-sound-sandbox/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-sound-sandbox/actions/workflows/maven.yml) [![CodeQL](https://github.com/umjammer/vavi-sound-sandbox/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-sound-sandbox/actions/workflows/codeql-analysis.yml) -![Java](https://img.shields.io/badge/Java-17-b07219) +![Java](https://img.shields.io/badge/Java-21-b07219) # vavi-sound-sandbox @@ -9,41 +9,42 @@ ### Status -| **SPI** | **Codec** | **IN Status** | **OUT Status** | **SPI Status** | **project** | **Description** | **Comment** | -|:------------|:-------------|:--------------|:---------------|:---------------|:---------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------| -| midi | unknown | 🚫 | 🚫 | - | this | MFi by [unknown]() | | -| midi | ittake | 🚫 | 🚫 | - | this | MFi by [ittake](https://web.archive.org/web/20090515001654/http://tokyo.cool.ne.jp/ittake/java/MIDIToMLDv013/MIDIToMLD.html) | | -| sampled | ilbc | 🚫 | 🚫 | - | this | [c](http://www.ilbcfreeware.org/) | | -| sampled | ldcelp | 🚫 | 🚫 | - | this | [c](ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/coding/ldcelp-2.0.tar.gz) | | -| sampled | mp3 | 🚫 | - | - | this | [mp3](https://github.com/umjammer/vavi-sound-sandbox/tree/master/src/main/java/vavi/sound/mp3) | need to deal tags | -| sampled | mp3 | ✅ | - | ✅ | [mp3spi](https://github.com/umjammer/mp3spi) | [jlayer](https://github.com/umjammer/jlayer) | | -| sampled | sse | 🚫 | - | 🚫 | this | [sse](http://shibatch.sourceforge.net/download/) | | -| sampled | resampling | ✅ | - | - | this | [laoe](http://www.oli4.ch/laoe/home.html) | | -| sampled | resampling | ✅ | - | - | this | [rohm](https://en.wikipedia.org/wiki/Rohm) | | -| sampled | polyphase | ✅ | - | 🚧 | this | [sox](http://sox.sourceforge.net/) resampling | | -| sampled | resampler | ✅ | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | -| sampled | perfect | 🚧 | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | -| sampled | monauralize | ✅ | - | ✅ | [tritonus-remaining](https://github.com/umjammer/tritonus-remaining) | `PCM2PCMConversionProvider` | works but not suitable for resampling | -| sampled | ~~alac~~ | ✅ | - | ✅ | [vavi-sound-alac](https://github.com/umjammer/vavi-sound-alac) | | graduated to vavi-sound-alac | -| ~~sampled~~ | ~~QTKit~~ | ~~✅~~ | - | ? | ~~this~~ | ~~[rococoa](https://github.com/umjammer/rococoa)~~ | deprecated | -| sampled | AVFoundation | 🚧 | - | 🚧 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioConverter` how to return objc value in callback? | -| sampled | twinvq | 🚫 | 🚫 | - | this | | TODO use ffmpeg | -| midi | vsq | 🚧 | - | 🚧 | this | | YAMAHA Vocaloid | -| sampled | opus | ✅ | 🚫 | ✅ | this | [concentus](https://github.com/lostromb/concentus) | | -| midi | AudioUnit | ✅ | - | ✅ | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitMIDIInstrument/kAudioUnitSubType_DLSSynth` | -| midi | AudioUnit | ✅ | - | 🚫 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitSampler`, how to adjust sf2 patch? | -| midi | JSyn | ✅ | - | ✅ | this | [JSyn](https://github.com/philburk/jsyn) | looking for good drums | -| midi | OPL3 | ✅ | - | ✅ | this | [adplug](https://github.com/adplug/adplug) | [opl3-player](http://opl3.cozendey.com/) | -| midi | ? | - | - | - | this | | opl, ma | -| midi | CoreMIDI | ✅ | ? | ✅ | [osxmidi4j](https://github.com/umjammer/osxmidi4j) | rococoa | iac ✓, network ✓, bluetooth ? | -| midi | CoreMIDI | ✅ | ? | ✅ | [CoreMidi4J](https://github.com/DerekCook/CoreMidi4J) | jni | iac ✓, network ✓, bluetooth ? | -| sampled | speex | ✅ | - | ✅ | [jspeex](http://jspeex.sourceforge.net/) | | sample rate is limited to convert | -| sampled | flac | ✅ | - | ✅ | [JustFLAC](https://github.com/umjammer/vavi-sound-flac) | | | -| sampled | flac | ✅ | - | ✅ | [jFLAC](http://jflac.sourceforge.net/) | | | -| sampled | aac | - | - | ✅ | [JAADec](https://github.com/umjammer/vavi-sound-aac) | | | -| sampled | vorbis | - | - | ✅ | [tritonus-jorbis](https://github.com/umjammer/tritonus-jorbis) | | | -| sampled | atrac3 | 🚧 | - | 🚧 | this | jpcsp | Sony MD | -| sampled | atrac3+ | 🚧 | - | 🚧 | this | jpcsp | Sony MD | +| **SPI** | **Codec** | **IN Status** | **OUT Status** | **SPI Status** | **project** | **Description** | **Comment** | +|:------------|:-------------|:--------------|:---------------|:---------------|:------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------| +| midi | unknown | 🚫 | 🚫 | - | this | MFi by [unknown]() | | +| midi | ittake | 🚫 | 🚫 | - | this | MFi by [ittake](https://web.archive.org/web/20090515001654/http://tokyo.cool.ne.jp/ittake/java/MIDIToMLDv013/MIDIToMLD.html) | | +| sampled | ilbc | ✅ | ? | ✅ | this | [c](http://www.ilbcfreeware.org/) | | +| sampled | ldcelp | ✅ | ? | ✅ | this | [c](https://archive.org/details/2014.12.svr-ftp.eng.cam.ac.uk#/pub/comp.speech/coding/ldcelp-2.0.tar.gz) | | +| sampled | mp3 | 🚫 | - | - | this | [mp3](https://github.com/umjammer/vavi-sound-sandbox/tree/master/src/main/java/vavi/sound/mp3) | need to deal tags | +| sampled | mp3 | ✅ | - | ✅ | [mp3spi](https://github.com/umjammer/mp3spi) | [jlayer](https://github.com/umjammer/jlayer) | | +| sampled | sse | 🚫 | - | 🚫 | this | [sse](http://shibatch.sourceforge.net/download/) | | +| sampled | resampling | ✅ | - | - | this | [laoe](http://www.oli4.ch/laoe/home.html) | | +| sampled | resampling | ✅ | - | - | this | [rohm](https://en.wikipedia.org/wiki/Rohm) | | +| sampled | polyphase | ✅ | - | 🚧 | this | [sox](http://sox.sourceforge.net/) resampling | | +| sampled | resampler | ✅ | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | +| sampled | perfect | 🚧 | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | +| sampled | monauralize | ✅ | - | ✅ | [tritonus-remaining](https://github.com/umjammer/tritonus/tree/develop/tritonus-remaining) | `PCM2PCMConversionProvider` | works but not suitable for resampling | +| sampled | alac | ✅ | - | ✅ | [vavi-sound-alac](https://github.com/umjammer/vavi-sound-alac) | | 🎓 graduated to vavi-sound-alac | +| ~~sampled~~ | ~~QTKit~~ | ~~✅~~ | - | ? | ~~this~~ | ~~[rococoa](https://github.com/umjammer/rococoa)~~ | deprecated | +| sampled | AVFoundation | 🚧 | - | 🚧 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioConverter` how to return objc value in callback? | +| sampled | twinvq | 🚧 | 🚫 | - | this | | TODO use ffmpeg | +| midi | vsq | 🚧 | - | 🚧 | this | | YAMAHA Vocaloid | +| sampled | opus | ✅ | 🚫 | ✅ | this | [concentus](https://github.com/lostromb/concentus) | | +| midi | AudioUnit | ✅ | - | ✅ | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitMIDIInstrument/kAudioUnitSubType_DLSSynth` | +| midi | AudioUnit | ✅ | - | 🚫 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitSampler`, how to adjust sf2 patch? | +| midi | JSyn | ✅ | - | ✅ | this | [JSyn](https://github.com/philburk/jsyn) | looking for good drums | +| midi | OPL3 | ✅ | - | ✅ | this | [adplug](https://github.com/adplug/adplug) | [opl3-player](http://opl3.cozendey.com/) | +| midi | ? | - | - | - | this | | opl, ma | +| midi | CoreMIDI | ✅ | ? | ✅ | [osxmidi4j](https://github.com/umjammer/osxmidi4j) | rococoa | iac ✓, network ✓, bluetooth ? | +| midi | CoreMIDI | ✅ | ? | ✅ | [CoreMidi4J](https://github.com/DerekCook/CoreMidi4J) | jni | iac ✓, network ✓, bluetooth ? | +| sampled | speex | ✅ | - | ✅ | [jspeex](http://jspeex.sourceforge.net/) | | sample rate is limited to convert | +| sampled | flac | ✅ | - | ✅ | [JustFLAC](https://github.com/umjammer/vavi-sound-flac) | | | +| sampled | flac | ✅ | - | ✅ | [jFLAC](http://jflac.sourceforge.net/) | | | +| sampled | aac | - | - | ✅ | [JAADec](https://github.com/umjammer/vavi-sound-aac) | | | +| sampled | vorbis | - | - | ✅ | [tritonus-jorbis](https://github.com/umjammer/tritonus/tree/develop/tritonus-jorbis) | | | +| sampled | atrac3 | ✅ | - | ? | [vavi-sound-atrack](https://github.com/umjammer/vavi-sound-atrack) | jpcsp | Sony MD | +| sampled | atrac3+ | ✅ | - | ✅ | [vavi-sound-atrack](https://github.com/umjammer/vavi-sound-atrack) | jpcsp | Sony MD | +| sampled | atrac9 | ✅ | - | ✅ | [vavi-sound-atrack](https://github.com/umjammer/vavi-sound-atrack) | jpcsp | Sony MD | ### Features @@ -107,14 +108,16 @@ clip.loop(Clip.LOOP_CONTINUOUSLY); ### codec - * https://github.com/hendriks73/ffsampledsp (twinvq) - * https://github.com/Icenowy/jcadencii (twinvq?) + * twinvq + * https://github.com/hendriks73/ffsampledsp + * https://github.com/Icenowy/jcadencii (?) + * http://k-takata.o.oo7.jp/mysoft/tvqdec.html * https://github.com/hendriks73/casampledsp/tree/master (coreaudio is base of avfoundation?) - * ~~https://github.com/drogatkin/JustFLAC~~ → [vavi-sound-lc3](https://github.com/umjammer/vavi-sound-flac) + * ~~https://github.com/drogatkin/JustFLAC~~ → [vavi-sound-flac](https://github.com/umjammer/vavi-sound-flac) * ~~lc3~~ → [vavi-sound-lc3](https://github.com/umjammer/vavi-sound-lc3) * https://github.com/ninjasource/lc3-codec * https://www.iis.fraunhofer.de/ja/ff/amm/communication/lc3.html - * https://jmac.sourceforge.net/ (monkey's audio) + * ~~https://jmac.sourceforge.net/ (monkey's audio)~~ → [jmac](https://github.com/umjammer/jmac) ### midi @@ -132,13 +135,14 @@ clip.loop(Clip.LOOP_CONTINUOUSLY); #### others * opl3 + * need to fix: dro(old), midi, etc? * opl3 volume * opl3 midi reader * https://github.com/fedex81/emuSandbox * https://github.com/toyoshim/tss * ~~Apple DLS Sound device~~ (done) * https://github.com/comsonica/comsonica-studio - * https://github.com/jtrfp/javamod (has graphical equalizer, opl2,3 emulator) + * ~~https://github.com/jtrfp/javamod (has graphical equalizer, opl2,3 emulator)~~ → [javamod](https://github.com/umjammer/javamod) * http://www.jfugue.org/download.html * https://sourceforge.net/projects/bristol/ * https://github.com/Xycl/JSynthLib @@ -152,6 +156,7 @@ clip.loop(Clip.LOOP_CONTINUOUSLY); * ~~mml (cmd sing)~~ * [thanks](http://asamomiji.jp/contents/mml-player) * crackling at end https://stackoverflow.com/a/9630897 + * https://github.com/trrk/FlMML-for-Android ### ebml diff --git a/pom.xml b/pom.xml index 1dbc71b..e096772 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ vavi vavi-sound-sandbox - 1.0.8 + 1.0.9 Vavi Sound API (Sandbox) https://github.com/umjammer/vavi-sound-sandbox @@ -42,7 +42,7 @@ org.codehaus.mojo properties-maven-plugin - 1.1.0 + 1.2.1 read-properties @@ -99,36 +99,69 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 - 17 - 17 + 21 + 21 + --add-modules=jdk.incubator.vector --add-exports java.desktop/com.sun.media.sound=ALL-UNNAMED true true - - vavi/sound/twinvq/*.java - + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + generate-test-sources + generate-test-sources + + add-test-source + + + + src/samples/java + + + + + generate-test-resources + generate-test-resources + + add-test-resource + + + + + src/samples/resources + + + + + + + org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.2.5 -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} false @@ -199,11 +232,6 @@ jitpack.io https://jitpack.io - - maven_central - Maven Central - https://repo.maven.apache.org/maven2/ - @@ -211,7 +239,7 @@ org.junit junit-bom - 5.10.2 + 5.10.3 pom import @@ -222,12 +250,12 @@ com.github.umjammer vavi-commons - 1.1.12 + 1.1.14 com.github.umjammer vavi-sound - 1.0.18 + 1.0.19 com.github.umjammer @@ -420,9 +448,9 @@ - com.github.umjammer + com.github.umjammer vavi-util-screenscraping - 1.0.13 + 1.0.14 test diff --git a/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLCompiler.java b/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLCompiler.java index 835e242..1d0280e 100644 --- a/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLCompiler.java +++ b/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLCompiler.java @@ -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; diff --git a/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLPlayerApplication.java b/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLPlayerApplication.java index 82a1e2e..31297f2 100644 --- a/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLPlayerApplication.java +++ b/src/main/java/jp/or/rim/kt/kemusiro/sound/MMLPlayerApplication.java @@ -17,8 +17,8 @@ */ public class MMLPlayerApplication extends JFrame { - Container container; - JDesktopPane desktop; + final Container container; + final JDesktopPane desktop; public MMLPlayerApplication() { super("MML Player"); diff --git a/src/main/java/jp/or/rim/kt/kemusiro/sound/MusicScore.java b/src/main/java/jp/or/rim/kt/kemusiro/sound/MusicScore.java index cc5413f..3645e99 100644 --- a/src/main/java/jp/or/rim/kt/kemusiro/sound/MusicScore.java +++ b/src/main/java/jp/or/rim/kt/kemusiro/sound/MusicScore.java @@ -65,7 +65,7 @@ public void add(MusicEvent event) { return; } } - eventList.add(0, event); + eventList.addFirst(event); } public void dump(OutputStream output) { diff --git a/src/main/java/jp/or/rim/kt/kemusiro/sound/WaveInputStream.java b/src/main/java/jp/or/rim/kt/kemusiro/sound/WaveInputStream.java index ac9b8c8..dc8f8fc 100644 --- a/src/main/java/jp/or/rim/kt/kemusiro/sound/WaveInputStream.java +++ b/src/main/java/jp/or/rim/kt/kemusiro/sound/WaveInputStream.java @@ -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; @@ -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; } @@ -119,7 +123,7 @@ private int fillBuffer() { if (events.isEmpty()) { break; } - if (events.get(0).getTick() == currentTick) { + if (events.getFirst().getTick() == currentTick) { processEvent(); } diff --git a/src/main/java/unknown/sound/MTMWindow.java b/src/main/java/unknown/sound/MTMWindow.java index 42a00f5..11cee29 100644 --- a/src/main/java/unknown/sound/MTMWindow.java +++ b/src/main/java/unknown/sound/MTMWindow.java @@ -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; } diff --git a/src/main/java/unknown/sound/converter/MIDITrackChunkToMLDTrackChunk.java b/src/main/java/unknown/sound/converter/MIDITrackChunkToMLDTrackChunk.java index 8ce62fe..20c4fde 100644 --- a/src/main/java/unknown/sound/converter/MIDITrackChunkToMLDTrackChunk.java +++ b/src/main/java/unknown/sound/converter/MIDITrackChunkToMLDTrackChunk.java @@ -90,6 +90,7 @@ public MIDITrackChunkToMLDTrackChunk(MIDIToMLDInputStream inputStream, try { NoteMessage[] tempo = { null, null, null, null }; int[] prevVelocity = { -1, -1, -1, -1 }; +label: do { unknown.sound.midi.track.TrackMessage message = (unknown.sound.midi.track.TrackMessage) stream.readMessage(); presentTime = message.getAbsoluteTime(); @@ -115,99 +116,103 @@ public MIDITrackChunkToMLDTrackChunk(MIDIToMLDInputStream inputStream, } } } while (timeOver); - if (message instanceof NoteOnMessage noteOn) { - int index = noteOn.getChunnel(); - if (index < 4) { - if (tempo[index] == null) { - if (noteOn.getVelocity() != 0) { + switch (message) { + case NoteOnMessage noteOn: { + int index = noteOn.getChunnel(); + if (index < 4) { + if (tempo[index] == null) { + if (noteOn.getVelocity() != 0) { + tempo[index] = new NoteMessage(0, index, + toMLDNote(noteOn.getNote()), + 0); + tempo[index].setAbsoluteTime(presentTime); + if (inputStream.getPreferences().useVelocity && + ((prevVelocity[index] != noteOn.getVelocity()) || + (prevVelocity[index] == -1))) { + SoundMessage sound = new SoundMessage(0, + index, + noteOn.getVelocity() / 2); + sound.setAbsoluteTime(presentTime); + add(sound); + prevVelocity[index] = noteOn.getVelocity(); + } + add(tempo[index]); + } + } else if (noteOn.getVelocity() == 0) { + if (toMLDNote(noteOn.getNote()) == tempo[index].getNote()) { + tempo[index].setSoundLength((int) (toMLDTime(presentTime) - + toMLDTime(tempo[index].getAbsoluteTime()))); + tempo[index] = null; + } + } else { + tempo[index].setSoundLength((int) (toMLDTime(presentTime) - + toMLDTime(tempo[index].getAbsoluteTime()) - + 1L)); tempo[index] = new NoteMessage(0, index, - toMLDNote(noteOn.getNote()), - 0); + toMLDNote(noteOn.getNote()), + 0); tempo[index].setAbsoluteTime(presentTime); - if (inputStream.getPreferences().useVelocity && - ((prevVelocity[index] != noteOn.getVelocity()) || - (prevVelocity[index] == -1))) { - SoundMessage sound = new SoundMessage(0, - index, - noteOn.getVelocity() / 2); - sound.setAbsoluteTime(presentTime); - add(sound); - prevVelocity[index] = noteOn.getVelocity(); - } add(tempo[index]); } - } else if (noteOn.getVelocity() == 0) { - if (toMLDNote(noteOn.getNote()) == tempo[index].getNote()) { - tempo[index].setSoundLength((int) (toMLDTime(presentTime) - - toMLDTime(tempo[index].getAbsoluteTime()))); - tempo[index] = null; - } - } else { - tempo[index].setSoundLength((int) (toMLDTime(presentTime) - - toMLDTime(tempo[index].getAbsoluteTime()) - - 1L)); - tempo[index] = new NoteMessage(0, index, - toMLDNote(noteOn.getNote()), - 0); - tempo[index].setAbsoluteTime(presentTime); - add(tempo[index]); } + continue; } - continue; - } - if (message instanceof NoteOffMessage noteOff) { - int index = noteOff.getChunnel(); - if ((index < 4) && (tempo[index] != null) && - (tempo[index].getNote() == toMLDNote(noteOff.getNote()))) { - tempo[index].setSoundLength((int) (toMLDTime(presentTime) - - toMLDTime(tempo[index].getAbsoluteTime()))); - tempo[index] = null; - } - continue; - } - if (message instanceof ProgramChangeMessage program) { - int index = program.getChunnel(); - if (index < 4) { - ProgramChangePrevMessage prev = new ProgramChangePrevMessage(0, - program.getChunnel(), - program.getProgram()); - ProgramChangeNextMessage next = new ProgramChangeNextMessage(0, - program.getChunnel(), - program.getProgram()); - prev.setAbsoluteTime(presentTime); - next.setAbsoluteTime(presentTime); - add(prev); - add(next); - } - continue; - } - if (message instanceof SetTempoMessage tempoChange) { - TempoMessage tempoMessage = new TempoMessage(0, - inputStream.getPreferences().resolution, - tempoChange.getTempo()); - tempoChange.setAbsoluteTime(presentTime); - add(tempoMessage); - continue; - } - if (message instanceof EndOfTrackMessage) { - break; - } - if (message instanceof SequenceTrackNameMessage name) { - if (inputStream.getTitleName() == null) { - inputStream.setTitleName(name.getTrackName()); + case NoteOffMessage noteOff: { + int index = noteOff.getChunnel(); + if ((index < 4) && (tempo[index] != null) && + (tempo[index].getNote() == toMLDNote(noteOff.getNote()))) { + tempo[index].setSoundLength((int) (toMLDTime(presentTime) - + toMLDTime(tempo[index].getAbsoluteTime()))); + tempo[index] = null; + } + continue; } - } else if (message instanceof TextMessage) { - if (inputStream.getPreferences().fullChorus) { - TextMessage text = (TextMessage) message; - if (text.getText().equals("MIDIToMLD Full chorus")) { - TrackBeginningMessage beginning = new TrackBeginningMessage(0, - 1); - beginning.setAbsoluteTime(presentTime); - add(beginning); + case ProgramChangeMessage program: { + int index = program.getChunnel(); + if (index < 4) { + ProgramChangePrevMessage prev = new ProgramChangePrevMessage(0, + program.getChunnel(), + program.getProgram()); + ProgramChangeNextMessage next = new ProgramChangeNextMessage(0, + program.getChunnel(), + program.getProgram()); + prev.setAbsoluteTime(presentTime); + next.setAbsoluteTime(presentTime); + add(prev); + add(next); } + continue; } - } else if (message instanceof RightMessage right) { - inputStream.setRightInformation(right.getRightText()); + case SetTempoMessage tempoChange: + TempoMessage tempoMessage = new TempoMessage(0, + inputStream.getPreferences().resolution, + tempoChange.getTempo()); + tempoChange.setAbsoluteTime(presentTime); + add(tempoMessage); + continue; + case EndOfTrackMessage endOfTrackMessage: + break label; + case SequenceTrackNameMessage name: + if (inputStream.getTitleName() == null) { + inputStream.setTitleName(name.getTrackName()); + } + break; + case TextMessage textMessage: + if (inputStream.getPreferences().fullChorus) { + TextMessage text = (TextMessage) message; + if (text.getText().equals("MIDIToMLD Full chorus")) { + TrackBeginningMessage beginning = new TrackBeginningMessage(0, + 1); + beginning.setAbsoluteTime(presentTime); + add(beginning); + } + } + break; + case RightMessage right: + inputStream.setRightInformation(right.getRightText()); + break; + default: + break; } } while (true); } catch (IOException | InvalidMidiDataException e) { diff --git a/src/main/java/unknown/sound/mfi/info/TitleMessage.java b/src/main/java/unknown/sound/mfi/info/TitleMessage.java index dcd019f..7854f16 100644 --- a/src/main/java/unknown/sound/mfi/info/TitleMessage.java +++ b/src/main/java/unknown/sound/mfi/info/TitleMessage.java @@ -25,7 +25,7 @@ public byte[] toBytes() { } private String messageTitle; - public static String TAG = "titl"; + public static final String TAG = "titl"; public TitleMessage(byte[] byteData) { super(byteData, TAG); diff --git a/src/main/java/unknown/sound/midi/track/TrackChunkInputStream.java b/src/main/java/unknown/sound/midi/track/TrackChunkInputStream.java index c2417c0..e1d2a46 100644 --- a/src/main/java/unknown/sound/midi/track/TrackChunkInputStream.java +++ b/src/main/java/unknown/sound/midi/track/TrackChunkInputStream.java @@ -177,7 +177,7 @@ private int readDeltaTime() throws InvalidMidiDataException, IOException { private int previousStatusByteTempo; private long trackAbsoluteTime; - public static String MYTAG = "MTrk"; + public static final String MYTAG = "MTrk"; public TrackChunkInputStream(byte[] dataBytes) { super(MYTAG, dataBytes); diff --git a/src/main/java/vavi/apps/packetcast/AudioSplitter.java b/src/main/java/vavi/apps/packetcast/AudioSplitter.java index 8992bdf..72c1020 100644 --- a/src/main/java/vavi/apps/packetcast/AudioSplitter.java +++ b/src/main/java/vavi/apps/packetcast/AudioSplitter.java @@ -267,7 +267,7 @@ class FileWriter implements ControllerListener, DataSinkListener { DataSink dsink; - String name; + final String name; FileWriter(String name) { this.name = name; diff --git a/src/main/java/vavi/apps/packetcast/PacketCaster.java b/src/main/java/vavi/apps/packetcast/PacketCaster.java index 47e0faf..6ba7f63 100644 --- a/src/main/java/vavi/apps/packetcast/PacketCaster.java +++ b/src/main/java/vavi/apps/packetcast/PacketCaster.java @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { } /** */ - int interval; + final int interval; /** */ PacketCaster(String[] args) throws Exception { @@ -159,7 +159,7 @@ public void doIt(MediaLocator inML, MediaLocator outML, long[] start, long[] end /** * Controller Listener. */ - ControllerListener controllerListener = evt -> { + final ControllerListener controllerListener = evt -> { if (evt instanceof ControllerErrorEvent) { System.err.println("Failed to cut the file."); @@ -196,7 +196,7 @@ boolean waitForFileDone() { /** * Event handler for the file writer. */ - DataSinkListener dataSinkListener = evt -> { + final DataSinkListener dataSinkListener = evt -> { if (evt instanceof EndOfStreamEvent) { synchronized (waitFileSync) { @@ -217,7 +217,7 @@ boolean waitForFileDone() { /** Get the file corresponding to the current second {@link #interval} [mesc] */ class MyUrlMaker implements UrlMaker { /** */ - Calendar calendar = Calendar.getInstance(); + final Calendar calendar = Calendar.getInstance(); /** */ MyUrlMaker() { calendar.roll(Calendar.SECOND, 10); diff --git a/src/main/java/vavi/apps/packetcast/SplitDataSource.java b/src/main/java/vavi/apps/packetcast/SplitDataSource.java index 3394c9b..2b0cc1c 100644 --- a/src/main/java/vavi/apps/packetcast/SplitDataSource.java +++ b/src/main/java/vavi/apps/packetcast/SplitDataSource.java @@ -19,15 +19,15 @@ */ class SplitDataSource extends PushBufferDataSource { - Processor p; + final Processor p; - PushBufferDataSource ds; + final PushBufferDataSource ds; - PushBufferStream[] pbss; + final PushBufferStream[] pbss; - SplitStream[] streams; + final SplitStream[] streams; - int idx; + final int idx; boolean done = false; @@ -104,7 +104,7 @@ public void setLocator(MediaLocator ml) { */ static class SplitStream implements PushBufferStream, BufferTransferHandler { - PushBufferStream pbs; + final PushBufferStream pbs; BufferTransferHandler bth; diff --git a/src/main/java/vavi/apps/packetcast/SuperCutDataSource.java b/src/main/java/vavi/apps/packetcast/SuperCutDataSource.java index fb0f7a8..dcb53c0 100644 --- a/src/main/java/vavi/apps/packetcast/SuperCutDataSource.java +++ b/src/main/java/vavi/apps/packetcast/SuperCutDataSource.java @@ -31,13 +31,13 @@ */ public class SuperCutDataSource extends PushBufferDataSource { - Processor p; + final Processor p; - MediaLocator ml; + final MediaLocator ml; - PushBufferDataSource ds; + final PushBufferDataSource ds; - SuperCutStream[] streams; + final SuperCutStream[] streams; /** * Creates special data source. @@ -120,13 +120,15 @@ public void setLocator(MediaLocator ml) { */ static class SuperCutStream implements PushBufferStream, BufferTransferHandler { - TrackControl tc; + final TrackControl tc; - PushBufferStream pbs; + final PushBufferStream pbs; - long[] start, end; + final long[] start; + final long[] end; - boolean[] startReached, endReached; + final boolean[] startReached; + final boolean[] endReached; int idx = 0; diff --git a/src/main/java/vavi/apps/packetcast/VideoEncoder.java b/src/main/java/vavi/apps/packetcast/VideoEncoder.java index 18b035b..606bd01 100644 --- a/src/main/java/vavi/apps/packetcast/VideoEncoder.java +++ b/src/main/java/vavi/apps/packetcast/VideoEncoder.java @@ -10,10 +10,10 @@ class VideoEncoder { /** */ - MovieProcessor mp; + final MovieProcessor mp; /** */ - Component vc; + final Component vc; /** */ int skip = 1; diff --git a/src/main/java/vavi/sound/ilbc/Decoder.java b/src/main/java/vavi/sound/ilbc/Decoder.java new file mode 100644 index 0000000..dfaddf0 --- /dev/null +++ b/src/main/java/vavi/sound/ilbc/Decoder.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.ilbc; + +import java.io.IOException; + + +/** + * Decoder. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-07-04 nsano initial version
+ */ +public class Decoder { + + private final Ilbc.Decoder decoder = new Ilbc.Decoder(); + + public Decoder(int mode, int useEnhancer) { + Ilbc.initDecode(decoder, mode, useEnhancer); + } + + public int getDecodedLength() { + return (decoder.mode == 30 ? Ilbc.BLOCKL_30MS : Ilbc.BLOCKL_20MS) * Short.BYTES; + } + + public int getEncodedLength() { + return decoder.mode == 30 ? Ilbc.NO_OF_BYTES_30MS : Ilbc.NO_OF_BYTES_20MS; + } + + /** */ + public void decode(byte[] encoded_data, byte[] decoded_data) throws IOException { + Ilbc.decode(decoder, decoded_data, encoded_data, 1); + } +} diff --git a/src/main/java/vavi/sound/ilbc/Ilbc.java b/src/main/java/vavi/sound/ilbc/Ilbc.java index 5981e84..8d9ed09 100644 --- a/src/main/java/vavi/sound/ilbc/Ilbc.java +++ b/src/main/java/vavi/sound/ilbc/Ilbc.java @@ -13,10 +13,12 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; +import vavi.util.Debug; +import vavi.util.StringUtil; + /** * iLBC Speech Coder ANSI-C Source Code @@ -26,13 +28,13 @@ */ public class Ilbc { - // A.6. iLBC_define.h +//#region A.6. iLBC_define.h /* general codec settings */ // private static final double FS = 8000.0; - private static final int BLOCKL_20MS = 160; - private static final int BLOCKL_30MS = 240; + public static final int BLOCKL_20MS = 160; + public static final int BLOCKL_30MS = 240; private static final int BLOCKL_MAX = 240; private static final int NSUB_20MS = 4; private static final int NSUB_30MS = 6; @@ -117,8 +119,8 @@ public class Ilbc { /* bit stream defs */ - private static final int NO_OF_BYTES_20MS = 38; - private static final int NO_OF_BYTES_30MS = 50; + public static final int NO_OF_BYTES_20MS = 38; + public static final int NO_OF_BYTES_30MS = 50; private static final int NO_OF_WORDS_20MS = 19; private static final int NO_OF_WORDS_30MS = 25; // private static final int STATE_BITS = 3; @@ -170,18 +172,18 @@ private static class Encoder { int state_short_len; ULP ULP_inst; /** analysis filter state */ - double[] anaMem = new double[LPC_FILTERORDER]; + final double[] anaMem = new double[LPC_FILTERORDER]; /** old lsf parameters for interpolation */ - double[] lsfold = new double[LPC_FILTERORDER]; - double[] lsfdeqold = new double[LPC_FILTERORDER]; + final double[] lsfold = new double[LPC_FILTERORDER]; + final double[] lsfdeqold = new double[LPC_FILTERORDER]; /* signal buffer for LP analysis */ - double[] lpc_buffer = new double[LPC_LOOKBACK + BLOCKL_MAX]; + final double[] lpc_buffer = new double[LPC_LOOKBACK + BLOCKL_MAX]; /* state of input HP filter */ - double[] hpimem = new double[4]; + final double[] hpimem = new double[4]; } /** type definition decoder instance */ - private static class Decoder { + static class Decoder { /** flag for frame size mode */ int mode; /** basic parameters for different frame sizes */ @@ -193,28 +195,30 @@ private static class Decoder { int state_short_len; ULP ULP_inst; /** synthesis filter state */ - double[] syntMem = new double[LPC_FILTERORDER]; + final double[] syntMem = new double[LPC_FILTERORDER]; /** old LSF for interpolation */ - double[] lsfdeqold = new double[LPC_FILTERORDER]; + final double[] lsfdeqold = new double[LPC_FILTERORDER]; /** pitch lag estimated in enhancer and used in PLC */ int last_lag; /** PLC state information */ int prevLag, consPLICount, prevPLI, prev_enh_pl; - double[] prevLpc = new double[LPC_FILTERORDER + 1]; - double[] prevResidual = new double[NSUB_MAX * SUBL]; + final double[] prevLpc = new double[LPC_FILTERORDER + 1]; + final double[] prevResidual = new double[NSUB_MAX * SUBL]; double per; long seed; /** previous synthesis filter parameters */ - double[] old_syntdenum = new double[(LPC_FILTERORDER + 1) * NSUB_MAX]; + final double[] old_syntdenum = new double[(LPC_FILTERORDER + 1) * NSUB_MAX]; /** state of output HP filter */ - double[] hpomem = new double[4]; + final double[] hpomem = new double[4]; /** enhancer state information */ int use_enhancer; - double[] enh_buf = new double[ENH_BUFL]; - double[] enh_period = new double[ENH_NBLOCKS_TOT]; + final double[] enh_buf = new double[ENH_BUFL]; + final double[] enh_period = new double[ENH_NBLOCKS_TOT]; } - // A.8. constants.c +//#endregion + +//#region A.8. constants.c /* ULP bit allocation */ @@ -778,7 +782,9 @@ private static class Decoder { 1.938232, 2.264404, 2.529053, 2.796143 }; - // A.1. iLBC_test.c +//#endregion + +//#region A.1. iLBC_test.c private static final int ILBCNOOFWORDS_MAX = (NO_OF_BYTES_30MS / 2); @@ -790,7 +796,7 @@ private static class Decoder { * @param encoded_data [o] The encoded bytes * @param data The signal block to encode */ - int encode(Encoder encoder, byte[] encoded_data, byte[] data) { + static int encode(Encoder encoder, byte[] encoded_data, byte[] data) { double[] block = new double[BLOCKL_MAX]; // convert signal to double @@ -798,10 +804,12 @@ int encode(Encoder encoder, byte[] encoded_data, byte[] data) { for (int k = 0; k < encoder.blockl; k++) { block[k] = (data[k * 2] & 0xff) | ((data[k * 2 + 1] & 0xff) << 8); } +//Arrays.stream(block, 0, 64).forEach(System.out::println); // do the actual encoding iLBC_encode(encoded_data, block, encoder); +//Debug.println("\n" + StringUtil.getDump(encoded_data, 64)); return encoder.no_of_bytes; } @@ -815,7 +823,7 @@ int encode(Encoder encoder, byte[] encoded_data, byte[] data) { * @param encoded_data Encoded bytes * @param mode 0=PL, 1=Normal */ - int decode(Decoder decoder, byte[] decoded_data, byte[] encoded_data, int mode) { + static int decode(Decoder decoder, byte[] decoded_data, byte[] encoded_data, int mode) { double[] decblock = new double[BLOCKL_MAX]; // check if mode is valid @@ -856,21 +864,14 @@ int decode(Decoder decoder, byte[] decoded_data, byte[] encoded_data, int mode) * channel: Bit error file, optional (16-bit) 1 - Packet received correctly 0 - Packet Lost */ public static void main(String[] argv) throws Exception { - new Ilbc(argv); - } - - int exitCode; - - /** */ - Ilbc(String[] argv) throws IOException { // Runtime statistics long runtime; double outtime; - InputStream iFile = null, cFile = null; - OutputStream oFile = null, eFile = null; + InputStream iFile, cFile; + OutputStream oFile, eFile; byte[] data = new byte[BLOCKL_MAX * 2]; byte[] encoded_data = new byte[ILBCNOOFWORDS_MAX * 2], decoded_data = new byte[BLOCKL_MAX * 2]; int len; @@ -886,7 +887,7 @@ public static void main(String[] argv) throws Exception { if ((argv.length != 4) && (argv.length != 5)) { System.err.print("\n*-----------------------------------------------*\n"); - System.err.printf(" %s <20,30> input encoded decoded (channel)\n\n", getClass().getName()); + System.err.printf(" %s <20,30> input encoded decoded (channel)\n\n", Ilbc.class.getName()); System.err.print(" mode : Frame size for the encoding/decoding\n"); System.err.print(" 20 - 20 ms\n"); System.err.print(" 30 - 30 ms\n"); @@ -1020,7 +1021,9 @@ public static void main(String[] argv) throws Exception { } } - // A.3. iLBC_encode.c +//#endregion + +//#region A.3. iLBC_encode.c /** * @return [o] Number of bytes encoded @@ -1071,7 +1074,7 @@ private static int initEncode(Encoder encoder, int mode) { * @param block [o] speech vector to encode * @param encoder (i/o) the general encoder state */ - private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { + private static void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { double[] data = new double[BLOCKL_MAX]; double[] residual = new double[BLOCKL_MAX], reverseResidual = new double[BLOCKL_MAX]; @@ -1086,7 +1089,7 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { int[] gain_index = new int[CB_NSTAGES * NASUB_MAX], extra_gain_index = new int[CB_NSTAGES]; int[] cb_index = new int[CB_NSTAGES * NASUB_MAX], extra_cb_index = new int[CB_NSTAGES]; int[] lsf_i = new int[LSF_NSPLIT * LPC_N_MAX]; - int /* double* */ pbytes; + int[] /* double* */ pbytes = new int[1]; int diff, start_pos; int[] state_first = new int[1]; double en1, en2; @@ -1231,7 +1234,9 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { // update memory - System.arraycopy(mem, SUBL, mem, 0, (CB_MEML - SUBL)); + for (int xx = 0; xx < CB_MEML - SUBL; xx++) { + mem[xx] = mem[xx + SUBL]; + } System.arraycopy(decresidual, (start[0] + 1 + subframe) * SUBL, mem, CB_MEML - SUBL, SUBL); Arrays.fill(weightState, 0); @@ -1283,12 +1288,13 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { // update memory - System.arraycopy(mem, SUBL, mem, 0, (CB_MEML - SUBL)); + for (int xx = 0; xx < CB_MEML - SUBL; xx++) { + mem[xx] = mem[xx + SUBL]; + } System.arraycopy(reverseDecresidual, subframe * SUBL, mem, CB_MEML - SUBL, SUBL); Arrays.fill(weightState, 0); subcount++; - } // get decoded residual from reversed vector @@ -1304,7 +1310,7 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { // pack bytes - pbytes = 0; // bytes + pbytes[0] = 0; // bytes pos[0] = 0; // loop over the 3 ULP classes @@ -1313,35 +1319,56 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { // LSF for (k = 0; k < LSF_NSPLIT * encoder.lpc_n; k++) { - packsplit(lsf_i, k, firstpart, lsf_i, k, encoder.ULP_inst.lsf_bits[k][ulp], encoder.ULP_inst.lsf_bits[k][ulp] + encoder.ULP_inst.lsf_bits[k][ulp + 1] + encoder.ULP_inst.lsf_bits[k][ulp + 2]); + packsplit(lsf_i, k, firstpart, lsf_i, k, encoder.ULP_inst.lsf_bits[k][ulp], + encoder.ULP_inst.lsf_bits[k][ulp] + + encoder.ULP_inst.lsf_bits[k][ulp + 1] + + encoder.ULP_inst.lsf_bits[k][ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.lsf_bits[k][ulp], pos); } // Start block info - packsplit(start, 0, firstpart, start, 0, encoder.ULP_inst.start_bits[ulp], encoder.ULP_inst.start_bits[ulp] + encoder.ULP_inst.start_bits[ulp + 1] + encoder.ULP_inst.start_bits[ulp + 2]); + packsplit(start, 0, firstpart, start, 0, encoder.ULP_inst.start_bits[ulp], + encoder.ULP_inst.start_bits[ulp] + + encoder.ULP_inst.start_bits[ulp + 1] + + encoder.ULP_inst.start_bits[ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.start_bits[ulp], pos); - packsplit(state_first, 0, firstpart, state_first, 0, encoder.ULP_inst.startfirst_bits[ulp], encoder.ULP_inst.startfirst_bits[ulp] + encoder.ULP_inst.startfirst_bits[ulp + 1] + encoder.ULP_inst.startfirst_bits[ulp + 2]); + packsplit(state_first, 0, firstpart, state_first, 0, encoder.ULP_inst.startfirst_bits[ulp], + encoder.ULP_inst.startfirst_bits[ulp] + + encoder.ULP_inst.startfirst_bits[ulp + 1] + + encoder.ULP_inst.startfirst_bits[ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.startfirst_bits[ulp], pos); - packsplit(idxForMax, 0, firstpart, idxForMax, 0, encoder.ULP_inst.scale_bits[ulp], encoder.ULP_inst.scale_bits[ulp] + encoder.ULP_inst.scale_bits[ulp + 1] + encoder.ULP_inst.scale_bits[ulp + 2]); + packsplit(idxForMax, 0, firstpart, idxForMax, 0, encoder.ULP_inst.scale_bits[ulp], + encoder.ULP_inst.scale_bits[ulp] + + encoder.ULP_inst.scale_bits[ulp + 1] + + encoder.ULP_inst.scale_bits[ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.scale_bits[ulp], pos); for (k = 0; k < encoder.state_short_len; k++) { - packsplit(idxVec, k, firstpart, idxVec, k, encoder.ULP_inst.state_bits[ulp], encoder.ULP_inst.state_bits[ulp] + encoder.ULP_inst.state_bits[ulp + 1] + encoder.ULP_inst.state_bits[ulp + 2]); + packsplit(idxVec, k, firstpart, idxVec, k, encoder.ULP_inst.state_bits[ulp], + encoder.ULP_inst.state_bits[ulp] + + encoder.ULP_inst.state_bits[ulp + 1] + + encoder.ULP_inst.state_bits[ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.state_bits[ulp], pos); } // 23/22 (20ms/30ms) sample block for (k = 0; k < CB_NSTAGES; k++) { - packsplit(extra_cb_index, k, firstpart, extra_cb_index, k, encoder.ULP_inst.extra_cb_index[k][ulp], encoder.ULP_inst.extra_cb_index[k][ulp] + encoder.ULP_inst.extra_cb_index[k][ulp + 1] + encoder.ULP_inst.extra_cb_index[k][ulp + 2]); + packsplit(extra_cb_index, k, firstpart, extra_cb_index, k, encoder.ULP_inst.extra_cb_index[k][ulp], + encoder.ULP_inst.extra_cb_index[k][ulp] + + encoder.ULP_inst.extra_cb_index[k][ulp + 1] + + encoder.ULP_inst.extra_cb_index[k][ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.extra_cb_index[k][ulp], pos); } for (k = 0; k < CB_NSTAGES; k++) { - packsplit(extra_gain_index, k, firstpart, extra_gain_index, k, encoder.ULP_inst.extra_cb_gain[k][ulp], encoder.ULP_inst.extra_cb_gain[k][ulp] + encoder.ULP_inst.extra_cb_gain[k][ulp + 1] + encoder.ULP_inst.extra_cb_gain[k][ulp + 2]); + packsplit(extra_gain_index, k, firstpart, extra_gain_index, k, encoder.ULP_inst.extra_cb_gain[k][ulp], + encoder.ULP_inst.extra_cb_gain[k][ulp] + + encoder.ULP_inst.extra_cb_gain[k][ulp + 1] + + encoder.ULP_inst.extra_cb_gain[k][ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.extra_cb_gain[k][ulp], pos); } @@ -1349,14 +1376,22 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { for (i = 0; i < encoder.nasub; i++) { for (k = 0; k < CB_NSTAGES; k++) { - packsplit(cb_index, i * CB_NSTAGES + k, firstpart, cb_index, i * CB_NSTAGES + k, encoder.ULP_inst.cb_index[i][k][ulp], encoder.ULP_inst.cb_index[i][k][ulp] + encoder.ULP_inst.cb_index[i][k][ulp + 1] + encoder.ULP_inst.cb_index[i][k][ulp + 2]); + packsplit(cb_index, i * CB_NSTAGES + k, firstpart, cb_index, i * CB_NSTAGES + k, + encoder.ULP_inst.cb_index[i][k][ulp], + encoder.ULP_inst.cb_index[i][k][ulp] + + encoder.ULP_inst.cb_index[i][k][ulp + 1] + + encoder.ULP_inst.cb_index[i][k][ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.cb_index[i][k][ulp], pos); } } for (i = 0; i < encoder.nasub; i++) { for (k = 0; k < CB_NSTAGES; k++) { - packsplit(gain_index, i * CB_NSTAGES + k, firstpart, gain_index, i * CB_NSTAGES + k, encoder.ULP_inst.cb_gain[i][k][ulp], encoder.ULP_inst.cb_gain[i][k][ulp] + encoder.ULP_inst.cb_gain[i][k][ulp + 1] + encoder.ULP_inst.cb_gain[i][k][ulp + 2]); + packsplit(gain_index, i * CB_NSTAGES + k, firstpart, gain_index, i * CB_NSTAGES + k, + encoder.ULP_inst.cb_gain[i][k][ulp], + encoder.ULP_inst.cb_gain[i][k][ulp] + + encoder.ULP_inst.cb_gain[i][k][ulp + 1] + + encoder.ULP_inst.cb_gain[i][k][ulp + 2]); dopack(bytes, pbytes, firstpart[0], encoder.ULP_inst.cb_gain[i][k][ulp], pos); } } @@ -1367,7 +1402,9 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { dopack(bytes, pbytes, 0, 1, pos); } - // A.5. iLBC_decode.c +//#endregion + +//#region A.5. iLBC_decode.c /** * @return Number of decoded samples @@ -1375,7 +1412,7 @@ private void iLBC_encode(byte[] bytes, double[] block, Encoder encoder) { * @param mode frame size mode * @param use_enhancer 1 to use enhancer 0 to run without enhancer */ - private static int initDecode(Decoder decoder, int mode, int use_enhancer) { + static int initDecode(Decoder decoder, int mode, int use_enhancer) { decoder.mode = mode; @@ -1453,7 +1490,9 @@ private static int initDecode(Decoder decoder, int mode, int use_enhancer) { * @param state_first 1 if non adaptive part of start state comes first * 0 if that part comes last */ - private void decode(Decoder decoder, double[] decresidual, int start, int idxForMax, int[] idxVec, double[] syntdenum, int[] cb_index, int[] gain_index, int[] extra_cb_index, int[] extra_gain_index, int state_first) { + private static void decode(Decoder decoder, double[] decresidual, int start, int idxForMax, int[] idxVec, + double[] syntdenum, int[] cb_index, int[] gain_index, int[] extra_cb_index, + int[] extra_gain_index, int state_first) { double[] reverseDecresidual = new double[BLOCKL_MAX], mem = new double[CB_MEML]; int k, meml_gotten, Nfor, Nback, i; int diff, start_pos; @@ -1469,7 +1508,8 @@ private void decode(Decoder decoder, double[] decresidual, int start, int idxFor // decode scalar part of start state - StateConstructW(idxForMax, idxVec, syntdenum, (start - 1) * (LPC_FILTERORDER + 1), decresidual, start_pos, decoder.state_short_len); + StateConstructW(idxForMax, idxVec, syntdenum, (start - 1) * (LPC_FILTERORDER + 1), decresidual, + start_pos, decoder.state_short_len); if (state_first != 0) { // put adaptive part in the end @@ -1481,7 +1521,8 @@ private void decode(Decoder decoder, double[] decresidual, int start, int idxFor // construct decoded vector - iCBConstruct(decresidual, start_pos + decoder.state_short_len, extra_cb_index, 0, extra_gain_index, 0, mem, CB_MEML - stMemLTbl, stMemLTbl, diff, CB_NSTAGES); + iCBConstruct(decresidual, start_pos + decoder.state_short_len, extra_cb_index, 0, + extra_gain_index, 0, mem, CB_MEML - stMemLTbl, stMemLTbl, diff, CB_NSTAGES); } else { // put adaptive part in the beginning @@ -1502,7 +1543,8 @@ private void decode(Decoder decoder, double[] decresidual, int start, int idxFor // construct decoded vector - iCBConstruct(reverseDecresidual, 0, extra_cb_index, 0, extra_gain_index, 0, mem, CB_MEML - stMemLTbl, stMemLTbl, diff, CB_NSTAGES); + iCBConstruct(reverseDecresidual, 0, extra_cb_index, 0, extra_gain_index, 0, + mem, CB_MEML - stMemLTbl, stMemLTbl, diff, CB_NSTAGES); // get decoded residual from reversed vector @@ -1537,13 +1579,13 @@ private void decode(Decoder decoder, double[] decresidual, int start, int idxFor // update memory - System.arraycopy(mem, SUBL, mem, 0, (CB_MEML - SUBL)); + for (int xx = 0; xx < CB_MEML - SUBL; xx++) { + mem[xx] = mem[xx + SUBL]; + } System.arraycopy(decresidual, (start + 1 + subframe) * SUBL, mem, CB_MEML - SUBL, SUBL); subcount++; - } - } // backward prediction of sub-frames @@ -1575,7 +1617,9 @@ private void decode(Decoder decoder, double[] decresidual, int start, int idxFor // update memory - System.arraycopy(mem, SUBL, mem, 0, (CB_MEML - SUBL)); + for (int xx = 0; xx < CB_MEML - SUBL; xx++) { + mem[xx] = mem[xx + SUBL]; + } System.arraycopy(reverseDecresidual, subframe * SUBL, mem, CB_MEML - SUBL, SUBL); subcount++; @@ -1596,7 +1640,7 @@ private void decode(Decoder decoder, double[] decresidual, int start, int idxFor * @param decoder (i/o) the decoder state structure * @param mode 0: bad packet, PLC, 1: normal */ - private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int mode) { + private static void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int mode) { double[] data = new double[BLOCKL_MAX]; double[] lsfdeq = new double[LPC_FILTERORDER * LPC_N_MAX]; double[] PLCresidual = new double[BLOCKL_MAX], PLClpc = new double[LPC_FILTERORDER + 1]; @@ -1614,7 +1658,7 @@ private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int m int[] lsf_i = new int[LSF_NSPLIT * LPC_N_MAX]; int[] state_first = new int[1]; int[] last_bit = new int[1]; - int /* double * */pbytes; + int[] /* double* */ pbytes = new int[1]; double[] weightdenum = new double[(LPC_FILTERORDER + 1) * NSUB_MAX]; int order_plus_one; double[] syntdenum = new double[NSUB_MAX * (LPC_FILTERORDER + 1)]; @@ -1624,7 +1668,7 @@ private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int m // decode data - pbytes = 0; // bytes + pbytes[0] = 0; // bytes pos[0] = 0; // Set everything to zero before decoding @@ -1740,7 +1784,6 @@ private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int m System.arraycopy(PLCresidual, 0, decresidual, 0, decoder.blockl); } - } if (mode == 0) { @@ -1813,7 +1856,6 @@ private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int m for (i = 0; i < decoder.nsub; i++) { syntFilter(data, i * SUBL, syntdenum, i * (LPC_FILTERORDER + 1), SUBL, decoder.syntMem); } - } // high pass filtering on output if desired, otherwise copy to out @@ -1831,7 +1873,9 @@ private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int m } } - // A.10. anaFilter.c +//#endregion + +//region A.10. anaFilter.c /** * LP analysis filter. @@ -1843,7 +1887,7 @@ private void iLBC_decode(double[] decblock, byte[] bytes, Decoder decoder, int m * @param mem (i/o) Filter state */ private static void anaFilter(double[] In, int inP, double[] a, int aP, int len, double[] Out, int outP, double[] mem) { - int /* double * */po, pi, pm, pa; + int /* double* */ po, pi, pm, pa; po = outP; // Out @@ -1852,15 +1896,14 @@ private static void anaFilter(double[] In, int inP, double[] a, int aP, int len, for (int i = 0; i < LPC_FILTERORDER; i++) { pi = inP + i; // In pm = LPC_FILTERORDER - 1; // mem - pa = 0; // a + pa = aP; // a Out[po] = 0.0; for (int j = 0; j <= i; j++) { - Out[po] += (a[pa++]) * (In[pi--]); + Out[po] += a[pa++] * In[pi--]; } for (int j = i + 1; j < LPC_FILTERORDER + 1; j++) { - - Out[po] += (a[pa++]) * (mem[pm--]); + Out[po] += a[pa++] * mem[pm--]; } po++; } @@ -1868,21 +1911,23 @@ private static void anaFilter(double[] In, int inP, double[] a, int aP, int len, // Filter last part where the state is entirely in the input vector for (int i = LPC_FILTERORDER; i < len; i++) { - pi = i; // In - pa = 0; // a + pi = inP + i; // In + pa = aP; // a Out[po] = 0.0; for (int j = 0; j < LPC_FILTERORDER + 1; j++) { - Out[po] += (a[pa++]) * (In[pi--]); + Out[po] += a[pa++] * In[pi--]; } po++; } // Update state vector - System.arraycopy(In, len - LPC_FILTERORDER, mem, 0, LPC_FILTERORDER); + System.arraycopy(In, inP + len - LPC_FILTERORDER, mem, 0, LPC_FILTERORDER); } - // A.12. createCB.c +//#endregion + +//region A.12. createCB.c /** * Construct an additional codebook vector by filtering the initial codebook @@ -1894,9 +1939,9 @@ private static void anaFilter(double[] In, int inP, double[] a, int aP, int len, * @param lMem Length of buffer */ private static void filteredCBvecs(double[] cbvectors, double[] mem, int memP, int lMem) { - int /* double * */pp, pp1; + int /* double* */ pp, pp1; double[] tempbuff2 = new double[CB_MEML + CB_FILTERLEN]; - int /* double * */pos; + int /* double* */ pos; for (int xx = 0; xx < CB_HALFFILTERLEN - 1; xx++) { tempbuff2[xx] = 0; @@ -1941,19 +1986,19 @@ private static void filteredCBvecs(double[] cbvectors, double[] mem, int memP, i */ private static void searchAugmentedCB(int low, int high, int stage, int startIndex, double[] target, double[] buffer, int bufferP, double[] max_measure, int[] best_index, double[] gain, double[] energy, double[] invenergy) { int icount, ilow, j, tmpIndex; - int /* double * */pp, ppo, ppi, ppe; + int /* double* */ pp, ppo, ppi, ppe; double crossDot, alfa; double weighted, measure, nrjRecursive; double ftmp; // Compute the energy for the first (low-5) noninterpolated samples nrjRecursive = 0.0; - pp = -low + 1; // buffer - for (j = 0; j < (low - 5); j++) { - nrjRecursive += ((buffer[bufferP+pp]) * (buffer[bufferP+pp])); + pp = bufferP - low + 1; // buffer + for (j = 0; j < low - 5; j++) { + nrjRecursive += buffer[pp] * buffer[pp]; pp++; } - ppe = -low; // buffer + ppe = bufferP - low; // buffer for (icount = low; icount <= high; icount++) { @@ -1963,24 +2008,24 @@ private static void searchAugmentedCB(int low, int high, int stage, int startInd ilow = icount - 4; // Update the energy recursively to save complexity - nrjRecursive = nrjRecursive + (buffer[bufferP+ppe]) * (buffer[bufferP+ppe]); + nrjRecursive = nrjRecursive + buffer[ppe] * buffer[ppe]; ppe--; energy[tmpIndex] = nrjRecursive; // Compute cross dot product for the first (low-5) samples crossDot = 0.0; - pp = -icount; // buffer + pp = bufferP - icount; // buffer for (j = 0; j < ilow; j++) { - crossDot += target[j] * (buffer[bufferP+pp++]); + crossDot += target[j] * buffer[pp++]; } // interpolation alfa = 0.2; - ppo = -4; // buffer - ppi = -icount - 4; // buffer + ppo = bufferP - 4; // buffer + ppi = bufferP - icount - 4; // buffer for (j = ilow; j < icount; j++) { - weighted = (1.0 - alfa) * (buffer[bufferP+ppo]) + alfa * (buffer[bufferP+ppi]); + weighted = (1.0 - alfa) * buffer[ppo] + alfa * buffer[ppi]; ppo++; ppi++; energy[tmpIndex] += weighted * weighted; @@ -1989,10 +2034,10 @@ private static void searchAugmentedCB(int low, int high, int stage, int startInd } // Compute energy and cross dot product for the remaining samples - pp = -icount; // buffer + pp = bufferP - icount; // buffer for (j = icount; j < SUBL; j++) { - energy[tmpIndex] += (buffer[bufferP+pp]) * (buffer[bufferP+pp]); - crossDot += target[j] * (buffer[bufferP+pp++]); + energy[tmpIndex] += buffer[pp] * buffer[pp]; + crossDot += target[j] * buffer[pp++]; } if (energy[tmpIndex] > 0.0) { @@ -2032,23 +2077,23 @@ private static void searchAugmentedCB(int low, int high, int stage, int startInd * @param cbVec [o] The construced codebook vector */ private static void createAugmentedVec(int index, double[] buffer, int bufferP, double[] cbVec) { - int /* double * */pp, ppo, ppi; + int /* double* */ pp, ppo, ppi; int ilow = index - 5; // copy the first noninterpolated part - pp = -index; // buffer - System.arraycopy(buffer, bufferP + pp, cbVec, 0, index); + pp = bufferP - index; // buffer + System.arraycopy(buffer, pp, cbVec, 0, index); // interpolation double alfa1 = 0.2; double alfa = 0.0; - ppo = -5; // buffer - ppi = -index - 5; // buffer + ppo = bufferP - 5; // buffer + ppi = bufferP - index - 5; // buffer for (int j = ilow; j < index; j++) { - double weighted = (1.0 - alfa) * (buffer[bufferP + ppo]) + alfa * (buffer[bufferP + ppi]); + double weighted = (1.0 - alfa) * buffer[ppo] + alfa * buffer[ppi]; ppo++; ppi++; cbVec[j] = weighted; @@ -2057,11 +2102,13 @@ private static void createAugmentedVec(int index, double[] buffer, int bufferP, // copy the second noninterpolated part - pp = -index; // buffer - System.arraycopy(buffer, bufferP + pp, cbVec, index, (SUBL - index)); + pp = bufferP - index; // buffer + System.arraycopy(buffer, pp, cbVec, index, SUBL - index); } - // A.14. doCPLC.c +//#endregion + +//#region A.14. doCPLC.c /** * Compute cross correlation and pitch gain for pitch prediction of last @@ -2192,8 +2239,8 @@ private static void doThePLC(double[] PLCresidual, double[] PLClpc, int PLI, dou // noise component - iLBCdec_inst.seed = (iLBCdec_inst.seed * 69069L + 1) & (0x80000000L - 1); - randlag = (int) (50 + (iLBCdec_inst.seed) % 70); + iLBCdec_inst.seed = (iLBCdec_inst.seed * 69069L + 1) & (0x8000_0000L - 1); + randlag = (int) (50 + iLBCdec_inst.seed % 70); pick = i - randlag; if (pick < 0) { @@ -2235,11 +2282,11 @@ private static void doThePLC(double[] PLCresidual, double[] PLClpc, int PLI, dou // use old LPC - System.arraycopy(iLBCdec_inst.prevLpc, 0, PLClpc, 0, (LPC_FILTERORDER + 1)); + System.arraycopy(iLBCdec_inst.prevLpc, 0, PLClpc, 0, LPC_FILTERORDER + 1); } else { // no packet loss, copy input System.arraycopy(decresidual, 0, PLCresidual, 0, iLBCdec_inst.blockl); - System.arraycopy(lpc, lpcP, PLClpc, 0, (LPC_FILTERORDER + 1)); + System.arraycopy(lpc, lpcP, PLClpc, 0, LPC_FILTERORDER + 1); iLBCdec_inst.consPLICount = 0; } @@ -2251,11 +2298,13 @@ private static void doThePLC(double[] PLCresidual, double[] PLClpc, int PLI, dou } iLBCdec_inst.prevPLI = PLI; - System.arraycopy(PLClpc, 0, iLBCdec_inst.prevLpc, 0, (LPC_FILTERORDER + 1)); + System.arraycopy(PLClpc, 0, iLBCdec_inst.prevLpc, 0, LPC_FILTERORDER + 1); System.arraycopy(PLCresidual, 0, iLBCdec_inst.prevResidual, 0, iLBCdec_inst.blockl); } - // A.16. enhancer.c +//#endregion + +//#region A.16. enhancer.c /** * Find index in array such that the array element with said index is the @@ -2271,14 +2320,14 @@ private static void NearestNeighbor(int[] index, int indexP, double[] array, dou double crit = array[0] - value; double bestcrit = crit * crit; - index[indexP+0] = 0; + index[indexP] = 0; for (int i = 1; i < arlength; i++) { crit = array[i] - value; crit = crit * crit; if (crit < bestcrit) { bestcrit = crit; - index[indexP+0] = i; + index[indexP] = i; } } } @@ -2295,7 +2344,8 @@ private static void NearestNeighbor(int[] index, int indexP, double[] array, dou private static void mycorr1(double[] corr, int corrP, double[] seq1, int seq1P, int dim1, double[] seq2, int seq2P, int dim2) { for (int i = 0; i <= dim1 - dim2; i++) { - corr[corrP+i] = 0.0; + if ((corrP+i) < corr.length) // BUG in ILBC ??? + corr[corrP+i] = 0.0; for (int j = 0; j < dim2; j++) { corr[corrP+i] += seq1[seq1P + i + j] * seq2[seq2P + j]; } @@ -2311,10 +2361,10 @@ private static void mycorr1(double[] corr, int corrP, double[] seq1, int seq1P, * @param hfl polyphase filter length=2*hfl+1 */ private static void enh_upsample(double[] useq1, double[] seq1, int dim1, int hfl) { - int /* double * */pu, ps; + int /* double* */ pu, ps; int i, j, k, q, filterlength, hfl2; int[] polyp = new int[ENH_UPS0]; // pointers to, ENH_UPS0 polyphase columns - int /* final double * */pp; + int /* final double* */ pp; // define pointers for filter @@ -2339,10 +2389,10 @@ private static void enh_upsample(double[] useq1, double[] seq1, int dim1, int hf for (i = hfl; i < filterlength; i++) { for (j = 0; j < ENH_UPS0; j++) { useq1[pu] = 0.0; - pp = 0; // polyp[j] + pp = polyp[j]; ps = i; // seq1 for (k = 0; k <= i; k++) { - useq1[pu] += seq1[ps--] * polyphaserTbl[polyp[j]+pp++]; + useq1[pu] += seq1[ps--] * polyphaserTbl[pp++]; } pu++; } @@ -2354,10 +2404,10 @@ private static void enh_upsample(double[] useq1, double[] seq1, int dim1, int hf for (j = 0; j < ENH_UPS0; j++) { useq1[pu] = 0.0; - pp = 0; // polyp[j] + pp = polyp[j]; ps = i; // seq1 for (k = 0; k < filterlength; k++) { - useq1[pu] += seq1[ps--] * polyphaserTbl[polyp[j]+pp++]; + useq1[pu] += seq1[ps--] * polyphaserTbl[pp++]; } pu++; } @@ -2368,10 +2418,10 @@ private static void enh_upsample(double[] useq1, double[] seq1, int dim1, int hf for (q = 1; q <= hfl; q++) { for (j = 0; j < ENH_UPS0; j++) { useq1[pu] = 0.0; - pp = q; // polyp[j] + pp = polyp[j] + q; ps = dim1 - 1; // seq1 for (k = 0; k < filterlength - q; k++) { - useq1[pu] += seq1[ps--] * polyphaserTbl[polyp[j]+pp++]; + useq1[pu] += seq1[ps--] * polyphaserTbl[pp++]; } pu++; } @@ -2432,7 +2482,7 @@ private static void refiner(double[] seg, int segP, double[] updStartPos, int uP // make vector can be upsampled without ever running outside bounds updStartPos[uP] = searchSegStartPos + (double) tloc / (double) ENH_UPS0 + 1.0; - tloc2 = (tloc / ENH_UPS0); + tloc2 = tloc / ENH_UPS0; if (tloc > tloc2 * ENH_UPS0) { tloc2++; @@ -2442,13 +2492,13 @@ private static void refiner(double[] seg, int segP, double[] updStartPos, int uP if (st < 0) { for (int xx = 0; xx < -st; xx++) vect[xx] = 0; - System.arraycopy(idata, 0, vect, -st, (ENH_VECTL + st)); + System.arraycopy(idata, 0, vect, -st, ENH_VECTL + st); } else { en = st + ENH_VECTL; if (en > idatal) { - System.arraycopy(idata, st, vect, 0, (ENH_VECTL - (en - idatal))); + System.arraycopy(idata, st, vect, 0, ENH_VECTL - (en - idatal)); for (int xx = 0; xx < en - idatal; xx++) vect[xx + ENH_VECTL - (en - idatal)] = 0; } else { @@ -2472,7 +2522,7 @@ private static void refiner(double[] seg, int segP, double[] updStartPos, int uP */ private static void smath(double[] odata, int odataP, double[] sseq, int hl, double alpha0) { double w00, w10, w11, A, B, C, err, errs; - int /* double * */psseq; + int /* double* */ psseq; double[] surround = new double[BLOCKL_MAX]; // shape contributed by other than current double[] wt = new double[2 * ENH_HL + 1]; // waveform weighting to get surround shape double denom; @@ -2570,7 +2620,7 @@ private static void getsseq(double[] sseq, double[] idata, int idatal, int cente double[] blockStartPos = new double[2 * ENH_HL + 1]; int[] lagBlock = new int[2 * ENH_HL + 1]; double[] plocs2 = new double[ENH_PLOCSL]; - int /* double * */psseq; + int /* double* */ psseq; centerEndPos = centerStartPos + ENH_BLOCKL - 1; @@ -2632,7 +2682,7 @@ private static void getsseq(double[] sseq, double[] idata, int idatal, int cente * @param plocs locations where period array values valid * @param periodl dimension of period and plocs */ - private void enhancer(double[] odata, int odataP, double[] idata, int idatal, int centerStartPos, double alpha0, double[] period, double[] plocs, int periodl) { + private static void enhancer(double[] odata, int odataP, double[] idata, int idatal, int centerStartPos, double alpha0, double[] period, double[] plocs, int periodl) { double[] sseq = new double[(2 * ENH_HL + 1) * ENH_BLOCKL]; // get said second sequence of segments @@ -2661,7 +2711,7 @@ private static double xCorrCoef(double[] target, int targetP, double[] regressor } if (ftmp1 > 0.0) { - return (ftmp1 * ftmp1 / ftmp2); + return ftmp1 * ftmp1 / ftmp2; } else { return 0.0; } @@ -2674,13 +2724,13 @@ private static double xCorrCoef(double[] target, int targetP, double[] regressor * @param in unenhanced signal * @param iLBCdec_inst buffers etc */ - private int enhancerInterface(double[] out, double[] in, Decoder iLBCdec_inst) { + private static int enhancerInterface(double[] out, double[] in, Decoder iLBCdec_inst) { double[] enh_buf, enh_period; int iblock, isample; int lag = 0, ilag, i, ioffset; double cc, maxcc; double ftmp1, ftmp2; - int /* double * */inPtr, enh_bufPtr1, enh_bufPtr2; + int /* double* */ inPtr, enh_bufPtr1, enh_bufPtr2; double[] plc_pred = new double[ENH_BLOCKL]; double[] lpState = new double[6], downsampled = new double[(ENH_NBLOCKS * ENH_BLOCKL + 120) / 2]; @@ -2707,7 +2757,9 @@ private int enhancerInterface(double[] out, double[] in, Decoder iLBCdec_inst) { } i = 3 - ioffset; - System.arraycopy(enh_period, i, enh_period, 0, (ENH_NBLOCKS_TOT - i)); + for (int xx = 0; xx < ENH_NBLOCKS_TOT - i; xx++) { + enh_period[xx] = enh_period[i + xx]; + } // Set state information to the 6 samples right before the samples to be // downsampled. @@ -2734,7 +2786,6 @@ private int enhancerInterface(double[] out, double[] in, Decoder iLBCdec_inst) { // Store the estimated lag in the non-downsampled domain enh_period[iblock + ENH_NBLOCKS_EXTRA + ioffset] = (double) lag * 2; - } // PLC was performed on the previous packet @@ -2817,7 +2868,9 @@ private int enhancerInterface(double[] out, double[] in, Decoder iLBCdec_inst) { return lag * 2; } - // A.18. filter.c +//#endregion + +//#region A.18. filter.c /** * all-pole filter @@ -2835,7 +2888,6 @@ private static void AllPoleFilter(double[] InOut, int iop, double[] Coef, int co for (int n = 0; n < lengthInOut; n++) { for (int k = 1; k <= orderCoef; k++) { InOut[iop] -= Coef[coefP + k] * InOut[iop - k]; - } iop++; } @@ -2854,7 +2906,7 @@ private static void AllPoleFilter(double[] InOut, int iop, double[] Coef, int co */ private static void AllZeroFilter(double[] In, int ip, double[] Coef, int lengthInOut, int orderCoef, double[] Out, int op) { for (int n = 0; n < lengthInOut; n++) { - Out[op] = Coef[0] * In[ip + 0]; + Out[op] = Coef[0] * In[ip]; for (int k = 1; k <= orderCoef; k++) { Out[op] += Coef[k] * In[ip - k]; } @@ -2894,15 +2946,15 @@ private static void ZeroPoleFilter(double[] In, int inP, double[] ZeroCoef, doub * @param Out [o] downsampled output */ private static void DownSample(double[] In, int inP, double[] Coef, int lengthIn, double[] state, double[] Out) { - int /* double * */Out_ptr = 0; // Out - int /* double * */Coef_ptr, In_ptr; - int /* double * */state_ptr; + int /* double* */ Out_ptr = 0; // Out + int /* double* */ Coef_ptr, In_ptr; + int /* double* */ state_ptr; // LP filter and decimate at the same time for (int i = DELAY_DS; i < lengthIn; i += FACTOR_DS) { Coef_ptr = 0; // Coef - In_ptr = i; // In + In_ptr = inP + i; // In state_ptr = FILTERORDER_DS - 2; // state double o = 0.0; @@ -2910,7 +2962,7 @@ private static void DownSample(double[] In, int inP, double[] Coef, int lengthIn int stop = (i < FILTERORDER_DS) ? i + 1 : FILTERORDER_DS; for (int j = 0; j < stop; j++) { - o += Coef[Coef_ptr++] * (In[inP+In_ptr--]); + o += Coef[Coef_ptr++] * (In[In_ptr--]); } for (int j = i + 1; j < FILTERORDER_DS; j++) { o += Coef[Coef_ptr++] * (state[state_ptr--]); @@ -2927,15 +2979,15 @@ private static void DownSample(double[] In, int inP, double[] Coef, int lengthIn if (i < lengthIn) { Coef_ptr = 0; // Coef - In_ptr = i; // In + In_ptr = inP + i; // In for (int j = 0; j < FILTERORDER_DS; j++) { o += Coef[Coef_ptr++] * (Out[Out_ptr--]); } } else { Coef_ptr = i - lengthIn; // Coef - In_ptr = lengthIn - 1; // In + In_ptr = inP + lengthIn - 1; // In for (int j = 0; j < FILTERORDER_DS - (i - lengthIn); j++) { - o += Coef[Coef_ptr++] * (In[inP+In_ptr--]); + o += Coef[Coef_ptr++] * (In[In_ptr--]); } } Out[Out_ptr++] = o; @@ -2954,7 +3006,7 @@ private static void DownSample(double[] In, int inP, double[] Coef, int lengthIn private static int FrameClassify(Encoder iLBCenc_inst, double[] residual) { double max_ssqEn; double[] fssqEn = new double[NSUB_MAX], bssqEn = new double[NSUB_MAX]; - int /* double * */pp; + int /* double* */ pp; int n, l, max_ssqEn_n; double[] ssqEn_win = { // NSUB_MAX-1 0.8, 0.9, 1.0, 0.9, 0.8 @@ -2970,12 +3022,11 @@ private static int FrameClassify(Encoder iLBCenc_inst, double[] residual) { n = 0; pp = 0; // residual for (l = 0; l < 5; l++) { - fssqEn[n] += sampEn_win[l] * (residual[pp]) * (residual[pp]); + fssqEn[n] += sampEn_win[l] * residual[pp] * residual[pp]; pp++; } for (l = 5; l < SUBL; l++) { - - fssqEn[n] += (residual[pp]) * (residual[pp]); + fssqEn[n] += residual[pp] * residual[pp]; pp++; } @@ -2984,18 +3035,18 @@ private static int FrameClassify(Encoder iLBCenc_inst, double[] residual) { for (n = 1; n < iLBCenc_inst.nsub - 1; n++) { pp = n * SUBL; // residual for (l = 0; l < 5; l++) { - fssqEn[n] += sampEn_win[l] * (residual[pp]) * (residual[pp]); - bssqEn[n] += (residual[pp]) * (residual[pp]); + fssqEn[n] += sampEn_win[l] * residual[pp] * residual[pp]; + bssqEn[n] += residual[pp] * residual[pp]; pp++; } for (l = 5; l < SUBL - 5; l++) { - fssqEn[n] += (residual[pp]) * (residual[pp]); - bssqEn[n] += (residual[pp]) * (residual[pp]); + fssqEn[n] += residual[pp] * residual[pp]; + bssqEn[n] += residual[pp] * residual[pp]; pp++; } for (l = SUBL - 5; l < SUBL; l++) { - fssqEn[n] += (residual[pp]) * (residual[pp]); - bssqEn[n] += sampEn_win[SUBL - l - 1] * (residual[pp]) * (residual[pp]); + fssqEn[n] += residual[pp] * residual[pp]; + bssqEn[n] += sampEn_win[SUBL - l - 1] * residual[pp] * residual[pp]; pp++; } } @@ -3005,11 +3056,11 @@ private static int FrameClassify(Encoder iLBCenc_inst, double[] residual) { n = iLBCenc_inst.nsub - 1; pp = n * SUBL; // residual for (l = 0; l < SUBL - 5; l++) { - bssqEn[n] += (residual[pp]) * (residual[pp]); + bssqEn[n] += residual[pp] * residual[pp]; pp++; } for (l = SUBL - 5; l < SUBL; l++) { - bssqEn[n] += sampEn_win[SUBL - l - 1] * (residual[pp]) * (residual[pp]); + bssqEn[n] += sampEn_win[SUBL - l - 1] * residual[pp] * residual[pp]; pp++; } @@ -3035,7 +3086,9 @@ private static int FrameClassify(Encoder iLBCenc_inst, double[] residual) { return max_ssqEn_n; } - // A.22. gainquant.c +//#endregion + +//#region A.22. gainquant.c /** * quantizer for the gain in the gain-shape coding of residual @@ -3118,7 +3171,9 @@ private static double gaindequant(int index, double maxIn, int cblen) { return 0.0; } - // A.24. getCBvec.c +//#endregion + +//#region A.24. getCBvec.c /** * Construct codebook vector for given index. @@ -3177,7 +3232,7 @@ private static void getCBvec(double[] cbvec, double[] mem, int memP, int index, // Copy second noninterpolated part - System.arraycopy(mem, memP + lMem - k + ihigh, cbvec, ihigh, (cbveclen - ihigh)); + System.arraycopy(mem, memP + lMem - k + ihigh, cbvec, ihigh, cbveclen - ihigh); } else { // Higher codebook section based on filtering @@ -3185,8 +3240,8 @@ private static void getCBvec(double[] cbvec, double[] mem, int memP, int index, if (index - base_size < lMem - cbveclen + 1) { double[] tempbuff2 = new double[CB_MEML + CB_FILTERLEN + 1]; - int /* double * */pos; - int /* double * */pp, pp1; + int /* double* */ pos; + int /* double* */ pp, pp1; for (int xx = 0; xx < CB_HALFFILTERLEN; xx++) { tempbuff2[xx] = 0; @@ -3209,7 +3264,7 @@ private static void getCBvec(double[] cbvec, double[] mem, int memP, int index, pp = memInd + n + CB_HALFFILTERLEN; // tempbuff2 pp1 = CB_FILTERLEN - 1; // cbfiltersTbl for (j = 0; j < CB_FILTERLEN; j++) { - (cbvec[pos]) += (tempbuff2[pp++]) * (cbfiltersTbl[pp1--]); + cbvec[pos] += tempbuff2[pp++] * (cbfiltersTbl[pp1--]); } pos++; } @@ -3217,8 +3272,8 @@ private static void getCBvec(double[] cbvec, double[] mem, int memP, int index, double[] tempbuff2 = new double[CB_MEML + CB_FILTERLEN + 1]; - int /* double * */pos; - int /* double * */pp, pp1; + int /* double* */ pos; + int /* double* */ pp, pp1; for (int xx = 0; xx < CB_HALFFILTERLEN; xx++) { tempbuff2[xx] = 0; @@ -3264,20 +3319,22 @@ private static void getCBvec(double[] cbvec, double[] mem, int memP, int index, // Copy second noninterpolated part - System.arraycopy(tmpbuf, lMem - k + ihigh, cbvec, ihigh, (cbveclen - ihigh)); + System.arraycopy(tmpbuf, lMem - k + ihigh, cbvec, ihigh, cbveclen - ihigh); } } } - // A.26. helpfun.c +//#endregion + +//#region A.26. helpfun.c /** * calculation of auto correlation * - * @param r [o] autocorrelation vector + * @param r [o] auto-correlation vector * @param x data vector * @param N length of data vector - * @param order largest lag for calculated autocorrelations + * @param order largest lag for calculated auto-correlations */ private static void autocorr(double[] r, double[] x, int N, int order) { @@ -3375,7 +3432,7 @@ private static void bwexpand(double[] out, int outP, double[] in, double coef, i double chirp = coef; - out[outP + 0] = in[0]; + out[outP] = in[0]; for (int i = 1; i < length; i++) { out[outP + i] = chirp * in[i]; chirp *= coef; @@ -3399,7 +3456,7 @@ private static void vq(double[] Xq, int xqP, int[] index, int indexP, double[] C mindist = FLOAT_MAX; int minindex = 0; for (int j = 0; j < n_cb; j++) { - dist = X[xP + 0] - CB[cbP + pos]; + dist = X[xP] - CB[cbP + pos]; dist *= dist; for (int i = 1; i < dim; i++) { tmp = X[xP + i] - CB[cbP + pos + i]; @@ -3415,7 +3472,7 @@ private static void vq(double[] Xq, int xqP, int[] index, int indexP, double[] C for (int i = 0; i < dim; i++) { Xq[xqP + i] = CB[cbP + minindex * dim + i]; } - index[indexP + 0] = minindex; + index[indexP] = minindex; } /** @@ -3504,7 +3561,6 @@ private static int LSF_check(double[] lsf, int dim, int NoAn) { lsf[pos + 1] += eps2; } change = 1; - } if (lsf[pos] < minlsf) { @@ -3523,7 +3579,9 @@ private static int LSF_check(double[] lsf, int dim, int NoAn) { return change; } - // A.28. hpInput.c +//#endregion + +//#region A.28. hpInput.c /** * Input high-pass filter @@ -3564,7 +3622,9 @@ private static void hpInput(double[] In, int len, double[] Out, double[] mem) { } } - // A.30. hpOutput.c +//#endregion + +//#region A.30. hpOutput.c /** * Output high-pass filter @@ -3589,7 +3649,6 @@ private static void hpOutput(double[] In, int len, double[] Out, double[] mem) { mem[0] = In[pi]; po++; pi++; - } // all-pole section @@ -3605,7 +3664,9 @@ private static void hpOutput(double[] In, int len, double[] Out, double[] mem) { } } - // A.32. iCBConstruct.c +//#endregion + +//#region A.32. iCBConstruct.c /** * Convert the codebook indexes to make the search easier @@ -3661,7 +3722,7 @@ private static void iCBConstruct(double[] decvector, int decvectorP, int[] index // gain de-quantization - gain[0] = gaindequant(gain_index[gain_indexP+0], 1.0f, 32); + gain[0] = gaindequant(gain_index[gain_indexP], 1.0f, 32); if (nStages > 1) { gain[1] = gaindequant(gain_index[gain_indexP+1], Math.abs(gain[0]), 16); } @@ -3685,7 +3746,9 @@ private static void iCBConstruct(double[] decvector, int decvectorP, int[] index } } - // A.34. iCBSearch.c +//#endregion + +//#region A.34. iCBSearch.c /** * Search routine for codebook encoding and gain quantization. @@ -4109,7 +4172,9 @@ private static void iCBSearch(Encoder encoder, gain_index[gain_indexP] = j; } - // A.36. LPCdecode.c +//#endregion + +//#region A.36. LPCdecode.c /** * interpolation of lsf coefficients for the decoder @@ -4142,7 +4207,7 @@ private static void SimplelsfDEQ(double[] lsfdeq, int[] index, int lpc_n) { int cb_pos = 0; for (int i = 0; i < LSF_NSPLIT; i++) { for (int j = 0; j < dim_lsfCbTbl[i]; j++) { - lsfdeq[pos + j] = lsfCbTbl[cb_pos + (index[i]) * dim_lsfCbTbl[i] + j]; + lsfdeq[pos + j] = lsfCbTbl[cb_pos + index[i] * dim_lsfCbTbl[i] + j]; } pos += dim_lsfCbTbl[i]; cb_pos += size_lsfCbTbl[i] * dim_lsfCbTbl[i]; @@ -4173,10 +4238,10 @@ private static void SimplelsfDEQ(double[] lsfdeq, int[] index, int lpc_n) { * @param length length of lsf coefficient vector * @param iLBCdec_inst the decoder state structure */ - private void DecoderInterpolateLSF(double[] syntdenum, double[] weightdenum, double[] lsfdeq, int length, Decoder iLBCdec_inst) { + private static void DecoderInterpolateLSF(double[] syntdenum, double[] weightdenum, double[] lsfdeq, int length, Decoder iLBCdec_inst) { int pos, lp_length; double[] lp = new double[LPC_FILTERORDER + 1]; - int /* double * */lsfdeq2; + int /* double* */ lsfdeq2; lsfdeq2 = length; // lsfdeq lp_length = length + 1; @@ -4214,10 +4279,11 @@ private void DecoderInterpolateLSF(double[] syntdenum, double[] weightdenum, dou } else { System.arraycopy(lsfdeq, 0, iLBCdec_inst.lsfdeqold, 0, length); } - } - // A.38. LPCencode.c +//#endregion + +//#region A.38. LPCencode.c /** * lpc analysis (subrutine to LPCencode) @@ -4291,10 +4357,10 @@ private static void LSFinterpolate2a_enc(double[] a, double[] lsf1, double[] lsf * @param length should equate LPC_FILTERORDER * @param iLBCenc_inst (i/o) the encoder state structure */ - private void SimpleInterpolateLSF(double[] syntdenum, double[] weightdenum, double[] lsf, double[] lsfdeq, double[] lsfold, double[] lsfdeqold, int length, Encoder iLBCenc_inst) { + private static void SimpleInterpolateLSF(double[] syntdenum, double[] weightdenum, double[] lsf, double[] lsfdeq, double[] lsfold, double[] lsfdeqold, int length, Encoder iLBCenc_inst) { int pos, lp_length; double[] lp = new double[LPC_FILTERORDER + 1]; - int /* double * */lsf2, lsfdeq2; + int /* double* */ lsf2, lsfdeq2; lsf2 = length; // lsf lsfdeq2 = length; // lsfdeq @@ -4335,7 +4401,7 @@ private void SimpleInterpolateLSF(double[] syntdenum, double[] weightdenum, doub // update memory if (iLBCenc_inst.mode == 30) { - System.arraycopy(lsf, length, lsfold, 0, length); + System.arraycopy(lsf, lsf2, lsfold, 0, length); System.arraycopy(lsfdeq, lsfdeq2, lsfdeqold, 0, length); } else { System.arraycopy(lsf, 0, lsfold, 0, length); @@ -4352,7 +4418,7 @@ private void SimpleInterpolateLSF(double[] syntdenum, double[] weightdenum, doub * FILTERORDER ) * @param lpc_n number of lsf sets to quantize */ - private void SimplelsfQ(double[] lsfdeq, int[] index, double[] lsf, int lpc_n) { + private static void SimplelsfQ(double[] lsfdeq, int[] index, double[] lsf, int lpc_n) { // Quantize first LSF with memoryless split VQ SplitVQ(lsfdeq, 0, index, 0, lsf, 0, lsfCbTbl, LSF_NSPLIT, dim_lsfCbTbl, size_lsfCbTbl); @@ -4373,7 +4439,7 @@ private void SimplelsfQ(double[] lsfdeq, int[] index, double[] lsf, int lpc_n) { * @param data lsf coefficients to quantize * @param iLBCenc_inst (i/o) the encoder state structure */ - private void LPCencode(double[] syntdenum, double[] weightdenum, int[] lsf_index, double[] data, Encoder iLBCenc_inst) { + private static void LPCencode(double[] syntdenum, double[] weightdenum, int[] lsf_index, double[] data, Encoder iLBCenc_inst) { double[] lsf = new double[LPC_FILTERORDER * LPC_N_MAX]; double[] lsfdeq = new double[LPC_FILTERORDER * LPC_N_MAX]; int change = 0; @@ -4384,7 +4450,9 @@ private void LPCencode(double[] syntdenum, double[] weightdenum, int[] lsf_index SimpleInterpolateLSF(syntdenum, weightdenum, lsf, lsfdeq, iLBCenc_inst.lsfold, iLBCenc_inst.lsfdeqold, LPC_FILTERORDER, iLBCenc_inst); } - // A.40. lsf.c +//#endregion + +//#region A.40. lsf.c /** * conversion from lpc coefficients to lsf coefficients @@ -4403,8 +4471,9 @@ private static void a2lsf(double[] freq, int freqP, double[] a) { double[] q = new double[LPC_HALFORDER]; double[] p_pre = new double[LPC_HALFORDER]; double[] q_pre = new double[LPC_HALFORDER]; - double old_p, old_q; - double[] old = new double[1]; + final int old_p = 0, old_q = 1; + int old; + double[] olds = new double[2]; double[] pq_coef; double omega, old_omega; double hlp, hlp1, hlp2, hlp3, hlp4, hlp5; @@ -4431,8 +4500,8 @@ private static void a2lsf(double[] freq, int freqP, double[] a) { omega = 0.0; old_omega = 0.0; - old_p = FLOAT_MAX; - old_q = FLOAT_MAX; + olds[old_p] = FLOAT_MAX; + olds[old_q] = FLOAT_MAX; // Here we loop through lsp_index to find all the LPC_FILTERORDER roots // for omega. @@ -4444,10 +4513,10 @@ private static void a2lsf(double[] freq, int freqP, double[] a) { if ((lsp_index & 0x1) == 0) { pq_coef = p_pre; - old[0] = old_p; + old = old_p; } else { pq_coef = q_pre; - old[0] = old_q; + old = old_q; } // Start with low resolution grid @@ -4464,20 +4533,20 @@ private static void a2lsf(double[] freq, int freqP, double[] a) { hlp4 = 2.0 * hlp * hlp3 - hlp2 + pq_coef[3]; hlp5 = hlp * hlp4 - hlp3 + pq_coef[4]; - if (((hlp5 * (old[0])) <= 0.0) || (omega >= 0.5)) { + if (((hlp5 * (olds[old])) <= 0.0) || (omega >= 0.5)) { if (step_idx == (LSF_NUMBER_OF_STEPS - 1)) { - if (Math.abs(hlp5) >= Math.abs(old[0])) { + if (Math.abs(hlp5) >= Math.abs(olds[old])) { freq[freqP+lsp_index] = omega - step; } else { freq[freqP+lsp_index] = omega; } - if ((old[0]) >= 0.0) { - old[0] = -1.0 * FLOAT_MAX; + if ((olds[old]) >= 0.0) { + olds[old] = -1.0 * FLOAT_MAX; } else { - old[0] = FLOAT_MAX; + olds[old] = FLOAT_MAX; } omega = old_omega; @@ -4502,7 +4571,7 @@ private static void a2lsf(double[] freq, int freqP, double[] a) { // increment omega until they are of different sign, and we // know there is at least one root between omega and // old_omega - old[0] = hlp5; + olds[old] = hlp5; omega += step; } } @@ -4605,7 +4674,9 @@ private static void lsf2a(double[] a_coef, double[] freq) { a_coef[0] = 1.0; } - // A.42. packing.c +//#endregion + +//#region A.42. packing.c /** * splitting an integer into first most significant bits and remaining least @@ -4620,8 +4691,8 @@ private static void lsf2a(double[] a_coef, double[] freq) { private static void packsplit(int[] index, int indexP, int[] firstpart, int[] rest, int restP, int bitno_firstpart, int bitno_total) { int bitno_rest = bitno_total - bitno_firstpart; - firstpart[0] = index[indexP+0] >> (bitno_rest); - rest[restP+0] = index[indexP+0] - (firstpart[0] << (bitno_rest)); + firstpart[0] = index[indexP] >>> bitno_rest; + rest[restP] = index[indexP] - (firstpart[0] << bitno_rest); } /** @@ -4633,8 +4704,8 @@ private static void packsplit(int[] index, int indexP, int[] firstpart, int[] re * @param bitno_rest the number of bits in the lsb part */ private static void packcombine(int[] index, int indexP, int rest, int bitno_rest) { - index[indexP+0] = index[indexP+0] << bitno_rest; - index[indexP+0] += rest; + index[indexP] = index[indexP] << bitno_rest; + index[indexP] += rest; } /** @@ -4647,12 +4718,12 @@ private static void packcombine(int[] index, int indexP, int rest, int bitno_res * @param bitno the number of bits that the value will fit within * @param pos (i/o) write position in the current byte */ - private static void dopack(byte[] bitstream, int bP, int index, int bitno, int[] pos) { + private static void dopack(byte[] bitstream, int[] bP, int index, int bitno, int[] pos) { int posLeft; // Clear the bits before starting in a new byte - if ((pos[0]) == 0) { - bitstream[bP] = 0; + if (pos[0] == 0) { + bitstream[bP[0]] = 0; } while (bitno > 0) { @@ -4661,20 +4732,20 @@ private static void dopack(byte[] bitstream, int bP, int index, int bitno, int[] if (pos[0] == 8) { pos[0] = 0; - bP++; // (*bitstream)++; - bitstream[bP] = 0; + bP[0]++; // (*bitstream)++; + bitstream[bP[0]] = 0; } - posLeft = 8 - (pos[0]); + posLeft = 8 - pos[0]; // Insert index into the bitstream if (bitno <= posLeft) { - bitstream[bP] |= (byte) (index << (posLeft - bitno)); + bitstream[bP[0]] = (byte) (bitstream[bP[0]] | (byte) (index << (posLeft - bitno))); pos[0] += bitno; bitno = 0; } else { - bitstream[bP] |= (byte) (index >> (bitno - posLeft)); + bitstream[bP[0]] = (byte) (bitstream[bP[0]] | (byte) (index >> (bitno - posLeft))); pos[0] = 8; index -= ((index >> (bitno - posLeft)) << (bitno - posLeft)); @@ -4694,7 +4765,7 @@ private static void dopack(byte[] bitstream, int bP, int index, int bitno, int[] * @param bitno number of bits used to represent the value * @param pos (i/o) read position in the current byte */ - private static void unpack(byte[] bitstream, int bP, int[] index, int bitno, int[] pos) { + private static void unpack(byte[] bitstream, int[] bP, int[] index, int bitno, int[] pos) { int BitsLeft; index[0] = 0; @@ -4704,7 +4775,7 @@ private static void unpack(byte[] bitstream, int bP, int[] index, int bitno, int if (pos[0] == 8) { pos[0] = 0; - bP++; // (*bitstream)++; + bP[0]++; // (*bitstream)++; } BitsLeft = 8 - (pos[0]); @@ -4712,17 +4783,17 @@ private static void unpack(byte[] bitstream, int bP, int[] index, int bitno, int // Extract bits to index if (BitsLeft >= bitno) { - index[0] += ((((bitstream[bP]) << (pos[0])) & 0xFF) >> (8 - bitno)); + index[0] += ((((bitstream[bP[0]]) << (pos[0])) & 0xFF) >> (8 - bitno)); pos[0] += bitno; bitno = 0; } else { if ((8 - bitno) > 0) { - index[0] += ((((bitstream[bP]) << (pos[0])) & 0xFF) >> (8 - bitno)); + index[0] += ((((bitstream[bP[0]]) << (pos[0])) & 0xFF) >> (8 - bitno)); pos[0] = 8; } else { - index[0] += ((((bitstream[bP]) << (pos[0])) & 0xFF) << (bitno - 8)); + index[0] += ((((bitstream[bP[0]]) << (pos[0])) & 0xFF) << (bitno - 8)); pos[0] = 8; } bitno -= BitsLeft; @@ -4730,7 +4801,9 @@ private static void unpack(byte[] bitstream, int bP, int[] index, int bitno, int } } - // A.44. StateConstructW.c +//#endregion + +//#region A.44. StateConstructW.c /** * decoding of the start state @@ -4741,13 +4814,13 @@ private static void unpack(byte[] bitstream, int bP, int[] index, int bitno, int * @param out [o] the decoded state vector * @param len length of a state vector */ - private void StateConstructW(int idxForMax, int[] idxVec, double[] syntDenum, int syntDenumP, double[] out, int outP, int len) { + private static void StateConstructW(int idxForMax, int[] idxVec, double[] syntDenum, int syntDenumP, double[] out, int outP, int len) { double maxVal; double[] tmpbuf = new double[LPC_FILTERORDER + 2 * STATE_LEN]; - int /* double * */tmp; + int /* double* */ tmp; double[] numerator = new double[LPC_FILTERORDER + 1]; double[] foutbuf = new double[LPC_FILTERORDER + 2 * STATE_LEN]; - int /* double * */fout; + int /* double* */ fout; // decoding of the maximum value @@ -4773,7 +4846,7 @@ private void StateConstructW(int idxForMax, int[] idxVec, double[] syntDenum, in for (int k = 0; k < len; k++) { int tmpi = len - 1 - k; - /* maxVal = 1/scal */ + // maxVal = 1 / scal tmpbuf[tmp + k] = maxVal * state_sq3Tbl[idxVec[tmpi]]; } @@ -4788,7 +4861,9 @@ private void StateConstructW(int idxForMax, int[] idxVec, double[] syntDenum, in } } - // A.46. StateSearchW.c +//#endregion + +//#region A.46. StateSearchW.c /** * predictive noise shaping encoding of scaled start state (subrutine for @@ -4803,7 +4878,7 @@ private void StateConstructW(int idxForMax, int[] idxVec, double[] syntDenum, in * @param state_first position of start state in the 80 vec */ private static void AbsQuantW(Encoder iLBCenc_inst, double[] in, int inP, double[] syntDenum, int syntDenumP, double[] weightDenum, int weightDenumP, int[] out, int len, int state_first) { - int /* double * */syntOut; + int /* double* */ syntOut; double[] syntOutBuf = new double[LPC_FILTERORDER + STATE_SHORT_LEN_30MS]; double toQ; double[] xq = new double[1]; @@ -4845,7 +4920,6 @@ private static void AbsQuantW(Encoder iLBCenc_inst, double[] in, int inP, double // synthesis and weighting filters on input AllPoleFilter(in, inP + n, weightDenum, weightDenumP, len - n, LPC_FILTERORDER); - } // prediction of synthesized and weighted input @@ -4879,14 +4953,14 @@ private static void AbsQuantW(Encoder iLBCenc_inst, double[] in, int inP, double * @param len length of all vectors * @param state_first position of start state in the 80 vec */ - private void StateSearchW(Encoder iLBCenc_inst, double[] residual, int residualP, double[] syntDenum, int syntDenumP, double[] weightDenum, int weightDenumP, int[] idxForMax, int[] idxVec, int len, int state_first) { + private static void StateSearchW(Encoder iLBCenc_inst, double[] residual, int residualP, double[] syntDenum, int syntDenumP, double[] weightDenum, int weightDenumP, int[] idxForMax, int[] idxVec, int len, int state_first) { double[] dtmp = new double[1]; double maxVal; double[] tmpbuf = new double[LPC_FILTERORDER + 2 * STATE_SHORT_LEN_30MS]; - int /* double * */tmp; + int /* double* */ tmp; double[] numerator = new double[1 + LPC_FILTERORDER]; double[] foutbuf = new double[LPC_FILTERORDER + 2 * STATE_SHORT_LEN_30MS]; - int /* double * */fout; + int /* double* */ fout; int k; double qmax, scal; @@ -4950,7 +5024,9 @@ private void StateSearchW(Encoder iLBCenc_inst, double[] residual, int residualP AbsQuantW(iLBCenc_inst, foutbuf, fout, syntDenum, syntDenumP, weightDenum, weightDenumP, idxVec, len, state_first); } - // A.48. syntFilter.c +//#endregion + +//#region A.48. syntFilter.c /** * LP synthesis filter. @@ -4961,21 +5037,21 @@ private void StateSearchW(Encoder iLBCenc_inst, double[] residual, int residualP * @param mem (i/o) Filter state */ private static void syntFilter(double[] out, int oP, double[] a, int aP, int len, double[] mem) { - int /* double * */po, pi, pa, pm; + int /* double* */ po, pi, pa, pm; po = oP; // out // Filter first part using memory from past for (int i = 0; i < LPC_FILTERORDER; i++) { - pi = i - 1; // out - pa = 1; // a + pi = oP + i - 1; // + pa = aP + 1; // a pm = LPC_FILTERORDER - 1; // mem for (int j = 1; j <= i; j++) { - out[po] -= (a[aP + pa++]) * (out[pi--]); + out[po] -= a[pa++] * out[pi--]; } for (int j = i + 1; j < LPC_FILTERORDER + 1; j++) { - out[po] -= (a[aP + pa++]) * (mem[pm--]); + out[po] -= a[pa++] * mem[pm--]; } po++; } @@ -4983,16 +5059,18 @@ private static void syntFilter(double[] out, int oP, double[] a, int aP, int len // Filter last part where the state is entirely in the output vector for (int i = LPC_FILTERORDER; i < len; i++) { - pi = i - 1; // out - pa = 1; // a + pi = oP + i - 1; // out + pa = aP + 1; // a for (int j = 1; j < LPC_FILTERORDER + 1; j++) { - out[po] -= (a[aP + pa++]) * (out[pi--]); + out[po] -= a[pa++] * out[pi--]; } po++; } // Update state vector - System.arraycopy(out, po + len - LPC_FILTERORDER, mem, 0, LPC_FILTERORDER); + System.arraycopy(out, oP + len - LPC_FILTERORDER, mem, 0, LPC_FILTERORDER); } + +//#endregion } diff --git a/src/main/java/vavi/sound/ilbc/readme.md b/src/main/java/vavi/sound/ilbc/readme.md index 7638dea..892efa9 100644 --- a/src/main/java/vavi/sound/ilbc/readme.md +++ b/src/main/java/vavi/sound/ilbc/readme.md @@ -4,8 +4,9 @@ Provides iLBC codec related classes. ## References - * [iLBCfreeware](http://www.ilbcfreeware.org/) + * [iLBCfreeware](http://www.ietf.org/rfc/rfc3951.txt) * http://www.sip-communicator.org/ this is outdone me... orz + * https://github.com/zhu/bigbluebutton/tree/master/bbb-voice/src/main/java/org/red5/app/sip/codecs/ilbc (java) ### License @@ -13,4 +14,4 @@ Provides iLBC codec related classes. ## TODO - * complete + * ~~complete~~ diff --git a/src/main/java/vavi/sound/ldcelp/Decoder.java b/src/main/java/vavi/sound/ldcelp/Decoder.java new file mode 100644 index 0000000..c084589 --- /dev/null +++ b/src/main/java/vavi/sound/ldcelp/Decoder.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.ldcelp; + +/** + * Decoder. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-06-30 nsano initial version
+ */ +public class Decoder { + + final LdCelp ldCelp = new LdCelp(); + + public Decoder(boolean postfilter) { + ldCelp.postfiltering_p = postfilter; + ldCelp.init_decoder(); + } + + public void decode(short[] in, short[] out) { + ldCelp.decoder(in, out); + } +} diff --git a/src/main/java/vavi/sound/ldcelp/LdCelp.java b/src/main/java/vavi/sound/ldcelp/LdCelp.java index fbdab8b..8ed7eaa 100644 --- a/src/main/java/vavi/sound/ldcelp/LdCelp.java +++ b/src/main/java/vavi/sound/ldcelp/LdCelp.java @@ -1,64 +1,93 @@ /* + * LD-CELP G.728 + * + * Low-Delay Code Excitation Linear Prediction speech compression. + * + * Code edited by Michael Concannon. + * Based on code written by Alex Zatsman, Analog Devices 1993 */ package vavi.sound.ldcelp; +import java.io.EOFException; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.lang.System.Logger; import java.util.Arrays; -import java.util.concurrent.atomic.AtomicInteger; -import vavi.util.Debug; +import vavi.io.LittleEndianDataInputStream; +import vavi.io.LittleEndianDataOutputStream; + +import static java.lang.System.getLogger; +import static vavi.sound.ldcelp.Constants.BIG; +import static vavi.sound.ldcelp.Constants.FAC; +import static vavi.sound.ldcelp.Constants.GOFF; +import static vavi.sound.ldcelp.Constants.IDIM; +import static vavi.sound.ldcelp.Constants.KPMIN; +import static vavi.sound.ldcelp.Constants.LPC; +import static vavi.sound.ldcelp.Constants.LPCLG; +import static vavi.sound.ldcelp.Constants.LPCW; +import static vavi.sound.ldcelp.Constants.MAX; +import static vavi.sound.ldcelp.Constants.MIN; +import static vavi.sound.ldcelp.Constants.NCWD; +import static vavi.sound.ldcelp.Constants.NFRSZ; +import static vavi.sound.ldcelp.Constants.NONR; +import static vavi.sound.ldcelp.Constants.NONRLG; +import static vavi.sound.ldcelp.Constants.NONRW; +import static vavi.sound.ldcelp.Constants.NUPDATE; +import static vavi.sound.ldcelp.Constants.WNCF; /** - * LD-CELP G.728 - *

* Low-Delay Code Excitation Linear Prediction speech compression. - *

- * Code edited by Michael Concannon.
- * Based on code written by Alex Zatsman, Analog Devices 1993 - *

- * Adapter for Perceptual Weighting Filter - *

* + * @author Michael Concannon + * @author Alex Zatsman, Analog Devices 1993 * @author Naohide Sano (nsano) * @version 0.00 040621 nsano initial version
*/ public class LdCelp { + private static final Logger logger = getLogger(LdCelp.class.getName()); + +//#region Adapters + + // Adapter for Perceptual Weighting Filter + /** Arrays for band widening: zeros and */ - private final float[] pwf_z_vec = new float[Constants.LPCW + 1]; + private final float[] pwf_z_vec = new float[LPCW + 1]; /** poles */ - private final float[] pwf_p_vec = new float[Constants.LPCW + 1]; - private final float[] pwf_old_input = new float[Constants.LPCW + Constants.NFRSZ + Constants.NONRW]; + private final float[] pwf_p_vec = new float[LPCW + 1]; + private final float[] pwf_old_input = new float[LPCW + NFRSZ + NONRW]; /** Recursive Part */ - private final float[] pwf_rec = new float[Constants.LPCW + 1]; + private final float[] pwf_rec = new float[LPCW + 1]; + + // auto-correlation coefficients + private final float[] _pwf_acorr = new float[LPCW + 1]; + private final float[] _pwf_lpcoeff = new float[LPCW + 1]; + private final float[] _pwf_temp = new float[LPCW + 1]; /** + * Adapter for Perceptual Weighting Filter. + * * @param z_out zero coefficients * @param p_out pole coefficients */ void pwf_adapter(float[] input, float[] z_out, float[] p_out) { - // autocorrelation coefficients - float[] acorr = new float[Constants.LPCW + 1]; - float[] lpcoeff = new float[Constants.LPCW + 1]; - float[] temp = new float[Constants.LPCW + 1]; - - hybwin(Constants.LPCW, // lpsize - Constants.NFRSZ, // framesize - Constants.NONRW, // nrsize -- nonrecursive size + + hybwin(LPCW, // lpsize + NFRSZ, // framesize + NONRW, // nrsize -- nonrecursive size pwf_old_input, input, - acorr, + _pwf_acorr, hw_percw, pwf_rec, 0.5f); - if (levdur(acorr, temp, Constants.LPCW) != 0) { - RCOPY(temp, 0, lpcoeff, 0, Constants.LPCW + 1); - bw_expand2(lpcoeff, z_out, p_out, - Constants.LPCW, pwf_z_vec, pwf_p_vec); + if (levdur(_pwf_acorr, _pwf_temp, LPCW) != 0) { + RCOPY(_pwf_temp, 0, _pwf_lpcoeff, 0, LPCW + 1); + bw_expand2(_pwf_lpcoeff, z_out, p_out, LPCW, pwf_z_vec, pwf_p_vec); } } @@ -68,7 +97,7 @@ void init_pwf_adapter(float[] z_co, float[] p_co) { float zv = 1.0f; float pv = 1.0f; - for (int i = 0; i <= Constants.LPCW; i++) { + for (int i = 0; i <= LPCW; i++) { pwf_z_vec[i] = zv; pwf_p_vec[i] = pv; zv *= Constants.WZCF; @@ -83,39 +112,40 @@ void init_pwf_adapter(float[] z_co, float[] p_co) { ZARR(pwf_rec); } - // Backward Synthesis Filter Adapter -------------------------------------- + // Backward Synthesis Filter Adapter ---- - private final float[] facv = new float[Constants.LPC + 1]; + private final float[] facv = new float[LPC + 1]; - private final float[] bsf_old_input = new float[Constants.LPC + Constants.NFRSZ + Constants.NONR]; - private final float[] bsf_rec = new float[Constants.LPC + 1]; + private final float[] bsf_old_input = new float[LPC + NFRSZ + NONR]; + private final float[] bsf_rec = new float[LPC + 1]; - /** */ + private final float[] _bsf_old_input = new float[LPC + NFRSZ + NONR]; + // auto-correlation coefficients + private final float[] _bsf_acorr = new float[LPC + 1]; + private final float[] _bsf_lpcoeff = new float[LPC + 1]; + private final float[] _bsf_temp = new float[LPC + 1]; + + /** Backward Synthesis Filter Adapter */ void bsf_adapter(float[] input, float[] p_out) { - float[] old_input = new float[Constants.LPC + Constants.NFRSZ + Constants.NONR]; - // autocorrelation coefficients - float[] acorr = new float[Constants.LPC + 1]; - float[] lpcoeff = new float[Constants.LPC + 1]; - float[] temp = new float[Constants.LPC + 1]; - - hybwin(Constants.LPC, // lpsize - Constants.NFRSZ, // framesize - Constants.NONR, // nrsize -- nonrecursive size - old_input, + + hybwin(LPC, // lpsize + NFRSZ, // framesize + NONR, // nrsize -- non-recursive size + _bsf_old_input, input, - acorr, + _bsf_acorr, hw_synth, bsf_rec, 0.75f); - if (sf_levdur(acorr, temp) != 0) { - k10 = -acorr[1] / acorr[0]; - RCOPY(temp, 0, lpcoeff, 0, Constants.LPC + 1); - bw_expand1(lpcoeff, p_out, Constants.LPC, facv); + if (sf_levdur(_bsf_acorr, _bsf_temp) != 0) { + k10 = -_bsf_acorr[1] / _bsf_acorr[0]; + RCOPY(_bsf_temp, 0, _bsf_lpcoeff, 0, LPC + 1); + bw_expand1(_bsf_lpcoeff, p_out, LPC, facv); } } - // Gain Adapter ----------------------------------------------------------- + // Gain Adapter ---- /** Array for band widening */ private static final float[] gain_p_vec = { @@ -133,42 +163,43 @@ void bsf_adapter(float[] input, float[] p_out) { }; /** Recursive part for Hybrid Window */ - private final float[] g_rec = new float[Constants.LPCLG + 1]; - private final float[] g_old_input = new float[Constants.LPCLG + Constants.NUPDATE + Constants.NONRLG]; + private final float[] g_rec = new float[LPCLG + 1]; + private final float[] g_old_input = new float[LPCLG + NUPDATE + NONRLG]; + + // auto-correlation coefficients + private final float[] _gain_acorr = new float[LPCLG + 1]; + private final float[] _gain_lpcoeff = new float[LPCLG + 1]; + + private final float[] _gain_temp = new float[LPCLG + 1]; /** recompute lpc_coeff */ void gain_adapter(float[] log_gain, float[] coeff) { - // autocorrelation coefficients - float[] acorr = new float[Constants.LPCLG + 1]; - float[] lpcoeff = new float[Constants.LPCLG + 1]; - - float[] temp = new float[Constants.LPCLG + 1]; - hybwin(Constants.LPCLG, // lpsize - Constants.NUPDATE, // framesize - Constants.NONRLG, // nrsize -- nonrecursive size + hybwin(LPCLG, // lpsize + NUPDATE, // framesize + NONRLG, // nrsize -- nonrecursive size g_old_input, log_gain, - acorr, + _gain_acorr, hw_gain, g_rec, 0.75f); - if (levdur(acorr, temp, Constants.LPCLG) != 0) { - System.arraycopy(temp, 1, lpcoeff, 1, Constants.LPCLG); - bw_expand1(lpcoeff, coeff, Constants.LPCLG, gain_p_vec); + if (levdur(_gain_acorr, _gain_temp, LPCLG) != 0) { + System.arraycopy(_gain_temp, 1, _gain_lpcoeff, 1, LPCLG); + bw_expand1(_gain_lpcoeff, coeff, LPCLG, gain_p_vec); } } - // Initializations -------------------------------------------------------- + // Initializations ---- /** */ void init_bsf_adapter(float[] co) { float v = 1.0f; - for (int i = 0; i <= Constants.LPC; i++) { + for (int i = 0; i <= LPC; i++) { facv[i] = v; - v *= Constants.FAC; + v *= FAC; co[i] = 0; } co[0] = 1.0f; @@ -177,29 +208,28 @@ void init_bsf_adapter(float[] co) { } /** */ - void init_gain_adapter (float[] coeff) { + void init_gain_adapter(float[] coeff) { gain_p_vec[0] = 1.0f; coeff[0] = 1.0f; coeff[1] = -1.0f; - for(int i = 0; i < Constants.LPCLG + Constants.NUPDATE + Constants.NONRLG; i++) { - g_old_input[i] = -Constants.GOFF; + for(int i = 0; i < LPCLG + NUPDATE + NONRLG; i++) { + g_old_input[i] = -GOFF; } ZARR(g_rec); ZARR(g_old_input); } - // Hybrid Window Module --------------------------------------------------- + // Hybrid Window Module ---- /** * Hybrid Window * - * @param lpsize size of OUTPUT (autocorrelation vector) + * @param lpsize size of OUTPUT (auto-correlation vector) * @param framesize size of NEW_INPUT * @param nrsize size of non-recursive part. - * @param old_input buffer for holding old input - * (size LPSIZE + FRAMESIZE + NRSIZE) + * @param old_input buffer for holding old input (size LPSIZE + FRAMESIZE + NRSIZE) * @param new_input new input, or frame (size FRAMESIZE) - * @param output autocorrelation vector (size LPSIZE) + * @param output auto-correlation vector (size LPSIZE) * @param window window coefficients (size LPSIZE+FRAMESIZE+NRSIZE) * @param rec recursive part (size LPSIZE) * @param decay scaling for the old recursive part. @@ -219,17 +249,16 @@ private static void hybwin(int lpsize, // M + N int N2 = lpsize + nrsize; int N3 = lpsize + framesize + nrsize; - int i; float[] ws = new float[N3]; float[] tmp1 = new float[lpsize + 1]; float[] tmp2 = new float[lpsize + 1]; // shift in INPUT into OLD_INPUT and window it - for (i = 0; i < N2; i++) { + for (int i = 0; i < N2; i++) { old_input[i] = old_input[i + framesize]; } - for (i = 0; i < framesize; i++) { + for (int i = 0; i < framesize; i++) { old_input[N2 + i] = new_input[i]; } @@ -237,32 +266,33 @@ private static void hybwin(int lpsize, autocorr(ws, tmp1, lpsize, lpsize, N1); - for (i = 0; i <= lpsize; i++) { + for (int i = 0; i <= lpsize; i++) { rec[i] = decay * rec[i] + tmp1[i]; } - autocorr(ws, tmp2, lpsize, N1, N3); + autocorr(ws, tmp2, lpsize, N1, N3); - for (i = 0; i <= lpsize; i++) { + for (int i = 0; i <= lpsize; i++) { output[i] = rec[i] + tmp2[i]; } - output[0] *= Constants.WNCF; + output[0] *= WNCF; } - // Levinson-Durbin Routines ----------------------------------------------- + // Levinson-Durbin Routines ---- + + private final float[] _levdur_rc = new float[20]; /** * Levinson-Durbin algorithm * return 1 if ok, otherwise 0 */ - private static int levdur(float[] acorr, float[] coeff, int order) { + private int levdur(float[] acorr, float[] coeff, int order) { // Local variables int minc2; float s; int ib, mh; float at; - float[] rc = new float[20]; float alpha; float tmp; @@ -270,16 +300,16 @@ private static int levdur(float[] acorr, float[] coeff, int order) { // --acorr; // --coeff; - // check for zero signal or illegal zero-lag autocorrelation + // check for zero signal or illegal zero-lag auto-correlation if ((acorr[1-(1)] <= 0.0f) || (acorr[order + 1-(1)] == 0)) { return 0; } - // start durbin's recursion - rc[1] = -acorr[2-(1)] / acorr[1-(1)]; + // start Durbin's recursion + _levdur_rc[1] = -acorr[2-(1)] / acorr[1-(1)]; coeff[1-(1)] = 1.0f; - coeff[2-(1)] = rc[1]; - alpha = acorr[1-(1)] + acorr[2-(1)] * rc[1]; + coeff[2-(1)] = _levdur_rc[1]; + alpha = acorr[1-(1)] + acorr[2-(1)] * _levdur_rc[1]; if (alpha <= 0.0f) { return 0; } @@ -289,18 +319,18 @@ private static int levdur(float[] acorr, float[] coeff, int order) { for (int ip = 2; ip <= minc; ++ip) { s += acorr[minc2 - ip-(1)] * coeff[ip-(1)]; } - rc[minc] = -s / alpha; + _levdur_rc[minc] = -s / alpha; mh = minc / 2 + 1; for (int ip = 2; ip <= mh; ip++) { ib = minc2 - ip; - at = rc[minc] * coeff[ib-(1)]; + at = _levdur_rc[minc] * coeff[ib-(1)]; at += coeff[ip-(1)]; - tmp = rc[minc] * coeff[ip-(1)]; + tmp = _levdur_rc[minc] * coeff[ip-(1)]; coeff[ib-(1)] += tmp; coeff[ip-(1)] = at; } - coeff[minc + 1-(1)] = rc[minc]; - alpha += rc[minc] * s; + coeff[minc + 1-(1)] = _levdur_rc[minc]; + alpha += _levdur_rc[minc] * s; // if residual energy less than zero (due to ill-conditioning), // return without updating filter coefficients (use old ones). @@ -324,7 +354,7 @@ private static int levdur(float[] acorr, float[] coeff, int order) { */ private int sf_levdur(float[] acorr, float[] coeff) { - if (acorr[Constants.LPC] == 0) { + if (acorr[LPC] == 0) { return 0; } float E = acorr[0]; @@ -332,7 +362,7 @@ private int sf_levdur(float[] acorr, float[] coeff) { return 0; } coeff[0] = 1.0f; - for (int m = 1; m <= Constants.LPC; m++) { + for (int m = 1; m <= LPC; m++) { float K = -acorr[m]; if (m > 1) { float a1 = acorr[m - 1]; @@ -362,28 +392,28 @@ private int sf_levdur(float[] acorr, float[] coeff) { if (halfm >= 1) { float t3; float t4; - int float_pointer_p = 1; - int float_pointer_pp = float_pointer_p; - int float_pointer_q = m - 1; - int float_pointer_qq = float_pointer_q; + int p = 1; // coeff + int pp = p; // coeff + int q = m - 1; // coeff + int qq = q; // coeff - float x = coeff[float_pointer_p++]; - float y = coeff[float_pointer_q--]; + float x = coeff[p++]; + float y = coeff[q--]; float t1 = K * x; float t2 = K * y; for (int j = 2; j <= halfm; j++) { - t4 = t2 + x; x = coeff[float_pointer_p++]; - t3 = t1 + y; y = coeff[float_pointer_q--]; - t1 = K * x; coeff[float_pointer_pp++] = t4; - t2 = K * y; coeff[float_pointer_qq--] = t3; + t4 = t2 + x; x = coeff[p++]; + t3 = t1 + y; y = coeff[q--]; + t1 = K * x; coeff[pp++] = t4; + t2 = K * y; coeff[qq--] = t3; } t3 = t1 + y; t4 = t2 + x; - coeff[float_pointer_pp] = t4; - coeff[float_pointer_qq] = t3; + coeff[pp] = t4; + coeff[qq] = t3; } if (m == 10) { - System.arraycopy(coeff, 0, a10, 0, 11); + System.arraycopy(coeff, 0, a10, 0, 10 + 1); } E = (1 - K * K) * E; if (E < 0) { @@ -393,7 +423,7 @@ private int sf_levdur(float[] acorr, float[] coeff) { return 1; } - // Band Width Expanders --------------------------------------------------- + // Band Width Expanders ---- /** * Don't have to worry about i=0 -- z_vec[0] and p_vec[0] should stay 1.0. @@ -413,7 +443,14 @@ private static void bw_expand2(float[] input, } } - /** Poles only */ + /** + * Poles only + * + * @param p_vec 1st vector + * @param input 2nd vector + * @param order length + * @param p_out result + */ private static void bw_expand1(float[] input, float[] p_out, int order, @@ -424,7 +461,13 @@ private static void bw_expand1(float[] input, } } - /** */ + /** + * @param x vector + * @param m from + * @param n to + * @param k vector dimension + * @param r result + */ private static void autocorr(float[] x, float[] r, int k, int m, int n) { for (int ii = 0; ii <= k; ii++) { @@ -436,12 +479,12 @@ private static void autocorr(float[] x, float[] r, int k, int m, int n) { } } - // CMain ---- +//#endregion + +//#region CMain /** Index of the end of the decoded speech */ private int dec_end; -// /** */ -// private int encoder_done = 0; /** * @param args -d[p]|-e infile outfile @@ -454,20 +497,58 @@ public static void main(String[] args) throws Exception { LdCelp ldCelp = new LdCelp(); if (args[0].equals("-e")) { - ldCelp.ifile_name = args[1]; - ldCelp.xfile_name = args[2]; - ldCelp.ffase.set(1); - ldCelp.encoder(); + String in_file_name = args[1]; + String x_file_name = args[2]; + // output file (codebook indices) + var eOut = new LittleEndianDataOutputStream(new FileOutputStream(x_file_name)); + // input file + var eIn = new LittleEndianDataInputStream(new FileInputStream(in_file_name)); + ldCelp.init_encoder(); + short[] in = new short[5]; + short[] out = new short[1]; + while (true) { + try { + for (int i = 0; i < in.length; i++) + in[i] = eIn.readShort(); + ldCelp.encoder(in, out); + for (short s : out) + eOut.writeShort(s); + } catch (EOFException e) { + break; + } + } + eIn.close(); + eOut.flush(); + eOut.close(); } else if (args[0].startsWith("-d")) { if (args[0].length() > 2 && args[0].charAt(2) == 'p') { ldCelp.postfiltering_p = true; } else { ldCelp.postfiltering_p = false; } - ldCelp.xfile_name = args[1]; - ldCelp.ofile_name = args[2]; - ldCelp.ffase.set(1); - ldCelp.decoder(); + String x_file_name = args[1]; + String out_file_name = args[2]; + // Output file + var dOut = new LittleEndianDataOutputStream(new FileOutputStream(out_file_name)); + // Input file (codebook indices) + var dIn = new LittleEndianDataInputStream(new FileInputStream(x_file_name)); + ldCelp.init_decoder(); + short[] in = new short[1]; + short[] out = new short[5]; + while (true) { + try { + for (int i = 0; i < in.length; i++) + in[0] = dIn.readShort(); + ldCelp.decoder(in, out); + for (short s : out) + dOut.writeShort(s); + } catch (EOFException e) { + break; + } + } + dIn.close(); + dOut.flush(); + dOut.close(); } else { usage(); } @@ -483,176 +564,175 @@ private static void usage() { /** */ private final float[] thequeue = new float[QSIZE]; /** */ - private int float_pointer_vector_end; + private int vector_end; // thequeue /** */ - void encoder() throws IOException { - - init_encoder(); - Arrays.fill(thequeue, 0); - for (int vnum = 0; read_sound_buffer(Constants.IDIM, thequeue, (vnum * Constants.IDIM) % QSIZE) > 0; vnum++) { - float_pointer_vector_end = (vnum * Constants.IDIM) % QSIZE + Constants.IDIM; - encode_vector(false); + void encoder(short[] in, short[] out) throws IOException { + for (int vnum = 0; vnum < (in.length + IDIM - 1) / IDIM; vnum++) { + int n = vnum % IDIM == 0 ? IDIM : vnum % IDIM; + read_sound_buffer(n, in, vnum * IDIM, thequeue, (vnum * IDIM) % QSIZE); + vector_end = (vnum * IDIM) % QSIZE + n; // thequeue + encode_vector(false, out, vnum); adapt_frame(); } } /** */ private void init_encoder() { + this.ffase = 1; + // init_pwf_adapter(pwf_z_coeff, pwf_p_coeff); _next[PWF_Z_COEFF][0] = _next[PWF_P_COEFF][0] = 1.0f; - _obsolete_p[PWF_Z_COEFF] = 0; + _obsolete_p[PWF_Z_COEFF] = false; init_bsf_adapter(sf_coeff); _next[SF_COEFF][0] = 1.0f; - _obsolete_p[SF_COEFF] = 0; + _obsolete_p[SF_COEFF] = false; init_gain_adapter(gp_coeff); init_gain_buf(); _next[GP_COEFF][0] = 1.0f; _next[GP_COEFF][1] = -1.0f; - _obsolete_p[GP_COEFF] = 0; - init_input(); - float_pointer_vector_end = 0; // thequeue + _obsolete_p[GP_COEFF] = false; + vector_end = 0; // thequeue ZARR(imp_resp); imp_resp[0] = 1.0f; shape_conv(imp_resp, shape_energy); + // + Arrays.fill(thequeue, 0); } + private final float[] _encode_vector_zero_response = new float[IDIM]; + private final float[] _encode_vector_weighted_speech = new float[IDIM]; + private final float[] _encode_vector_target = new float[IDIM]; + private final float[] _encode_vector_normtarg = new float[IDIM]; + private final float[] _encode_vector_cb_vec = new float[IDIM]; + private final float[] _encode_vector_pn = new float[IDIM]; + private float _encode_vector_gain = 1.0f; + private float _encode_vector_scale = 1.0f; + /** */ - private void encode_vector(boolean ignore) throws IOException { - // Computed Codebook Index - int ix; - // Index of Recently Read Vector - int vx; - // Logarithmic Gain Index - int lgx; + private void encode_vector(boolean ignore, short[] out, int outp) { // recently read vector in the queue - int float_pointer_vector; - - float[] zero_response = new float[Constants.IDIM]; - float[] weighted_speech = new float[Constants.IDIM]; - float[] target = new float[Constants.IDIM]; - float[] normtarg = new float[Constants.IDIM]; - float[] cb_vec = new float[Constants.IDIM]; - float[] pn = new float[Constants.IDIM]; - float gain = 1.0f; - float scale = 1.0f; - - float_pointer_vector = float_pointer_vector_end - Constants.IDIM; - if (float_pointer_vector < 0) { - float_pointer_vector += QSIZE; - } - vx = float_pointer_vector; + int vector = vector_end - IDIM; + if (vector < 0) { + vector += QSIZE; + } + // Index of Recently Read Vector + int vx = vector; UPDATE(pwf_z_coeff, PWF_Z_COEFF); // Copy new coeff if flag set UPDATE(pwf_p_coeff, PWF_P_COEFF); - pwfilter2(thequeue, float_pointer_vector, weighted_speech); + pwfilter2(thequeue, vector, _encode_vector_weighted_speech); UPDATE(sf_coeff, SF_COEFF); - zresp(zero_response); - sub_sig(weighted_speech, zero_response, target); + zresp(_encode_vector_zero_response); + sub_sig(_encode_vector_weighted_speech, _encode_vector_zero_response, _encode_vector_target); UPDATE(gp_coeff, GP_COEFF); - gain = predict_gain(); - scale = 1.0f / gain; - scaleSignals(scale, target, 0, normtarg, 0); + _encode_vector_gain = predict_gain(); + _encode_vector_scale = 1.0f / _encode_vector_gain; + sig_scale(_encode_vector_scale, _encode_vector_target, 0, _encode_vector_normtarg, 0); UPDATE(imp_resp, IMP_RESP); - trev_conv(imp_resp, normtarg, pn); + trev_conv(imp_resp, _encode_vector_normtarg, _encode_vector_pn); UPDATE(shape_energy, SHAPE_ENERGY); - ix = cb_index(pn); - put_index(ix); - cb_excitation(ix, cb_vec); - scaleSignals(gain, cb_vec, 0, qspeech, vx); - lgx = vx / Constants.IDIM; + // Computed Codebook Index + int ix = cb_index(_encode_vector_pn); + out[outp] = (short) ix; + cb_excitation(ix, _encode_vector_cb_vec); + sig_scale(_encode_vector_gain, _encode_vector_cb_vec, 0, qspeech, vx); + // Logarithmic Gain Index + int lgx = vx / IDIM; update_gain(qspeech, vx, log_gains, lgx); mem_update(qspeech, vx, synspeech, vx); - dec_end = vx + Constants.IDIM; + dec_end = vx + IDIM; if (dec_end >= QSIZE) { dec_end -= QSIZE; } - // declare array and its copy together with a semafor - ffase.set(ffase.get() == 4 ? 1 : ffase.get() + 1); // Update vector counter + // declare array and its copy together with a semaphore + NEXT_FFASE(); // Update vector counter } + private final float[] _adapt_frame_input = new float[NUPDATE * IDIM]; + private final float[] _adapt_frame_synth = new float[NUPDATE * IDIM]; + private final float[] _adapt_frame_lg = new float[NUPDATE]; + /** * Update the filter coeff if we are at the correct vector in the frame * ffase is the vector count (1-4) within the current frame */ void adapt_frame() { - float[] input = new float[Constants.NUPDATE * Constants.IDIM]; - float[] synth = new float[Constants.NUPDATE * Constants.IDIM]; - float[] lg = new float[Constants.NUPDATE]; - // Index for log_gains, cycle end - int gx; // Backward syn. filter coeff update. Occurs after full frame (before // first vector) but not used until the third vector of the frame - if (ffase.get() == 1) { - CIRCOPY(synth, synspeech, dec_end, - Constants.NUPDATE * Constants.IDIM, QSIZE); - bsf_adapter(synth, _next[SF_COEFF]); // Compute then new coeff + if (ffase == 1) { + CIRCOPY(_adapt_frame_synth, synspeech, dec_end, NUPDATE * IDIM, QSIZE); + bsf_adapter(_adapt_frame_synth, _next[SF_COEFF]); // Compute then new coeff } // Before third vector of frame - if (ffase.get() == 3) { + if (ffase == 3) { // Copy coeff computed above(2 frames later) - _obsolete_p[SF_COEFF] = 1; + _obsolete_p[SF_COEFF] = true; } // Gain coeff update before second vector of frame - if (ffase.get() == 2) { - gx = dec_end / Constants.IDIM; - CIRCOPY(lg, log_gains, gx, Constants.NUPDATE, - QSIZE / Constants.IDIM); - gain_adapter(lg, _next[GP_COEFF]); - _obsolete_p[GP_COEFF] = 1; + if (ffase == 2) { + // Index for log_gains, cycle end + int gx = dec_end / IDIM; + CIRCOPY(_adapt_frame_lg, log_gains, gx, NUPDATE, QSIZE / IDIM); + gain_adapter(_adapt_frame_lg, _next[GP_COEFF]); + _obsolete_p[GP_COEFF] = true; } - if (ffase.get() == 3) { - CIRCOPY(input, thequeue, dec_end, - Constants.NUPDATE * Constants.IDIM, QSIZE); - pwf_adapter(input, _next[PWF_Z_COEFF], _next[PWF_P_COEFF]); - _obsolete_p[PWF_Z_COEFF] = 1; - _obsolete_p[PWF_P_COEFF] = 1; + if (ffase == 3) { + CIRCOPY(_adapt_frame_input, thequeue, dec_end, NUPDATE * IDIM, QSIZE); + pwf_adapter(_adapt_frame_input, _next[PWF_Z_COEFF], _next[PWF_P_COEFF]); + _obsolete_p[PWF_Z_COEFF] = true; + _obsolete_p[PWF_P_COEFF] = true; } - if (ffase.get() == 3) { - iresp_vcalc(_next[SF_COEFF], _next[PWF_Z_COEFF], - _next[PWF_P_COEFF], _next[IMP_RESP]); + if (ffase == 3) { + iresp_vcalc(_next[SF_COEFF], _next[PWF_Z_COEFF], _next[PWF_P_COEFF], _next[IMP_RESP]); shape_conv(_next[IMP_RESP], _next[SHAPE_ENERGY]); - _obsolete_p[SHAPE_ENERGY] = 1; - _obsolete_p[IMP_RESP] = 1; + _obsolete_p[SHAPE_ENERGY] = true; + _obsolete_p[IMP_RESP] = true; } } - // CodeBook --- +//#endregion - /** */ - static void iresp_vcalc(float[] sf_co, +//#region CodeBook + + private final float[] _iresp_vcalc_temp = new float[IDIM]; + private final float[] _iresp_vcalc_rc = new float[IDIM]; + + /** Impulse Response Vector Calculator */ + void iresp_vcalc(float[] sf_co, float[] pwf_z_co, float[] pwf_p_co, float[] h) { - float[] temp = new float[Constants.IDIM]; - float[] rc = new float[Constants.IDIM]; - temp[0] = rc[0] = 1.0f; - for (int k = 1; k < Constants.IDIM; k++) { + _iresp_vcalc_temp[0] = _iresp_vcalc_rc[0] = 1.0f; + for (int k = 1; k < IDIM; k++) { float a0 = 0.0f; float a1 = 0.0f; float a2 = 0.0f; for (int i = k; i >= 1; i--) { - temp[i] = temp[i-1]; - rc[i] = rc[i-1]; - a0 -= sf_co[i] * temp[i]; - a1 += pwf_z_co[i] * temp[i]; - a2 -= pwf_p_co[i] * rc[i]; + _iresp_vcalc_temp[i] = _iresp_vcalc_temp[i-1]; + _iresp_vcalc_rc[i] = _iresp_vcalc_rc[i-1]; + a0 -= sf_co[i] * _iresp_vcalc_temp[i]; + a1 += pwf_z_co[i] * _iresp_vcalc_temp[i]; + a2 -= pwf_p_co[i] * _iresp_vcalc_rc[i]; } - temp[0] = a0; - rc[0] = a0 + a1 + a2; + _iresp_vcalc_temp[0] = a0; + _iresp_vcalc_rc[0] = a0 + a1 + a2; } - for (int k = 0; k < Constants.IDIM; k++) { - h[k] = rc[Constants.IDIM - 1 - k]; + for (int k = 0; k < IDIM; k++) { + h[k] = _iresp_vcalc_rc[IDIM - 1 - k]; } } /** + * Cb_shape Codevector Convolution Module and Energy Table Calculator + * The output is energy table + * * Unoptimized version -- kept for reference */ static void shape_conv(float[] h, float[] shen) { @@ -663,21 +743,19 @@ static void shape_conv(float[] h, float[] shen) { float h3 = h[3]; float h4 = h[4]; - for (int j = 0; j < Constants.NCWD; j++) { + for (int j = 0; j < NCWD; j++) { float energy = 0; float tmp = h0 * cb_shape[j][0]; energy += tmp * tmp; tmp = h0 * cb_shape[j][1] + h1 * cb_shape[j][0]; energy += tmp * tmp; - tmp = h0 * cb_shape[j][2] + h1 * cb_shape[j][1] + - h2 * cb_shape[j][0]; + tmp = h0 * cb_shape[j][2] + h1 * cb_shape[j][1] + h2 * cb_shape[j][0]; energy += tmp * tmp; - tmp = h0 * cb_shape[j][3] + h1 * cb_shape[j][2] + - h2 * cb_shape[j][1] + h3 * cb_shape[j][0]; + tmp = h0 * cb_shape[j][3] + h1 * cb_shape[j][2] + h2 * cb_shape[j][1] + + h3 * cb_shape[j][0]; energy += tmp * tmp; - tmp = h0 * cb_shape[j][4] + h1 * cb_shape[j][3] + - h2 * cb_shape[j][2] + h3 * cb_shape[j][1] + - h4 * cb_shape[j][0]; + tmp = h0 * cb_shape[j][4] + h1 * cb_shape[j][3] + h2 * cb_shape[j][2] + + h3 * cb_shape[j][1] + h4 * cb_shape[j][0]; energy += tmp * tmp; shen[j] = energy; } @@ -686,9 +764,9 @@ static void shape_conv(float[] h, float[] shen) { /** Time Reversed Convolution Module -- Block 13 */ static void trev_conv(float[] h, float[] target, float[] pn) { - for (int k = 0; k < Constants.IDIM; k++) { + for (int k = 0; k < IDIM; k++) { float tmp = 0.0f; - for (int j = k; j < Constants.IDIM; j++) { + for (int j = k; j < IDIM; j++) { tmp += target[j] * h[j - k]; } pn[k] = tmp; @@ -702,11 +780,8 @@ static void trev_conv(float[] h, float[] target, float[] pn) { static void cb_excitation(int ix, float[] v) { int sx = ix >> 3; int gx = ix & 7; -//Debug.println("sx: " + sx + ", ix: " + ix + ", gx: " + gx); float gain = cb_gain[gx]; - for (int i = 0; i < Constants.IDIM; i++) { -//Debug.println("v: " + i + "/" + v.length); -Debug.println("cb_shape: " + sx + ", " + i + "/" + cb_shape.length + ", " + cb_shape[sx].length); + for (int i = 0; i < IDIM; i++) { v[i] = cb_shape[sx][i] * gain; } } @@ -723,60 +798,54 @@ private static int GTINC(float a, float b, int x) { /** */ int cb_index(float[] pn) { - float distm = Constants.BIG; + float distm = BIG; // best shape index int is = 0; // best gain index int ig = 0; - int float_pointer_shape_ptr = 0; - int float_pointer_sher_ptr = 0; - int float_pointer_pb = 0; + int shape_ptr = 0; // cb_shape + int sher_ptr = 0; // shape_energy + int pb = 0; // pn float cgm0 = cb_gain_mid_0; float cgm1 = cb_gain_mid_1; float cgm2 = cb_gain_mid_2; - float cor = 0; final int minus5 = -5; - for (int j = 0; j < Constants.NCWD; j++) { - cor = cor - cor; - float energy = shape_energy[float_pointer_sher_ptr++]; + for (int j = 0; j < NCWD; j++) { + float cor = 0.0f; + float energy = shape_energy[sher_ptr++]; float b0 = cgm0 * energy; - int p = float_pointer_shape_ptr; - float x = cb_shape[p / 5][p % 5]; - float_pointer_shape_ptr++; - float y = pn[float_pointer_pb++]; + float x = cb_shape[shape_ptr / 5][shape_ptr % 5]; + shape_ptr++; + float y = pn[pb++]; float t = x * y; - p = float_pointer_shape_ptr; - x = cb_shape[p / 5][p % 5]; - float_pointer_shape_ptr++; - y = pn[float_pointer_pb++]; + x = cb_shape[shape_ptr / 5][shape_ptr % 5]; + shape_ptr++; + y = pn[pb++]; cor += t; t = x * y; - p = float_pointer_shape_ptr; - x = cb_shape[p / 5][p % 5]; - float_pointer_shape_ptr++; - y = pn[float_pointer_pb++]; + x = cb_shape[shape_ptr / 5][shape_ptr % 5]; + shape_ptr++; + y = pn[pb++]; cor += t; t = x * y; - p = float_pointer_shape_ptr; - x = cb_shape[p / 5][p % 5]; - float_pointer_shape_ptr++; - y = pn[float_pointer_pb++]; + x = cb_shape[shape_ptr / 5][shape_ptr % 5]; + shape_ptr++; + y = pn[pb++]; cor += t; t = x * y; - p = float_pointer_shape_ptr; - x = cb_shape[p / 5][p % 5]; - float_pointer_shape_ptr++; - y = pn[float_pointer_pb++]; + x = cb_shape[shape_ptr / 5][shape_ptr % 5]; + shape_ptr++; + y = pn[pb++]; cor += t; t = x * y; cor += t; float b1 = cgm1 * energy; - float_pointer_pb += minus5; + pb += minus5; float b2 = cgm2 * energy; // current gain index int idxg = 0; @@ -806,9 +875,12 @@ int cb_index(float[] pn) { // Common ---- - /** */ + /** + * @param X dst + * @param Y src + */ private static void RCOPY(float[] X, int xofs, float[] Y, int yofs, int N) { - System.arraycopy(Y, yofs, X, xofs, N); + System.arraycopy(X, xofs, Y, yofs, N); } /** */ @@ -818,38 +890,23 @@ private static void RCOPY(float[] X, int xofs, float[] Y, int yofs, int N) { /** */ private static float CLIPP(float X, float LOW, float HIGH) { - return ((X) < (LOW) ? (LOW) : Math.min((X), (HIGH))); + return X < LOW ? LOW : Math.min(X, HIGH); } /** */ - private static void scaleSignals(float scale, - float[] a, - int offsetA, - float[] b, - int offsetB) { - for (int i = 0; i < Constants.IDIM; i++) { -// Debug.println("b: " + b.length); -// Debug.println("bi: " + offsetB + ", " + (offsetB + i)); -// Debug.println("a: " + a.length); -// Debug.println("ai: " + offsetA + ", " + (offsetA + i)); - b[offsetB + i] = scale * a[offsetA + i]; + private static void sig_scale(float scale, float[] a, int ap, float[] b, int bp) { + for (int i = 0; i < IDIM; i++) { + b[bp + i] = scale * a[ap + i]; } } /** */ private static void sub_sig(float[] A, float[] B, float[] C) { - for (int i = 0; i < Constants.IDIM; i++) { + for (int i = 0; i < IDIM; i++) { C[i] = A[i] - B[i]; } } - // Circular Buffer Register numbers for ADSP21000 - -// /** */ -// private static final float NPUT = 8; -// /** */ -// private static final float NGET = 9; - /** */ private static void ZARR(float[] A) { for (int i = A.length - 1; i >= 0 ; i--) { @@ -861,47 +918,51 @@ private static void ZARR(float[] A) { * Update obsoleted atomic array */ private void UPDATE(float[] YYY, int name) { - if (_obsolete_p[name] != 0) { + if (_obsolete_p[name]) { for (int i = YYY.length - 1; i >= 0; i--) { YYY[i] = _next[name][i]; - _obsolete_p[name] = 0; } + _obsolete_p[name] = false; } } /** * Copy L words to X from circular buffer CIRC *ending* at offset EOS. - * CL is the size of circular buffe CIRC + * CL is the size of circular buffer CIRC + * + * @param X dst + * @param CIRC circular buffer + * @param EOS offset + * @param L length + * @param CL size of circular buffer */ private static void CIRCOPY(float[] X, float[] CIRC, int EOS, int L, int CL) { int i1; int i2; int lx = 0; - if ((EOS) >= (L)) { - i1 = (EOS) - (L); - i2 = (CL); + if (EOS >= L) { + i1 = EOS - L; + i2 = CL; } else { i1 = 0; - i2 = (CL) + (EOS) - (L); + i2 = CL + EOS - L; } - for (int i = i2; i < (CL); i++) { + for (int i = i2; i < CL; i++) { X[lx++] = CIRC[i]; } - for (int i = i1; i < (EOS); i++) { + for (int i = i1; i < EOS; i++) { X[lx++] = CIRC[i]; } } -// /** get queue index of the most recent vector */ -// private float QINDEX() { -// int qx = float_pointer_vector_end; -// return qx != 0 ? QSIZE - Constants.IDIM : qx - Constants.IDIM; -// } + synchronized void NEXT_FFASE() { ffase = ffase == 4 ? 1 : ffase + 1; } + +//#endregion - // DMain ---- +//#region DMain /** */ - private boolean postfiltering_p = false; + boolean postfiltering_p = false; /** Index of the start of the decoded speech vector */ private int d_vec_start; @@ -913,122 +974,116 @@ private static void CIRCOPY(float[] X, float[] CIRC, int EOS, int L, int CL) { private int w_vec_end; /** */ - private volatile boolean decoder_done = false; - - /** */ - void decoder() throws IOException { - Arrays.fill(thequeue, 0); - init_decoder(); - for (w_vec_start = 0; !decoder_done; w_vec_start += Constants.IDIM) { + void decoder(short[] in, short[] out) { + assert in.length < QSIZE / IDIM; + for (int inp = 0; inp < in.length; inp++) { if (w_vec_start >= QSIZE) { w_vec_start = 0; } w_vec_end = w_vec_start; - float_pointer_vector_end = w_vec_end; - decode_vector(false); - w_vec_end = w_vec_start + Constants.IDIM; - if (!decoder_done) { - if (w_vec_end >= QSIZE) { - w_vec_end = 0; - } - write_sound_buffer(Constants.IDIM, thequeue, w_vec_end); - adapt_decoder(); + vector_end = w_vec_end; + decode_vector(false, in[inp]); + w_vec_end = w_vec_start + IDIM; + if (w_vec_end >= QSIZE) { + w_vec_end = 0; } + write_sound_buffer(IDIM, thequeue, w_vec_end, out, inp * IDIM); + adapt_decoder(); + + w_vec_start += IDIM; } } /** */ - private void init_decoder() { + void init_decoder() { + this.ffase = 1; + // init_bsf_adapter(sf_coeff); _next[SF_COEFF][0] = 1.0f; - _obsolete_p[SF_COEFF] = 0; + _obsolete_p[SF_COEFF] = false; init_gain_adapter(gp_coeff); init_gain_buf(); _next[GP_COEFF][0] = 1.0f; _next[GP_COEFF][1] = -1.0f; - _obsolete_p[GP_COEFF] = 0; + _obsolete_p[GP_COEFF] = false; init_output(); - float_pointer_vector_end = 0; // thequeue + vector_end = 0; // thequeue + // + Arrays.fill(thequeue, 0); + w_vec_start = 0; } - /** */ - private void decode_vector(boolean ignore) throws IOException { - // Computed Codebook Index - int ix; - // Log Gains INdex - int lgx; - float[] zero_response = new float[Constants.IDIM]; - float[] cb_vec = new float[Constants.IDIM]; - float[] pf_speech = new float[Constants.IDIM]; - float[] qs = new float[Constants.NUPDATE * Constants.IDIM]; - - float gain = 1.0f; - w_vec_end = float_pointer_vector_end; - d_vec_start = w_vec_end + Constants.IDIM; + private final float[] _decode_vector_zero_response = new float[IDIM]; + private final float[] _decode_vector_cb_vec = new float[IDIM]; + private final float[] _decode_vector_pf_speech = new float[IDIM]; + private float _decode_vector_gain = 1.0f; + + /** @param ix Computed Codebook Index */ + private void decode_vector(boolean ignore, int ix) { + float[] qs = new float[NUPDATE * IDIM]; + + w_vec_end = vector_end; + d_vec_start = w_vec_end + IDIM; if (d_vec_start >= QSIZE) { d_vec_start -= QSIZE; } - ix = get_index(); -//Debug.println("ix: " + ix); - if (ix < 0) { -Debug.println("decoder_done"); - decoder_done = true; // TODO even though it's eof, just flag it? - } UPDATE(sf_coeff, SF_COEFF); - zresp(zero_response); - cb_excitation(ix, cb_vec); + zresp(_decode_vector_zero_response); + cb_excitation(ix, _decode_vector_cb_vec); UPDATE(gp_coeff, GP_COEFF); - gain = predict_gain(); - scaleSignals(gain, cb_vec, 0, qspeech, d_vec_start); - lgx = d_vec_start / Constants.IDIM; + _decode_vector_gain = predict_gain(); + sig_scale(_decode_vector_gain, _decode_vector_cb_vec, 0, qspeech, d_vec_start); + // Log Gains INdex + int lgx = d_vec_start / IDIM; update_gain(qspeech, d_vec_start, log_gains, lgx); mem_update(qspeech, d_vec_start, synspeech, d_vec_start); - d_vec_end = d_vec_start + Constants.IDIM; + d_vec_end = d_vec_start + IDIM; if (d_vec_end >= QSIZE) { d_vec_end -= QSIZE; } if (postfiltering_p) { inv_filter(synspeech, d_vec_start); - if (ffase.get() == 3) { - CIRCOPY(qs, synspeech, d_vec_end, Constants.NUPDATE * Constants.IDIM, QSIZE); + if (ffase == 3) { + CIRCOPY(qs, synspeech, d_vec_end, NUPDATE * IDIM, QSIZE); psf_adapter(qs); } - if (ffase.get() == 1) { + if (ffase == 1) { compute_sh_coeff(); } - postfilter(synspeech, d_vec_start, pf_speech, 0); - RCOPY(pf_speech, 0, thequeue, d_vec_start, Constants.IDIM); + postfilter(synspeech, d_vec_start, _decode_vector_pf_speech, 0); + RCOPY(_decode_vector_pf_speech, 0, thequeue, d_vec_start, IDIM); } else { - RCOPY(synspeech, d_vec_start, thequeue, d_vec_start, Constants.IDIM); + RCOPY(synspeech, d_vec_start, thequeue, d_vec_start, IDIM); } - // declare array and its copy together with a semafor - ffase.set(ffase.get() == 4 ? 1 : ffase.get() + 1); + // declare array and its copy together with a semaphore + NEXT_FFASE(); } /** */ void adapt_decoder() { - float[] synth = new float[Constants.NUPDATE * Constants.IDIM]; - float[] lg = new float[Constants.NUPDATE]; - // gain index - int gx; + float[] synth = new float[NUPDATE * IDIM]; + float[] lg = new float[NUPDATE]; - if (ffase.get() == 1) { - CIRCOPY(synth, synspeech, d_vec_end, Constants.NUPDATE * Constants.IDIM, QSIZE); + if (ffase == 1) { + CIRCOPY(synth, synspeech, d_vec_end, NUPDATE * IDIM, QSIZE); bsf_adapter(synth, _next[SF_COEFF]); } - if (ffase.get() == 2) { - gx = d_vec_end / Constants.IDIM; - CIRCOPY(lg, log_gains, gx, Constants.NUPDATE, QSIZE / Constants.IDIM); + if (ffase == 2) { + // gain index + int gx = d_vec_end / IDIM; + CIRCOPY(lg, log_gains, gx, NUPDATE, QSIZE / IDIM); gain_adapter(lg, _next[GP_COEFF]); - _obsolete_p[GP_COEFF] = 1; + _obsolete_p[GP_COEFF] = true; } - if (ffase.get() == 3) { - _obsolete_p[SF_COEFF] = 1; + if (ffase == 3) { + _obsolete_p[SF_COEFF] = true; } } - // Data ---- +//#endregion + +//#region Data /** */ private static final float[][] cb_shape = { @@ -1278,101 +1333,30 @@ void adapt_decoder() { static final float B2 = -0.0069956244f; static final float B3 = 0.0357081667f; - // Fast ---- +//#endregion - /** */ - static void PROD5(float[] A, float[] B, float R) { - int float_pointer_pa = 0; - int float_pointer_pb = 0; - float x = A[float_pointer_pa++]; - float y = B[float_pointer_pb++]; - R = R - R; - float t = x * y; - x = A[float_pointer_pa++]; - y = B[float_pointer_pb++]; - R += t; - t = x * y; - x = A[float_pointer_pa++]; - y = B[float_pointer_pb++]; - R += t; - t = x * y; - x = A[float_pointer_pa++]; - y = B[float_pointer_pb++]; - R += t; - t = x * y; - x = A[float_pointer_pa++]; - y = B[float_pointer_pb++]; - R += t; - t = x * y; - R += t; - } - - /** - * Autocorrelation : R[0:K] is autocorrelation of X[M:N-1] i.e. - * R[k] = Sum X[i]*X[i-k] for M<=i= 2. * computes sum(x[i] * y[i]) */ - static float DOTPROD(float[] X, int xofs, float[] Y, int yofs, int N) { - float r = 0; - int float_pointer_xp = xofs; - int float_pointer_yp = yofs; - float x1 = X[float_pointer_xp++]; - float y1 = Y[float_pointer_yp++]; - float t = x1 * y1; - x1 = X[float_pointer_xp++]; - y1 = Y[float_pointer_yp++]; - for (int i = 0; i < N - 2; i++) { - r += t; - t = x1 * y1; - x1 = X[float_pointer_xp++]; - y1 = Y[float_pointer_yp++]; - } - r += t; - t = x1 * y1; - r += t; - return r; + static float DOTPROD(float[] X, int xp, float[] Y, int yp, int N) { + float sum = 0; + for (int i = 0; i < N; i++) { + sum += X[xp + i] * Y[yp + i]; + } + return sum; } - // Filters ---- +//#endregion + +//#region Filters /** */ - private final float[] firmem = new float[Constants.LPCW + Constants.IDIM]; + private final float[] firmem = new float[LPCW + IDIM]; /** */ - private final float[] iirmem = new float[Constants.LPCW + Constants.IDIM]; + private final float[] iirmem = new float[LPCW + IDIM]; /** */ - void pwfilter2(float[] input, int offset, float[] output) { + void pwfilter2(float[] input, int ip, float[] output) { - RSHIFT(firmem, Constants.LPCW, Constants.IDIM); - for (int k = 0; k < Constants.IDIM; k++) { - firmem[k] = input[offset + Constants.IDIM - 1 - k]; + RSHIFT(firmem, LPCW, IDIM); + for (int k = 0; k < IDIM; k++) { + firmem[k] = input[ip + IDIM - 1 - k]; } - RSHIFT(iirmem, Constants.LPCW, Constants.IDIM); + RSHIFT(iirmem, LPCW, IDIM); - for (int k = 0; k < Constants.IDIM; k++) { + for (int k = 0; k < IDIM; k++) { // pwf_z_coeff[0] is always 1.0 - float out = firmem[Constants.IDIM - 1 - k]; - out += DOTPROD(firmem, Constants.IDIM - k, pwf_z_coeff, 1, Constants.LPCW); - out -= DOTPROD(iirmem, Constants.IDIM - k, pwf_p_coeff, 1, Constants.LPCW); - iirmem[Constants.IDIM - 1 - k] = out; + float out = firmem[IDIM - 1 - k]; + out += DOTPROD(firmem, IDIM - k, pwf_z_coeff, 1, LPCW); + out -= DOTPROD(iirmem, IDIM - k, pwf_p_coeff, 1, LPCW); + iirmem[IDIM - 1 - k] = out; output[k] = out; } } @@ -1430,30 +1403,30 @@ void pwfilter2(float[] input, int offset, float[] output) { // Synthesis and Perceptual Weighting Filter. /** */ - float[] statelpc = new float[Constants.LPC + Constants.IDIM]; + final float[] statelpc = new float[LPC + IDIM]; /** */ - float[] zirwfir = new float[Constants.LPCW]; + final float[] zirwfir = new float[LPCW]; /** */ - float[] zirwiir = new float[Constants.LPCW]; + final float[] zirwiir = new float[LPCW]; /** Updateable coefficients */ void sf_zresp(float[] output) { // This is un-pipelined version of the above. Kept for reference - for (int j = Constants.LPC - 1; j >= 0; j--) { - statelpc[j + Constants.IDIM] = statelpc[j]; - } - for (int k = 0; k < Constants.IDIM; k++) { - float out = 0.0f, sj, aj; - sj = statelpc[Constants.LPC + Constants.IDIM - k - 1]; - aj = sf_coeff[Constants.LPC]; - for (int j = Constants.LPC - 2; j >= 1; j--) { + for (int j = LPC - 1; j >= 0; j--) { + statelpc[j + IDIM] = statelpc[j]; + } + for (int k = 0; k < IDIM; k++) { + float out = 0.0f; + float sj = statelpc[LPC + IDIM - k - 1]; + float aj = sf_coeff[LPC]; + for (int j = LPC - 2; j >= 1; j--) { out -= sj * aj; - sj = statelpc[Constants.IDIM - k + j]; + sj = statelpc[IDIM - k + j]; aj = sf_coeff[j + 1]; } - output[k] = out - sj * aj - statelpc[Constants.IDIM - k] * sf_coeff[1]; - statelpc[Constants.IDIM - 1 - k] = output[k]; + output[k] = out - sj * aj - statelpc[IDIM - k] * sf_coeff[1]; + statelpc[IDIM - 1 - k] = output[k]; } } @@ -1461,15 +1434,15 @@ void sf_zresp(float[] output) { void pwf_zresp(float[] input, float[] output) { // Un-pipelined version, kept for reference - for (int k = 0; k < Constants.IDIM; k++) { + for (int k = 0; k < IDIM; k++) { float tmp = input[k]; - for (int j = Constants.LPCW - 1; j >= 1; j--) { + for (int j = LPCW - 1; j >= 1; j--) { input[k] += zirwfir[j] * pwf_z_coeff[j + 1]; zirwfir[j] = zirwfir[j - 1]; } input[k] += zirwfir[0] * pwf_z_coeff[1]; zirwfir[0] = tmp; - for (int j = Constants.LPCW - 1; j >= 1; j--) { + for (int j = LPCW - 1; j >= 1; j--) { input[k] -= zirwiir[j] * pwf_p_coeff[j + 1]; zirwiir[j] = zirwiir[j - 1]; } @@ -1480,77 +1453,77 @@ void pwf_zresp(float[] input, float[] output) { /** */ void zresp(float[] output) { - float[] temp = new float[Constants.IDIM]; + float[] temp = new float[IDIM]; sf_zresp(temp); pwf_zresp(temp, output); } - void mem_update(float[] input, int inofs, float[] output, int outofs) { - float[] temp = new float[Constants.IDIM]; - int float_pointer_t2 = 0; // zirwfir - zirwfir[float_pointer_t2] = temp[0] = input[inofs]; - for (int k = 1; k < Constants.IDIM; k++) { - float a0 = input[inofs + k]; + void mem_update(float[] input, int inp, float[] output, int outp) { + float[] temp = new float[IDIM]; + int t2 = 0; // zirwfir + zirwfir[t2] = temp[0] = input[inp]; + for (int k = 1; k < IDIM; k++) { + float a0 = input[inp + k]; float a1 = 0.0f; float a2 = 0.0f; for (int i = k; i >= 1; i--) { - zirwfir[float_pointer_t2 + i] = zirwfir[float_pointer_t2 + i - 1]; + zirwfir[t2 + i] = zirwfir[t2 + i - 1]; temp[i] = temp[i - 1]; - a0 -= sf_coeff[i] * zirwfir[float_pointer_t2 + i]; - a1 += pwf_z_coeff[i] * zirwfir[float_pointer_t2 + i]; + a0 -= sf_coeff[i] * zirwfir[t2 + i]; + a1 += pwf_z_coeff[i] * zirwfir[t2 + i]; a2 -= pwf_p_coeff[i] * temp[i]; } - zirwfir[float_pointer_t2] = a0; + zirwfir[t2] = a0; temp[0] = a0 + a1 + a2; } - for (int k = 0; k < Constants.IDIM; k++) { - statelpc[k] += zirwfir[float_pointer_t2 + k]; - if (statelpc[k] > Constants.MAX) { - statelpc[k] = Constants.MAX; + for (int k = 0; k < IDIM; k++) { + statelpc[k] += zirwfir[t2 + k]; + if (statelpc[k] > MAX) { + statelpc[k] = MAX; } - else if (statelpc[k] < Constants.MIN) { - statelpc[k] = Constants.MIN; + else if (statelpc[k] < MIN) { + statelpc[k] = MIN; } zirwiir[k] += temp[k]; } - System.arraycopy(statelpc, 0, zirwfir, 0, Constants.LPCW); - for (int k = 0; k < Constants.IDIM; k++) { - output[outofs + k] = statelpc[Constants.IDIM - 1 - k]; + System.arraycopy(statelpc, 0, zirwfir, 0, LPCW); + for (int k = 0; k < IDIM; k++) { + output[outp + k] = statelpc[IDIM - 1 - k]; } } // The Gain Predictor - private final float[] gain_input = new float[Constants.LPCLG]; + private final float[] gain_input = new float[LPCLG]; /** */ - private static float log_rms(float[] input, int offset) { + private static float log_rms(float[] input, int inp) { float etrms = 0.0f; - for (int k = offset; k < Constants.IDIM; k++) { - etrms += input[k] * input[k]; + for (int k = 0; k < IDIM; k++) { + etrms += input[inp + k] * input[inp + k]; } - etrms /= Constants.IDIM; - if (etrms < 1.0) { + etrms /= IDIM; + if (etrms < 1.0f) { etrms = 1.0f; } - etrms = 10.0f * (float) (Math.log(etrms) / Math.log(10)); + etrms = 10.0f * (float) Math.log10(etrms); return etrms; } /** */ float predict_gain() { - float new_gain = Constants.GOFF; + float new_gain = GOFF; float temp; - for (int i = 1; i <= Constants.LPCLG; i++) { - temp = gp_coeff[i] * gain_input[Constants.LPCLG - i]; + for (int i = 1; i <= LPCLG; i++) { + temp = gp_coeff[i] * gain_input[LPCLG - i]; new_gain -= temp; } - if (new_gain < 0.0) { + if (new_gain < 0.0f) { new_gain = 0.0f; } - if (new_gain > 60.0) { + if (new_gain > 60.0f) { new_gain = 60.0f; } new_gain = (float) Math.pow(10, 0.05f * new_gain); @@ -1558,43 +1531,40 @@ float predict_gain() { } /** */ - void update_gain(float[] input, - int offset, - float[] lgp, - int float_pointer_lgp) { + void update_gain(float[] input, int inp, float[] lgp, int lgpP) { - lgp[float_pointer_lgp] = log_rms(input, offset) - Constants.GOFF; - for (int i = 0; i < Constants.LPCLG - 1; i++) { + lgp[lgpP] = log_rms(input, inp) - GOFF; + for (int i = 0; i < LPCLG - 1; i++) { gain_input[i] = gain_input[i + 1]; } - gain_input[Constants.LPCLG - 1] = lgp[float_pointer_lgp]; + gain_input[LPCLG - 1] = lgp[lgpP]; } /** */ void init_gain_buf() { - Arrays.fill(gain_input, -Constants.GOFF); - for (int i = 0; i < QSIZE / Constants.IDIM; i++) { - log_gains[i] = -Constants.GOFF; + Arrays.fill(gain_input, -GOFF); + for (int i = 0; i < QSIZE / IDIM; i++) { + log_gains[i] = -GOFF; } } // Global ---- - float[] sf_coeff = new float[Constants.LPC + 1]; - float[] gp_coeff = new float[Constants.LPCLG + 1]; - float[] pwf_z_coeff = new float[Constants.LPCW + 1]; - float[] pwf_p_coeff = new float[Constants.LPCW + 1]; - float[] shape_energy = new float[Constants.NCWD]; - float[] imp_resp = new float[Constants.IDIM]; - - float[][] _next = new float[][] { - new float[Constants.LPC + 1], - new float[Constants.LPCLG + 1], - new float[Constants.LPCW + 1], - new float[Constants.LPCW + 1], - new float[Constants.NCWD], - new float[Constants.IDIM] + final float[] sf_coeff = new float[LPC + 1]; + final float[] gp_coeff = new float[LPCLG + 1]; + final float[] pwf_z_coeff = new float[LPCW + 1]; + final float[] pwf_p_coeff = new float[LPCW + 1]; + final float[] shape_energy = new float[NCWD]; + final float[] imp_resp = new float[IDIM]; + + final float[][] _next = new float[][] { + new float[LPC + 1], + new float[LPCLG + 1], + new float[LPCW + 1], + new float[LPCW + 1], + new float[NCWD], + new float[IDIM] }; static final int SF_COEFF = 0; @@ -1604,130 +1574,64 @@ void init_gain_buf() { static final int SHAPE_ENERGY = 4; static final int IMP_RESP = 5; - int[] _obsolete_p = new int[6]; + final boolean[] _obsolete_p = new boolean[6]; static final int QSIZE = 60; /** Synthesized Speech */ - float[] synspeech = new float[QSIZE]; + final float[] synspeech = new float[QSIZE]; /** Quantized Speech */ - float[] qspeech = new float[QSIZE]; + final float[] qspeech = new float[QSIZE]; /** Logarithm of Gains */ - float[] log_gains = new float[QSIZE / Constants.IDIM]; + final float[] log_gains = new float[QSIZE / IDIM]; - AtomicInteger ffase = new AtomicInteger(-4); + volatile int ffase = -4; // IOSparc ---- /** Scaling factor for input */ float rscale = 0.125f; - String xfile_name; - - /** output file (codebook indices) */ - FileOutputStream oxfd; - /** input file */ - FileInputStream ifd; - - /** */ - String ifile_name; - - /** */ - void init_input() { - try { - ifd = new FileInputStream(ifile_name); - } catch (IOException e) { -System.err.println("Can't open \"" + ifile_name + "\"\n"); - System.exit(1); - } - try { - oxfd = new FileOutputStream(xfile_name); - } catch (IOException e) { -System.err.println("Can't open \"" + xfile_name + "\"\n"); - } - } - - /** */ - void put_index(int x) throws IOException { - oxfd.write((x & 0xff00) >> 8); - oxfd.write( x & 0x00ff); - } - - /** */ - String ofile_name; - - /** Outpu file */ - private FileOutputStream ofd; - /** Input file (codebook indices) */ - private FileInputStream ixfd; int sound_overflow = 0; - /** */ + /** for decoding */ void init_output() { sound_overflow = 0; - try { - ofd = new FileOutputStream(ofile_name); - } catch (IOException e) { -System.err.println("Can't open \"" + ofile_name + "\" for output\n"); - System.exit(1); - } - try { - ixfd = new FileInputStream(xfile_name); - } catch (IOException e) { -System.err.println("Can't open \"" + xfile_name + "\"\n"); - System.exit(3); - } - } - - /** */ - int get_index() throws IOException { - int c1 = ixfd.read(); - int c2 = ixfd.read(); - return (short) (c1 << 8 | c2); } /** Return Number of Samples Read */ - int read_sound_buffer(int n, float[] buf, int offset) throws IOException { - int c = 0; - + void read_sound_buffer(int n, short[] in, int inp, float[] out, int outp) { for (int i = 0; i < n; i++) { - int c1 = ifd.read(); - int c2 = ifd.read(); - if (c1 == -1 || c2 == -1) { - break; - } - int s = (c1 << 8) | c2; - buf[offset + c++] = rscale * s; + out[outp + i] = rscale * in[inp + i]; } - return c; } - /** */ - void write_sound_buffer(int n, float[] buf, int offset) - throws IOException { + /** for decoding */ + void write_sound_buffer(int n, float[] in, int inp, short[] out, int outp) { for (int i = 0; i < n; i++) { - float xx = buf[offset + i] / rscale; + float xx = in[inp + i] / rscale; if (xx > 0.0) { - if (xx > 32767.0) { + if (xx > 32767.0f) { xx = 32767.0f; } else { xx += 0.5f; } } else { - if (xx < -32768.0) { + if (xx < -32768.0f) { xx = -32768.0f; } else { xx -= 0.5f; } } - int s = (int) xx; - ofd.write((s & 0xff00) >> 8); - ofd.write( s & 0x00ff); + short s = (short) xx; + out[outp + i] = s; } } - // PostFil ---- +//#endregion + +//#region PostFil // Parameters from the adapter: @@ -1743,11 +1647,11 @@ void write_sound_buffer(int n, float[] buf, int offset) /** Max. Decimated Period */ private static final int DPERMAX = (Constants.KPMAX / DECIM); /** Min. Decimated Period */ - private static final int DPERMIN = (Constants.KPMIN / DECIM); - private static final int SHIFTSZ = (Constants.KPMAX + Constants.NPWSZ - Constants.NFRSZ + Constants.IDIM); + private static final int DPERMIN = (KPMIN / DECIM); + private static final int SHIFTSZ = (Constants.KPMAX + Constants.NPWSZ - NFRSZ + IDIM); /** Post-Filter Memory for syn. sp. */ - private final float[] tap_mem = new float[Constants.KPMAX + Constants.NPWSZ + Constants.IDIM]; + private final float[] tap_mem = new float[Constants.KPMAX + Constants.NPWSZ + IDIM]; /** */ int pitch_period = 50; @@ -1801,43 +1705,47 @@ void write_sound_buffer(int n, float[] buf, int offset) */ private static float vec_abs(float[] v, int offset) { float r = Math.abs(v[offset]); - for (int i = 1; i < Constants.IDIM; i++) { + for (int i = 1; i < IDIM; i++) { r += Math.abs(v[offset + i]); } return r; } + private int _inv_filter_ip = IDIM; + private final float[] _inv_filter_mem1 = new float[SPORDER + NFRSZ]; + /** Inverse Filter */ void inv_filter(float[] input, int offset) { - int ip = Constants.IDIM; - float[] mem1 = new float[SPORDER + Constants.NFRSZ]; // Shift in input into mem1 - for (int i = Constants.IDIM; i < SPORDER + Constants.IDIM; i++) { - mem1[i - Constants.IDIM] = mem1[i]; + for (int i = IDIM; i < SPORDER + IDIM; i++) { + _inv_filter_mem1[i - IDIM] = _inv_filter_mem1[i]; } - System.arraycopy(input, offset + 0, mem1, 10, Constants.IDIM); - for (int k = 0; k < Constants.IDIM; k++) { - float tmp = mem1[SPORDER+k]; + System.arraycopy(input, offset, _inv_filter_mem1, SPORDER, IDIM); + for (int k = 0; k < IDIM; k++) { + float tmp = _inv_filter_mem1[SPORDER + k]; for (int j = 1; j <= SPORDER; j++) { - tmp += mem1[SPORDER + k - j] * a10[j]; + tmp += _inv_filter_mem1[SPORDER + k - j] * a10[j]; } - fil_mem[PMSIZE - Constants.NFRSZ + ip + k] = tmp; + fil_mem[PMSIZE - NFRSZ + _inv_filter_ip + k] = tmp; } - if (ip == (Constants.NFRSZ - Constants.IDIM)) { - ip = 0; + if (_inv_filter_ip == (NFRSZ - IDIM)) { + _inv_filter_ip = 0; } else { - ip += Constants.IDIM; + _inv_filter_ip += IDIM; } } + /** Output of long term filter */ + private final float[] _postfilter_temp = new float[IDIM]; + /** Input of short term filter */ + private final float[] _postfilter_temp2 = new float[IDIM]; + + // Smoother version of scale + float _postfilter_scalefil = 1.0f; + /** */ void postfilter(float[] input, int inofs, float[] output, int outofs) { - - // Output of long term filter - float[] temp = new float[Constants.IDIM]; - // Input of short term filter - float[] temp2 = new float[Constants.IDIM]; // Gain of filtered output float new_gain; // Gain of input @@ -1845,15 +1753,12 @@ void postfilter(float[] input, int inofs, float[] output, int outofs) { // Scaling factor for gain preservation float scale; - // Smoother version of scale - float scalefil = 1.0f; - - longterm(input, inofs, temp, 0); - shortterm(temp, temp2); + longterm(input, inofs, _postfilter_temp, 0); + shortterm(_postfilter_temp, _postfilter_temp2); // Computed scale for gain preservation - new_gain = vec_abs(temp2, 0); + new_gain = vec_abs(_postfilter_temp2, 0); if (new_gain > 1.0) { input_gain = vec_abs(input, inofs); scale = input_gain / new_gain; @@ -1861,69 +1766,69 @@ void postfilter(float[] input, int inofs, float[] output, int outofs) { scale = 1.0f; } - // Smooth out scale, then scale the output + // Smooth dOut scale, then scale the output - for (int i = 0; i < Constants.IDIM; i++) { - scalefil = Constants.AGCFAC * scalefil + (1.0f - Constants.AGCFAC) * scale; - output[outofs + i] = scalefil * temp2[i]; + for (int i = 0; i < IDIM; i++) { + _postfilter_scalefil = Constants.AGCFAC * _postfilter_scalefil + (1.0f - Constants.AGCFAC) * scale; + output[outofs + i] = _postfilter_scalefil * _postfilter_temp2[i]; } } + private final float[] _longterm_lmemory = new float[Constants.KPMAX]; + /** */ private void longterm(float[] input, int inofs, float[] output, int outofs) { - float[] lmemory = new float[Constants.KPMAX]; - // Add weighted pitch_period-delayed signal - for (int i = 0; i < Constants.IDIM; i++) { - float out = pitch_tap * lmemory[Constants.KPMAX + i - pitch_period]; + for (int i = 0; i < IDIM; i++) { + float out = pitch_tap * _longterm_lmemory[Constants.KPMAX + i - pitch_period]; out += input[inofs + i]; output[outofs + i] = pitch_gain * out; } // Shift-in input to lmemory - for (int i = 0; i < Constants.KPMAX - Constants.IDIM; i++) { - lmemory[i] = lmemory[i + Constants.IDIM]; + for (int i = 0; i < Constants.KPMAX - IDIM; i++) { + _longterm_lmemory[i] = _longterm_lmemory[i + IDIM]; } - System.arraycopy(input, inofs + 0, lmemory, 135, Constants.IDIM); + System.arraycopy(input, inofs + 0, _longterm_lmemory, 135, IDIM); } + private final float[] _shortterm_shpmem = new float[SPORDER]; + private final float[] _shortterm_shzmem = new float[SPORDER]; + /** * Again, memories (shpmem, shzmem) are in reverse order, * i.e. [0] is the oldest. */ private void shortterm(float[] input, float[] output) { - float[] shpmem = new float[SPORDER]; - float[] shzmem = new float[SPORDER]; - - for (int k = 0; k < Constants.IDIM; k++) { + for (int k = 0; k < IDIM; k++) { // FIR Part float in = input[k]; float out = in; for (int j = SPORDER - 1; j >= 1; j--) { - out += shzmem[j] * shzcoef[j + 1]; - shzmem[j] = shzmem[j - 1]; + out += _shortterm_shzmem[j] * shzcoef[j + 1]; + _shortterm_shzmem[j] = _shortterm_shzmem[j - 1]; } - out += shzmem[0] * shzcoef[1]; - shzmem[0] = in; + out += _shortterm_shzmem[0] * shzcoef[1]; + _shortterm_shzmem[0] = in; // IIR Part for (int j = SPORDER - 1; j >= 1; j--) { - out -= shpmem[j] * shpcoef[j + 1]; - shpmem[j] = shpmem[j - 1]; + out -= _shortterm_shpmem[j] * shpcoef[j + 1]; + _shortterm_shpmem[j] = _shortterm_shpmem[j - 1]; } - out -= shpmem[0] * shpcoef[1]; - shpmem[0] = out; - output[k] = out+tiltz*shpmem[1]; + out -= _shortterm_shpmem[0] * shpcoef[1]; + _shortterm_shpmem[0] = out; + output[k] = out+tiltz*_shortterm_shpmem[1]; } } /** - * Postfilter Adapter + * Post-filter Adapter */ void psf_adapter(float[] frame) { @@ -1934,10 +1839,10 @@ void psf_adapter(float[] frame) { float corr_per = 0.0f; // Shift old memory for (int i = 0; i < SHIFTSZ; i++) { - tap_mem[i] = tap_mem[i + Constants.NFRSZ]; + tap_mem[i] = tap_mem[i + NFRSZ]; } // Shift new frame into memory - System.arraycopy(frame, 0, tap_mem, 225, Constants.NFRSZ); + System.arraycopy(frame, 0, tap_mem, 225, NFRSZ); for (int i = Constants.KPMAX - pitch_period; i < (Constants.KPMAX - pitch_period + Constants.NPWSZ); @@ -1979,7 +1884,7 @@ private static int best_period(float[] buffer, int pmin, int pmax) { int best_per = -1; - float best_corr = -Constants.BIG; + float best_corr = -BIG; for (int per = pmin; per < pmax; per++) { float corr = 0.0f; for (int i = pmax; i < buflen; i++) { @@ -1994,7 +1899,7 @@ private static int best_period(float[] buffer, } /** size of decimated frame */ - private static final int DCFRSZ = Constants.NFRSZ / DECIM; + private static final int DCFRSZ = NFRSZ / DECIM; /** */ private int extract_pitch() { @@ -2007,29 +1912,26 @@ private int extract_pitch() { // Limits for search of best period int permin; int permax; - float best_corr = -Constants.BIG; - float best_old_corr = -Constants.BIG; + float best_corr = -BIG; + float best_old_corr = -BIG; float tap0 = 0.0f; float tap1 = 0.0f; - int old_per = (Constants.KPMIN + Constants.KPMAX) >> 1; + int old_per = (KPMIN + Constants.KPMAX) >> 1; float[] fil_decim_mem = new float[PDMSIZE]; - float[] fil_out_mem = new float[Constants.NFRSZ + DECIM]; + float[] fil_out_mem = new float[NFRSZ + DECIM]; // Shift decimated filtered output -//Debug.println("DCFRSZ: " + DCFRSZ + ", PDMSIZE: " + PDMSIZE); for (int i = DCFRSZ; i < PDMSIZE; i++) { -// Debug.println("fil_decim_mem: " + (i - DCFRSZ) + "/" + fil_decim_mem.length); -// Debug.println("fil_out_mem: " + i + "/" + fil_out_mem.length); fil_decim_mem[i - DCFRSZ] = fil_decim_mem[i]; } - // Filter and decimate input + // Filter and decimate input int decim_phase = 0; int dk = 0; - for (int k = 0; k < Constants.NFRSZ; k++) { + for (int k = 0; k < NFRSZ; k++) { float tmp; - tmp = fil_mem[PMSIZE - Constants.NFRSZ + k] - + tmp = fil_mem[PMSIZE - NFRSZ + k] - A1 * fil_out_mem[2] - A2 * fil_out_mem[1] - A3 * fil_out_mem[0]; @@ -2052,18 +1954,18 @@ private int extract_pitch() { best_dper = best_period(fil_decim_mem, PDMSIZE, DPERMIN, DPERMAX); - // Now fine-tune the best correlation on undecimated domain + // Now fine-tune the best correlation on undecimated domain permin = best_dper * DECIM - DECIM + 1; permax = best_dper * DECIM + DECIM - 1; if (permax > Constants.KPMAX) { permax = Constants.KPMAX; } - if (permin < Constants.KPMIN) { - permin = Constants.KPMIN; + if (permin < KPMIN) { + permin = KPMIN; } - best_corr = -Constants.BIG; + best_corr = -BIG; for (int per = permin; per <= permax; per++) { float corr = 0.0f; for (int i = 1, j = (per + 1); i <= Constants.NPWSZ; i++, j++) { @@ -2084,11 +1986,11 @@ private int extract_pitch() { // Now compute the best period around the old period permin = old_per - Constants.KPDELTA; - if (permin < Constants.KPMIN) { - permin = Constants.KPMIN; + if (permin < KPMIN) { + permin = KPMIN; } - best_old_corr = -Constants.BIG; + best_old_corr = -BIG; for (int per = permin; per <= permax; per++) { float corr = 0.0f; for (int i = 1, j = (per + 1); i <= Constants.NPWSZ; i++, j++) { @@ -2125,8 +2027,8 @@ private int extract_pitch() { // Shift fil_mem - for (int i = Constants.NFRSZ; i < PMSIZE; i++) { - fil_mem[i - Constants.NFRSZ] = fil_mem[i]; + for (int i = NFRSZ; i < PMSIZE; i++) { + fil_mem[i - NFRSZ] = fil_mem[i]; } old_per = best_per; @@ -2141,4 +2043,6 @@ static void init_postfilter() { shpscale[i] = Constants.SPFPCF * shpscale[i - 1]; } } + +//#endregion } diff --git a/src/main/java/vavi/sound/ldcelp/readme.md b/src/main/java/vavi/sound/ldcelp/readme.md index d8bc02d..3410c8b 100644 --- a/src/main/java/vavi/sound/ldcelp/readme.md +++ b/src/main/java/vavi/sound/ldcelp/readme.md @@ -4,6 +4,9 @@ Provides G.728 LD-CELP sound related classes. ## References + * https://github.com/ging/isabel/tree/master/lib/aCodecs/src/codecs/g728 (c++) + * https://github.com/ufwt/windows-XP-SP1/tree/master/XPSP1/NT/multimedia/dshow/filters.ks/tests/iphone (nearest of original) + ### License ``` @@ -21,5 +24,4 @@ Provides G.728 LD-CELP sound related classes. ## TODO -* complete - +* ~~complete~~ diff --git a/src/main/java/vavi/sound/mfi/ittake/IttakeMidiConverter.java b/src/main/java/vavi/sound/mfi/ittake/IttakeMidiConverter.java index 2baa598..2d702f4 100644 --- a/src/main/java/vavi/sound/mfi/ittake/IttakeMidiConverter.java +++ b/src/main/java/vavi/sound/mfi/ittake/IttakeMidiConverter.java @@ -51,24 +51,20 @@ public class IttakeMidiConverter implements MidiConverter { "MIDItoMLD", "Version 1.01") {}; - /** */ @Override public MfiDevice.Info getDeviceInfo() { return info; } - /* */ @Override public void close() { } - /* */ @Override public boolean isOpen() { return true; } - /* */ @Override public void open() { } diff --git a/src/main/java/vavi/sound/midi/jsyn/JSynMidiDeviceProvider.java b/src/main/java/vavi/sound/midi/jsyn/JSynMidiDeviceProvider.java index dcb962d..8a04c50 100644 --- a/src/main/java/vavi/sound/midi/jsyn/JSynMidiDeviceProvider.java +++ b/src/main/java/vavi/sound/midi/jsyn/JSynMidiDeviceProvider.java @@ -28,7 +28,6 @@ public class JSynMidiDeviceProvider extends MidiDeviceProvider { /** */ private static final MidiDevice.Info[] infos = new MidiDevice.Info[] { JSynSynthesizer.info }; - /* */ @Override public MidiDevice.Info[] getDeviceInfo() { return infos; diff --git a/src/main/java/vavi/sound/midi/jsyn/JSynOscillator.java b/src/main/java/vavi/sound/midi/jsyn/JSynOscillator.java index 35f162a..8222720 100644 --- a/src/main/java/vavi/sound/midi/jsyn/JSynOscillator.java +++ b/src/main/java/vavi/sound/midi/jsyn/JSynOscillator.java @@ -37,7 +37,7 @@ public class JSynOscillator extends ModelAbstractOscillator { /** */ public class JSynInstrument extends SimpleInstrument { - UnitVoice data; + final UnitVoice data; protected JSynInstrument(int bank, int program, boolean isPercussion, String name, UnitVoice data) { setName(JSynOscillator.this.getName()); add(getPerformer()); @@ -57,7 +57,7 @@ public Object getData() { } static class VoiceDescriptionAdapter extends VoiceDescription { - UnitVoice unitVoice; + final UnitVoice unitVoice; public VoiceDescriptionAdapter(UnitVoice unitVoice) { super(unitVoice.getClass().getSimpleName(), new String[] { unitVoice.getClass().getSimpleName() }); this.unitVoice = unitVoice; diff --git a/src/main/java/vavi/sound/midi/jsyn/JSynSoundbank.java b/src/main/java/vavi/sound/midi/jsyn/JSynSoundbank.java index 795edf4..c8415d9 100644 --- a/src/main/java/vavi/sound/midi/jsyn/JSynSoundbank.java +++ b/src/main/java/vavi/sound/midi/jsyn/JSynSoundbank.java @@ -78,7 +78,7 @@ public Instrument getInstrument(Patch patch) { /** */ public static class JSynInstrument extends Instrument { - UnitVoice data; + final UnitVoice data; protected JSynInstrument(JSynSoundbank sounBbank, int bank, int program, String name, UnitVoice data) { super(sounBbank, new Patch(bank, program), name, VoiceDescriptionAdapter.class); this.data = data; @@ -91,7 +91,7 @@ public Object getData() { } static class VoiceDescriptionAdapter extends VoiceDescription { - UnitVoice unitVoice; + final UnitVoice unitVoice; public VoiceDescriptionAdapter(UnitVoice unitVoice) { super(unitVoice.getClass().getSimpleName(), new String[] { unitVoice.getClass().getSimpleName() }); this.unitVoice = unitVoice; diff --git a/src/main/java/vavi/sound/midi/opl3/Opl3MidiDeviceProvider.java b/src/main/java/vavi/sound/midi/opl3/Opl3MidiDeviceProvider.java index 218eef4..643d48d 100644 --- a/src/main/java/vavi/sound/midi/opl3/Opl3MidiDeviceProvider.java +++ b/src/main/java/vavi/sound/midi/opl3/Opl3MidiDeviceProvider.java @@ -28,7 +28,6 @@ public class Opl3MidiDeviceProvider extends MidiDeviceProvider { /** */ private static final MidiDevice.Info[] infos = new MidiDevice.Info[] { Opl3Synthesizer.info }; - /* */ @Override public MidiDevice.Info[] getDeviceInfo() { return infos; diff --git a/src/main/java/vavi/sound/midi/opl3/Opl3MidiFileReader.java b/src/main/java/vavi/sound/midi/opl3/Opl3MidiFileReader.java index 916abf7..f493dec 100644 --- a/src/main/java/vavi/sound/midi/opl3/Opl3MidiFileReader.java +++ b/src/main/java/vavi/sound/midi/opl3/Opl3MidiFileReader.java @@ -46,6 +46,5 @@ public OplSequence(float divisionType, int resolution) throws InvalidMidiDataExc super(divisionType, resolution); // TODO Auto-generated constructor stub } - } } diff --git a/src/main/java/vavi/sound/midi/opl3/Opl3Soundbank.java b/src/main/java/vavi/sound/midi/opl3/Opl3Soundbank.java index 8bc0092..af6e4c9 100644 --- a/src/main/java/vavi/sound/midi/opl3/Opl3Soundbank.java +++ b/src/main/java/vavi/sound/midi/opl3/Opl3Soundbank.java @@ -83,7 +83,7 @@ public static Opl3Instrument newInstrument(int bank, int program, String name, i /** */ public static class Opl3Instrument extends Instrument { - int[] data; + final int[] data; protected Opl3Instrument(Opl3Soundbank sounBbank, int bank, int program, String name, int[] data) { super(sounBbank, new Patch(bank, program), name, int[].class); this.data = data; diff --git a/src/main/java/vavi/sound/midi/opl3/Opl3Synthesizer.java b/src/main/java/vavi/sound/midi/opl3/Opl3Synthesizer.java index 2c10f33..9c09cbf 100644 --- a/src/main/java/vavi/sound/midi/opl3/Opl3Synthesizer.java +++ b/src/main/java/vavi/sound/midi/opl3/Opl3Synthesizer.java @@ -106,6 +106,8 @@ public class Opl3Synthesizer implements Synthesizer { // ---- + private FileType type; + private Adlib adlib; private Opl3Soundbank soundBank; @@ -181,6 +183,7 @@ public void open(FileType type, Adlib.Writer writer) throws MidiUnavailableExcep } Debug.println("type: " + type); + this.type = type; type.midiTypeFile.init(new Context()); adlib.reset(); @@ -414,10 +417,9 @@ public void noteOn(int noteNumber, int velocity) { ++percussions[i].volume; } - int voice; + int voice = -1; if (channel < 11 || adlib.mode == Adlib.MELODIC) { boolean f = false; - voice = -1; int onl = 0; for (int i = 0; i < numchan; ++i) { @@ -453,24 +455,7 @@ public void noteOn(int noteNumber, int velocity) { adlib.percussion(channel, ins); } - int nv; - if ((adlib.style & Adlib.MIDI_STYLE) != 0) { - nv = voiceStatus[channel].volume * velocity / 128; - if ((adlib.style & Adlib.LUCAS_STYLE) != 0) { - nv *= 2; - } - - if (nv > 127) { - nv = 127; - } - - nv = Adlib.my_midi_fm_vol_table[nv]; - if ((adlib.style & Adlib.LUCAS_STYLE) != 0) { - nv = (int) ((float) Math.sqrt((nv)) * 11.0F); - } - } else { - nv = velocity; - } + int nv = type.midiTypeFile.nativeVelocity(channel, velocity); adlib.playNote(voice, noteNumber + nshift, nv * 2); @@ -482,21 +467,29 @@ public void noteOn(int noteNumber, int velocity) { adlib.write(0xbd, adlib.read(0xbd) & ~(16 >> (channel - 11))); adlib.write(0xbd, adlib.read(0xbd) | 16 >> (channel - 11)); } - } else if (velocity == 0) { // same code as end note - for (int i = 0; i < 9; ++i) { - if (percussions[i].channel == channel && percussions[i].note == noteNumber) { - adlib.endNote(i); - percussions[i].channel = -1; + } else { + if (velocity == 0) { // same code as end note + if (adlib.mode == Adlib.RYTHM && channel >= 11) { + // Turn off the percussion instrument + adlib.write(0xbd, adlib.read((0xbd) & ~(0x10 >> (channel - 11)))); + // midi_fm_endnote(percussion_map[c]); + percussions[Adlib.percussion_map[channel - 11]].channel = -1; + } else { + for (int i = 0; i < 9; ++i) { + if (percussions[i].channel == channel && percussions[i].note == noteNumber) { + adlib.endNote(i); + percussions[i].channel = -1; + } + } } + } else { // i forget what this is for. + percussions[voice].channel = -1; + percussions[voice].volume = 0; } - } else { // i forget what this is for. - percussions[voice].channel = -1; - percussions[voice].volume = 0; } - - logger.fine(String.format("note on[%d]: %d %d %d", channel, inum, noteNumber, velocity)); +logger.finest(String.format("note on[%d]: (%d %d) %d", channel, inum, noteNumber, velocity)); } else { - logger.fine("note is off"); +logger.finer("note is off"); } // voiceStatus[channel].note = noteNumber; @@ -544,22 +537,16 @@ public int getChannelPressure() { @Override public void controlChange(int controller, int value) { switch (controller) { - case 0x07: // channel volume - voiceStatus[channel].volume = value; - logger.fine(String.format("control change[%d]: vol(%02x): %d", channel, controller, value)); - break; - case 0x67: // 103: undefined - logger.fine(String.format("control change[%d]: (%02x): %d", channel, controller, value)); - if ((adlib.style & Adlib.CMF_STYLE) != 0) { - adlib.mode = value; - if (adlib.mode == Adlib.RYTHM) { - adlib.write(0xbd, adlib.read(0xbd) | (1 << 5)); - } else { - adlib.write(0xbd, adlib.read(0xbd) & ~(1 << 5)); - } + case 0x07 -> { // channel volume + voiceStatus[channel].volume = value; +logger.fine(String.format("control change[%d]: vol(%02x): %d", channel, controller, value)); } - break; + default -> +logger.fine(String.format("control change unhandled[%d]: (%02x): %d", channel, controller, value)); } + + type.midiTypeFile.controlChange(channel, controller, value); + // control[controller] = value; } @@ -571,8 +558,9 @@ public int getController(int controller) { @Override public void programChange(int program) { - inum = program; + inum = program & 0x7f; setIns(instruments[inum]); +logger.fine(String.format("program change[%d]: %d", channel, inum)); // voiceStatus[channel].program = program; } @@ -593,6 +581,7 @@ public int getProgram() { @Override public void setPitchBend(int bend) { + // pitchBend = bend; } @@ -682,71 +671,80 @@ public void send(MidiMessage message, long timeStamp) { throw new IllegalStateException("receiver is not open"); } - if (message instanceof ShortMessage shortMessage) { - int channel = shortMessage.getChannel(); - int command = shortMessage.getCommand(); - int data1 = shortMessage.getData1(); - int data2 = shortMessage.getData2(); - switch (command) { - case ShortMessage.NOTE_OFF: - channels[channel].noteOff(data1, data2); - break; - case ShortMessage.NOTE_ON: - channels[channel].noteOn(data1, data2); - break; - case ShortMessage.POLY_PRESSURE: - channels[channel].setPolyPressure(data1, data2); - break; - case ShortMessage.CONTROL_CHANGE: - channels[channel].controlChange(data1, data2); - break; - case ShortMessage.PROGRAM_CHANGE: - channels[channel].programChange(data1); - break; - case ShortMessage.CHANNEL_PRESSURE: - channels[channel].setChannelPressure(data1); - break; - case ShortMessage.PITCH_BEND: - channels[channel].setPitchBend(data1 | (data2 << 7)); - break; - default: -Debug.printf("unhandled short: %02X\n", command); - } - } else if (message instanceof SysexMessage sysexMessage) { - byte[] data = sysexMessage.getData(); -Debug.printf("sysex: %02X\n%s", sysexMessage.getStatus(), StringUtil.getDump(data)); - switch (data[0]) { - case 0x7f: { // Universal Realtime - int c = data[1]; // 0x7f: Disregards channel - // Sub-ID, Sub-ID2 - if (data[2] == 0x04 && data[3] == 0x01) { // Device Control / Master Volume - float gain = ((data[4] & 0x7f) | ((data[5] & 0x7f) << 7)) / 16383f; -Debug.printf("sysex volume: gain: %3.0f%n", gain * 127); - for (c = 0; c < 16; c++) { - voiceStatus[c].volume = (int) (gain * 127); // TODO doesn't work - } + switch (message) { + case ShortMessage shortMessage -> { + int channel = shortMessage.getChannel(); + int command = shortMessage.getCommand(); + int data1 = shortMessage.getData1(); + int data2 = shortMessage.getData2(); + switch (command) { + case ShortMessage.NOTE_OFF: + channels[channel].noteOff(data1, data2); + break; + case ShortMessage.NOTE_ON: + channels[channel].noteOn(data1, data2); + break; + case ShortMessage.POLY_PRESSURE: + channels[channel].setPolyPressure(data1, data2); + break; + case ShortMessage.CONTROL_CHANGE: + channels[channel].controlChange(data1, data2); + break; + case ShortMessage.PROGRAM_CHANGE: + channels[channel].programChange(data1); + break; + case ShortMessage.CHANNEL_PRESSURE: + channels[channel].setChannelPressure(data1); + break; + case ShortMessage.PITCH_BEND: + channels[channel].setPitchBend(data1 | (data2 << 7)); + break; + default: + Debug.printf("unhandled short: %02X", command); } - } break; - case 0x7d: { // test + } + case SysexMessage sysexMessage -> { + byte[] data = sysexMessage.getData(); +Debug.printf("sysex: %02X\n%s", sysexMessage.getStatus(), StringUtil.getDump(data, 32)); switch (data[1]) { - case 0x10: // 7D 10 ch -- set an instrument to ch - adlib.style = Adlib.LUCAS_STYLE | Adlib.MIDI_STYLE; + case 0x7 -> { // Universal Realtime + int c = data[2]; // 0x7f: Disregards channel + // Sub-ID, Sub-ID2 + if (data[3] == 0x04 && data[4] == 0x01) { // Device Control / Master Volume + float gain = ((data[5] & 0x7f) | ((data[6] & 0x7f) << 7)) / 16383f; +Debug.printf("sysex volume: gain: %3.0f", gain * 127); + for (c = 0; c < 16; c++) { + voiceStatus[c].volume = (int) (gain * 127); // TODO doesn't work + } + } + } + case 0x7d -> { // test + switch (data[2]) { + case 0x10: // 7D 10 ch -- set an instrument to ch + // TODO maybe for LUCAS only +if (type != FileType.LUCAS) { + Debug.println(Level.WARNING, "sysex test: set LUCAS_STYLE for " + type); +} + adlib.style = Adlib.LUCAS_STYLE | Adlib.MIDI_STYLE; - int c = data[2]; - channels[c].ins = MidPlayer.fromSysex(data); + int c = data[3]; + channels[c].ins = MidPlayer.fromSysex(data); - break; + break; + } + } + default -> Debug.printf("sysex unhandled: %02x", data[1]); } - } break; } - } else if (message instanceof MetaMessage metaMessage) { + case MetaMessage metaMessage -> { Debug.printf("meta: %02x", metaMessage.getType()); - switch (metaMessage.getType()) { - case 0x2f: - break; + switch (metaMessage.getType()) { + case 0x2f -> {} + } + } + case null, default -> { + assert false; } - } else { - assert false; } } diff --git a/src/main/java/vavi/sound/midi/rococoa/RococoaMidiDeviceProvider.java b/src/main/java/vavi/sound/midi/rococoa/RococoaMidiDeviceProvider.java index e91e177..f40ee09 100644 --- a/src/main/java/vavi/sound/midi/rococoa/RococoaMidiDeviceProvider.java +++ b/src/main/java/vavi/sound/midi/rococoa/RococoaMidiDeviceProvider.java @@ -28,7 +28,6 @@ public class RococoaMidiDeviceProvider extends MidiDeviceProvider { /** */ private static final MidiDevice.Info[] infos = new MidiDevice.Info[] { RococoaSynthesizer.info }; - /* */ @Override public MidiDevice.Info[] getDeviceInfo() { return infos; diff --git a/src/main/java/vavi/sound/midi/rococoa/RococoaSoundbank.java b/src/main/java/vavi/sound/midi/rococoa/RococoaSoundbank.java index 5c33c7a..1e33ddf 100644 --- a/src/main/java/vavi/sound/midi/rococoa/RococoaSoundbank.java +++ b/src/main/java/vavi/sound/midi/rococoa/RococoaSoundbank.java @@ -92,7 +92,7 @@ public Instrument getInstrument(Patch patch) { /** */ public static class RococoaInstrument extends Instrument { - Object data; + final Object data; protected RococoaInstrument(RococoaSoundbank sounBbank, int bank, int program, String name, Object data) { super(sounBbank, new Patch(bank, program), name, Object.class); this.data = data; diff --git a/src/main/java/vavi/sound/mp3/Mp3Decoder.java b/src/main/java/vavi/sound/mp3/Mp3Decoder.java index 30daee0..ddfb7bb 100644 --- a/src/main/java/vavi/sound/mp3/Mp3Decoder.java +++ b/src/main/java/vavi/sound/mp3/Mp3Decoder.java @@ -6,12 +6,15 @@ package vavi.sound.mp3; +import java.util.Arrays; +import java.util.StringJoiner; + import vavi.util.Debug; import vavi.util.StringUtil; /** - * MPEG Audio Layer III Decorder. + * MPEG Audio Layer III Decoder. * * @author 小杉 篤史 (Kosugi Atsushi) * @author Naohide Sano (nsano) @@ -21,16 +24,21 @@ class Mp3Decoder { /** */ private static class GrInfo { - int length; - int bigValues; - int gain; + final int length; + final int bigValues; + final int gain; GrInfo(int length, int bigValues, int gain) { this.length = length; this.bigValues = bigValues; this.gain = gain; } - public String toString() { - return StringUtil.paramString(this); + + @Override public String toString() { + return new StringJoiner(", ", GrInfo.class.getSimpleName() + "[", "]") + .add("length=" + length) + .add("bigValues=" + bigValues) + .add("gain=" + gain) + .toString(); } } @@ -43,6 +51,16 @@ static class MpegDecodeParam { /** pcm */ byte[] outputBuf; int outputSize; + + @Override public String toString() { + return new StringJoiner(", ", MpegDecodeParam.class.getSimpleName() + "[", "]") + .add("header=" + header) + .add("inputBuf=" + Arrays.toString(inputBuf)) + .add("inputSize=" + inputSize) + .add("outputBuf=" + Arrays.toString(outputBuf)) + .add("outputSize=" + outputSize) + .toString(); + } } /** */ @@ -58,6 +76,17 @@ static class MpegDecodeInfo { int inputSize; /** 1 frame output size */ int outputSize; + + @Override public String toString() { + return new StringJoiner(", ", MpegDecodeInfo.class.getSimpleName() + "[", "]") + .add("header=" + header) + .add("channels=" + channels) + .add("frequency=" + frequency) + .add("bitRate=" + bitRate) + .add("inputSize=" + inputSize) + .add("outputSize=" + outputSize) + .toString(); + } } /** header information 4 byte */ @@ -85,7 +114,7 @@ static class MpegHeader { *
  • 11 - MPEG Version 1 * */ - int version; + final int version; /** *
      *
    • 00 - reserved @@ -94,11 +123,11 @@ static class MpegHeader { *
    • 11 - Layer I *
    */ - int layer; + final int layer; /** */ - int bitrate; + final int bitrate; /** */ - int frequency; + final int frequency; /** *
      *
    1. stereo @@ -107,7 +136,7 @@ static class MpegHeader { *
    2. single channel *
    */ - int mode; + final int mode; /** Gets header information. */ public MpegHeader(byte[] buf, int offset) { Debug.println("offset: " + offset); @@ -116,7 +145,17 @@ public MpegHeader(byte[] buf, int offset) { this.bitrate = m_bitrate[3 - layer][(buf[offset + 2] & 0xf0) >> 4]; this.frequency = m_frequency[version == 3 ? 0 : 1][(buf[offset + 2] & 0x0c) >> 2]; this.mode = (buf[offset + 3] & 0xc0) >> 6; -Debug.println(StringUtil.paramString(this)); +//Debug.println(this); + } + + @Override public String toString() { + return new StringJoiner(", ", MpegHeader.class.getSimpleName() + "[", "]") + .add("version=" + version) + .add("layer=" + layer) + .add("bitrate=" + bitrate) + .add("frequency=" + frequency) + .add("mode=" + mode) + .toString(); } } @@ -229,9 +268,10 @@ public void decode(MpegDecodeParam param) throws IllegalArgumentException { MpegHeader header = param.header; m_frame_size = (144 * header.bitrate * 1000) / m_freq; +Debug.println("m_frame_size: " + m_frame_size + ", bitrate: "+ header.bitrate); if (param.inputSize < m_frame_size) { - throw new IllegalArgumentException("inputSize: " + param.inputSize + " < frameSize"); + throw new IllegalArgumentException("inputSize: " + param.inputSize + " < frameSize: " + m_frame_size); } decode_frame(param.outputBuf, param.inputBuf); diff --git a/src/main/java/vavi/sound/mp3/Mp3InputStream.java b/src/main/java/vavi/sound/mp3/Mp3InputStream.java index 130cf2c..e5706a0 100644 --- a/src/main/java/vavi/sound/mp3/Mp3InputStream.java +++ b/src/main/java/vavi/sound/mp3/Mp3InputStream.java @@ -60,7 +60,7 @@ public Mp3InputStream(InputStream in) throws IOException { int firstSyncAddress = Mp3Decoder.findSync(buf, 0, readBytes); Debug.printf("firstSyncAddress: %08x", firstSyncAddress); decodeInfo = decoder.getInfo(buf, firstSyncAddress, readBytes - firstSyncAddress); -Debug.println(StringUtil.paramStringDeep(decodeInfo, 2)); +Debug.println(decodeInfo); // in.reset(); @@ -133,9 +133,9 @@ public int read(byte[] data, int offset, int length) throws IOException { Mp3Decoder.MpegDecodeParam param = new Mp3Decoder.MpegDecodeParam(); //Debug.println("length: " + length); -//Debug.println("decodeInfo: " + StringUtil.paramString(decodeInfo)); +Debug.println("decodeInfo: " + decodeInfo); param.inputSize = decodeInfo.inputSize; -//Debug.println("param.inputSize: " + param.inputSize); +Debug.println("param.inputSize: " + param.inputSize); param.inputBuf = new byte[param.inputSize]; int readBytes = 0; while (readBytes < param.inputSize) { diff --git a/src/main/java/vavi/sound/opl3/Adlib.java b/src/main/java/vavi/sound/opl3/Adlib.java index 4039caf..8d5675a 100644 --- a/src/main/java/vavi/sound/opl3/Adlib.java +++ b/src/main/java/vavi/sound/opl3/Adlib.java @@ -6,6 +6,11 @@ package vavi.sound.opl3; +import java.util.logging.Level; + +import vavi.util.Debug; + + /** * Adlib. * @@ -190,7 +195,7 @@ public class Adlib { /** for outer opl3 */ @FunctionalInterface public interface Writer { - void write(int a, int b, int c); + void write(int array, int address, int data); } /** internal opl3 */ @@ -224,6 +229,7 @@ public int read(int address) { } public void write(int address, int data) { +Debug.printf(Level.FINEST, "write: %04x, %02x", address, data); writer.write(0, address, data); this.data[address] = data; } @@ -238,6 +244,7 @@ public void instrument(int voice, int[] inst) { write(0x20 + opadd[voice], inst[0]); write(0x23 + opadd[voice], inst[1]); + if ((style & LUCAS_STYLE) != 0) { write(0x43 + opadd[voice], 0x3f); if ((inst[10] & 1) == 0) { @@ -245,7 +252,7 @@ public void instrument(int voice, int[] inst) { } else { write(0x40 + opadd[voice], 0x3f); } - } else if ((style & SIERRA_STYLE) != 0) { + } else if ((style & SIERRA_STYLE) != 0 || (style & CMF_STYLE) != 0) { write(0x40 + opadd[voice], inst[2]); write(0x43 + opadd[voice], inst[3]); } else { @@ -304,7 +311,7 @@ public void playNote(int voice, int note, int volume) { int oct = note / 12; volume(voice, volume); write(0xa0 + voice, freq & 0xff); - int c = ((freq & 0x300) >> 8) + (oct << 2) + (mode == MELODIC || voice < 6 ? (1 << 5) : 0); + int c = ((freq & 0x300) >> 8) + ((oct & 7) << 2) + (mode == MELODIC || voice < 6 ? (1 << 5) : 0); write(0xb0 + voice, c); } diff --git a/src/main/java/vavi/sound/opl3/AdvancedSierraFile.java b/src/main/java/vavi/sound/opl3/AdvancedSierraFile.java index c3c75a3..bc1a488 100644 --- a/src/main/java/vavi/sound/opl3/AdvancedSierraFile.java +++ b/src/main/java/vavi/sound/opl3/AdvancedSierraFile.java @@ -8,6 +8,7 @@ import java.io.DataInputStream; import java.io.IOException; +import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.util.logging.Logger; @@ -17,7 +18,7 @@ /** - * AdvancedSierraFile. + * AdvancedSierraFile. (SCI) * * @author Naohide Sano (umjammer) * @version 0.00 2020/10/26 umjammer initial version
    @@ -26,6 +27,8 @@ class AdvancedSierraFile extends SierraFile { private static final Logger logger = Logger.getLogger(MidiFile.class.getName()); + private URI uri; + @Override int markSize() { return 3; @@ -33,7 +36,7 @@ int markSize() { @Override boolean matchFormatImpl(DataInputStream dis) throws IOException { - //loadSierraIns(null)) { // TODO null + if (uri != null) loadSierraIns(Path.of(uri)); return dis.readUnsignedByte() == 0x84 && dis.readUnsignedByte() == 0 && dis.readUnsignedByte() == 0xf0; @@ -57,8 +60,7 @@ private static int[] fromSierra(int[] buf) { return x; } - // TODO - private boolean loadSierraIns(Path path) throws IOException { + private void loadSierraIns(Path path) throws IOException { Path patch = path.getParent().resolve("patch.003"); DataInputStream dis = new DataInputStream(Files.newInputStream(patch.toFile().toPath())); @@ -85,7 +87,6 @@ private boolean loadSierraIns(Path path) throws IOException { } dis.close(); - return true; } private void sierra_next_section(MidPlayer player) throws IOException { @@ -119,6 +120,7 @@ private void sierra_next_section(MidPlayer player) throws IOException { @Override void rewind(int subSong, MidPlayer player) throws IOException { + this.uri = (URI) player.getProperties().get("uri"); player.tins = stins; player.deltas = 32; player.takeBE(12); // worthless empty space and "stuff" :) diff --git a/src/main/java/vavi/sound/opl3/CmfFile.java b/src/main/java/vavi/sound/opl3/CmfFile.java index 5471fd0..57e684b 100644 --- a/src/main/java/vavi/sound/opl3/CmfFile.java +++ b/src/main/java/vavi/sound/opl3/CmfFile.java @@ -8,6 +8,7 @@ import java.io.DataInputStream; import java.io.IOException; +import java.util.Arrays; import java.util.logging.Logger; import vavi.sound.midi.opl3.Opl3Soundbank; @@ -23,6 +24,7 @@ * @version 0.00 2020/10/25 umjammer initial version
    */ class CmfFile extends MidiTypeFile { + private static final Logger logger = Logger.getLogger(CmfFile.class.getName()); @Override @@ -52,7 +54,12 @@ void rewind(int subSong, MidPlayer player) throws IOException { player.deltas = player.takeLE(2); //ticks/qtr note //the stuff in the cmf is click ticks per second... player.msqtr = 1000000 / player.takeLE(2) * player.deltas; - player.takeLE(2 * 3); + int i = player.takeLE(2); +// String title = new String(player.data, i, ByteUtil.strlen(data, i)); + i = player.takeLE(2); +// String author = new String(data, i, ByteUtil.strlen(data, i)); + i = player.takeLE(2); +// String remarks = new String(data, i, ByteUtil.strlen(data, i)); player.takeBE(16); // channel in use table... @@ -63,38 +70,38 @@ void rewind(int subSong, MidPlayer player) throws IOException { if (player.tins > 128) { // to ward of bad numbers... player.tins = 128; } - player.takeLE(2); //basic tempo + player.takeLE(2); // basic tempo } -logger.info(String.format("numinstr: 0x%04x", player.tins)); + logger.info(String.format("numinstr: 0x%04x", player.tins)); this.tins = player.tins; - logger.info(String.format("ioff: %d, moff: %d, deltas: %d, msqtr: %d, numi: %d", n, m, player.deltas, player.msqtr, player.tins)); - -// title = new String(data, v, ByteUtil.strlen(data, v)); -// author = new String(data, v, ByteUtil.strlen(data, v)); -// remarks = new String(data, v, ByteUtil.strlen(data, v)); + logger.info(String.format("ioff: 0x%04x, moff: 0x%04x, deltas: %d, msqtr: %d, numi: %d, v: %04x", n, m, player.deltas, player.msqtr, player.tins, v)); player.takeBE(n - 40); -logger.info(String.format("pos1: 0x%04x", player.pos)); + logger.info(String.format("pos1: 0x%04x", player.pos)); this.instruments = new Opl3Instrument[this.tins]; for (int p = 0; p < player.tins; ++p) { -logger.fine(String.format("\n%d: ", p)); int[] x = new int[16]; for (int j = 0; j < 16; ++j) { x[j] = player.takeBE(1); } - this.instruments[p] = Opl3Soundbank.newInstrument(0, p, "oldlucas." + p, x); + this.instruments[p] = Opl3Soundbank.newInstrument(0, p, "oldlucas." + p, x); + logger.fine(String.format("%d: %s", p, Arrays.toString((int[]) this.instruments[p].getData()))); } -logger.info(String.format("pos2: 0x%04x", player.pos)); + logger.info(String.format("pos2: 0x%04x", player.pos)); player.tracks[0].on = true; player.tracks[0].tend = player.flen; // music until the end of the file player.tracks[0].spos = m; // jump to midi music } + protected Context context; + @Override public void init(Context context) { + this.context = context; + for (int p = 0; p < this.tins; ++p) { context.instruments()[p] = this.instruments[p]; } @@ -105,4 +112,43 @@ public void init(Context context) { context.adlib().style = Adlib.CMF_STYLE; } + + @Override + public int nativeVelocity(int channel, int velocity) { +// if ((adlib.style & Adlib.CMF_STYLE) != 0) { + // CMF doesn't support note velocity (even though some files have them!) + return 127; +// } + } + + @Override + public void controlChange(int channel, int controller, int value) { + Adlib adlib = context.adlib(); + switch (controller) { + case 0x63 -> { +// if ((adlib.style & Adlib.CMF_STYLE) != 0) { + // Custom extension to allow CMF files to switch the + // AM+VIB depth on and off (officially this is on, + // and there's no way to switch it off.) Controller + // values: + // 0 == AM+VIB off + // 1 == VIB on + // 2 == AM on + // 3 == AM+VIB on + adlib.write(0xbd, (adlib.read(0xbd) & ~0xc0) | (value << 6)); +// } + } + case 0x67 -> { // 103: undefined + logger.fine(String.format("control change[%d]: (%02x): %d", channel, controller, value)); +// if ((adlib.style & Adlib.CMF_STYLE) != 0) { + adlib.mode = value; + if (adlib.mode == Adlib.RYTHM) { + adlib.write(0xbd, adlib.read(0xbd) | (1 << 5)); + } else { + adlib.write(0xbd, adlib.read(0xbd) & ~(1 << 5)); + } +// } + } + } + } } diff --git a/src/main/java/vavi/sound/opl3/Dro2Player.java b/src/main/java/vavi/sound/opl3/Dro2Player.java index 85878e6..49686f8 100644 --- a/src/main/java/vavi/sound/opl3/Dro2Player.java +++ b/src/main/java/vavi/sound/opl3/Dro2Player.java @@ -26,7 +26,6 @@ import java.util.logging.Logger; import vavi.io.LittleEndianDataInputStream; -import vavi.util.Debug; /** diff --git a/src/main/java/vavi/sound/opl3/DroPlayer.java b/src/main/java/vavi/sound/opl3/DroPlayer.java index 396cede..7f9c734 100644 --- a/src/main/java/vavi/sound/opl3/DroPlayer.java +++ b/src/main/java/vavi/sound/opl3/DroPlayer.java @@ -26,7 +26,6 @@ import java.util.logging.Logger; import vavi.io.LittleEndianDataInputStream; -import vavi.util.Debug; /** @@ -46,6 +45,7 @@ *
  • 10-jun-12: the DRO 1 format is finalized, but capturing is buggy. */ class DroPlayer extends Opl3Player { + private static final Logger logger = Logger.getLogger(DroPlayer.class.getName()); protected static final String ID = "DBRAWOPL"; @@ -107,12 +107,19 @@ public void load(InputStream is) throws IOException { dis.skipBytes(8); // id dis.skipBytes(4); // version - length = dis.readInt(); mstotal = dis.readInt(); + length = dis.readInt(); opl3_mode = dis.readUnsignedByte(); - dis.readUnsignedByte(); - dis.readUnsignedByte(); - dis.readUnsignedByte(); + dis.mark(3); + byte[] zero = new byte[3]; + zero[0] = dis.readByte(); + zero[1] = dis.readByte(); + zero[2] = dis.readByte(); + if (zero[0] != 0 || zero[1] != 0 || zero[2] != 0) { + // need these three bytes! + dis.reset(); +logger.fine("not zero: " + Arrays.toString(zero)); + } logger.fine("id: " + ID); logger.fine("version: " + 1); @@ -144,12 +151,12 @@ public boolean update() throws IOException { ++pos; switch (iIndex) { case 0: - if (pos < length) return false; + if (pos >= length) return false; delay = 1 + data.readUnsignedByte(); ++pos; return true; case 1: - if (pos + 1 < length) return false; + if (pos + 1 >= length) return false; delay = 1 + data.readUnsignedShort(); pos += 2; return true; @@ -161,11 +168,14 @@ public boolean update() throws IOException { break; default: if (iIndex == 4) { + if (pos >= length) return false; iIndex = data.readUnsignedByte(); ++pos; } + if (pos >= length) return false; int v = data.readUnsignedByte(); +logger.fine(String.format("%d, %d, %d, %02x", opl3_mode, currChip, iIndex, v)); ++pos; if (opl3_mode == 0) { write(0, iIndex, v); diff --git a/src/main/java/vavi/sound/opl3/LucasFile.java b/src/main/java/vavi/sound/opl3/LucasFile.java index 25a72f7..ac336f0 100644 --- a/src/main/java/vavi/sound/opl3/LucasFile.java +++ b/src/main/java/vavi/sound/opl3/LucasFile.java @@ -13,12 +13,13 @@ /** - * LucasFile. + * LucasFile. (LAA) * * @author Naohide Sano (umjammer) * @version 0.00 2020/10/25 umjammer initial version
    */ class LucasFile extends MidiFile { + @Override int markSize() { return 3; @@ -33,14 +34,36 @@ boolean matchFormatImpl(DataInputStream dis) throws IOException { @Override void rewind(int subSong, MidPlayer player) throws IOException { - player.takeBE(24); //skip junk and get to the midi. + player.takeBE(1 + 24); // skip junk and get to the midi. // note: no break, we go right into midi headers... super.rewind(subSong, player); } @Override public void init(Context context) { + this.context = context; + context.adlib().style = Adlib.LUCAS_STYLE | Adlib.MIDI_STYLE; super.init(context); } + + @Override + public int nativeVelocity(int channel, int velocity) { +// if ((adlib.style & Adlib.MIDI_STYLE) != 0) { + int nv = (context.voiceStatus()[channel].volume * velocity) / 128; +// if ((adlib.style & Adlib.LUCAS_STYLE) != 0) { + nv *= 2; +// } + + if (nv > 127) { + nv = 127; + } + + nv = Adlib.my_midi_fm_vol_table[nv]; +// if ((adlib.style & Adlib.LUCAS_STYLE) != 0) { + nv = (int) ((float) Math.sqrt((nv)) * 11.0F); +// } + return nv; +// } + } } diff --git a/src/main/java/vavi/sound/opl3/MidPlayer.java b/src/main/java/vavi/sound/opl3/MidPlayer.java index 6b54e80..531582f 100644 --- a/src/main/java/vavi/sound/opl3/MidPlayer.java +++ b/src/main/java/vavi/sound/opl3/MidPlayer.java @@ -43,7 +43,9 @@ import javax.sound.midi.Track; import javax.sound.midi.Transmitter; +import vavi.sound.midi.MidiConstants; import vavi.sound.midi.MidiConstants.MetaEvent; +import vavi.sound.midi.MidiUtil; import vavi.sound.midi.opl3.Opl3Soundbank; import vavi.sound.midi.opl3.Opl3Synthesizer; import vavi.sound.midi.opl3.Opl3Synthesizer.Context; @@ -160,6 +162,8 @@ boolean matchFormat(InputStream bitStream) { abstract boolean matchFormatImpl(DataInputStream dis) throws IOException; abstract void rewind(int subSong, MidPlayer player) throws IOException; public abstract void init(Context context); + public int nativeVelocity(int channel, int velocity) { return velocity; } + public void controlChange(int channel, int controller, int value) {} } public static class MidiTrack { @@ -199,7 +203,7 @@ public void initOn() { private FileType type; protected int subsongs; - protected MidiTrack[] tracks = new MidiTrack[MAX_CHANNELS]; + protected final MidiTrack[] tracks = new MidiTrack[MAX_CHANNELS]; protected int deltas; protected int msqtr; @@ -340,7 +344,7 @@ public boolean update() throws IOException { tracks[t].pv = v; int c = v & 0x0f; - logger.fine(String.format("[%2X]", v)); +logger.finer(String.format("[%2X]", v)); int data1; int data2; @@ -376,12 +380,12 @@ public boolean update() throws IOException { case 0xc0: // patch change data1 = takeBE(1); midiMessage = new ShortMessage(); - ((ShortMessage) midiMessage).setMessage(ShortMessage.PROGRAM_CHANGE, c, data1); + ((ShortMessage) midiMessage).setMessage(ShortMessage.PROGRAM_CHANGE, c, data1, 0); break; case 0xd0: // channel touch data1 = takeBE(1); midiMessage = new ShortMessage(); - ((ShortMessage) midiMessage).setMessage(ShortMessage.CHANNEL_PRESSURE, c, data1); + ((ShortMessage) midiMessage).setMessage(ShortMessage.CHANNEL_PRESSURE, c, data1, 0); break; case 0xe0: // pitch wheel data1 = takeBE(1); @@ -404,10 +408,10 @@ public boolean update() throws IOException { for (int i = 2; i < b.length; i++) { b[i] = (byte) (takeBE(1) & 0xff); } - logger.fine("sysex:\n" + StringUtil.getDump(b)); + logger.finer(String.format("sysex: %02x, %d\n%s", v, l, StringUtil.getDump(b, Math.min(l + 2, 64)))); midiMessage = new SysexMessage(); ((SysexMessage) midiMessage).setMessage(b, b.length); - logger.fine("sysex: " + midiMessage.getLength()); + logger.finest("sysex: len: " + midiMessage.getLength()); if (f) { takeBE(1); } @@ -429,7 +433,7 @@ public boolean update() throws IOException { case 0xf3: data1 = takeBE(1); midiMessage = new ShortMessage(); - ((ShortMessage) midiMessage).setMessage(ShortMessage.SONG_SELECT, c, data1); + ((ShortMessage) midiMessage).setMessage(ShortMessage.SONG_SELECT, c, data1, 0); break; case 0xf6: // something case 0xf8: @@ -443,23 +447,25 @@ public boolean update() throws IOException { } break; case 0xff: // meta - logger.fine("meta:\n" + StringUtil.getDump(data, 0, 64)); v = takeBE(1); + l = takeBE(1); +logger.fine(String.format("meta: %02x, %s\n%s", v, MidiConstants.MetaEvent.valueOf(v), StringUtil.getDump(data, 0, l))); switch (v) { case 0x2f: logger.info(String.format("meta: %02x", v)); - takeBE(data.available()); // TODO out of spec. + if (data.available() > 0) { + logger.fine("out of spec data for meta:0x2f: " + data.available()); + } + takeBE(l); // TODO out of spec. break; case 0x51: - l = takeLen(); msqtr = takeBE(l); // set tempo logger.fine(String.format("(qtr=%d)", msqtr)); break; default: - l = takeLen(); - logger.fine(String.format("meta: %02x, %02x", v, l)); + logger.finer(String.format("meta unhandled: %02x, %02x", v, l)); for (int i = 0; i < l; ++i) { - logger.fine(String.format("%2X ", takeBE(1))); + takeBE(1); } break; } @@ -468,7 +474,7 @@ public boolean update() throws IOException { break; default: // if we get down here, an error occurred - logger.warning(String.format("!: %02x at %d", v, pos)); + logger.warning(String.format("unknown midi command!: %02x at %d", v, pos)); break; } } catch (InvalidMidiDataException e) { @@ -479,6 +485,7 @@ public boolean update() throws IOException { transmitter.getReceiver().send(midiMessage, -1); } +logger.finer(String.format("pos: %d, end: %d", pos, tracks[t].tend)); if (pos < tracks[t].tend) { int w; if (type != FileType.SIERRA && type != FileType.ADVSIERRA) { @@ -507,7 +514,7 @@ public boolean update() throws IOException { } if (eos) { - iwait = 0xffffff; // bigger than any wait can be! + iwait = 0xff_ffff; // bigger than any wait can be! for (int t = 0; t < MAX_CHANNELS; ++t) { if (tracks[t].on && tracks[t].pos < tracks[t].tend && tracks[t].iwait < iwait) { @@ -540,9 +547,9 @@ public boolean update() throws IOException { for (int t = 0; t < MAX_CHANNELS; ++t) { if (tracks[t].on) { if (tracks[t].pos < tracks[t].tend) { - logger.fine(String.format("iwait: %d", tracks[t].iwait)); + logger.finer(String.format("iwait: %d", tracks[t].iwait)); } else { - logger.fine("stop"); + logger.finer("stop"); } } } @@ -551,6 +558,7 @@ public boolean update() throws IOException { } /** + * TODO maybe for LUCAS only * @param data {@link SysexMessage#getData()} */ public static int[] fromSysex(byte[] data) { @@ -567,6 +575,7 @@ public static int[] fromSysex(byte[] data) { x[7] = 0xff - (((data[pos + 20] & 0xff) << 4) + (data[pos + 21] & 0xff)); x[9] = ((data[pos + 22] & 0xff) << 4) + (data[pos + 23] & 0xff); x[10] = ((data[pos + 24] & 0xff) << 4) + (data[pos + 24] & 0xff); +logger.fine(String.format("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10])); return x; } diff --git a/src/main/java/vavi/sound/opl3/MidiFile.java b/src/main/java/vavi/sound/opl3/MidiFile.java index bf2d4cd..7fe1762 100644 --- a/src/main/java/vavi/sound/opl3/MidiFile.java +++ b/src/main/java/vavi/sound/opl3/MidiFile.java @@ -50,8 +50,11 @@ boolean matchFormatImpl(DataInputStream dis) throws IOException { @Override void rewind(int subSong, MidPlayer player) throws IOException { - player.tins = 128; - player.takeBE(4 + 4 + 2 + 2); // skip header + if (!(this instanceof LucasFile)) { + player.tins = 128; + player.takeBE(1); + } + player.takeBE(3 + 4 + 2 + 2); // skip header player.deltas = player.takeBE(2); logger.fine(String.format("deltas: %d", player.deltas)); player.takeBE(4); @@ -62,7 +65,24 @@ void rewind(int subSong, MidPlayer player) throws IOException { logger.fine(String.format("tracklen: %d", player.tracks[0].tend)); } + protected Context context; + @Override public void init(Context context) { + this.context = context; + } + + @Override + public int nativeVelocity(int channel, int velocity) { +// if ((adlib.style & Adlib.MIDI_STYLE) != 0) { + int nv = (context.voiceStatus()[channel].volume * velocity) / 128; + + if (nv > 127) { + nv = 127; + } + + nv = Adlib.my_midi_fm_vol_table[nv]; + return nv; +// } } } diff --git a/src/main/java/vavi/sound/opl3/OPL3.java b/src/main/java/vavi/sound/opl3/OPL3.java index cb6bcb4..557bf82 100644 --- a/src/main/java/vavi/sound/opl3/OPL3.java +++ b/src/main/java/vavi/sound/opl3/OPL3.java @@ -47,6 +47,7 @@ * @version 1.0.6 */ public final class OPL3 { + private final int[] registers = new int[0x200]; private Operator[][] operators; @@ -433,9 +434,9 @@ private void setRhythmMode() { * Channels */ private abstract class Channel { - int channelBaseAddress; + final int channelBaseAddress; - double[] feedback; + final double[] feedback; int fNumL, fNumH, kon, block, chA, chB, chC, chD, fb, cnt; @@ -517,7 +518,8 @@ protected double[] getInFourChannels(double channelOutput) { } private class Channel2Op extends Channel { - Operator op1, op2; + final Operator op1; + final Operator op2; Channel2Op(int baseAddress, Operator o1, Operator o2) { super(baseAddress); @@ -592,7 +594,10 @@ public String toString() { } private class Channel4Op extends Channel { - Operator op1, op2, op3, op4; + final Operator op1; + final Operator op2; + final Operator op3; + final Operator op4; Channel4Op(int baseAddress, Operator o1, Operator o2, Operator o3, Operator o4) { super(baseAddress); @@ -735,12 +740,12 @@ protected void updateOperators() { } * Operators */ private class Operator { - PhaseGenerator phaseGenerator; - EnvelopeGenerator envelopeGenerator; + final PhaseGenerator phaseGenerator; + final EnvelopeGenerator envelopeGenerator; double envelope, phase; - int operatorBaseAddress; + final int operatorBaseAddress; int am, vib, ksr, egt, mult, ksl, tl, ar, dr, sl, rr, ws; int keyScaleNumber, f_number, block; diff --git a/src/main/java/vavi/sound/opl3/OldLucasFile.java b/src/main/java/vavi/sound/opl3/OldLucasFile.java index bdab536..1b14ce6 100644 --- a/src/main/java/vavi/sound/opl3/OldLucasFile.java +++ b/src/main/java/vavi/sound/opl3/OldLucasFile.java @@ -87,8 +87,12 @@ void rewind(int subSong, MidPlayer player) throws IOException { player.tracks[0].spos = 0x98; // jump to midi music } + protected Context context; + @Override public void init(Context context) { + this.context = context; + for (int p = 0; p < this.tins; ++p) { context.instruments()[p] = this.instruments[p]; } @@ -103,4 +107,24 @@ public void init(Context context) { context.adlib().style = Adlib.LUCAS_STYLE | Adlib.MIDI_STYLE; } + + @Override + public int nativeVelocity(int channel, int velocity) { +// if ((adlib.style & Adlib.MIDI_STYLE) != 0) { + int nv = (context.voiceStatus()[channel].volume * velocity) / 128; +// if ((adlib.style & Adlib.LUCAS_STYLE) != 0) { + nv *= 2; +// } + + if (nv > 127) { + nv = 127; + } + + nv = Adlib.my_midi_fm_vol_table[nv]; +// if ((adlib.style & Adlib.LUCAS_STYLE) != 0) { + nv = (int) ((float) Math.sqrt((nv)) * 11.0F); +// } + return nv; +// } + } } diff --git a/src/main/java/vavi/sound/opl3/Opl3Player.java b/src/main/java/vavi/sound/opl3/Opl3Player.java index 2cccce4..537fde8 100644 --- a/src/main/java/vavi/sound/opl3/Opl3Player.java +++ b/src/main/java/vavi/sound/opl3/Opl3Player.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import java.util.logging.Logger; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; @@ -40,6 +42,9 @@ public abstract class Opl3Player { private static final Logger logger = Logger.getLogger(Opl3Player.class.getName()); + /** generic properties */ + protected Map props = new HashMap<>(); + /** TODO who defined 49700? */ public static final AudioFormat opl3 = new AudioFormat(49700.0f, 16, 2, true, false); @@ -67,6 +72,7 @@ static AudioFileFormat.Type getType(String ext) { public static AudioFileFormat.Type getType(AudioFormat.Encoding encoding) { return Arrays.stream(values()).filter(e -> e.encoding == encoding).findFirst().get().type; } + /** mark/reset will be done internally */ public static AudioFormat.Encoding getEncoding(InputStream is) { return Arrays.stream(values()).filter(e -> e.player.matchFormat(is)).findFirst().get().encoding; } @@ -111,4 +117,13 @@ public byte[] read(int len) { public abstract boolean update() throws IOException; public abstract int getTotalMilliseconds(); + + public void setProperties(Map props) { + this.props.clear(); + this.props.putAll(props); + } + + public Map getProperties() { + return this.props; + } } diff --git a/src/main/java/vavi/sound/opl3/SierraFile.java b/src/main/java/vavi/sound/opl3/SierraFile.java index aeea38e..e8b2941 100644 --- a/src/main/java/vavi/sound/opl3/SierraFile.java +++ b/src/main/java/vavi/sound/opl3/SierraFile.java @@ -34,7 +34,7 @@ boolean matchFormatImpl(DataInputStream dis) throws IOException { dis.readUnsignedByte() != 0xf0; } - protected Opl3Instrument[] smyinsbank = new Opl3Instrument[128]; + protected final Opl3Instrument[] smyinsbank = new Opl3Instrument[128]; // sierra instruments protected int stins; @@ -57,8 +57,12 @@ void rewind(int subSong, MidPlayer player) throws IOException { player.tracks[0].spos = player.pos; } + protected Context context; + @Override public void init(Context context) { + this.context = context; + if (smyinsbank[0] != null) { context.instruments(smyinsbank); } @@ -73,4 +77,18 @@ public void init(Context context) { context.adlib().style = Adlib.SIERRA_STYLE | Adlib.MIDI_STYLE; } + + @Override + public int nativeVelocity(int channel, int velocity) { +// if ((adlib.style & Adlib.MIDI_STYLE) != 0) { + int nv = (context.voiceStatus()[channel].volume * velocity) / 128; + + if (nv > 127) { + nv = 127; + } + + nv = Adlib.my_midi_fm_vol_table[nv]; + return nv; +// } + } } diff --git a/src/main/java/vavi/sound/opl3/readme.md b/src/main/java/vavi/sound/opl3/readme.md index ef93979..d4effc0 100644 --- a/src/main/java/vavi/sound/opl3/readme.md +++ b/src/main/java/vavi/sound/opl3/readme.md @@ -6,15 +6,18 @@ * [adplug](https://github.com/adplug/adplug) * [adplug](https://adplug.github.io/) -|type |status|description| -|------|------|-----------| -| mid | ✅ | MIDI Audio File Format | -| cmt | ✅ | Creative Music File Format by Creative Technology | -| laa | ✅ | LucasArts AdLib Audio File Format by LucasArts | -| dro | ✅ | DOSBox Raw OPL Format v1 | -| dro2 | ✅ | DOSBox Raw OPL Format v2 | -| sci | ✅ | Sierra's AdLib Audio File Format | +| type | status | ext | sequencer | description | +|---------|--------|------|-----------|----------------------------------------------------| +| mid | ✅ | mid | midi | MIDI Audio File Format | +| cmt | 🚧 | cmf | midi | Creative Music File Format by Creative Technology | +| laa | ✅ | laa | midi | LucasArts AdLib Audio File Format by LucasArts | +| laa? | ? | laa? | midi | old LucasArts AdLib Audio File Format by LucasArts | +| dro | 🚫 | dro | dro | DOSBox Raw OPL Format v1 | +| dro v2 | ✅ | dro | dro2 | DOSBox Raw OPL Format v2 | +| sci | 🚧 | sci | midi | Sierra's AdLib Audio File Format | +| adv sci | 🚧 | sci? | midi | advanced Sierra's AdLib Audio File Format | ## TODO - * https://github.com/scemino/NScumm.Audio \ No newline at end of file + * https://github.com/scemino/NScumm.Audio + * 🚧🚫 maybe dual opl implementation is needed ... see [javamod](https://github.com/umjammer/javamod) diff --git a/src/main/java/vavi/sound/pcm/equalizing/sse/Equalizer.java b/src/main/java/vavi/sound/pcm/equalizing/sse/Equalizer.java index 0decf21..4ffad17 100644 --- a/src/main/java/vavi/sound/pcm/equalizing/sse/Equalizer.java +++ b/src/main/java/vavi/sound/pcm/equalizing/sse/Equalizer.java @@ -77,7 +77,7 @@ private static int RINT(double x) { private final double[] fact = new double[M + 1]; /** */ - private final double aa = 96; + private static final double aa = 96; /** */ private final double iza; @@ -246,11 +246,11 @@ private static double hn_imp(int n) { /** * @param param2 TODO does index 0 have any meaning??? */ - private double hn(int n, List param2, double fs) { + private static double hn(int n, List param2, double fs) { double ret, lhn; - lhn = hn_lpf(n, param2.get(0).upper, fs); - ret = param2.get(0).gain * lhn; + lhn = hn_lpf(n, param2.getFirst().upper, fs); + ret = param2.getFirst().gain * lhn; Parameter e = null; for (int i = 1; i < param2.size(); i++) { @@ -986,7 +986,7 @@ public static void main(String[] argv) throws Exception { /** */ private static final class RAOutputStream extends OutputStream { - RandomAccessFile raf; + final RandomAccessFile raf; public RAOutputStream(RandomAccessFile raf) throws IOException { this.raf = raf; } diff --git a/src/main/java/vavi/sound/pcm/resampling/rohm/Resampler.java b/src/main/java/vavi/sound/pcm/resampling/rohm/Resampler.java index f5c7ee0..21bd0bb 100644 --- a/src/main/java/vavi/sound/pcm/resampling/rohm/Resampler.java +++ b/src/main/java/vavi/sound/pcm/resampling/rohm/Resampler.java @@ -15,7 +15,7 @@ public class Resampler { /** number of bits per sample */ - private final int nBitPerSample = 16; + private static final int nBitPerSample = 16; /** frequency */ private final float nFreq; diff --git a/src/main/java/vavi/sound/pcm/resampling/sox/PerfectResampler.java b/src/main/java/vavi/sound/pcm/resampling/sox/PerfectResampler.java index 1fdbb9a..8ab878a 100644 --- a/src/main/java/vavi/sound/pcm/resampling/sox/PerfectResampler.java +++ b/src/main/java/vavi/sound/pcm/resampling/sox/PerfectResampler.java @@ -53,7 +53,7 @@ private static void coef_coef1(int x, double value, double[] result, int interp_ } /** */ - private double[] prepare_coefs(double[] coefs, int num_coefs, int num_phases, int interp_order, int multiplier) { + private static double[] prepare_coefs(double[] coefs, int num_coefs, int num_phases, int interp_order, int multiplier) { int length = num_coefs * num_phases; double[] result = new double[length * (interp_order + 1)]; double fm1 = coefs[0]; @@ -108,7 +108,7 @@ private double[] prepare_coefs(double[] coefs, int num_coefs, int num_phases, in static class HalfBand { int dft_length; int num_taps; - int[] post_peak = new int[1]; + final int[] post_peak = new int[1]; double[] coefs; } @@ -116,7 +116,7 @@ static class HalfBand { static class RateShared { double[] poly_fir_coefs; /** [0]: halve; [1]: down/up: halve/double */ - HalfBand[] half_band = { new HalfBand(), new HalfBand() }; + final HalfBand[] half_band = { new HalfBand(), new HalfBand() }; /** For Ooura fft */ double[] sin_cos_table; /** ditto */ @@ -156,7 +156,8 @@ void all(long v) { /** For poly_fir & spline: */ StageFunction fn; /** 32bit.32bit fixed point arithmetic */ - Union at, step; + final Union at; + final Union step; /** For step: > 1 for rational; 1 otherwise */ int divisor; double out_in_ratio; @@ -178,7 +179,7 @@ private static int stage_read_p(Stage s) { } /** */ - StageFunction cubic_spline = (stage, output_fifo) -> { + final StageFunction cubic_spline = (stage, output_fifo) -> { int i; int num_in = stage_occupancy(stage); int max_num_out = (int) (1 + num_in * stage.out_in_ratio); @@ -202,7 +203,7 @@ private static int stage_read_p(Stage s) { }; /** */ - StageFunction half_sample = (stage, output_fifo) -> { + final StageFunction half_sample = (stage, output_fifo) -> { double[] output; int i, j; int num_in = Math.max(0, stage.fifo.occupancy()); @@ -249,7 +250,7 @@ private static int stage_read_p(Stage s) { }; /** */ - StageFunction double_sample = (stage, output_fifo) -> { + final StageFunction double_sample = (stage, output_fifo) -> { double[] output; int i, j; int num_in = Math.max(0, stage.fifo.occupancy()); @@ -469,15 +470,15 @@ private static int set_dft_length(int num_taps) { } /** */ - private void half_band_filter_init(RateShared rateShared, - /* unsigned */int which, - int[] num_taps, - double[] h, - double Fp, - double atten, - int multiplier, - double phase, - boolean allow_aliasing) { + private static void half_band_filter_init(RateShared rateShared, + /* unsigned */int which, + int[] num_taps, + double[] h, + double Fp, + double atten, + int multiplier, + double phase, + boolean allow_aliasing) { HalfBand f = rateShared.half_band[which]; int dft_length, i; @@ -550,9 +551,10 @@ enum Quality { /** */ static class Filter { - int[] len = new int[1]; - double[] h; - double bw, a; + final int[] len = new int[1]; + final double[] h; + final double bw; + final double a; Filter(int len, double[] h, double bw, double a) { this.len[0] = len; this.h = h; @@ -563,8 +565,8 @@ static class Filter { /** */ static class PolyFir1 { - int phase_bits; - StageFunction fn; + final int phase_bits; + final StageFunction fn; PolyFir1(int phase_bits, StageFunction fn) { this.phase_bits = phase_bits; this.fn = fn; @@ -573,10 +575,10 @@ static class PolyFir1 { /** */ static class PolyFir { - int num_coefs; - double pass; - double stop; - double att; + final int num_coefs; + final double pass; + final double stop; + final double att; PolyFir1[] interp = new PolyFir1[4]; PolyFir(int num_coefs, double pass, double stop, double att, PolyFir1[] interp) { this.num_coefs = num_coefs; @@ -624,7 +626,7 @@ static class PolyFir { * Down-sample by a factor of 2 using a FIR with odd length (LEN). * Input must be preceded and followed by LEN >> 1 samples. */ - abstract class RateHalfFir implements StageFunction { + abstract static class RateHalfFir implements StageFunction { abstract double[] COEFS(); abstract int CONVOLVE(); @Override @@ -656,7 +658,7 @@ public void exec(Stage p, Fifo output_fifo) { * Input must be preceded by LEN >> 1 samples. * Input must be followed by (LEN-1) >> 1 samples. */ - abstract class RatePolyFir0 implements StageFunction { + abstract static class RatePolyFir0 implements StageFunction { abstract int FIR_LENGTH(); abstract int CONVOLVE(); @Override @@ -699,7 +701,7 @@ public void exec(Stage p, Fifo output_fifo) { * Input must be preceded by LEN >> 1 samples. * Input must be followed by (LEN-1) >> 1 samples. */ - abstract class RatePolyFir implements StageFunction { + abstract static class RatePolyFir implements StageFunction { abstract int CONVOLVE(); abstract int COEF_INTERP(); abstract int FIR_LENGTH(); @@ -764,7 +766,7 @@ public void exec(Stage p, Fifo output_fifo) { } // assert_static(!((array_length(COEFS)- 1) & 1), HALF_FIR_LENGTH_25 ); - StageFunction half_sample_25 = new RateHalfFir() { + final StageFunction half_sample_25 = new RateHalfFir() { // _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @Override int CONVOLVE() { return 22; } @@ -773,7 +775,7 @@ public void exec(Stage p, Fifo output_fifo) { }; // assert_static(!((array_length(COEFS)- 1) & 1), HALF_FIR_LENGTH_low); - StageFunction half_sample_low = new RateHalfFir() { + final StageFunction half_sample_low = new RateHalfFir() { // _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @Override int CONVOLVE() { return 44; } @@ -783,14 +785,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int d100_l = 16; // poly_fir_convolve_d100 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - StageFunction d100_0 = new RatePolyFir0() { + final StageFunction d100_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return d100_l; } @Override int CONVOLVE() { return 16; } }; - StageFunction d100_1 = new RatePolyFir() { + final StageFunction d100_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -802,7 +804,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int d100_1_b = 9; - StageFunction d100_2 = new RatePolyFir() { + final StageFunction d100_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -814,7 +816,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int d100_2_b = 7; - StageFunction d100_3 = new RatePolyFir() { + final StageFunction d100_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -828,14 +830,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int d100_3_b = 6; static final int d120_l = 30; // poly_fir_convolve_d120 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - StageFunction d120_0 = new RatePolyFir0() { + final StageFunction d120_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return d120_l; } @Override int CONVOLVE() { return 30; } }; - StageFunction d120_1 = new RatePolyFir() { + final StageFunction d120_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -847,7 +849,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int d120_1_b = 10; - StageFunction d120_2 = new RatePolyFir() { + final StageFunction d120_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -859,7 +861,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int d120_2_b = 9; - StageFunction d120_3 = new RatePolyFir() { + final StageFunction d120_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -873,14 +875,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int d120_3_b = 7; static final int d150_l = 38; // poly_fir_convolve_d150 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - StageFunction d150_0 = new RatePolyFir0() { +final StageFunction d150_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return d150_l; } @Override int CONVOLVE() { return 38; } }; - StageFunction d150_1 = new RatePolyFir() { + final StageFunction d150_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -892,7 +894,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int d150_1_b = 12; - StageFunction d150_2 = new RatePolyFir() { + final StageFunction d150_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -904,7 +906,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int d150_2_b = 10; - StageFunction d150_3 = new RatePolyFir() { + final StageFunction d150_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -918,14 +920,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int d150_3_b = 8; static final int U100_l = 42; // poly_fir_convolve_U100 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - StageFunction U100_0 = new RatePolyFir0() { + final StageFunction U100_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return U100_l; } @Override int CONVOLVE() { return 42; } }; - StageFunction U100_1 = new RatePolyFir() { + final StageFunction U100_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -937,7 +939,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int U100_1_b = 10; - StageFunction U100_2 = new RatePolyFir() { + final StageFunction U100_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -949,7 +951,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int U100_2_b = 8; - StageFunction U100_3 = new RatePolyFir() { + final StageFunction U100_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -963,14 +965,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int U100_3_b = 6; static final int u100_l = 10; // poly_fir_convolve_u100 _ _ _ _ _ _ _ _ _ _ - StageFunction u100_0 = new RatePolyFir0() { +final StageFunction u100_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return u100_l; } @Override int CONVOLVE() { return 10; } }; - StageFunction u100_1 = new RatePolyFir() { + final StageFunction u100_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -982,7 +984,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int u100_1_b = 9; - StageFunction u100_2 = new RatePolyFir() { + final StageFunction u100_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -994,7 +996,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int u100_2_b = 7; - StageFunction u100_3 = new RatePolyFir() { + final StageFunction u100_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -1008,14 +1010,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int u100_3_b = 6; static final int u120_l = 14; // poly_fir_convolve_u120 _ _ _ _ _ _ _ _ _ _ _ _ _ _ - StageFunction u120_0 = new RatePolyFir0() { + final StageFunction u120_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return u120_l; } @Override int CONVOLVE() { return 14; } }; - StageFunction u120_1 = new RatePolyFir() { + final StageFunction u120_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -1027,7 +1029,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int u120_1_b = 10; - StageFunction u120_2 = new RatePolyFir() { + final StageFunction u120_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -1039,7 +1041,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int u120_2_b = 8; - StageFunction u120_3 = new RatePolyFir() { + final StageFunction u120_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -1053,14 +1055,14 @@ public void exec(Stage p, Fifo output_fifo) { static final int u120_3_b = 6; static final int u150_l = 20; // poly_fir_convolve_u150 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - StageFunction u150_0 = new RatePolyFir0() { + final StageFunction u150_0 = new RatePolyFir0() { @Override int FIR_LENGTH() { return u150_l; } @Override int CONVOLVE() { return 20; } }; - StageFunction u150_1 = new RatePolyFir() { + final StageFunction u150_1 = new RatePolyFir() { @Override int COEF_INTERP() { return 1; } @Override @@ -1072,7 +1074,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int u150_1_b = 11; - StageFunction u150_2 = new RatePolyFir() { + final StageFunction u150_2 = new RatePolyFir() { @Override int COEF_INTERP() { return 2; } @Override @@ -1084,7 +1086,7 @@ public void exec(Stage p, Fifo output_fifo) { }; static final int u150_2_b = 9; - StageFunction u150_3 = new RatePolyFir() { + final StageFunction u150_3 = new RatePolyFir() { @Override int COEF_INTERP() { return 3; } @Override @@ -1297,7 +1299,7 @@ private static int rate_output(Rate p, double[] samples, int[] n) { } /** */ - private void rate_flush(Rate p) { + private static void rate_flush(Rate p) { Fifo fifo = p.stages[p.output_stage_num + 1].fifo; int samples_out = (int) (p.samples_in / p.factor + .5); int remaining = samples_out - p.samples_out; @@ -1321,8 +1323,8 @@ static class Priv { Quality quality; double coef_interp, phase, bandwidth; boolean allow_aliasing; - Rate rate; - RateShared shared; + final Rate rate; + final RateShared shared; int shared_ptr; Priv() { rate = new Rate(); diff --git a/src/main/java/vavi/sound/pcm/resampling/sox/Polyphase.java b/src/main/java/vavi/sound/pcm/resampling/sox/Polyphase.java index ce8efc9..f50ff3d 100644 --- a/src/main/java/vavi/sound/pcm/resampling/sox/Polyphase.java +++ b/src/main/java/vavi/sound/pcm/resampling/sox/Polyphase.java @@ -75,7 +75,7 @@ private static class PolyWork { /** output samples 'in the pipe' */ double inpipe; /** array of pointers to polystage structs */ - PolyStage[] stage = new PolyStage[MF]; + final PolyStage[] stage = new PolyStage[MF]; } /** */ @@ -334,7 +334,7 @@ private static float st_gcd(float a, float b) { } /** parenthesize this way to avoid st_sample_t overflow in product term */ - private float st_lcm(float a, float b) { + private static float st_lcm(float a, float b) { return a * (b / st_gcd(a, b)); } @@ -470,7 +470,7 @@ private static double st_prod(double[] q, int qP, int qstep, double[] p, int pP, } /** */ - private void polyphase(double[] output, int oP, PolyStage s) { + private static void polyphase(double[] output, int oP, PolyStage s) { int up = s.up; int down = s.down; int f_len = s.filt_len; diff --git a/src/main/java/vavi/sound/sampled/ilbc/Ilbc2PcmAudioInputStream.java b/src/main/java/vavi/sound/sampled/ilbc/Ilbc2PcmAudioInputStream.java new file mode 100644 index 0000000..fed3e3b --- /dev/null +++ b/src/main/java/vavi/sound/sampled/ilbc/Ilbc2PcmAudioInputStream.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ilbc; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.logging.Level; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; + +import vavi.io.OutputEngine; +import vavi.io.OutputEngineInputStream; +import vavi.sound.ilbc.Decoder; +import vavi.util.Debug; + + +/** + * Converts a iLBC BitStream into a PCM 16bits/sample audio stream. + * + * @author Naohide Sano (nsano) + * @version 0.00 240704 nsano initial version
    + */ +class Ilbc2PcmAudioInputStream extends AudioInputStream { + + /** + * Constructor. + * + * @param in the underlying input stream. + * @param format the target format of this stream's audio data. + * @param length the length in sample frames of the data in this stream. + */ + public Ilbc2PcmAudioInputStream(InputStream in, AudioFormat format, long length) throws IOException { + super(new OutputEngineInputStream(new IlbcOutputEngine(in)), format, length); + } + + /** */ + private static class IlbcOutputEngine implements OutputEngine { + + /** */ + private DataOutputStream out; + + /** */ + private final Decoder decoder; + + /** */ + final InputStream is; + + /** */ + public IlbcOutputEngine(InputStream is) throws IOException { + this.is = is; + decoder = new Decoder(30, 1); // TODO parameter x2 +Debug.println(Level.FINE, "iLBC"); + decoded = new byte[decoder.getDecodedLength()]; + buf = new byte[decoder.getEncodedLength()]; + } + + @Override + public void initialize(OutputStream out) throws IOException { + if (this.out != null) { + throw new IOException("Already initialized"); + } else { + this.out = new DataOutputStream(out); + } + } + + final byte[] decoded; + final byte[] buf; + + @Override + public void execute() throws IOException { + if (out == null) { + throw new IOException("Not yet initialized"); + } else { + int r = is.read(buf); + if (r >= 0) { + try { + decoder.decode(buf, decoded); + + out.write(decoded, 0, decoded.length); + } catch (IllegalArgumentException e) { + out.close(); + throw new IOException(e); + } + } else { + out.close(); + } + } + } + + @Override + public void finish() throws IOException { + } + } +} diff --git a/src/main/java/vavi/sound/sampled/ilbc/IlbcEncoding.java b/src/main/java/vavi/sound/sampled/ilbc/IlbcEncoding.java new file mode 100644 index 0000000..bd842c9 --- /dev/null +++ b/src/main/java/vavi/sound/sampled/ilbc/IlbcEncoding.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ilbc; + + +import javax.sound.sampled.AudioFormat; + + +/** + * Encodings used by the iLBC audio decoder. + * + * @author Naohide Sano (nsano) + * @version 0.00 240704 nsano initial version
    + */ +public class IlbcEncoding extends AudioFormat.Encoding { + + /** Specifies any iLBC encoded data. */ + public static final IlbcEncoding iLBC = new IlbcEncoding("iLBC"); + + /** + * Constructs a new encoding. + * + * @param name Name of the iLBC encoding. + */ + public IlbcEncoding(String name) { + super(name); + } +} diff --git a/src/main/java/vavi/sound/sampled/ilbc/IlbcFormatConversionProvider.java b/src/main/java/vavi/sound/sampled/ilbc/IlbcFormatConversionProvider.java new file mode 100644 index 0000000..e4f9437 --- /dev/null +++ b/src/main/java/vavi/sound/sampled/ilbc/IlbcFormatConversionProvider.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ilbc; + +import java.io.IOException; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.FormatConversionProvider; + + +/** + * IlbcFormatConversionProvider. + * + * @author Naohide Sano (nsano) + * @version 0.00 240704 nsano initial version
    + */ +public class IlbcFormatConversionProvider extends FormatConversionProvider { + + @Override + public AudioFormat.Encoding[] getSourceEncodings() { + return new AudioFormat.Encoding[] {IlbcEncoding.iLBC, AudioFormat.Encoding.PCM_SIGNED}; + } + + @Override + public AudioFormat.Encoding[] getTargetEncodings() { + return new AudioFormat.Encoding[] {IlbcEncoding.iLBC, AudioFormat.Encoding.PCM_SIGNED}; + } + + @Override + public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) { + if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) { + return new AudioFormat.Encoding[] {IlbcEncoding.iLBC}; + } else if (sourceFormat.getEncoding() instanceof IlbcEncoding) { + return new AudioFormat.Encoding[] {AudioFormat.Encoding.PCM_SIGNED}; + } else { + return new AudioFormat.Encoding[0]; + } + } + + @Override + public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) { + if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && + targetEncoding instanceof IlbcEncoding) { + if (sourceFormat.getChannels() > 2 || + sourceFormat.getChannels() <= 0 || + sourceFormat.isBigEndian()) { + return new AudioFormat[0]; + } else { + return new AudioFormat[] { + new AudioFormat(targetEncoding, + sourceFormat.getSampleRate(), + -1, // sample size in bits + sourceFormat.getChannels(), + -1, // frame size + -1, // frame rate + false) // little endian + }; + } + } else if (sourceFormat.getEncoding() instanceof IlbcEncoding && targetEncoding.equals(AudioFormat.Encoding.PCM_SIGNED)) { + return new AudioFormat[] { + new AudioFormat(sourceFormat.getSampleRate(), + 16, // sample size in bits + sourceFormat.getChannels(), + true, // signed + false) // little endian (for PCM wav) + }; + } else { + return new AudioFormat[0]; + } + } + + @Override + public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream) { + if (isConversionSupported(targetEncoding, sourceStream.getFormat())) { + AudioFormat[] formats = getTargetFormats(targetEncoding, sourceStream.getFormat()); + if (formats != null && formats.length > 0) { + AudioFormat sourceFormat = sourceStream.getFormat(); + AudioFormat targetFormat = formats[0]; + if (sourceFormat.equals(targetFormat)) { + return sourceStream; + } else if (sourceFormat.getEncoding() instanceof IlbcEncoding && targetFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) { + try { + return new Ilbc2PcmAudioInputStream(sourceStream, targetFormat, AudioSystem.NOT_SPECIFIED); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } else if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && targetFormat.getEncoding() instanceof IlbcEncoding) { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat); + } else { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat.toString()); + } + } else { + throw new IllegalArgumentException("target format not found"); + } + } else { + throw new IllegalArgumentException("conversion not supported"); + } + } + + @Override + public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream) { + if (isConversionSupported(targetFormat, sourceStream.getFormat())) { + AudioFormat[] formats = getTargetFormats(targetFormat.getEncoding(), sourceStream.getFormat()); + if (formats != null && formats.length > 0) { + AudioFormat sourceFormat = sourceStream.getFormat(); + if (sourceFormat.equals(targetFormat)) { + return sourceStream; + } else if (sourceFormat.getEncoding() instanceof IlbcEncoding && + targetFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) { + try { + return new Ilbc2PcmAudioInputStream(sourceStream, targetFormat, AudioSystem.NOT_SPECIFIED); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } else if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && targetFormat.getEncoding() instanceof IlbcEncoding) { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat); + } else { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat); + } + } else { + throw new IllegalArgumentException("target format not found"); + } + } else { + throw new IllegalArgumentException("conversion not supported"); + } + } +} diff --git a/src/main/java/vavi/sound/sampled/ldclep/LdCelp2PcmAudioInputStream.java b/src/main/java/vavi/sound/sampled/ldclep/LdCelp2PcmAudioInputStream.java new file mode 100644 index 0000000..ab559fd --- /dev/null +++ b/src/main/java/vavi/sound/sampled/ldclep/LdCelp2PcmAudioInputStream.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ldclep; + +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.ShortBuffer; +import java.util.logging.Level; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; + +import vavi.io.OutputEngine; +import vavi.io.OutputEngineInputStream; +import vavi.sound.ldcelp.Decoder; +import vavi.util.Debug; + + +/** + * Converts a LD-CELP BitStream into a PCM 16bits/sample audio stream. + * + * @author Naohide Sano (nsano) + * @version 0.00 240629 nsano initial version
    + */ +class LdCelp2PcmAudioInputStream extends AudioInputStream { + + /** + * Constructor. + * + * @param in the underlying input stream. + * @param format the target format of this stream's audio data. + * @param length the length in sample frames of the data in this stream. + */ + public LdCelp2PcmAudioInputStream(InputStream in, AudioFormat format, long length) throws IOException { + super(new OutputEngineInputStream(new LdCelpOutputEngine(in)), format, length); + } + + /** */ + private static class LdCelpOutputEngine implements OutputEngine { + + /** */ + private DataOutputStream out; + + /** */ + private final Decoder decoder; + + /** */ + final InputStream is; + + /** */ + public LdCelpOutputEngine(InputStream is) throws IOException { + this.is = is; + decoder = new Decoder(true); // TODO parameter postfilter +Debug.println(Level.FINE, "LD-CELP"); + } + + @Override + public void initialize(OutputStream out) throws IOException { + if (this.out != null) { + throw new IOException("Already initialized"); + } else { + this.out = new DataOutputStream(out); + } + } + + final byte[] buf = new byte[Short.BYTES]; + final byte[] decoded = new byte[5 * Short.BYTES]; + + final short[] inDataS = new short[1]; + final ShortBuffer isb = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer(); + final short[] outDataS = new short[5]; + final ShortBuffer osb = ByteBuffer.wrap(decoded).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer(); + + @Override + public void execute() throws IOException { + if (out == null) { + throw new IOException("Not yet initialized"); + } else { + int r = is.read(buf); + if (r >= 0) { + try { + isb.get(inDataS); + isb.flip(); + decoder.decode(inDataS, outDataS); + osb.put(outDataS); + osb.flip(); + + out.write(decoded, 0, decoded.length); + } catch (IllegalArgumentException e) { + out.close(); + throw new IOException(e); + } + } else { + out.close(); + } + } + } + + @Override + public void finish() throws IOException { + } + } +} diff --git a/src/main/java/vavi/sound/sampled/ldclep/LdCelpEncoding.java b/src/main/java/vavi/sound/sampled/ldclep/LdCelpEncoding.java new file mode 100644 index 0000000..7e3b0d7 --- /dev/null +++ b/src/main/java/vavi/sound/sampled/ldclep/LdCelpEncoding.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ldclep; + + +import javax.sound.sampled.AudioFormat; + + +/** + * Encodings used by the LD-CELP audio decoder. + * + * @author Naohide Sano (nsano) + * @version 0.00 240628 nsano initial version
    + */ +public class LdCelpEncoding extends AudioFormat.Encoding { + + /** Specifies any LD-CELP encoded data. */ + public static final LdCelpEncoding G728 = new LdCelpEncoding("G728"); + + /** + * Constructs a new encoding. + * + * @param name Name of the LD-CELP encoding. + */ + public LdCelpEncoding(String name) { + super(name); + } +} diff --git a/src/main/java/vavi/sound/sampled/ldclep/LdCelpFormatConversionProvider.java b/src/main/java/vavi/sound/sampled/ldclep/LdCelpFormatConversionProvider.java new file mode 100644 index 0000000..72821f2 --- /dev/null +++ b/src/main/java/vavi/sound/sampled/ldclep/LdCelpFormatConversionProvider.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ldclep; + +import java.io.IOException; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.FormatConversionProvider; + + +/** + * LdCelpFormatConversionProvider. + * + * @author Naohide Sano (nsano) + * @version 0.00 240629 nsano initial version
    + */ +public class LdCelpFormatConversionProvider extends FormatConversionProvider { + + @Override + public AudioFormat.Encoding[] getSourceEncodings() { + return new AudioFormat.Encoding[] {LdCelpEncoding.G728, AudioFormat.Encoding.PCM_SIGNED}; + } + + @Override + public AudioFormat.Encoding[] getTargetEncodings() { + return new AudioFormat.Encoding[] {LdCelpEncoding.G728, AudioFormat.Encoding.PCM_SIGNED}; + } + + @Override + public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) { + if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) { + return new AudioFormat.Encoding[] {LdCelpEncoding.G728}; + } else if (sourceFormat.getEncoding() instanceof LdCelpEncoding) { + return new AudioFormat.Encoding[] {AudioFormat.Encoding.PCM_SIGNED}; + } else { + return new AudioFormat.Encoding[0]; + } + } + + @Override + public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) { + if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && + targetEncoding instanceof LdCelpEncoding) { + if (sourceFormat.getChannels() > 2 || + sourceFormat.getChannels() <= 0 || + sourceFormat.isBigEndian()) { + return new AudioFormat[0]; + } else { + return new AudioFormat[] { + new AudioFormat(targetEncoding, + sourceFormat.getSampleRate(), + -1, // sample size in bits + sourceFormat.getChannels(), + -1, // frame size + -1, // frame rate + false) // little endian + }; + } + } else if (sourceFormat.getEncoding() instanceof LdCelpEncoding && targetEncoding.equals(AudioFormat.Encoding.PCM_SIGNED)) { + return new AudioFormat[] { + new AudioFormat(sourceFormat.getSampleRate(), + 16, // sample size in bits + sourceFormat.getChannels(), + true, // signed + false) // little endian (for PCM wav) + }; + } else { + return new AudioFormat[0]; + } + } + + @Override + public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream) { + if (isConversionSupported(targetEncoding, sourceStream.getFormat())) { + AudioFormat[] formats = getTargetFormats(targetEncoding, sourceStream.getFormat()); + if (formats != null && formats.length > 0) { + AudioFormat sourceFormat = sourceStream.getFormat(); + AudioFormat targetFormat = formats[0]; + if (sourceFormat.equals(targetFormat)) { + return sourceStream; + } else if (sourceFormat.getEncoding() instanceof LdCelpEncoding && targetFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) { + try { + return new LdCelp2PcmAudioInputStream(sourceStream, targetFormat, AudioSystem.NOT_SPECIFIED); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } else if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && targetFormat.getEncoding() instanceof LdCelpEncoding) { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat); + } else { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat.toString()); + } + } else { + throw new IllegalArgumentException("target format not found"); + } + } else { + throw new IllegalArgumentException("conversion not supported"); + } + } + + @Override + public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream) { + if (isConversionSupported(targetFormat, sourceStream.getFormat())) { + AudioFormat[] formats = getTargetFormats(targetFormat.getEncoding(), sourceStream.getFormat()); + if (formats != null && formats.length > 0) { + AudioFormat sourceFormat = sourceStream.getFormat(); + if (sourceFormat.equals(targetFormat)) { + return sourceStream; + } else if (sourceFormat.getEncoding() instanceof LdCelpEncoding && + targetFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) { + try { + return new LdCelp2PcmAudioInputStream(sourceStream, targetFormat, AudioSystem.NOT_SPECIFIED); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } else if (sourceFormat.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED) && targetFormat.getEncoding() instanceof LdCelpEncoding) { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat); + } else { + throw new IllegalArgumentException("unable to convert " + sourceFormat + " to " + targetFormat); + } + } else { + throw new IllegalArgumentException("target format not found"); + } + } else { + throw new IllegalArgumentException("conversion not supported"); + } + } +} diff --git a/src/main/java/vavi/sound/sampled/opl3/Opl3AudioFileReader.java b/src/main/java/vavi/sound/sampled/opl3/Opl3AudioFileReader.java index 0df2e8b..5b9e2df 100644 --- a/src/main/java/vavi/sound/sampled/opl3/Opl3AudioFileReader.java +++ b/src/main/java/vavi/sound/sampled/opl3/Opl3AudioFileReader.java @@ -10,8 +10,12 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.nio.file.Files; +import java.util.HashMap; +import java.util.Map; import java.util.logging.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; @@ -36,9 +40,12 @@ */ public class Opl3AudioFileReader extends AudioFileReader { + private URI uri; + @Override public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException { try (InputStream inputStream = Files.newInputStream(file.toPath())) { + uri = file.toURI(); return getAudioFileFormat(inputStream, (int) file.length()); } } @@ -46,6 +53,10 @@ public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFile @Override public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException { try (InputStream inputStream = url.openStream()) { + try { + uri = url.toURI(); + } catch (URISyntaxException ignore) { + } return getAudioFileFormat(inputStream); } } @@ -77,8 +88,10 @@ protected AudioFileFormat getAudioFileFormat(InputStream bitStream, int mediaLen throw (UnsupportedAudioFileException) new UnsupportedAudioFileException().initCause(e); } AudioFileFormat.Type type = FileType.getType(encoding); + Map props = new HashMap<>(); + props.put("uri", uri); // for advanced sierra file // specification for around frame might cause AudioInputStream modification at below (*1) - AudioFormat format = new AudioFormat(encoding, opl3.getSampleRate(), AudioSystem.NOT_SPECIFIED, opl3.getChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, opl3.isBigEndian()); + AudioFormat format = new AudioFormat(encoding, opl3.getSampleRate(), AudioSystem.NOT_SPECIFIED, opl3.getChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, opl3.isBigEndian(), props); return new AudioFileFormat(type, format, AudioSystem.NOT_SPECIFIED); } diff --git a/src/main/java/vavi/sound/sampled/opl3/Opl3ToPcmAudioInputStream.java b/src/main/java/vavi/sound/sampled/opl3/Opl3ToPcmAudioInputStream.java index 1e1c7a4..abfbdd6 100644 --- a/src/main/java/vavi/sound/sampled/opl3/Opl3ToPcmAudioInputStream.java +++ b/src/main/java/vavi/sound/sampled/opl3/Opl3ToPcmAudioInputStream.java @@ -4,12 +4,11 @@ package vavi.sound.sampled.opl3; -import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.logging.Level; - +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -19,6 +18,8 @@ import vavi.sound.opl3.Opl3Player.FileType; import vavi.util.Debug; +import static java.lang.System.getLogger; + /** * Opl3AudioInputStream. @@ -28,6 +29,8 @@ */ public class Opl3ToPcmAudioInputStream extends AudioInputStream { + private static final Logger logger = getLogger(Opl3ToPcmAudioInputStream.class.getName()); + /** decode */ public Opl3ToPcmAudioInputStream(InputStream stream, AudioFormat format, long length, AudioFormat sourceFormat) throws IOException { super(new OutputEngineInputStream(new Opl3OutputEngine(stream, sourceFormat)), format, length); @@ -40,7 +43,7 @@ private static class Opl3OutputEngine implements OutputEngine { private final Opl3Player player; /** */ - private DataOutputStream out; + private OutputStream out; /** */ private final float sampleRate; @@ -49,6 +52,7 @@ private static class Opl3OutputEngine implements OutputEngine { public Opl3OutputEngine(InputStream is, AudioFormat format) throws IOException { player = FileType.getPlayer(format.getEncoding()); player.load(is); + player.setProperties(format.properties()); sampleRate = format.getSampleRate(); } @@ -58,8 +62,9 @@ public void initialize(OutputStream out) throws IOException { if (this.out != null) { throw new IOException("Already initialized"); } else { - this.out = new DataOutputStream(out); + this.out = out; } +logger.log(Level.DEBUG, "engin start"); } @Override @@ -69,17 +74,18 @@ public void execute() throws IOException { } else { if (player.update()) { double sec = 1.0 / player.getRefresh(); -Debug.println(Level.FINEST, "bytes: " + (int) (sampleRate * sec) + ", " + player.getRefresh()); +logger.log(Level.TRACE, "engine bytes: " + (int) (sampleRate * sec) + ", " + player.getRefresh()); byte[] buf = player.read(4 * (int) (sampleRate * sec)); - out.write(buf); + out.write(buf, 0, buf.length); } else { for (int wait = 0; wait < 30; ++wait) { double sec = 0.1; byte[] buf = player.read(4 * (int) (sampleRate * sec)); - out.write(buf); + out.write(buf, 0, buf.length); } +logger.log(Level.DEBUG, "engine last"); out.close(); } } @@ -87,7 +93,7 @@ public void execute() throws IOException { @Override public void finish() throws IOException { -Debug.println(Level.FINEST, "finish"); +logger.log(Level.TRACE, "finish"); } } } diff --git a/src/main/java/vavi/sound/sampled/opus/OpusEncoding.java b/src/main/java/vavi/sound/sampled/opus/OpusEncoding.java index 160bde8..a48489a 100644 --- a/src/main/java/vavi/sound/sampled/opus/OpusEncoding.java +++ b/src/main/java/vavi/sound/sampled/opus/OpusEncoding.java @@ -18,13 +18,13 @@ */ public class OpusEncoding extends AudioFormat.Encoding { - /** Specifies any ALAC encoded data. */ + /** Specifies any Opus encoded data. */ public static final OpusEncoding OPUS = new OpusEncoding("OPUS"); /** * Constructs a new encoding. * - * @param name Name of the ALAC encoding. + * @param name Name of the Opus encoding. */ public OpusEncoding(String name) { super(name); diff --git a/src/main/java/vavi/sound/sampled/opus/OpusFileFormatType.java b/src/main/java/vavi/sound/sampled/opus/OpusFileFormatType.java index e6ef20a..397930b 100644 --- a/src/main/java/vavi/sound/sampled/opus/OpusFileFormatType.java +++ b/src/main/java/vavi/sound/sampled/opus/OpusFileFormatType.java @@ -20,7 +20,7 @@ public class OpusFileFormatType extends AudioFileFormat.Type { /** * Specifies an OPUS file. */ - public static final AudioFileFormat.Type OPUS = new OpusFileFormatType("OPUS", "opus"); + public static final AudioFileFormat.Type OPUS = new OpusFileFormatType("OPUS", "ogg"); /** * Constructs a file type. diff --git a/src/main/java/vavi/sound/sampled/rococoa/Rococoa2PcmAudioInputStream.java b/src/main/java/vavi/sound/sampled/rococoa/Rococoa2PcmAudioInputStream.java index 6601502..54e5932 100644 --- a/src/main/java/vavi/sound/sampled/rococoa/Rococoa2PcmAudioInputStream.java +++ b/src/main/java/vavi/sound/sampled/rococoa/Rococoa2PcmAudioInputStream.java @@ -99,7 +99,7 @@ public void initialize(InputStream in) throws IOException { } } - ByteBuffer buffer = ByteBuffer.allocateDirect(8192); + final ByteBuffer buffer = ByteBuffer.allocateDirect(8192); @Override public void execute() throws IOException { diff --git a/src/main/java/vavi/sound/sampled/rococoa/RococoaClip.java b/src/main/java/vavi/sound/sampled/rococoa/RococoaClip.java index e49a9f0..0566895 100644 --- a/src/main/java/vavi/sound/sampled/rococoa/RococoaClip.java +++ b/src/main/java/vavi/sound/sampled/rococoa/RococoaClip.java @@ -41,7 +41,7 @@ */ public class RococoaClip implements Clip { - public static javax.sound.sampled.DataLine.Info info = + public static final javax.sound.sampled.DataLine.Info info = new javax.sound.sampled.DataLine.Info(RococoaClip.class, new AudioFormat(RcococaEncoding.ROCOCOA, AudioSystem.NOT_SPECIFIED, @@ -57,7 +57,7 @@ protected void fireUpdate(LineEvent event) { listeners.forEach(l -> l.update(event)); } - private Control[] controls; + private final Control[] controls; private AVAudioPlayer player; @@ -198,7 +198,7 @@ private void calcVolume() { } } - private Gain gainControl = new Gain(); + private final Gain gainControl = new Gain(); private final Mute muteControl = new Mute(); private final Balance balanceControl = new Balance(); private final Pan panControl = new Pan(); diff --git a/src/main/java/vavi/sound/sampled/rococoa/RococoaMixer.java b/src/main/java/vavi/sound/sampled/rococoa/RococoaMixer.java index 8686ff7..3f5cb20 100644 --- a/src/main/java/vavi/sound/sampled/rococoa/RococoaMixer.java +++ b/src/main/java/vavi/sound/sampled/rococoa/RococoaMixer.java @@ -44,7 +44,7 @@ public class RococoaMixer implements Mixer { private static final String version; - public static Mixer.Info mixerInfo = new Mixer.Info( + public static final Mixer.Info mixerInfo = new Mixer.Info( "Rococoa Mixer", "vavi", "Mixer for Rococoa", diff --git a/src/main/java/vavi/sound/sampled/rococoa/RococoaMixerPropvider.java b/src/main/java/vavi/sound/sampled/rococoa/RococoaMixerPropvider.java deleted file mode 100644 index c8814a3..0000000 --- a/src/main/java/vavi/sound/sampled/rococoa/RococoaMixerPropvider.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2022 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano - */ - -package vavi.sound.sampled.rococoa; - -import java.util.logging.Level; - -import javax.sound.sampled.Mixer; -import javax.sound.sampled.Mixer.Info; -import javax.sound.sampled.spi.MixerProvider; - -import vavi.util.Debug; - - -/** - * RococoaMixerPropvider. - * - * @author Naohide Sano (umjammer) - * @version 0.00 2022/02/21 umjammer initial version
    - */ -public class RococoaMixerPropvider extends MixerProvider { - - @Override - public Info[] getMixerInfo() { - return new Info[] {RococoaMixer.mixerInfo}; - } - - @Override - public Mixer getMixer(Info info) { - if (info == RococoaMixer.mixerInfo) { - Debug.println(Level.FINE, "★1 info: " + info); - RococoaMixer mixer = new RococoaMixer(); - return mixer; - } else { - Debug.println(Level.FINE, "not suitable for this provider: " + info); - throw new IllegalArgumentException("info is not suitable for this provider"); - } - } -} diff --git a/src/main/java/vavi/sound/twinvq/GetBits.java b/src/main/java/vavi/sound/twinvq/GetBits.java new file mode 100644 index 0000000..8285d86 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/GetBits.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.twinvq; + +/** + * GetBits. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-04-07 nsano initial version
    + */ +public class GetBits { + + final int bitcount; + + int pos; + + public final char[] buffer; + final int buffer_len; + int buffer_pos; + + public int get_bits_count() { + return bitcount; + } + + public byte get_bits1() { + return (byte) get_bits(1); + } + + public GetBits(byte[] buf, int bufSize) { + buffer = new char[bufSize]; + buffer_len = bufSize; + buffer_pos = 0; + bitcount = 8 * bufSize; + for (int i = 0; i < bufSize; i++) { + buffer[i] = (char) buf[i]; + } + } + + public void skip_bits(int bits) { + get_bits(bits); + } + + /** + * Read 1-25 bits. + */ + int get_bits(int bitno) { + int BitsLeft; + int index = 0; + + while (bitno > 0) { + + // move forward in BitStream when the end of the + // byte is reached + + if (pos == 8) { + pos = 0; + buffer_pos++; + } + + BitsLeft = 8 - pos; + + // Extract bits to index + + if (BitsLeft >= bitno) { + index += ((((buffer[buffer_pos]) << (pos)) & 0xFF) >>> (8 - bitno)); + pos += bitno; + bitno = 0; + } else { + + if ((8 - bitno) > 0) { + index += ((((buffer[buffer_pos]) << (pos)) & 0xFF) >>> (8 - bitno)); + pos = 8; + } else { + index += ((((buffer[buffer_pos]) << (pos)) & 0xFF) << (bitno - 8)); + pos = 8; + } + bitno -= BitsLeft; + } + } + + return index; + } +} diff --git a/src/main/java/vavi/sound/twinvq/LibAV.java b/src/main/java/vavi/sound/twinvq/LibAV.java new file mode 100644 index 0000000..4ce94d2 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/LibAV.java @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.twinvq; + +import java.io.DataInputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +import jdk.incubator.vector.FloatVector; +import jdk.incubator.vector.VectorSpecies; +import vavi.io.SeekableDataInputStream; +import vavi.sound.twinvq.TwinVQDec.TwinVQContext; +import vavi.sound.twinvq.VFQ.VqfContext; +import vavi.util.Debug; + +import static java.lang.System.getLogger; + + +/** + * LibAV. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-06-25 nsano initial version
    + */ +public class LibAV { + + private static final Logger logger = getLogger(LibAV.class.getName()); + + interface TetraFunction { + + R apply(T t, U u, V v, W w); + } + + interface TetraConsumer { + + void accept(T t, U u, V v, W w, X x); + } + + interface HeptaConsumer { + + void accept(T t, U u, V v, W w, X x, Y y, Z z); + } + +//#region common.h + + static final int AVERROR_INVALIDDATA = -1; + + static int MKTAG(int a, int b, int c, int d) { + return a | (b << 8) | (c << 16) | (d << 24); + } + +//#endregion + +//#region avformat + + static class AVInputFormat { + String name; + String long_name; + int priv_data_size; + Function read_probe; + Function read_header; + Function read_packet; + TetraFunction read_seek; + String extensions; + } + + static class AVFormatContext { + + public VqfContext priv_data = new VqfContext(); + public AVStream[] streams = new AVStream[1]; + public DataInputStream pb; + public Map metadata = new HashMap<>(); + } + + static class AVStream { + + public AVCodecContext codecpar = new AVCodecContext(); + public long start_time; + + public AVStream(AVFormatContext s, Object o) { + s.streams[0] = this; + } + } + + static class AVProbeData { + + public byte[] buf; + } + +//#endregion + +//#region avcodec + + static final int AV_SAMPLE_FMT_FLTP = 0; // ??? + + static final int AV_TX_FLOAT_MDCT = 1; + + static final int AV_CODEC_FLAG_BITEXACT = 1 << 23; + + static final int AV_INPUT_BUFFER_PADDING_SIZE = 8; + + static class AVChannelLayout { + + /** + * Number of channels in this layout. Mandatory field. + */ + int nb_channels; + } + + static class AVCodecContext { + + public TwinVQContext priv_data; + + public int sample_rate; + + /** + * the average bitrate + * - encoding: Set by user; unused for constant quantizer encoding. + * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. + */ + public int bit_rate; + + public int extradata_size; + + public byte[] extradata; + + public int block_align; + public AVChannelLayout ch_layout = new AVChannelLayout(); + public Object sample_fmt; + public int flags; + public int codec_type; + public Object pix_fmt; + public Object sw_pix_fmt; + public int channels; + public int codec_id; + int max_samples; + } + + static class AVFloatDSPContext { + + public AVFloatDSPContext(int flags) { + } + + /** + * Calculate the product of two vectors of floats and store the result in + * a vector of floats. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + public void vector_fmul(float[] dst, int destP, float[] src0, int src0P, float[] src1, int src1P, int len) { + VectorSpecies SPECIES = FloatVector.SPECIES_256; + int upperBound = SPECIES.loopBound(len); + + for (int i = 0; i < upperBound; i += SPECIES.length()) { + FloatVector v0 = FloatVector.fromArray(SPECIES, src0, src0P + i); + FloatVector v1 = FloatVector.fromArray(SPECIES, src1, src1P + i); + FloatVector result = v0.mul(v1); + result.intoArray(dst, destP + i); + } + + // Handle any remaining elements + for (int i = upperBound; i < len; i++) { + dst[destP + i] = src0[src0P + i] * src1[src1P + i]; + } + } + + /** + * Overlap/add with window function. + * Used primarily by MDCT-based audio codecs. + * Source and destination vectors must overlap exactly or not at all. + * + * @param dst result vector + * constraints: 16-byte aligned + * @param src0 first source vector + * constraints: 16-byte aligned + * @param src1 second source vector + * constraints: 16-byte aligned + * @param win half-window vector + * constraints: 16-byte aligned + * @param len length of vector + * constraints: multiple of 4 + */ + public void vector_fmul_window(float[] dst, int dstP, float[] src0, int src0P, float[] src1, int src1P, float[] win, int len) { + VectorSpecies SPECIES = FloatVector.SPECIES_128; + int upperBound = SPECIES.loopBound(len); + + for (int i = 0; i < upperBound; i += SPECIES.length()) { + FloatVector v_src0 = FloatVector.fromArray(SPECIES, src0, src0P + i); + FloatVector v_win = FloatVector.fromArray(SPECIES, win, i); + + // Manually load reversed src1 and win vectors + float[] src1Reversed = new float[SPECIES.length()]; + float[] winReversed = new float[SPECIES.length()]; + for (int j = 0; j < SPECIES.length(); j++) { + src1Reversed[j] = src1[src1P + len - i - j - 1]; + winReversed[j] = win[len - i - j - 1]; + } + FloatVector v_src1 = FloatVector.fromArray(SPECIES, src1Reversed, 0); + FloatVector v_win_rev = FloatVector.fromArray(SPECIES, winReversed, 0); + + FloatVector result = v_src0.mul(v_win).add(v_src1.mul(v_win_rev)); + result.intoArray(dst, dstP + i); + } + + // Handle any remaining elements + for (int i = upperBound; i < len; i++) { + dst[dstP + i] = src0[src0P + i] * win[i] + src1[src1P + len - i - 1] * win[len - i - 1]; + } + } + + /** + * Calculate the sum and difference of two vectors of floats. + * + * @param v1 first input vector, sum output, 16-byte aligned + * @param v2 second input vector, difference output, 16-byte aligned + * @param len length of vectors, multiple of 4 + */ + public void butterflies_float(float[] v1, int p1, float[] v2, int p2, short len) { + VectorSpecies SPECIES = FloatVector.SPECIES_128; + int upperBound = SPECIES.loopBound(len); + + for (int i = 0; i < upperBound; i += SPECIES.length()) { + FloatVector vec1 = FloatVector.fromArray(SPECIES, v1, p1 + i); + FloatVector vec2 = FloatVector.fromArray(SPECIES, v2, p2 + i); + + FloatVector sum = vec1.add(vec2); + FloatVector diff = vec1.sub(vec2); + + sum.intoArray(v1, p1 + i); + diff.intoArray(v2, p2 + i); + } + + // Handle any remaining elements + for (int i = upperBound; i < len; i++) { + float temp1 = v1[p1 + i]; + float temp2 = v2[p2 + i]; + v1[p1 + i] = temp1 + temp2; + v2[p2 + i] = temp1 - temp2; + } + } + } + + static class AVTXContext { + interface TXFunction extends TetraConsumer {} + } + + static class AVFrame { + + public int nb_samples; + public Object extended_data; + public byte[] data; + } + + static class AVPacket { + + public byte[] data; + public int size; + public int duration; + public int stream_index; + public long pos; + + public AVPacket(int size) { + this.size = size; + data = new byte[size]; + } + } + + static Map ff_sine_windows = new HashMap<>(); + + static { + for (int i = 5; i < 14; i++) + ff_init_ff_sine_windows(i); + } + + static void ff_init_ff_sine_windows(int index) { + float[] windows = new float[1 << index]; + ff_sine_window_init(windows, 1 << index); +Debug.println("index: " + index + ", windows: " + windows.length); + ff_sine_windows.put(index, windows); + } + + // Generate a sine window. + static void ff_sine_window_init(float[] window, int n) { + for (int i = 0; i < n; i++) + window[i] = (float) Math.sin((i + 0.5) * (Math.PI / (2.0 * n))); + } + + static int ff_get_buffer(AVCodecContext avctx, AVFrame frame, int flags) { + int ret = 0; + + if (frame.nb_samples * (long) avctx.ch_layout.nb_channels > avctx.max_samples) { + logger.log(Level.ERROR, "samples per frame %d, exceeds max_samples %d", frame.nb_samples, avctx.max_samples); + return -1; + } +// ret = ff_decode_frame_props(avctx, frame); + if (ret < 0) + return -1; + + avctx.sw_pix_fmt = avctx.pix_fmt; + +// ret = avctx.get_buffer2(avctx, frame, flags); + if (ret < 0) + return -1; + +// validate_avframe_allocation(avctx, frame); + +// ret = ff_attach_decode_data(frame); + if (ret < 0) + return -1; + + return ret; + } + + static int av_tx_init(AVTXContext[] ctx, AVTXContext.TXFunction[] tx, int index, int /*AVTXType*/ type, + int inv, int len, float[] scale, long flags) { +Debug.println("type: " + type); + scale[0] = 1f; + MDCT mdct = new MDCT(Float.SIZE, false, scale[0]); + tx[index] = (x, in, inp, out, op) -> mdct.imdctHalf(in, inp, out, op); + return 0; + } + + static int FF_ARRAY_ELEMS(float[][][] barkHist) { + return 0; + } + +//#endregion +} diff --git a/src/main/java/vavi/sound/twinvq/MDCT.java b/src/main/java/vavi/sound/twinvq/MDCT.java new file mode 100644 index 0000000..534a765 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/MDCT.java @@ -0,0 +1,151 @@ +/* + * MDCT/IMDCT transforms + * Copyright (c) 2002 Fabrice Bellard + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package vavi.sound.twinvq; + +public class MDCT { + + private int mdctBits; + private int mdctSize; + private float[] tcos; + private float[] tsin; + private int[] revtab; + private boolean inverse; + + public MDCT(int nbits, boolean inverse, float scale) { + this.mdctBits = nbits; + this.mdctSize = 1 << nbits; + this.inverse = inverse; + initTables(scale); + initFFT(); + } + + private void initTables(float scale) { + int n = mdctSize; + int n4 = n >> 2; + tcos = new float[n / 2]; + tsin = new float[n / 2]; + + float theta = 1.0f / 8.0f + (scale < 0 ? n4 : 0); + scale = (float) Math.sqrt(Math.abs(scale)); + for (int i = 0; i < n4; i++) { + float alpha = (float) (2 * Math.PI * (i + theta) / n); + tcos[i] = (float) (-Math.cos(alpha) * scale); + tsin[i] = (float) (-Math.sin(alpha) * scale); + } + } + + private void initFFT() { + // Implement FFT initialization if needed + // This might involve creating a separate FFT class + } + + public void imdctHalf(float[] output, int op, float[] input, int ip) { + int n = mdctSize; + int n2 = n >> 1; + int n4 = n >> 2; + int n8 = n >> 3; + + float[] z = new float[n]; + + // Pre rotation + for (int k = 0; k < n4; k++) { + int j = revtab[k]; + float re = input[ip + n2 - 2 - k] * tcos[k] + input[ip + k] * tsin[k]; + float im = input[ip + n2 - 2 - k] * tsin[k] - input[ip + k] * tcos[k]; + z[2 * j] = re; + z[2 * j + 1] = im; + } + + // FFT calculation would go here + // fftCalc(z); + + // Post rotation and reordering + for (int k = 0; k < n8; k++) { + float r0 = z[2 * (n8 - k - 1)]; + float i0 = z[2 * (n8 - k - 1) + 1]; + float r1 = z[2 * (n8 + k)]; + float i1 = z[2 * (n8 + k) + 1]; + + output[op + 2 * k] = r0 * tcos[n8 - k - 1] - i0 * tsin[n8 - k - 1]; + output[op + 2 * k + 1] = r1 * tcos[n8 + k] - i1 * tsin[n8 + k]; + output[op + n2 - 2 - 2 * k] = r0 * tsin[n8 - k - 1] + i0 * tcos[n8 - k - 1]; + output[op + n2 - 1 - 2 * k] = r1 * tsin[n8 + k] + i1 * tcos[n8 + k]; + } + } + + public void imdctCalc(float[] output, int op, float[] input, int ip) { + int n = mdctSize; + int n2 = n >> 1; + int n4 = n >> 2; + + float[] temp = new float[n2]; + imdctHalf(temp, 0, input, ip); + + for (int k = 0; k < n4; k++) { + output[op + k] = -temp[n2 - k - 1]; + output[op + n - k - 1] = temp[n2 + k]; + } + } + + public void mdctCalc(float[] out, int op, float[] input, int ip) { + int n = mdctSize; + int n2 = n >> 1; + int n4 = n >> 2; + int n8 = n >> 3; + int n3 = 3 * n4; + + float[] x = new float[n]; + + // Pre rotation + for (int i = 0; i < n8; i++) { + float re = -input[2 * i + n3] - input[n3 - 1 - 2 * i]; + float im = -input[n4 + 2 * i] + input[n4 - 1 - 2 * i]; + int j = revtab[i]; + x[2 * j] = re * tcos[i] - im * tsin[i]; + x[2 * j + 1] = re * tsin[i] + im * tcos[i]; + + re = input[2 * i] - input[n2 - 1 - 2 * i]; + im = -input[n2 + 2 * i] - input[n - 1 - 2 * i]; + j = revtab[n8 + i]; + x[2 * j] = re * tcos[n8 + i] - im * tsin[n8 + i]; + x[2 * j + 1] = re * tsin[n8 + i] + im * tcos[n8 + i]; + } + + // FFT calculation would go here + // fftCalc(x); + + // Post rotation + for (int i = 0; i < n8; i++) { + float r0 = x[2 * (n8 - i - 1)]; + float i0 = x[2 * (n8 - i - 1) + 1]; + float r1 = x[2 * (n8 + i)]; + float i1 = x[2 * (n8 + i) + 1]; + + out[2 * i] = -r1 * tsin[n8 + i] - i1 * tcos[n8 + i]; + out[2 * i + 1] = -r0 * tsin[n8 - i - 1] - i0 * tcos[n8 - i - 1]; + out[n2 - 2 - 2 * i] = r0 * tcos[n8 - i - 1] - i0 * tsin[n8 - i - 1]; + out[n2 - 1 - 2 * i] = r1 * tcos[n8 + i] - i1 * tsin[n8 + i]; + } + } + + // Helper methods like initRevtab() and fftCalc() would be implemented here +} \ No newline at end of file diff --git a/src/main/java/vavi/sound/twinvq/MetaSoundTwinVQData.java b/src/main/java/vavi/sound/twinvq/MetaSoundTwinVQData.java new file mode 100644 index 0000000..cc493e3 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/MetaSoundTwinVQData.java @@ -0,0 +1,818 @@ +/* + * MetaSound decoder + * Copyright (c) 2013 Konstantin Shishkov + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package vavi.sound.twinvq; + +/** + * MetaSoundTwinVQData. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-04-06 nsano initial version
    + */ +public class MetaSoundTwinVQData { + + static final float[] ff_metasound_lsp8 = { + 0.2702f, 0.5096f, 0.6437f, 0.7672f, 0.9639f, 1.0696f, 1.2625f, 1.5789f, + 1.9285f, 2.2383f, 2.5129f, 2.8470f, 0.1740f, 0.3677f, 0.6082f, 0.8387f, + 1.1084f, 1.3721f, 1.6362f, 1.8733f, 2.0640f, 2.3442f, 2.6087f, 2.8548f, + 0.1536f, 0.3279f, 0.5143f, 0.6859f, 0.9763f, 1.2744f, 1.5605f, 1.8566f, + 2.1007f, 2.3450f, 2.6075f, 2.8850f, 0.2075f, 0.4533f, 0.7709f, 1.0377f, + 1.2953f, 1.5132f, 1.7826f, 2.0351f, 2.2590f, 2.4996f, 2.6795f, 2.8748f, + 0.1393f, 0.2453f, 0.3754f, 0.5453f, 0.8148f, 1.1289f, 1.4389f, 1.7592f, + 2.0353f, 2.3215f, 2.5934f, 2.8588f, 0.1250f, 0.3627f, 0.7613f, 1.1380f, + 1.4163f, 1.5565f, 1.6920f, 1.8130f, 1.8678f, 2.0427f, 2.4318f, 2.8544f, + 0.2256f, 0.4223f, 0.6452f, 0.8599f, 1.0673f, 1.3118f, 1.5486f, 1.8366f, + 2.0759f, 2.3026f, 2.5284f, 2.8030f, 0.2304f, 0.4404f, 0.6891f, 0.8964f, + 1.1510f, 1.4202f, 1.6483f, 1.8580f, 2.1181f, 2.3686f, 2.6078f, 2.9128f, + 0.2230f, 0.3816f, 0.5520f, 0.6062f, 0.7909f, 1.0988f, 1.4330f, 1.7846f, + 2.0713f, 2.3457f, 2.6048f, 2.8708f, 0.2447f, 0.5800f, 0.8249f, 0.9905f, + 1.1721f, 1.3990f, 1.6694f, 1.9064f, 2.1307f, 2.4255f, 2.6815f, 2.9117f, + 0.1974f, 0.3812f, 0.5802f, 0.7759f, 0.9280f, 1.1547f, 1.4170f, 1.6369f, + 1.8890f, 2.2587f, 2.5626f, 2.8239f, 0.1209f, 0.2510f, 0.4841f, 0.8048f, + 1.1197f, 1.3563f, 1.6073f, 1.8926f, 2.1350f, 2.3669f, 2.6291f, 2.8985f, + 0.2352f, 0.4347f, 0.6582f, 0.8178f, 0.9548f, 1.1654f, 1.4942f, 1.8812f, + 2.1703f, 2.3779f, 2.6412f, 2.8871f, 0.2091f, 0.4084f, 0.6730f, 0.9151f, + 1.1259f, 1.3262f, 1.5937f, 1.8129f, 2.0237f, 2.3317f, 2.5778f, 2.8620f, + 0.1167f, 0.2406f, 0.4520f, 0.7298f, 0.9848f, 1.2448f, 1.5137f, 1.7874f, + 2.0280f, 2.3020f, 2.5914f, 2.8794f, 0.3003f, 0.4966f, 0.6520f, 0.8505f, + 1.1600f, 1.3981f, 1.5805f, 1.8346f, 2.0757f, 2.3102f, 2.5760f, 2.8499f, + 0.2451f, 0.4163f, 0.5960f, 0.7805f, 0.9507f, 1.2438f, 1.5587f, 1.8581f, + 2.0735f, 2.3198f, 2.5704f, 2.8220f, 0.3112f, 0.5517f, 0.7032f, 0.8528f, + 1.1489f, 1.4257f, 1.6848f, 1.9388f, 2.1577f, 2.4265f, 2.6678f, 2.9051f, + 0.2249f, 0.3897f, 0.5559f, 0.7473f, 1.0158f, 1.3581f, 1.6914f, 1.9930f, + 2.1843f, 2.3534f, 2.5512f, 2.8065f, 0.2600f, 0.4574f, 0.7349f, 0.9691f, + 1.1696f, 1.3848f, 1.6335f, 1.9021f, 2.1174f, 2.3481f, 2.5902f, 2.8390f, + 0.2246f, 0.3372f, 0.4560f, 0.5249f, 0.7056f, 1.0273f, 1.3810f, 1.7132f, + 1.9819f, 2.2574f, 2.5410f, 2.8491f, 0.1419f, 0.4834f, 0.8835f, 1.1453f, + 1.2839f, 1.4224f, 1.5593f, 1.7877f, 2.1285f, 2.4070f, 2.6043f, 2.8511f, + 0.1886f, 0.3677f, 0.5617f, 0.8099f, 1.1277f, 1.3841f, 1.5804f, 1.8136f, + 2.0307f, 2.2805f, 2.5399f, 2.8322f, 0.2351f, 0.4151f, 0.6675f, 0.8713f, + 1.0464f, 1.3292f, 1.6586f, 1.9281f, 2.1355f, 2.3495f, 2.6222f, 2.8782f, + 0.2700f, 0.4489f, 0.6206f, 0.7121f, 0.7737f, 0.9848f, 1.3658f, 1.7433f, + 2.0139f, 2.2243f, 2.4806f, 2.8175f, 0.2479f, 0.4425f, 0.6490f, 0.8745f, + 1.1161f, 1.3849f, 1.6773f, 1.9566f, 2.1491f, 2.3624f, 2.5685f, 2.8114f, + 0.2035f, 0.3701f, 0.5567f, 0.7953f, 1.0082f, 1.2758f, 1.5373f, 1.7822f, + 2.0175f, 2.2601f, 2.4759f, 2.7771f, 0.1856f, 0.3461f, 0.5998f, 0.9041f, + 1.2383f, 1.4612f, 1.6667f, 1.9305f, 2.1617f, 2.4107f, 2.6477f, 2.8656f, + 0.2107f, 0.3715f, 0.5289f, 0.6651f, 0.8420f, 1.1168f, 1.4401f, 1.7230f, + 1.9901f, 2.2687f, 2.5452f, 2.8655f, 0.1218f, 0.2999f, 0.6348f, 0.9482f, + 1.2745f, 1.5876f, 1.9129f, 2.2348f, 2.4020f, 2.4922f, 2.6351f, 2.8357f, + 0.1617f, 0.3483f, 0.5869f, 0.8163f, 1.0366f, 1.2344f, 1.4609f, 1.7029f, + 1.9476f, 2.2337f, 2.5258f, 2.8442f, 0.2505f, 0.4894f, 0.7510f, 0.9152f, + 1.0845f, 1.3657f, 1.6528f, 1.8346f, 2.0160f, 2.2811f, 2.5338f, 2.8136f, + 0.0947f, 0.1158f, 0.0578f, -0.0337f, -0.0066f, 0.0104f, -0.0447f, -0.0505f, + -0.0778f, -0.0293f, 0.0251f, -0.0143f, 0.0349f, -0.0227f, -0.0909f, 0.0523f, + 0.0325f, -0.0410f, -0.1045f, -0.0899f, -0.0009f, 0.0075f, -0.0575f, -0.0855f, + -0.0129f, 0.0575f, 0.0597f, 0.0391f, 0.0371f, -0.0184f, -0.0083f, 0.0287f, + 0.0143f, 0.0167f, 0.0120f, -0.0168f, 0.0452f, 0.0223f, -0.0352f, 0.0119f, + -0.0496f, -0.0965f, -0.0661f, -0.0072f, 0.1099f, 0.0843f, -0.0087f, -0.0478f, + -0.0128f, -0.0120f, -0.0004f, 0.0731f, 0.1047f, 0.0630f, 0.0196f, -0.0103f, + -0.0399f, -0.0986f, -0.0912f, -0.0390f, -0.0247f, -0.0694f, -0.0749f, -0.0066f, + 0.0223f, 0.0634f, 0.0343f, -0.0134f, 0.0727f, 0.0241f, 0.0066f, 0.0437f, + 0.0610f, 0.0364f, 0.0248f, -0.0358f, -0.0686f, -0.0104f, 0.0426f, 0.0088f, + -0.0137f, -0.0165f, 0.0671f, 0.0815f, -0.0863f, -0.0644f, -0.0088f, 0.0023f, + 0.0482f, 0.1174f, 0.1270f, 0.0594f, 0.0165f, 0.0949f, 0.1098f, 0.0137f, + 0.4951f, 0.4999f, 0.4958f, 0.4907f, 0.4984f, 0.4965f, 0.4958f, 0.4996f, + 0.4987f, 0.4958f, 0.4986f, 0.4977f, 0.2841f, 0.2186f, 0.1474f, 0.1687f, + 0.2217f, 0.2632f, 0.2706f, 0.2624f, 0.2162f, 0.2453f, 0.2460f, 0.2531f, + }; + + static final float[] ff_metasound_lsp11 = { + 0.1103f, 0.3862f, 0.6863f, 0.8447f, 0.9231f, 1.0261f, 1.1248f, 1.4057f, + 1.6621f, 1.8010f, 1.8692f, 2.0704f, 2.3490f, 2.6060f, 2.7539f, 2.8977f, + 0.1273f, 0.2407f, 0.3812f, 0.6004f, 0.7767f, 0.9383f, 1.1344f, 1.3351f, + 1.5233f, 1.7262f, 1.9466f, 2.1739f, 2.3495f, 2.5162f, 2.7164f, 2.9202f, + 0.2010f, 0.3330f, 0.4488f, 0.6465f, 0.8046f, 0.9889f, 1.1479f, 1.2964f, + 1.4770f, 1.6606f, 1.8789f, 2.1155f, 2.3287f, 2.5199f, 2.7101f, 2.9119f, + 0.1168f, 0.2197f, 0.3279f, 0.4691f, 0.6268f, 0.8251f, 1.0533f, 1.2714f, + 1.4712f, 1.6762f, 1.8831f, 2.1114f, 2.3230f, 2.5297f, 2.7365f, 2.9270f, + 0.1405f, 0.3109f, 0.4986f, 0.6891f, 0.8634f, 1.0583f, 1.2594f, 1.4349f, + 1.6232f, 1.8116f, 1.9905f, 2.1935f, 2.3799f, 2.5656f, 2.7661f, 2.9486f, + 0.1703f, 0.3057f, 0.4403f, 0.5225f, 0.5969f, 0.8110f, 1.0729f, 1.3215f, + 1.5407f, 1.7381f, 1.9477f, 2.1680f, 2.3586f, 2.5612f, 2.7630f, 2.9410f, + 0.1128f, 0.2628f, 0.4523f, 0.6495f, 0.8176f, 0.9816f, 1.1746f, 1.3710f, + 1.5568f, 1.7518f, 1.9497f, 2.1452f, 2.3346f, 2.5389f, 2.7362f, 2.9264f, + 0.1809f, 0.3287f, 0.5205f, 0.7264f, 0.9298f, 1.1217f, 1.2970f, 1.4894f, + 1.6874f, 1.8493f, 2.0576f, 2.2382f, 2.4097f, 2.6041f, 2.7796f, 2.9389f, + 0.2502f, 0.4709f, 0.6892f, 0.8346f, 0.9209f, 1.0455f, 1.2399f, 1.4616f, + 1.6463f, 1.8380f, 2.0475f, 2.2397f, 2.4665f, 2.6550f, 2.7701f, 2.8895f, + 0.1040f, 0.2340f, 0.3964f, 0.5740f, 0.7764f, 0.9941f, 1.2000f, 1.4014f, + 1.6024f, 1.7974f, 1.9939f, 2.1959f, 2.3783f, 2.5663f, 2.7613f, 2.9484f, + 0.1912f, 0.3393f, 0.4743f, 0.6313f, 0.8014f, 0.9879f, 1.1855f, 1.3922f, + 1.5678f, 1.7289f, 1.9271f, 2.1165f, 2.3089f, 2.5414f, 2.7448f, 2.9269f, + 0.0965f, 0.2025f, 0.3398f, 0.4990f, 0.6934f, 0.9386f, 1.1730f, 1.3766f, + 1.5783f, 1.7783f, 1.9790f, 2.1831f, 2.3670f, 2.5578f, 2.7641f, 2.9516f, + 0.2126f, 0.3652f, 0.5545f, 0.7170f, 0.8674f, 1.0640f, 1.2558f, 1.4061f, + 1.5904f, 1.8095f, 1.9760f, 2.1505f, 2.3549f, 2.5575f, 2.7023f, 2.8877f, + 0.1827f, 0.3426f, 0.4894f, 0.6488f, 0.7960f, 0.9535f, 1.1217f, 1.2798f, + 1.4566f, 1.6453f, 1.8044f, 2.0042f, 2.2379f, 2.4611f, 2.6697f, 2.8966f, + 0.2034f, 0.3822f, 0.5231f, 0.6960f, 0.9200f, 1.0394f, 1.1616f, 1.3772f, + 1.5493f, 1.7330f, 1.9646f, 2.1233f, 2.3334f, 2.5361f, 2.7087f, 2.9470f, + 0.1050f, 0.2060f, 0.3705f, 0.5998f, 0.8337f, 1.0577f, 1.2559f, 1.4327f, + 1.6334f, 1.8165f, 1.9853f, 2.2058f, 2.4063f, 2.5818f, 2.7625f, 2.9458f, + 0.1419f, 0.4053f, 0.6660f, 0.8911f, 1.0405f, 1.1547f, 1.2506f, 1.3926f, + 1.5669f, 1.7527f, 1.9694f, 2.2054f, 2.3889f, 2.5743f, 2.7586f, 2.9174f, + 0.1514f, 0.2825f, 0.4309f, 0.5772f, 0.7470f, 0.9703f, 1.1462f, 1.3316f, + 1.5321f, 1.7259f, 1.9282f, 2.1266f, 2.3106f, 2.5064f, 2.7067f, 2.9094f, + 0.1693f, 0.3156f, 0.4878f, 0.6635f, 0.8206f, 0.9569f, 1.1154f, 1.3064f, + 1.5109f, 1.7184f, 1.9179f, 2.1036f, 2.2763f, 2.4820f, 2.6949f, 2.9105f, + 0.1432f, 0.2718f, 0.4241f, 0.5564f, 0.6939f, 0.9011f, 1.1582f, 1.3948f, + 1.6181f, 1.8024f, 1.9814f, 2.1740f, 2.3459f, 2.5456f, 2.7491f, 2.9307f, + 0.2294f, 0.3857f, 0.5590f, 0.7434f, 0.9189f, 1.0941f, 1.2740f, 1.4456f, + 1.6178f, 1.7994f, 1.9689f, 2.1644f, 2.3525f, 2.5385f, 2.7468f, 2.9405f, + 0.1667f, 0.3109f, 0.4612f, 0.6032f, 0.7375f, 0.8866f, 1.0840f, 1.3053f, + 1.4982f, 1.7044f, 1.9146f, 2.1117f, 2.2942f, 2.4983f, 2.7084f, 2.9132f, + 0.1810f, 0.3205f, 0.4696f, 0.6231f, 0.7641f, 0.9959f, 1.2427f, 1.4361f, + 1.5889f, 1.7544f, 1.9083f, 2.0733f, 2.2457f, 2.4461f, 2.6793f, 2.9098f, + 0.1164f, 0.3753f, 0.6068f, 0.7503f, 1.0100f, 1.2131f, 1.3793f, 1.5302f, + 1.6300f, 1.7950f, 1.9057f, 2.1031f, 2.3830f, 2.5745f, 2.6949f, 2.8779f, + 0.1571f, 0.4378f, 0.6735f, 0.8312f, 0.8944f, 0.9818f, 1.1622f, 1.4094f, + 1.6423f, 1.8066f, 1.9258f, 2.1838f, 2.4363f, 2.6279f, 2.7358f, 2.8790f, + 0.1398f, 0.2686f, 0.4248f, 0.6156f, 0.7870f, 1.0035f, 1.2012f, 1.3689f, + 1.5363f, 1.7398f, 1.9604f, 2.1619f, 2.3345f, 2.5097f, 2.7271f, 2.9368f, + 0.1913f, 0.3338f, 0.4987f, 0.6446f, 0.7852f, 1.0163f, 1.1886f, 1.3610f, + 1.5379f, 1.7230f, 1.8880f, 2.0862f, 2.2960f, 2.4928f, 2.7122f, 2.9151f, + 0.0908f, 0.1752f, 0.2899f, 0.5365f, 0.7761f, 1.0100f, 1.2124f, 1.4060f, + 1.6019f, 1.8010f, 1.9774f, 2.1905f, 2.3733f, 2.5623f, 2.7660f, 2.9565f, + 0.1773f, 0.3179f, 0.4925f, 0.6864f, 0.8452f, 0.9897f, 1.1860f, 1.3722f, + 1.5515f, 1.7658f, 1.9802f, 2.1819f, 2.3620f, 2.5442f, 2.7250f, 2.9220f, + 0.1286f, 0.2341f, 0.3689f, 0.5364f, 0.7176f, 0.9350f, 1.1083f, 1.2943f, + 1.4974f, 1.7059f, 1.9047f, 2.1145f, 2.3242f, 2.5361f, 2.7453f, 2.9329f, + 0.2273f, 0.3834f, 0.5565f, 0.7192f, 0.8431f, 0.9962f, 1.1763f, 1.3571f, + 1.5774f, 1.7419f, 1.9202f, 2.1131f, 2.2919f, 2.4898f, 2.6895f, 2.9180f, + 0.1775f, 0.3058f, 0.4274f, 0.6023f, 0.8151f, 1.0734f, 1.3211f, 1.5178f, + 1.6706f, 1.8154f, 1.9686f, 2.1537f, 2.3461f, 2.5276f, 2.7181f, 2.9121f, + 0.1653f, 0.4304f, 0.6361f, 0.7824f, 0.9183f, 1.0452f, 1.2071f, 1.4077f, + 1.6206f, 1.8299f, 2.0089f, 2.1948f, 2.3900f, 2.5982f, 2.7844f, 2.9487f, + 0.1492f, 0.2609f, 0.3820f, 0.5485f, 0.7243f, 0.9319f, 1.1538f, 1.3579f, + 1.5266f, 1.7002f, 1.8873f, 2.1016f, 2.3175f, 2.5221f, 2.7241f, 2.9243f, + 0.2074f, 0.3781f, 0.5209f, 0.6869f, 0.8577f, 0.9875f, 1.1849f, 1.3568f, + 1.4907f, 1.7335f, 1.8902f, 2.1224f, 2.3099f, 2.4918f, 2.7023f, 2.8765f, + 0.1359f, 0.2254f, 0.3286f, 0.4432f, 0.6586f, 0.8964f, 1.1125f, 1.3523f, + 1.5626f, 1.7579f, 1.9846f, 2.1905f, 2.3548f, 2.5542f, 2.7663f, 2.9346f, + 0.1430f, 0.2966f, 0.4685f, 0.6493f, 0.8315f, 1.0304f, 1.2220f, 1.4082f, + 1.5995f, 1.7888f, 1.9774f, 2.1737f, 2.3607f, 2.5577f, 2.7558f, 2.9405f, + 0.1477f, 0.2694f, 0.4056f, 0.5626f, 0.7051f, 0.8647f, 1.0491f, 1.2488f, + 1.4814f, 1.7072f, 1.9150f, 2.1147f, 2.3038f, 2.5144f, 2.7184f, 2.9202f, + 0.1690f, 0.3033f, 0.4580f, 0.6686f, 0.8536f, 1.0293f, 1.2124f, 1.3998f, + 1.5718f, 1.7607f, 1.9580f, 2.1245f, 2.2971f, 2.4762f, 2.6896f, 2.9177f, + 0.1092f, 0.2779f, 0.4853f, 0.6880f, 0.9011f, 1.0953f, 1.2752f, 1.4618f, + 1.6623f, 1.8484f, 2.0264f, 2.2152f, 2.4017f, 2.5835f, 2.7671f, 2.9436f, + 0.1497f, 0.3637f, 0.6014f, 0.8032f, 0.9963f, 1.1835f, 1.3741f, 1.5698f, + 1.7382f, 1.9094f, 2.0710f, 2.2392f, 2.4082f, 2.5926f, 2.7762f, 2.9536f, + 0.1434f, 0.2492f, 0.3966f, 0.5934f, 0.8033f, 1.0657f, 1.2796f, 1.4276f, + 1.5745f, 1.7833f, 1.9288f, 2.1247f, 2.3543f, 2.5412f, 2.7049f, 2.8872f, + 0.1612f, 0.2926f, 0.4574f, 0.6387f, 0.8265f, 1.0180f, 1.1808f, 1.3526f, + 1.5564f, 1.7536f, 1.9187f, 2.1192f, 2.3149f, 2.5006f, 2.7101f, 2.9217f, + 0.0828f, 0.1863f, 0.3235f, 0.5050f, 0.7250f, 0.9867f, 1.2093f, 1.3941f, + 1.5980f, 1.7932f, 1.9809f, 2.1894f, 2.3918f, 2.5773f, 2.7540f, 2.9329f, + 0.2001f, 0.3655f, 0.5290f, 0.6761f, 0.8027f, 0.9972f, 1.2090f, 1.4255f, + 1.6085f, 1.7825f, 1.9804f, 2.1681f, 2.3457f, 2.5325f, 2.7319f, 2.9196f, + 0.1505f, 0.2767f, 0.4254f, 0.6054f, 0.7821f, 0.9567f, 1.1294f, 1.3080f, + 1.4984f, 1.6954f, 1.8666f, 2.0736f, 2.2875f, 2.4969f, 2.7072f, 2.9163f, + 0.1589f, 0.4151f, 0.5749f, 0.6651f, 0.8061f, 1.0470f, 1.2616f, 1.3690f, + 1.4985f, 1.7808f, 1.9825f, 2.1068f, 2.2751f, 2.5448f, 2.7133f, 2.8689f, + 0.0916f, 0.1846f, 0.3788f, 0.6329f, 0.8774f, 1.0687f, 1.2653f, 1.4561f, + 1.6573f, 1.8449f, 2.0402f, 2.2254f, 2.3968f, 2.5861f, 2.7792f, 2.9508f, + 0.2282f, 0.4159f, 0.5834f, 0.6899f, 0.8108f, 1.0321f, 1.2795f, 1.5262f, + 1.6936f, 1.8469f, 2.0922f, 2.2607f, 2.3795f, 2.5301f, 2.7386f, 2.9530f, + 0.1651f, 0.3004f, 0.4555f, 0.6179f, 0.7891f, 0.9584f, 1.1372f, 1.3707f, + 1.5951f, 1.7880f, 1.9434f, 2.1465f, 2.3311f, 2.5081f, 2.6977f, 2.8970f, + 0.1279f, 0.3828f, 0.6330f, 0.8323f, 0.9652f, 1.1175f, 1.2319f, 1.3511f, + 1.5115f, 1.6392f, 1.7835f, 1.9558f, 2.2008f, 2.4635f, 2.6910f, 2.9058f, + 0.1193f, 0.2185f, 0.3521f, 0.5311f, 0.7378f, 0.9239f, 1.1105f, 1.3217f, + 1.5362f, 1.7504f, 1.9536f, 2.1627f, 2.3560f, 2.5506f, 2.7548f, 2.9453f, + 0.1806f, 0.3432f, 0.4981f, 0.6948f, 0.8928f, 1.0527f, 1.2467f, 1.4140f, + 1.6326f, 1.7950f, 1.9935f, 2.1969f, 2.3512f, 2.5682f, 2.7445f, 2.9277f, + 0.1846f, 0.3112f, 0.4568f, 0.5891f, 0.7317f, 0.8493f, 1.0204f, 1.2022f, + 1.3688f, 1.6020f, 1.8428f, 2.0710f, 2.2725f, 2.4879f, 2.7057f, 2.9160f, + 0.0880f, 0.2514f, 0.5332f, 0.7272f, 0.8906f, 1.1354f, 1.3199f, 1.4941f, + 1.6010f, 1.7151f, 1.8712f, 2.0643f, 2.2755f, 2.5375f, 2.7054f, 2.8891f, + 0.1382f, 0.2833f, 0.4658f, 0.6897f, 0.9071f, 1.0716f, 1.2469f, 1.4143f, + 1.5910f, 1.7947f, 1.9805f, 2.1581f, 2.3338f, 2.5215f, 2.7292f, 2.9211f, + 0.1061f, 0.3494f, 0.6327f, 0.8570f, 0.9748f, 1.0560f, 1.1529f, 1.3250f, + 1.6032f, 1.8340f, 1.9711f, 2.1157f, 2.3011f, 2.5464f, 2.8078f, 2.9803f, + 0.1603f, 0.2839f, 0.4307f, 0.5980f, 0.7980f, 1.0399f, 1.1971f, 1.3524f, + 1.5715f, 1.7838f, 1.9468f, 2.1498f, 2.3627f, 2.5514f, 2.7327f, 2.9148f, + 0.1691f, 0.3117f, 0.4796f, 0.6895f, 0.8732f, 1.0164f, 1.1916f, 1.3707f, + 1.5384f, 1.7202f, 1.8857f, 2.0672f, 2.2487f, 2.4593f, 2.6789f, 2.8940f, + 0.0965f, 0.1702f, 0.3191f, 0.5721f, 0.8100f, 1.0241f, 1.2272f, 1.4196f, + 1.6093f, 1.8057f, 1.9884f, 2.2037f, 2.3925f, 2.5805f, 2.7578f, 2.9366f, + 0.1950f, 0.3519f, 0.5272f, 0.6973f, 0.8732f, 1.0656f, 1.2112f, 1.3959f, + 1.6116f, 1.7821f, 1.9445f, 2.1592f, 2.3348f, 2.5142f, 2.7440f, 2.9297f, + 0.1388f, 0.2557f, 0.4120f, 0.5727f, 0.7354f, 0.9196f, 1.0985f, 1.2805f, + 1.4643f, 1.6535f, 1.8340f, 2.0546f, 2.2758f, 2.4778f, 2.6921f, 2.9122f, + 0.1823f, 0.3336f, 0.4957f, 0.6771f, 0.8563f, 1.0137f, 1.2299f, 1.3849f, + 1.5718f, 1.7667f, 1.9193f, 2.1326f, 2.3135f, 2.5268f, 2.7133f, 2.8998f, + 0.0790f, 0.1901f, 0.4083f, 0.6456f, 0.8463f, 1.0285f, 1.2297f, 1.4181f, + 1.6159f, 1.8056f, 1.9971f, 2.1912f, 2.3816f, 2.5746f, 2.7692f, 2.9497f, + 0.0049f, 0.0116f, 0.0045f, 0.0039f, -0.0010f, -0.0122f, -0.0205f, -0.0034f, + -0.0140f, -0.0041f, 0.0191f, -0.0322f, 0.0002f, -0.0124f, -0.0269f, 0.0059f, + 0.0586f, 0.0339f, -0.0389f, -0.0319f, -0.0079f, -0.0205f, -0.0363f, -0.0211f, + 0.0241f, 0.0595f, 0.0469f, 0.0283f, 0.0176f, -0.0183f, -0.0173f, -0.0004f, + 0.0024f, 0.0145f, 0.0534f, 0.0197f, -0.0065f, -0.0067f, 0.0133f, 0.0358f, + -0.0104f, -0.0386f, -0.0109f, -0.0078f, 0.0275f, 0.0565f, 0.0251f, -0.0027f, + -0.0053f, 0.0171f, 0.0088f, 0.0495f, 0.0141f, 0.0039f, -0.0445f, -0.0426f, + -0.0184f, -0.0280f, -0.0223f, 0.0039f, -0.0171f, -0.0606f, -0.0786f, -0.0430f, + 0.0544f, 0.0595f, 0.0320f, -0.0012f, 0.0108f, 0.0185f, 0.0066f, 0.0408f, + 0.0552f, -0.0073f, -0.0247f, -0.0480f, -0.0288f, 0.0186f, 0.0212f, -0.0013f, + 0.0403f, 0.0598f, 0.0690f, 0.0516f, -0.0298f, -0.0177f, 0.0278f, 0.0168f, + -0.0106f, 0.0251f, 0.0386f, 0.0331f, -0.0052f, 0.0133f, 0.0291f, -0.0158f, + -0.0329f, -0.0367f, 0.0287f, 0.0462f, -0.0176f, 0.0049f, 0.0242f, -0.0034f, + 0.0135f, 0.0086f, -0.0149f, 0.0241f, 0.0504f, 0.0246f, -0.0273f, -0.0369f, + -0.0108f, -0.0449f, -0.0625f, -0.0414f, -0.0292f, -0.0571f, -0.0440f, -0.0088f, + 0.0098f, 0.0009f, -0.0004f, 0.0007f, -0.0314f, -0.0208f, -0.0138f, -0.0277f, + -0.0044f, 0.0522f, 0.0315f, -0.0270f, -0.0277f, -0.0256f, -0.0103f, -0.0201f, + -0.0287f, -0.0279f, -0.0182f, 0.0472f, 0.0613f, 0.0450f, 0.0413f, 0.0333f, + 0.0444f, 0.0223f, 0.0061f, 0.0316f, 0.0321f, 0.0501f, 0.0460f, 0.0250f, + 0.0227f, 0.0235f, 0.0099f, 0.0185f, -0.0347f, -0.0684f, -0.0189f, 0.0242f, + -0.0190f, -0.0273f, -0.0012f, -0.0253f, 0.0293f, -0.0231f, -0.0219f, -0.0010f, + 0.0153f, 0.0128f, -0.0166f, -0.0435f, -0.0417f, -0.0121f, -0.0351f, -0.0390f, + 0.0077f, -0.0278f, -0.0355f, 0.0092f, -0.0063f, 0.0005f, 0.0216f, 0.0461f, + 0.0538f, 0.0451f, 0.0298f, -0.0130f, 0.0058f, 0.0206f, 0.0471f, 0.0499f, + 0.0280f, 0.0086f, -0.0007f, -0.0317f, 0.0259f, 0.0176f, 0.0043f, 0.0212f, + 0.0138f, 0.0106f, 0.0220f, -0.0025f, 0.0050f, 0.0122f, -0.0051f, -0.0086f, + -0.0472f, -0.0005f, 0.0193f, 0.0032f, 0.0246f, 0.0222f, 0.0090f, -0.0320f, + -0.0713f, -0.0526f, -0.0151f, -0.0440f, -0.0648f, -0.0466f, -0.0092f, 0.0115f, + -0.0129f, 0.0053f, -0.0344f, -0.0385f, 0.0392f, 0.0599f, 0.0414f, 0.0165f, + -0.0098f, -0.0320f, -0.0261f, -0.0055f, -0.0139f, -0.0110f, 0.0084f, 0.0172f, + -0.0492f, -0.0537f, -0.0320f, -0.0036f, 0.0265f, 0.0385f, 0.0064f, -0.0280f, + -0.0230f, 0.0134f, 0.0241f, 0.0106f, 0.0387f, 0.0105f, 0.0068f, 0.0260f, + 0.4940f, 0.4911f, 0.4849f, 0.4820f, 0.4837f, 0.4839f, 0.4824f, 0.4799f, + 0.4812f, 0.4782f, 0.4788f, 0.4711f, 0.4706f, 0.4671f, 0.4601f, 0.4578f, + 0.2954f, 0.2121f, 0.1859f, 0.1958f, 0.1474f, 0.1086f, 0.1351f, 0.1362f, + 0.1486f, 0.1342f, 0.1215f, 0.1423f, 0.1634f, 0.1588f, 0.1539f, 0.1857f, + }; + + static final float[] ff_metasound_lsp16 = { + 0.1813f, 0.3911f, 0.6301f, 0.8012f, 1.0057f, 1.2041f, 1.4271f, 1.6943f, + 1.9402f, 2.1733f, 2.3521f, 2.4989f, 2.5839f, 2.6846f, 2.7634f, 2.8950f, + 0.1311f, 0.3183f, 0.4659f, 0.5601f, 0.6658f, 0.7828f, 1.0065f, 1.2717f, + 1.5185f, 1.7339f, 1.9530f, 2.2189f, 2.3739f, 2.4991f, 2.6984f, 2.9256f, + 0.1627f, 0.4519f, 0.6323f, 0.7012f, 0.7848f, 0.9801f, 1.1810f, 1.3222f, + 1.5413f, 1.8129f, 1.9338f, 2.0809f, 2.3180f, 2.5189f, 2.7066f, 2.9514f, + 0.1475f, 0.2447f, 0.4240f, 0.5669f, 0.7872f, 0.9838f, 1.1823f, 1.3814f, + 1.5358f, 1.6820f, 1.8794f, 2.1419f, 2.4132f, 2.6112f, 2.7911f, 2.9511f, + 0.1224f, 0.2876f, 0.5013f, 0.6985f, 0.8902f, 1.0901f, 1.2835f, 1.4768f, + 1.6596f, 1.8538f, 2.0467f, 2.2304f, 2.4124f, 2.5942f, 2.7729f, 2.9531f, + 0.1741f, 0.3034f, 0.4677f, 0.5879f, 0.7258f, 0.9648f, 1.1417f, 1.3220f, + 1.5081f, 1.7151f, 1.9212f, 2.1286f, 2.3208f, 2.4938f, 2.6765f, 2.8891f, + 0.1657f, 0.3174f, 0.4907f, 0.6559f, 0.8295f, 1.0254f, 1.2071f, 1.3880f, + 1.5737f, 1.7845f, 1.9027f, 2.1139f, 2.3323f, 2.5157f, 2.7323f, 2.9015f, + 0.1592f, 0.2758f, 0.4417f, 0.6315f, 0.8257f, 0.9873f, 1.1277f, 1.2830f, + 1.4337f, 1.6315f, 1.8899f, 2.1356f, 2.3572f, 2.5632f, 2.7468f, 2.9420f, + 0.1524f, 0.4325f, 0.5931f, 0.7036f, 0.7696f, 0.8923f, 1.1739f, 1.4773f, + 1.6609f, 1.7911f, 1.9666f, 2.1972f, 2.3754f, 2.5045f, 2.6613f, 2.8882f, + 0.2130f, 0.3013f, 0.3721f, 0.4257f, 0.5079f, 0.7015f, 0.9815f, 1.2554f, + 1.4648f, 1.6966f, 1.9138f, 2.1075f, 2.3318f, 2.5292f, 2.7453f, 2.9347f, + 0.1142f, 0.3748f, 0.6205f, 0.7642f, 0.8121f, 0.9022f, 0.9843f, 1.1558f, + 1.4467f, 1.7422f, 1.9574f, 2.1302f, 2.3812f, 2.5898f, 2.7720f, 2.9583f, + 0.1255f, 0.2339f, 0.3570f, 0.5323f, 0.7458f, 1.0003f, 1.1729f, 1.3567f, + 1.5217f, 1.6977f, 1.8924f, 2.0942f, 2.3145f, 2.5408f, 2.7553f, 2.9337f, + 0.1316f, 0.2289f, 0.4327f, 0.6663f, 0.8509f, 0.9994f, 1.1697f, 1.3804f, + 1.5609f, 1.6903f, 1.8572f, 2.1019f, 2.3687f, 2.5789f, 2.7715f, 2.9472f, + 0.1502f, 0.2546f, 0.3883f, 0.5333f, 0.6976f, 0.9163f, 1.1071f, 1.3364f, + 1.5420f, 1.7525f, 1.8948f, 2.0839f, 2.2819f, 2.4651f, 2.6875f, 2.8987f, + 0.1593f, 0.3014f, 0.4573f, 0.6354f, 0.8157f, 0.9805f, 1.1783f, 1.3747f, + 1.5678f, 1.7326f, 1.9286f, 2.1340f, 2.3253f, 2.5280f, 2.7180f, 2.9298f, + 0.1811f, 0.3167f, 0.4655f, 0.6507f, 0.8198f, 1.0075f, 1.1892f, 1.3743f, + 1.5227f, 1.7090f, 1.8849f, 2.0743f, 2.2750f, 2.4830f, 2.6896f, 2.8953f, + 0.1846f, 0.3577f, 0.5315f, 0.7290f, 0.9176f, 1.1016f, 1.2654f, 1.4525f, + 1.6315f, 1.8268f, 2.0238f, 2.1934f, 2.3868f, 2.5753f, 2.7682f, 2.9469f, + 0.0876f, 0.1439f, 0.2048f, 0.3654f, 0.6281f, 0.8853f, 1.0907f, 1.2992f, + 1.5227f, 1.7373f, 1.9395f, 2.1419f, 2.3488f, 2.5486f, 2.7466f, 2.9348f, + 0.1391f, 0.4170f, 0.6561f, 0.7953f, 0.8734f, 0.9986f, 1.1870f, 1.4520f, + 1.6042f, 1.7910f, 2.0135f, 2.1870f, 2.3358f, 2.5066f, 2.7409f, 2.9955f, + 0.0804f, 0.1355f, 0.2599f, 0.4998f, 0.7408f, 0.9474f, 1.1276f, 1.3428f, + 1.5556f, 1.7712f, 1.9699f, 2.1535f, 2.3605f, 2.5548f, 2.7489f, 2.9325f, + 0.1304f, 0.3087f, 0.4979f, 0.6584f, 0.8414f, 1.0329f, 1.2244f, 1.4189f, + 1.6118f, 1.8200f, 1.9985f, 2.1893f, 2.3915f, 2.5794f, 2.7647f, 2.9344f, + 0.1895f, 0.2849f, 0.3705f, 0.4126f, 0.6265f, 0.9207f, 1.1774f, 1.3762f, + 1.5757f, 1.7728f, 1.9568f, 2.1662f, 2.3615f, 2.5575f, 2.7561f, 2.9416f, + 0.1800f, 0.3078f, 0.4805f, 0.6796f, 0.8503f, 1.0046f, 1.1703f, 1.3269f, + 1.4862f, 1.6502f, 1.8454f, 2.0873f, 2.3175f, 2.5356f, 2.7516f, 2.9469f, + 0.1950f, 0.3233f, 0.4568f, 0.5940f, 0.7589f, 0.9978f, 1.1701f, 1.3383f, + 1.5017f, 1.6565f, 1.8243f, 2.0605f, 2.2938f, 2.5147f, 2.7419f, 2.9396f, + 0.2531f, 0.4391f, 0.5790f, 0.7170f, 0.8998f, 1.1430f, 1.3577f, 1.5326f, + 1.6328f, 1.7627f, 1.9726f, 2.1762f, 2.3563f, 2.5478f, 2.7385f, 2.9067f, + 0.1805f, 0.2788f, 0.3591f, 0.3881f, 0.5441f, 0.8055f, 1.0766f, 1.3165f, + 1.5316f, 1.7508f, 1.9477f, 2.1374f, 2.3438f, 2.5484f, 2.7501f, 2.9410f, + 0.2044f, 0.3671f, 0.5396f, 0.7042f, 0.8582f, 0.9831f, 1.1261f, 1.3194f, + 1.4769f, 1.6979f, 1.8717f, 2.0463f, 2.2620f, 2.4739f, 2.7054f, 2.9208f, + 0.1048f, 0.2175f, 0.4206f, 0.5923f, 0.7483f, 0.9400f, 1.1356f, 1.3799f, + 1.5958f, 1.7320f, 1.8984f, 2.1296f, 2.3594f, 2.5492f, 2.7387f, 2.9305f, + 0.0842f, 0.1729f, 0.3951f, 0.6447f, 0.8688f, 1.0605f, 1.2472f, 1.4330f, + 1.6232f, 1.8144f, 2.0216f, 2.1915f, 2.3878f, 2.5763f, 2.7685f, 2.9464f, + 0.1461f, 0.2593f, 0.4105f, 0.5677f, 0.7328f, 0.8919f, 1.0484f, 1.2302f, + 1.4386f, 1.6635f, 1.8873f, 2.1024f, 2.3116f, 2.5268f, 2.7273f, 2.9269f, + 0.1503f, 0.3108f, 0.4756f, 0.6731f, 0.8600f, 1.0233f, 1.2115f, 1.3971f, + 1.5915f, 1.7892f, 1.9517f, 2.1603f, 2.3487f, 2.5460f, 2.7308f, 2.8998f, + 0.2163f, 0.3669f, 0.5125f, 0.6709f, 0.8143f, 0.9930f, 1.2095f, 1.4205f, + 1.6176f, 1.7112f, 1.8398f, 2.0896f, 2.3513f, 2.5290f, 2.6667f, 2.8960f, + 0.2133f, 0.4382f, 0.6287f, 0.8702f, 1.1088f, 1.3749f, 1.6062f, 1.7446f, + 1.8333f, 1.9122f, 1.9614f, 2.0669f, 2.1789f, 2.3449f, 2.6038f, 2.8849f, + 0.1598f, 0.2719f, 0.3877f, 0.4815f, 0.5926f, 0.7795f, 1.0449f, 1.3045f, + 1.5210f, 1.7391f, 1.9462f, 2.1397f, 2.3553f, 2.5458f, 2.7540f, 2.9392f, + 0.2918f, 0.5607f, 0.6801f, 0.7404f, 0.8285f, 0.9431f, 1.1579f, 1.4080f, + 1.6332f, 1.8472f, 1.9738f, 2.0771f, 2.2890f, 2.5178f, 2.7445f, 2.9830f, + 0.1664f, 0.2842f, 0.3965f, 0.5463f, 0.8162f, 1.0346f, 1.1849f, 1.3446f, + 1.5122f, 1.7563f, 1.9960f, 2.2002f, 2.3796f, 2.5689f, 2.7712f, 2.9550f, + 0.0911f, 0.2397f, 0.5052f, 0.7868f, 1.0299f, 1.1311f, 1.2244f, 1.3333f, + 1.4395f, 1.6790f, 1.9369f, 2.1717f, 2.3689f, 2.5538f, 2.7340f, 2.9326f, + 0.1647f, 0.2931f, 0.3836f, 0.4978f, 0.6255f, 0.9243f, 1.1339f, 1.3001f, + 1.5269f, 1.8010f, 1.9715f, 2.1419f, 2.3784f, 2.5503f, 2.6719f, 2.8745f, + 0.2440f, 0.3802f, 0.4756f, 0.6613f, 0.8627f, 1.0292f, 1.2291f, 1.4060f, + 1.5198f, 1.7354f, 1.9044f, 2.1010f, 2.3147f, 2.4996f, 2.7171f, 2.9041f, + 0.1590f, 0.2876f, 0.4572f, 0.5996f, 0.7713f, 0.9490f, 1.1205f, 1.2815f, + 1.4516f, 1.6385f, 1.8179f, 2.0457f, 2.2759f, 2.4785f, 2.6861f, 2.9080f, + 0.2297f, 0.4309f, 0.5712f, 0.6717f, 0.8138f, 1.0463f, 1.2492f, 1.4560f, + 1.6796f, 1.8458f, 1.9642f, 2.1452f, 2.3636f, 2.5395f, 2.7456f, 2.9495f, + 0.2975f, 0.4678f, 0.4996f, 0.5809f, 0.6279f, 0.6884f, 0.8606f, 1.1386f, + 1.4412f, 1.6876f, 1.8760f, 2.0932f, 2.3178f, 2.5166f, 2.7345f, 2.9280f, + 0.1278f, 0.3737f, 0.6004f, 0.7069f, 0.8147f, 1.0180f, 1.2581f, 1.3812f, + 1.4855f, 1.7268f, 1.9970f, 2.1258f, 2.2936f, 2.5702f, 2.7563f, 2.8983f, + 0.1314f, 0.2508f, 0.3999f, 0.5680f, 0.7424f, 0.9367f, 1.1286f, 1.3175f, + 1.5336f, 1.7404f, 1.9317f, 2.1404f, 2.3514f, 2.5562f, 2.7510f, 2.9402f, + 0.1043f, 0.2367f, 0.4293f, 0.6376f, 0.8160f, 0.9836f, 1.1779f, 1.3850f, + 1.5835f, 1.7875f, 1.9765f, 2.1593f, 2.3654f, 2.5577f, 2.7465f, 2.9398f, + 0.1529f, 0.2515f, 0.3454f, 0.4374f, 0.7011f, 0.9015f, 1.0744f, 1.3532f, + 1.5699f, 1.7545f, 2.0021f, 2.1259f, 2.2278f, 2.4546f, 2.7264f, 2.9425f, + 0.1429f, 0.2808f, 0.4395f, 0.6334f, 0.8069f, 0.9705f, 1.1520f, 1.3250f, + 1.5109f, 1.7285f, 1.9356f, 2.1469f, 2.3479f, 2.5554f, 2.7512f, 2.9348f, + 0.1625f, 0.3022f, 0.4756f, 0.6315f, 0.8032f, 0.9924f, 1.1596f, 1.3204f, + 1.4994f, 1.6929f, 1.8955f, 2.1090f, 2.3025f, 2.5018f, 2.6908f, 2.8980f, + 0.1692f, 0.3427f, 0.5228f, 0.7756f, 0.9688f, 1.0950f, 1.3056f, 1.4360f, + 1.5675f, 1.8049f, 1.9376f, 2.1151f, 2.3407f, 2.5012f, 2.7192f, 2.9258f, + 0.0474f, 0.1251f, 0.1939f, 0.3841f, 0.6501f, 0.9231f, 1.1153f, 1.3240f, + 1.5478f, 1.7599f, 1.9651f, 2.1510f, 2.3645f, 2.5552f, 2.7542f, 2.9393f, + 0.2196f, 0.4656f, 0.7492f, 0.9922f, 1.1678f, 1.2489f, 1.3112f, 1.3657f, + 1.4223f, 1.5302f, 1.7212f, 1.9996f, 2.2523f, 2.4844f, 2.7036f, 2.9145f, + 0.1128f, 0.2368f, 0.3704f, 0.5476f, 0.7723f, 0.9968f, 1.1930f, 1.3992f, + 1.6013f, 1.7957f, 1.9888f, 2.1857f, 2.3825f, 2.5705f, 2.7616f, 2.9434f, + 0.1341f, 0.2768f, 0.4510f, 0.6359f, 0.8332f, 1.0335f, 1.2004f, 1.3952f, + 1.5762f, 1.7681f, 1.9815f, 2.1735f, 2.3657f, 2.5552f, 2.7514f, 2.9498f, + 0.1247f, 0.2559f, 0.3516f, 0.4726f, 0.6861f, 0.9483f, 1.1852f, 1.3858f, + 1.5851f, 1.7815f, 1.9778f, 2.1737f, 2.3729f, 2.5664f, 2.7620f, 2.9429f, + 0.1988f, 0.3320f, 0.4777f, 0.6737f, 0.8425f, 1.0265f, 1.1694f, 1.3655f, + 1.5463f, 1.7135f, 1.9385f, 2.1650f, 2.3529f, 2.5367f, 2.7545f, 2.9585f, + 0.1376f, 0.2620f, 0.4273f, 0.6169f, 0.7755f, 0.9441f, 1.1169f, 1.3157f, + 1.5179f, 1.7020f, 1.8931f, 2.1059f, 2.3112f, 2.5136f, 2.7169f, 2.9198f, + 0.2112f, 0.4385f, 0.6091f, 0.7618f, 0.9553f, 1.1543f, 1.3445f, 1.5396f, + 1.7153f, 1.9192f, 2.1263f, 2.3593f, 2.5958f, 2.8171f, 2.9394f, 3.0409f, + 0.1347f, 0.2099f, 0.2646f, 0.3453f, 0.5266f, 0.7869f, 1.0513f, 1.2795f, + 1.4880f, 1.7181f, 1.9294f, 2.1332f, 2.3362f, 2.5442f, 2.7433f, 2.9362f, + 0.3141f, 0.5935f, 0.7517f, 0.8313f, 0.8568f, 0.9570f, 1.0250f, 1.1275f, + 1.3422f, 1.6303f, 1.8577f, 2.0705f, 2.2957f, 2.5095f, 2.7244f, 2.9262f, + 0.0962f, 0.2116f, 0.3961f, 0.5641f, 0.7122f, 0.8883f, 1.1023f, 1.3481f, + 1.5623f, 1.7554f, 1.9618f, 2.1675f, 2.3706f, 2.5556f, 2.7430f, 2.9337f, + 0.0898f, 0.1510f, 0.3060f, 0.5820f, 0.8221f, 1.0388f, 1.2261f, 1.4289f, + 1.6054f, 1.8103f, 1.9941f, 2.1844f, 2.3742f, 2.5711f, 2.7632f, 2.9474f, + 0.1326f, 0.2316f, 0.3761f, 0.5177f, 0.6782f, 0.8761f, 1.0952f, 1.3175f, + 1.5078f, 1.7034f, 1.9051f, 2.1245f, 2.3424f, 2.5484f, 2.7444f, 2.9389f, + 0.1740f, 0.3293f, 0.5174f, 0.6824f, 0.8394f, 1.0372f, 1.2046f, 1.3723f, + 1.5656f, 1.7444f, 1.9442f, 2.1386f, 2.3139f, 2.4960f, 2.7071f, 2.9297f, + 0.2304f, 0.3775f, 0.4865f, 0.6182f, 0.7842f, 0.9208f, 1.1151f, 1.2843f, + 1.4641f, 1.6988f, 1.9209f, 2.1260f, 2.3099f, 2.5229f, 2.7414f, 2.9276f, + 0.0094f, 0.0261f, -0.0037f, 0.0041f, -0.0092f, -0.0044f, -0.0232f, -0.0073f, + -0.0047f, -0.0021f, 0.0250f, -0.0580f, -0.0140f, -0.0342f, -0.0586f, 0.0020f, + 0.0449f, 0.0155f, -0.0523f, -0.0279f, 0.0299f, -0.0183f, -0.0736f, -0.0639f, + -0.0017f, 0.0336f, 0.0209f, 0.0046f, 0.0077f, -0.0148f, -0.0114f, -0.0120f, + 0.0115f, -0.0050f, 0.0445f, 0.0048f, 0.0188f, -0.0137f, -0.0080f, 0.0239f, + -0.0184f, -0.0524f, -0.0195f, -0.0126f, 0.0284f, 0.0632f, 0.0141f, -0.0093f, + -0.0096f, 0.0196f, 0.0230f, 0.0379f, 0.0308f, 0.0237f, -0.0224f, -0.0600f, + -0.0755f, -0.1074f, -0.0988f, -0.0606f, -0.1038f, -0.1552f, -0.1480f, -0.0672f, + 0.0504f, 0.0676f, 0.0336f, -0.0042f, 0.0729f, 0.1013f, 0.0868f, 0.0846f, + 0.0954f, 0.0515f, -0.0066f, -0.0851f, -0.0485f, 0.0294f, 0.0395f, 0.0087f, + 0.0078f, 0.0446f, 0.0881f, 0.0672f, -0.0384f, -0.0025f, 0.0415f, 0.0353f, + 0.0080f, 0.0052f, 0.0190f, 0.0182f, 0.0069f, 0.0168f, 0.0374f, 0.0037f, + -0.0292f, -0.0429f, 0.0302f, 0.0681f, -0.0233f, -0.0238f, -0.0003f, -0.0043f, + 0.0054f, -0.0029f, -0.0149f, 0.0642f, 0.0622f, 0.0341f, -0.0232f, -0.0461f, + -0.0082f, -0.0469f, -0.0618f, -0.0326f, -0.0452f, -0.0649f, -0.0597f, -0.0398f, + -0.0318f, -0.0116f, 0.0011f, 0.0009f, -0.0384f, -0.0384f, -0.0156f, -0.0260f, + -0.0007f, 0.0473f, 0.0111f, -0.0358f, -0.0484f, -0.0204f, -0.0029f, -0.0090f, + -0.0285f, -0.0495f, -0.0376f, 0.0917f, 0.1192f, 0.1026f, 0.0745f, 0.0397f, + 0.0463f, 0.0253f, 0.0025f, 0.0465f, 0.0100f, 0.0488f, 0.0416f, 0.0223f, + 0.0263f, 0.0072f, -0.0053f, 0.0595f, 0.0060f, -0.0518f, -0.0316f, -0.0043f, + -0.0133f, -0.0233f, -0.0075f, -0.0251f, 0.0277f, -0.0067f, -0.0136f, -0.0004f, + 0.0235f, 0.0112f, -0.0182f, -0.0324f, -0.0210f, -0.0035f, -0.0395f, -0.0384f, + 0.0005f, -0.0150f, -0.0356f, 0.0127f, -0.0033f, -0.0034f, 0.0205f, 0.0747f, + 0.1138f, 0.1015f, 0.0995f, -0.0161f, -0.0045f, 0.0129f, 0.0472f, 0.0575f, + 0.0222f, 0.0091f, 0.0037f, -0.0471f, 0.0371f, 0.0132f, 0.0208f, 0.0247f, + 0.0117f, 0.0164f, 0.0225f, 0.0124f, -0.0023f, 0.0088f, -0.0046f, 0.0047f, + -0.0393f, 0.0018f, 0.0148f, 0.0020f, 0.0044f, 0.0165f, 0.0229f, -0.0208f, + -0.0477f, -0.0310f, -0.0164f, -0.0390f, -0.0764f, -0.0525f, -0.0094f, 0.0075f, + -0.0102f, -0.0045f, -0.0504f, -0.0709f, 0.0822f, 0.0710f, 0.0426f, 0.0014f, + -0.0371f, -0.0400f, -0.0157f, -0.0155f, -0.0173f, -0.0138f, -0.0015f, 0.0134f, + -0.0418f, -0.0682f, -0.0256f, 0.0050f, 0.0360f, 0.0354f, 0.0074f, -0.0396f, + -0.0235f, 0.0284f, 0.0494f, 0.0153f, 0.0448f, 0.0025f, -0.0061f, 0.0252f, + 0.1000f, 0.2260f, 0.2158f, 0.2116f, 0.2198f, 0.2055f, 0.2110f, 0.1873f, + 0.1907f, 0.2071f, 0.2164f, 0.2009f, 0.2059f, 0.2124f, 0.2141f, 0.2093f, + 0.0875f, 0.0981f, 0.1177f, 0.1071f, 0.1033f, 0.1248f, 0.1048f, 0.1238f, + 0.1166f, 0.1008f, 0.1062f, 0.0992f, 0.0994f, 0.1067f, 0.0999f, 0.1187f, + 0.0750f, 0.0794f, 0.0828f, 0.0854f, 0.0859f, 0.0801f, 0.0891f, 0.0933f, + 0.0969f, 0.0920f, 0.0915f, 0.0862f, 0.0868f, 0.0891f, 0.0842f, 0.0824f, + 0.0625f, 0.0930f, 0.0815f, 0.0853f, 0.0898f, 0.0828f, 0.0822f, 0.0910f, + 0.0873f, 0.0906f, 0.0856f, 0.0840f, 0.0774f, 0.0785f, 0.0684f, 0.0711f, + 0.3319f, 0.4219f, 0.4588f, 0.4090f, 0.4092f, 0.4014f, 0.3548f, 0.3353f, + 0.3708f, 0.3352f, 0.3720f, 0.3538f, 0.4084f, 0.4289f, 0.4060f, 0.4210f, + 0.0588f, 0.0209f, -0.0082f, -0.0115f, -0.0343f, -0.0621f, -0.0541f, -0.0346f, + -0.0346f, -0.0366f, -0.0220f, -0.0265f, -0.0102f, 0.0374f, 0.0306f, 0.0404f, + 0.0306f, 0.0090f, -0.0054f, 0.0333f, 0.0047f, 0.0238f, 0.0141f, 0.0165f, + 0.0306f, 0.0420f, 0.0159f, 0.0124f, 0.0414f, 0.0158f, -0.0237f, 0.0141f, + 0.0765f, 0.0057f, -0.0260f, -0.0426f, -0.0395f, -0.0126f, -0.0579f, -0.0417f, + -0.0429f, -0.0615f, -0.0893f, -0.0618f, -0.0384f, -0.0134f, -0.0232f, -0.0238f, + }; + + static final float[] ff_metasound_lsp22 = { + 0.0664f, 0.1875f, 0.4300f, 0.6730f, 0.8793f, 1.0640f, 1.2563f, 1.4433f, + 1.6394f, 1.8176f, 2.0029f, 2.1921f, 2.3796f, 2.5671f, 2.7595f, 2.9536f, + 0.2128f, 0.4052f, 0.5311f, 0.6404f, 0.7875f, 0.8775f, 1.0974f, 1.3261f, + 1.5563f, 1.6790f, 1.8339f, 2.1195f, 2.3226f, 2.4609f, 2.6440f, 2.8947f, + 0.2024f, 0.3362f, 0.4834f, 0.6784f, 0.9088f, 1.0850f, 1.2188f, 1.4054f, + 1.6102f, 1.7767f, 1.9679f, 2.1436f, 2.3445f, 2.5467f, 2.7429f, 2.9320f, + 0.1181f, 0.2279f, 0.4413f, 0.6114f, 0.7710f, 0.9427f, 1.1142f, 1.2707f, + 1.4892f, 1.7416f, 1.9526f, 2.1466f, 2.3629f, 2.5445f, 2.7293f, 2.9205f, + 0.1155f, 0.2720f, 0.4886f, 0.6812f, 0.8594f, 1.0422f, 1.2315f, 1.4116f, + 1.6137f, 1.8020f, 1.9758f, 2.1743f, 2.3602f, 2.5568f, 2.7472f, 2.9374f, + 0.1110f, 0.3312f, 0.4735f, 0.5612f, 0.7129f, 0.8146f, 1.0233f, 1.3155f, + 1.5765f, 1.7746f, 1.9574f, 2.1416f, 2.3220f, 2.5384f, 2.7334f, 2.9318f, + 0.1656f, 0.3350f, 0.4215f, 0.5609f, 0.6759f, 0.8503f, 1.1405f, 1.4094f, + 1.6057f, 1.6860f, 1.7639f, 2.0031f, 2.2680f, 2.5076f, 2.7263f, 2.9368f, + 0.1466f, 0.3638f, 0.4587f, 0.5674f, 0.7381f, 0.8669f, 0.9619f, 1.1658f, + 1.4667f, 1.7440f, 1.9335f, 2.1018f, 2.3022f, 2.5281f, 2.7359f, 2.9261f, + 0.1061f, 0.2566f, 0.4739f, 0.6751f, 0.8711f, 1.0704f, 1.2720f, 1.4655f, + 1.6605f, 1.8494f, 2.0290f, 2.2197f, 2.4008f, 2.5912f, 2.7772f, 2.9513f, + 0.1116f, 0.2364f, 0.3971f, 0.6316f, 0.8583f, 1.0335f, 1.1686f, 1.3302f, + 1.5612f, 1.7877f, 1.9829f, 2.2052f, 2.3596f, 2.5460f, 2.7341f, 2.9290f, + 0.2661f, 0.4186f, 0.5126f, 0.6477f, 0.8818f, 1.1045f, 1.2852f, 1.4128f, + 1.5851f, 1.7593f, 1.9399f, 2.1757f, 2.3684f, 2.5136f, 2.6927f, 2.9064f, + 0.1495f, 0.2749f, 0.4391f, 0.6304f, 0.8239f, 1.0181f, 1.1995f, 1.3759f, + 1.5669f, 1.7722f, 1.9671f, 2.1635f, 2.3586f, 2.5528f, 2.7445f, 2.9311f, + 0.0912f, 0.1759f, 0.3066f, 0.5660f, 0.8005f, 0.9568f, 1.1832f, 1.4504f, + 1.6259f, 1.7948f, 2.0113f, 2.2002f, 2.3654f, 2.5583f, 2.7929f, 2.9735f, + 0.1353f, 0.2747f, 0.4078f, 0.5977f, 0.7658f, 0.9124f, 1.1081f, 1.3630f, + 1.5875f, 1.7847f, 1.9323f, 2.1181f, 2.3321f, 2.5046f, 2.7183f, 2.9225f, + 0.1938f, 0.4063f, 0.4982f, 0.6002f, 0.7702f, 0.9071f, 1.1631f, 1.3885f, + 1.6043f, 1.8118f, 1.9306f, 2.0893f, 2.2724f, 2.4609f, 2.6283f, 2.8802f, + 0.1857f, 0.3351f, 0.4381f, 0.6101f, 0.7561f, 0.8555f, 1.0384f, 1.3171f, + 1.5667f, 1.6904f, 1.7552f, 1.9689f, 2.2597f, 2.5260f, 2.7272f, 2.9337f, + 0.1037f, 0.2159f, 0.4188f, 0.6174f, 0.8035f, 1.0285f, 1.2256f, 1.4230f, + 1.6400f, 1.8322f, 2.0144f, 2.1988f, 2.3810f, 2.5682f, 2.7613f, 2.9438f, + 0.1625f, 0.2776f, 0.4225f, 0.6001f, 0.7879f, 0.9087f, 1.0801f, 1.2759f, + 1.4899f, 1.7448f, 1.9911f, 2.1770f, 2.3723f, 2.5777f, 2.7971f, 2.9444f, + 0.2111f, 0.3640f, 0.5839f, 0.7290f, 0.8051f, 1.0023f, 1.2315f, 1.4143f, + 1.5878f, 1.7755f, 1.9804f, 2.1498f, 2.3312f, 2.5350f, 2.7613f, 2.9472f, + 0.1423f, 0.2646f, 0.4136f, 0.6350f, 0.8070f, 0.9514f, 1.1168f, 1.3213f, + 1.5776f, 1.7721f, 1.9404f, 2.1545f, 2.3385f, 2.5137f, 2.7396f, 2.9553f, + 0.1132f, 0.2386f, 0.4103f, 0.5931f, 0.7808f, 0.9881f, 1.1840f, 1.3860f, + 1.6021f, 1.7990f, 1.9922f, 2.1885f, 2.3852f, 2.5717f, 2.7640f, 2.9510f, + 0.1267f, 0.2602f, 0.3913f, 0.5944f, 0.7598f, 0.9198f, 1.0781f, 1.2715f, + 1.5299f, 1.7573f, 1.9308f, 2.1346f, 2.3267f, 2.5419f, 2.7466f, 2.9320f, + 0.2023f, 0.3417f, 0.4392f, 0.6141f, 0.7439f, 0.8593f, 1.1096f, 1.3543f, + 1.5185f, 1.6553f, 1.7862f, 2.0341f, 2.2718f, 2.4834f, 2.7103f, 2.9466f, + 0.1113f, 0.2470f, 0.3677f, 0.5686f, 0.7700f, 0.9356f, 1.0806f, 1.2452f, + 1.4830f, 1.7344f, 1.9268f, 2.1404f, 2.3371f, 2.5169f, 2.7329f, 2.9012f, + 0.1664f, 0.3554f, 0.5573f, 0.7471f, 0.9245f, 1.0998f, 1.2787f, 1.4655f, + 1.6654f, 1.8346f, 2.0179f, 2.2159f, 2.4096f, 2.5946f, 2.7790f, 2.9530f, + 0.1313f, 0.2625f, 0.4731f, 0.6444f, 0.8110f, 0.9878f, 1.1493f, 1.3212f, + 1.5719f, 1.8138f, 1.9861f, 2.1943f, 2.3714f, 2.5578f, 2.7346f, 2.9296f, + 0.1186f, 0.3035f, 0.5049f, 0.6860f, 0.8670f, 0.9975f, 1.1364f, 1.3471f, + 1.5695f, 1.7412f, 1.9346f, 2.1506f, 2.3413f, 2.5531f, 2.7794f, 2.9627f, + 0.1108f, 0.2697f, 0.4787f, 0.6344f, 0.7909f, 0.9586f, 1.1440f, 1.3511f, + 1.5686f, 1.7601f, 1.9246f, 2.1241f, 2.3293f, 2.5390f, 2.7315f, 2.9333f, + 0.0985f, 0.2302f, 0.3544f, 0.5759f, 0.7620f, 0.9651f, 1.1497f, 1.3080f, + 1.5500f, 1.7845f, 1.9518f, 2.1734f, 2.3565f, 2.5665f, 2.7605f, 2.9102f, + 0.1208f, 0.2727f, 0.4381f, 0.5736f, 0.7382f, 0.8390f, 1.0102f, 1.2648f, + 1.5100f, 1.7440f, 1.9619f, 2.1430f, 2.3307f, 2.5159f, 2.7264f, 2.9211f, + 0.1582f, 0.2777f, 0.4475f, 0.6551f, 0.8591f, 1.0084f, 1.1414f, 1.3291f, + 1.5902f, 1.7826f, 1.9543f, 2.1659f, 2.3233f, 2.5044f, 2.6935f, 2.9199f, + 0.1360f, 0.2873f, 0.4585f, 0.6295f, 0.7592f, 0.9089f, 1.0492f, 1.2733f, + 1.5391f, 1.7768f, 1.9372f, 2.1329f, 2.3168f, 2.5015f, 2.6857f, 2.8837f, + 0.0886f, 0.1829f, 0.3696f, 0.6126f, 0.8334f, 1.0135f, 1.2303f, 1.4674f, + 1.6743f, 1.8564f, 2.0530f, 2.2370f, 2.3960f, 2.5787f, 2.7756f, 2.9377f, + 0.2005f, 0.3537f, 0.4700f, 0.6249f, 0.7385f, 0.9097f, 1.1759f, 1.3811f, + 1.5314f, 1.6705f, 1.8546f, 2.1229f, 2.3292f, 2.5251f, 2.7951f, 2.9646f, + 0.1999f, 0.3112f, 0.4722f, 0.7146f, 0.8908f, 1.0028f, 1.1831f, 1.3903f, + 1.6125f, 1.7514f, 1.9083f, 2.1248f, 2.3271f, 2.5339f, 2.6945f, 2.8918f, + 0.1243f, 0.2606f, 0.4382f, 0.5850f, 0.7705f, 0.9727f, 1.1214f, 1.3059f, + 1.5218f, 1.7406f, 1.9137f, 2.1353f, 2.3354f, 2.5299f, 2.7287f, 2.9068f, + 0.1039f, 0.2426f, 0.4265f, 0.6284f, 0.8152f, 0.9941f, 1.2004f, 1.4038f, + 1.5912f, 1.7763f, 1.9650f, 2.1598f, 2.3474f, 2.5488f, 2.7419f, 2.9322f, + 0.1364f, 0.2420f, 0.3886f, 0.5864f, 0.7663f, 0.8844f, 1.0860f, 1.3242f, + 1.5518f, 1.7893f, 2.0004f, 2.1562f, 2.3619f, 2.5516f, 2.7687f, 2.9181f, + 0.1483f, 0.2851f, 0.4479f, 0.6312f, 0.7924f, 0.9821f, 1.1705f, 1.3386f, + 1.5375f, 1.7226f, 1.9053f, 2.0991f, 2.2898f, 2.4953f, 2.7000f, 2.9146f, + 0.2332f, 0.4561f, 0.5407f, 0.6212f, 0.7524f, 0.8215f, 0.9522f, 1.1685f, + 1.5216f, 1.7132f, 1.8291f, 2.0647f, 2.2811f, 2.4857f, 2.7071f, 2.9281f, + 0.1348f, 0.3126f, 0.5179f, 0.7192f, 0.9227f, 1.1363f, 1.3223f, 1.4756f, + 1.6509f, 1.8191f, 1.9991f, 2.1976f, 2.3877f, 2.5768f, 2.7590f, 2.9386f, + 0.1093f, 0.2211f, 0.4763f, 0.6703f, 0.8282f, 0.9536f, 1.1202f, 1.3796f, + 1.6043f, 1.8031f, 1.9832f, 2.1604f, 2.3578f, 2.5856f, 2.7650f, 2.9291f, + 0.1865f, 0.3027f, 0.4580f, 0.6719f, 0.8400f, 1.0082f, 1.1901f, 1.3782f, + 1.5448f, 1.6885f, 1.9477f, 2.1381f, 2.2797f, 2.5113f, 2.7465f, 2.9414f, + 0.1575f, 0.3124f, 0.4649f, 0.6262f, 0.8095f, 0.9858f, 1.1676f, 1.3602f, + 1.5646f, 1.7582f, 1.9550f, 2.1671f, 2.3628f, 2.5734f, 2.7670f, 2.9519f, + 0.1174f, 0.2777f, 0.4663f, 0.6333f, 0.8169f, 1.0096f, 1.1885f, 1.3847f, + 1.5803f, 1.7571f, 1.9380f, 2.1398f, 2.3414f, 2.5407f, 2.7360f, 2.9375f, + 0.1073f, 0.2264f, 0.4083f, 0.5973f, 0.7474f, 0.9514f, 1.1349f, 1.3337f, + 1.5433f, 1.7348f, 1.9380f, 2.1436f, 2.3441f, 2.5438f, 2.7457f, 2.9383f, + 0.1472f, 0.2880f, 0.4793f, 0.6268f, 0.8015f, 1.0063f, 1.1715f, 1.3644f, + 1.5525f, 1.7410f, 1.9258f, 2.1227f, 2.3214f, 2.5149f, 2.7148f, 2.9196f, + 0.1414f, 0.2565f, 0.4349f, 0.6111f, 0.7695f, 0.9496f, 1.1212f, 1.3265f, + 1.5218f, 1.7209f, 1.9015f, 2.0887f, 2.3158f, 2.5077f, 2.7233f, 2.9421f, + 0.1252f, 0.2667f, 0.4454f, 0.6431f, 0.8371f, 1.0124f, 1.2110f, 1.4160f, + 1.6240f, 1.8242f, 2.0047f, 2.1974f, 2.3902f, 2.5778f, 2.7637f, 2.9481f, + 0.1321f, 0.2565f, 0.3846f, 0.5847f, 0.7578f, 0.9259f, 1.0637f, 1.2239f, + 1.4690f, 1.7346f, 1.9750f, 2.1882f, 2.3712f, 2.5509f, 2.7280f, 2.8885f, + 0.1437f, 0.2930f, 0.4428f, 0.6156f, 0.8045f, 0.9638f, 1.1450f, 1.3138f, + 1.5144f, 1.7355f, 1.9469f, 2.1534f, 2.3414f, 2.5452f, 2.7353f, 2.9334f, + 0.1692f, 0.2770f, 0.3831f, 0.6100f, 0.7825f, 0.9302f, 1.0690f, 1.2481f, + 1.4615f, 1.6799f, 1.9165f, 2.1739f, 2.3435f, 2.5349f, 2.7520f, 2.9163f, + 0.1235f, 0.2489f, 0.4354f, 0.6343f, 0.8236f, 1.0066f, 1.1908f, 1.3474f, + 1.5656f, 1.8275f, 2.0620f, 2.2548f, 2.4135f, 2.5913f, 2.7639f, 2.9334f, + 0.1090f, 0.1961f, 0.3854f, 0.5701f, 0.7024f, 0.8843f, 1.1393f, 1.3785f, + 1.5940f, 1.7797f, 1.9442f, 2.1740f, 2.3853f, 2.5773f, 2.7727f, 2.9406f, + 0.1560f, 0.3477f, 0.5011f, 0.6287f, 0.7612f, 0.9896f, 1.1510f, 1.3420f, + 1.5435f, 1.6816f, 1.8731f, 2.0651f, 2.2613f, 2.4999f, 2.7027f, 2.8971f, + 0.1459f, 0.2416f, 0.3833f, 0.5450f, 0.7916f, 0.9223f, 1.0662f, 1.1953f, + 1.4029f, 1.6616f, 1.9320f, 2.1459f, 2.3386f, 2.5081f, 2.6799f, 2.9195f, + 0.1546f, 0.3854f, 0.6184f, 0.8460f, 1.0599f, 1.2428f, 1.3906f, 1.5550f, + 1.7388f, 1.8945f, 2.0757f, 2.2386f, 2.4014f, 2.5705f, 2.7574f, 2.9400f, + 0.1080f, 0.2307f, 0.4112f, 0.6067f, 0.7725f, 0.9467f, 1.1285f, 1.3205f, + 1.5348f, 1.7609f, 1.9937f, 2.1878f, 2.3583f, 2.5515f, 2.7199f, 2.9049f, + 0.1482f, 0.3178f, 0.4983f, 0.6342f, 0.7783f, 0.9880f, 1.2019f, 1.3404f, + 1.5223f, 1.7296f, 1.9211f, 2.0943f, 2.2928f, 2.5008f, 2.7136f, 2.9224f, + 0.1145f, 0.2910f, 0.4891f, 0.6492f, 0.8126f, 0.9530f, 1.1180f, 1.3155f, + 1.5054f, 1.6893f, 1.8899f, 2.1188f, 2.3389f, 2.5512f, 2.7313f, 2.9224f, + 0.0939f, 0.1689f, 0.3250f, 0.5792f, 0.7698f, 0.9245f, 1.1574f, 1.3865f, + 1.5959f, 1.7977f, 1.9821f, 2.1528f, 2.3326f, 2.5540f, 2.7553f, 2.9179f, + 0.1243f, 0.2474f, 0.3923f, 0.6199f, 0.7908f, 0.9379f, 1.1497f, 1.3734f, + 1.5582f, 1.7420f, 1.9539f, 2.1385f, 2.3240f, 2.5277f, 2.7311f, 2.9178f, + 0.1961f, 0.3748f, 0.5176f, 0.6387f, 0.8169f, 1.0477f, 1.2124f, 1.3869f, + 1.5604f, 1.7225f, 1.8770f, 2.0837f, 2.2960f, 2.5103f, 2.6945f, 2.8862f, + 0.1295f, 0.2403f, 0.4149f, 0.6189f, 0.7913f, 0.9130f, 1.0832f, 1.2787f, + 1.4860f, 1.7112f, 1.9502f, 2.1348f, 2.2776f, 2.4982f, 2.7431f, 2.9522f, + 0.0160f, 0.0362f, 0.0097f, 0.0057f, -0.0014f, -0.0073f, -0.0046f, -0.0064f, + -0.0121f, 0.0019f, 0.0149f, -0.0440f, -0.0479f, -0.0382f, -0.0480f, -0.0182f, + 0.0170f, 0.0114f, -0.0298f, -0.0175f, -0.0033f, -0.0354f, -0.0510f, -0.0025f, + 0.0307f, 0.0351f, 0.0338f, 0.0420f, 0.0138f, -0.0175f, -0.0102f, 0.0053f, + 0.0084f, -0.0003f, 0.0412f, -0.0027f, 0.0145f, -0.0039f, 0.0083f, 0.0400f, + 0.0001f, -0.0262f, 0.0055f, -0.0082f, 0.0348f, 0.0433f, 0.0137f, -0.0024f, + -0.0055f, 0.0262f, 0.0521f, 0.0349f, 0.0185f, 0.0076f, -0.0319f, -0.0561f, + -0.0460f, -0.0253f, -0.0097f, 0.0163f, 0.0184f, -0.0037f, -0.0480f, -0.0371f, + 0.0628f, 0.0665f, 0.0296f, -0.0057f, 0.0253f, 0.0227f, 0.0350f, 0.0692f, + 0.0545f, 0.0218f, 0.0094f, -0.0449f, -0.0372f, 0.0005f, 0.0258f, 0.0118f, + 0.0285f, 0.0760f, 0.0822f, 0.0527f, -0.0299f, -0.0049f, 0.0170f, 0.0195f, + 0.0136f, 0.0286f, 0.0289f, 0.0139f, 0.0054f, 0.0152f, 0.0244f, 0.0028f, + -0.0056f, -0.0260f, 0.0307f, 0.0572f, -0.0087f, 0.0088f, 0.0062f, 0.0000f, + 0.0125f, 0.0000f, -0.0292f, 0.0820f, 0.0872f, 0.0646f, 0.0346f, 0.0076f, + -0.0022f, -0.0253f, -0.0567f, -0.0188f, -0.0336f, -0.0673f, -0.0549f, -0.0166f, + -0.0259f, -0.0140f, 0.0040f, -0.0029f, -0.0430f, -0.0531f, -0.0253f, -0.0019f, + -0.0071f, 0.0393f, 0.0072f, -0.0327f, -0.0236f, -0.0235f, -0.0177f, -0.0186f, + -0.0280f, -0.0201f, -0.0077f, 0.0383f, 0.0418f, 0.0321f, 0.0294f, 0.0169f, + 0.0468f, 0.0301f, 0.0133f, 0.0363f, 0.0516f, 0.0937f, 0.1240f, 0.1404f, + 0.1325f, 0.1178f, 0.0999f, 0.0251f, -0.0037f, -0.0495f, -0.0703f, -0.0219f, + -0.0261f, -0.0304f, -0.0204f, -0.0372f, 0.0355f, 0.0131f, -0.0093f, -0.0099f, + -0.0069f, -0.0034f, -0.0065f, -0.0208f, -0.0231f, -0.0117f, -0.0211f, -0.0243f, + 0.0046f, -0.0107f, -0.0070f, 0.0123f, 0.0230f, 0.0152f, 0.0164f, 0.0412f, + 0.0619f, 0.0858f, 0.0862f, -0.0056f, 0.0125f, 0.0182f, 0.0347f, 0.0388f, + 0.0456f, 0.0407f, -0.0249f, -0.0460f, 0.0206f, 0.0299f, 0.0253f, 0.0207f, + 0.0177f, 0.0238f, 0.0253f, 0.0030f, 0.0042f, 0.0020f, -0.0081f, -0.0136f, + -0.0290f, -0.0042f, 0.0122f, 0.0051f, 0.0107f, 0.0228f, 0.0211f, -0.0068f, + -0.0436f, -0.0299f, -0.0078f, -0.0779f, -0.1157f, -0.0679f, 0.0172f, 0.0150f, + -0.0051f, 0.0081f, -0.0512f, -0.0616f, 0.0576f, 0.0799f, 0.0803f, 0.0336f, + 0.0001f, -0.0298f, -0.0747f, -0.0115f, -0.0101f, -0.0170f, -0.0050f, 0.0174f, + -0.0290f, -0.0601f, -0.0150f, 0.0121f, 0.0165f, 0.0230f, 0.0028f, -0.0317f, + -0.0165f, 0.0356f, 0.0451f, 0.0120f, 0.0321f, 0.0084f, -0.0058f, 0.0122f, + 0.1935f, 0.1802f, 0.2195f, 0.2410f, 0.2201f, 0.1915f, 0.1840f, 0.1935f, + 0.2213f, 0.2079f, 0.1858f, 0.1974f, 0.2239f, 0.2173f, 0.1840f, 0.2120f, + 0.4912f, 0.4777f, 0.4607f, 0.4395f, 0.4426f, 0.4388f, 0.4416f, 0.4345f, + 0.4239f, 0.4331f, 0.4522f, 0.4423f, 0.4475f, 0.4387f, 0.4525f, 0.4446f, + }; + + static final float[] ff_metasound_lsp44 = { + 0.0927f, 0.2291f, 0.4059f, 0.5779f, 0.7288f, 0.8821f, 1.0377f, 1.1915f, + 1.3433f, 1.4931f, 1.6475f, 1.7989f, 1.9381f, 2.0858f, 2.2321f, 2.3765f, + 2.5187f, 2.6530f, 2.7895f, 2.9354f, 0.0944f, 0.1974f, 0.3046f, 0.4714f, + 0.6116f, 0.7829f, 0.9027f, 1.0375f, 1.1869f, 1.3488f, 1.5036f, 1.6781f, + 1.8276f, 1.9983f, 2.1449f, 2.3089f, 2.4534f, 2.6113f, 2.7553f, 2.9062f, + 0.1168f, 0.2843f, 0.4907f, 0.6706f, 0.8100f, 0.9417f, 1.0753f, 1.2014f, + 1.3151f, 1.4496f, 1.5832f, 1.7379f, 1.8642f, 2.0230f, 2.1681f, 2.3250f, + 2.4676f, 2.6242f, 2.7602f, 2.9066f, 0.1353f, 0.2335f, 0.3370f, 0.4380f, + 0.5819f, 0.7353f, 0.8671f, 1.0160f, 1.1435f, 1.2977f, 1.4860f, 1.6739f, + 1.8412f, 2.0028f, 2.1537f, 2.3124f, 2.4741f, 2.6272f, 2.7862f, 2.9536f, + 0.1003f, 0.2226f, 0.3584f, 0.4971f, 0.6291f, 0.7710f, 0.9157f, 1.0669f, + 1.2143f, 1.3624f, 1.5104f, 1.6681f, 1.8164f, 1.9823f, 2.1394f, 2.3082f, + 2.4677f, 2.6306f, 2.7909f, 2.9382f, 0.1056f, 0.2027f, 0.2956f, 0.4005f, + 0.5215f, 0.6708f, 0.8545f, 1.0557f, 1.2344f, 1.4023f, 1.5676f, 1.7278f, + 1.8808f, 2.0381f, 2.1846f, 2.3376f, 2.4887f, 2.6377f, 2.7878f, 2.9504f, + 0.1015f, 0.2462f, 0.4122f, 0.5783f, 0.7233f, 0.8833f, 1.0377f, 1.1903f, + 1.3341f, 1.4727f, 1.6138f, 1.7582f, 1.8912f, 2.0370f, 2.1701f, 2.3125f, + 2.4500f, 2.6006f, 2.7507f, 2.9166f, 0.1787f, 0.2418f, 0.3265f, 0.5379f, + 0.6584f, 0.7681f, 0.9545f, 1.1050f, 1.2125f, 1.3528f, 1.4763f, 1.6705f, + 1.8136f, 1.9594f, 2.0936f, 2.2724f, 2.4394f, 2.5919f, 2.7037f, 2.8747f, + 0.0859f, 0.1600f, 0.2980f, 0.4933f, 0.6696f, 0.8285f, 0.9958f, 1.1545f, + 1.3107f, 1.4591f, 1.6127f, 1.7652f, 1.9143f, 2.0680f, 2.2171f, 2.3643f, + 2.5141f, 2.6611f, 2.8143f, 2.9691f, 0.0910f, 0.2110f, 0.3364f, 0.4718f, + 0.5856f, 0.7298f, 0.8910f, 1.0514f, 1.1988f, 1.3572f, 1.5178f, 1.6861f, + 1.8399f, 2.0099f, 2.1639f, 2.3225f, 2.4774f, 2.6321f, 2.7863f, 2.9412f, + 0.1904f, 0.2874f, 0.3681f, 0.4981f, 0.6248f, 0.7880f, 0.9121f, 1.0750f, + 1.2185f, 1.3809f, 1.5296f, 1.7007f, 1.8592f, 2.0470f, 2.1913f, 2.3250f, + 2.4519f, 2.5984f, 2.7408f, 2.9023f, 0.0917f, 0.2067f, 0.3246f, 0.4961f, + 0.6310f, 0.8024f, 0.9438f, 1.1008f, 1.2362f, 1.3892f, 1.5407f, 1.7033f, + 1.8427f, 2.0061f, 2.1498f, 2.3117f, 2.4550f, 2.6053f, 2.7462f, 2.9029f, + 0.0989f, 0.2193f, 0.3756f, 0.5410f, 0.6929f, 0.8368f, 0.9801f, 1.1250f, + 1.2677f, 1.4184f, 1.5677f, 1.7292f, 1.8770f, 2.0311f, 2.1803f, 2.3306f, + 2.4836f, 2.6339f, 2.7943f, 2.9549f, 0.0861f, 0.1943f, 0.3057f, 0.4867f, + 0.6194f, 0.7592f, 0.9184f, 1.1052f, 1.2486f, 1.4064f, 1.5609f, 1.7273f, + 1.8703f, 2.0291f, 2.1686f, 2.3225f, 2.4628f, 2.6115f, 2.7471f, 2.9005f, + 0.0932f, 0.2110f, 0.3737f, 0.5479f, 0.7120f, 0.8570f, 0.9975f, 1.1364f, + 1.2772f, 1.4220f, 1.5612f, 1.7089f, 1.8410f, 1.9827f, 2.1263f, 2.2859f, + 2.4459f, 2.6172f, 2.7788f, 2.9395f, 0.1193f, 0.2341f, 0.3523f, 0.5029f, + 0.6437f, 0.7803f, 0.9367f, 1.1007f, 1.2392f, 1.3869f, 1.5425f, 1.7168f, + 1.8709f, 2.0248f, 2.1584f, 2.2949f, 2.4308f, 2.5823f, 2.7235f, 2.9034f, + 0.0834f, 0.1988f, 0.3557f, 0.5261f, 0.6767f, 0.8427f, 1.0029f, 1.1683f, + 1.3138f, 1.4527f, 1.6046f, 1.7583f, 1.9011f, 2.0517f, 2.1928f, 2.3397f, + 2.4839f, 2.6291f, 2.7771f, 2.9329f, 0.0938f, 0.1967f, 0.3213f, 0.4675f, + 0.6068f, 0.7664f, 0.9418f, 1.1120f, 1.2535f, 1.3932f, 1.5243f, 1.6801f, + 1.8346f, 1.9931f, 2.1376f, 2.3035f, 2.4636f, 2.6244f, 2.7829f, 2.9371f, + 0.1017f, 0.2552f, 0.4327f, 0.6017f, 0.7467f, 0.8797f, 1.0097f, 1.1442f, + 1.2628f, 1.4049f, 1.5541f, 1.7090f, 1.8461f, 1.9982f, 2.1486f, 2.3029f, + 2.4513f, 2.6075f, 2.7594f, 2.9209f, 0.1031f, 0.2295f, 0.3747f, 0.5122f, + 0.6596f, 0.7935f, 0.9345f, 1.1050f, 1.2384f, 1.3543f, 1.4739f, 1.6136f, + 1.7447f, 1.8914f, 2.0434f, 2.1916f, 2.3557f, 2.5396f, 2.7419f, 2.9401f, + 0.1007f, 0.2374f, 0.3715f, 0.5173f, 0.6465f, 0.8069f, 0.9553f, 1.1145f, + 1.2594f, 1.4143f, 1.5617f, 1.7166f, 1.8457f, 2.0012f, 2.1462f, 2.2864f, + 2.4258f, 2.5910f, 2.7372f, 2.9018f, 0.0808f, 0.1726f, 0.2849f, 0.4592f, + 0.6118f, 0.7853f, 0.9588f, 1.1256f, 1.2751f, 1.4392f, 1.5898f, 1.7514f, + 1.8977f, 2.0554f, 2.1937f, 2.3430f, 2.4831f, 2.6249f, 2.7601f, 2.9155f, + 0.1669f, 0.2574f, 0.3694f, 0.5569f, 0.6773f, 0.8061f, 1.0160f, 1.1667f, + 1.2791f, 1.4041f, 1.5452f, 1.7207f, 1.8524f, 2.0038f, 2.1414f, 2.3338f, + 2.4747f, 2.6157f, 2.7303f, 2.8848f, 0.1598f, 0.2521f, 0.3416f, 0.5149f, + 0.6703f, 0.7941f, 0.9408f, 1.1164f, 1.2017f, 1.3293f, 1.4908f, 1.6783f, + 1.8438f, 1.9927f, 2.1149f, 2.2698f, 2.4420f, 2.6193f, 2.7583f, 2.9103f, + 0.0902f, 0.1978f, 0.3265f, 0.4578f, 0.5878f, 0.7439f, 0.9110f, 1.0906f, + 1.2556f, 1.4125f, 1.5688f, 1.7295f, 1.8829f, 2.0472f, 2.2058f, 2.3537f, + 2.5075f, 2.6548f, 2.8058f, 2.9538f, 0.0818f, 0.1695f, 0.2794f, 0.4470f, + 0.6069f, 0.7641f, 0.9313f, 1.0946f, 1.2411f, 1.4072f, 1.5640f, 1.7186f, + 1.8651f, 2.0254f, 2.1726f, 2.3286f, 2.4784f, 2.6287f, 2.7750f, 2.9339f, + 0.1980f, 0.3134f, 0.4099f, 0.4975f, 0.6491f, 0.8376f, 0.9441f, 1.0298f, + 1.1795f, 1.3866f, 1.5784f, 1.7209f, 1.8137f, 1.9271f, 2.0863f, 2.2930f, + 2.4696f, 2.6184f, 2.7587f, 2.9251f, 0.1338f, 0.2341f, 0.3566f, 0.4797f, + 0.6129f, 0.7580f, 0.9093f, 1.0491f, 1.1911f, 1.3313f, 1.4841f, 1.6503f, + 1.8035f, 1.9685f, 2.1128f, 2.2694f, 2.4093f, 2.5728f, 2.7206f, 2.8994f, + 0.0937f, 0.2034f, 0.3447f, 0.5032f, 0.6370f, 0.7993f, 0.9674f, 1.1323f, + 1.2830f, 1.4199f, 1.5492f, 1.7010f, 1.8513f, 2.0087f, 2.1550f, 2.3115f, + 2.4643f, 2.6237f, 2.7812f, 2.9392f, 0.1085f, 0.2152f, 0.3126f, 0.4569f, + 0.5718f, 0.7213f, 0.8837f, 1.0604f, 1.2053f, 1.3755f, 1.5397f, 1.7001f, + 1.8409f, 2.0039f, 2.1498f, 2.3080f, 2.4535f, 2.6063f, 2.7505f, 2.9110f, + 0.0562f, 0.2066f, 0.4034f, 0.5490f, 0.6682f, 0.7924f, 0.9495f, 1.0800f, + 1.1869f, 1.3156f, 1.4834f, 1.6619f, 1.8404f, 2.0199f, 2.1509f, 2.2755f, + 2.4072f, 2.5580f, 2.6993f, 2.8913f, 0.0939f, 0.2303f, 0.3742f, 0.5260f, + 0.6662f, 0.8294f, 0.9769f, 1.1315f, 1.2792f, 1.4153f, 1.5436f, 1.6701f, + 1.8215f, 1.9920f, 2.1310f, 2.3005f, 2.4534f, 2.5786f, 2.7204f, 2.9068f, + 0.1005f, 0.2442f, 0.3898f, 0.5398f, 0.6958f, 0.8474f, 1.0008f, 1.1556f, + 1.3020f, 1.4456f, 1.5954f, 1.7470f, 1.8922f, 2.0500f, 2.2019f, 2.3492f, + 2.4963f, 2.6412f, 2.7890f, 2.9423f, 0.1022f, 0.2031f, 0.3213f, 0.4402f, + 0.5637f, 0.7117f, 0.8673f, 1.0242f, 1.1727f, 1.3206f, 1.4846f, 1.6465f, + 1.8015f, 1.9655f, 2.1233f, 2.2873f, 2.4464f, 2.6074f, 2.7685f, 2.9409f, + 0.1985f, 0.3497f, 0.4622f, 0.5982f, 0.7489f, 0.8752f, 0.9925f, 1.1679f, + 1.3288f, 1.4606f, 1.5820f, 1.7492f, 1.8922f, 2.0511f, 2.1780f, 2.3373f, + 2.4760f, 2.6233f, 2.7466f, 2.8978f, 0.1284f, 0.2433f, 0.3630f, 0.4852f, + 0.6117f, 0.7460f, 0.8904f, 1.0360f, 1.1738f, 1.3142f, 1.4696f, 1.6185f, + 1.7719f, 1.9318f, 2.0961f, 2.2697f, 2.4408f, 2.6046f, 2.7681f, 2.9451f, + 0.1042f, 0.2286f, 0.3598f, 0.5064f, 0.6438f, 0.7899f, 0.9350f, 1.0891f, + 1.2323f, 1.3807f, 1.5225f, 1.6747f, 1.8153f, 1.9669f, 2.1145f, 2.2832f, + 2.4430f, 2.6085f, 2.7748f, 2.9346f, 0.0780f, 0.1724f, 0.2440f, 0.3489f, + 0.5280f, 0.7426f, 0.9272f, 1.0914f, 1.2562f, 1.4188f, 1.5804f, 1.7376f, + 1.8909f, 2.0473f, 2.1946f, 2.3457f, 2.4950f, 2.6424f, 2.7926f, 2.9549f, + 0.1103f, 0.2608f, 0.4087f, 0.5538f, 0.6923f, 0.8418f, 0.9940f, 1.1507f, + 1.2919f, 1.4406f, 1.5802f, 1.7262f, 1.8638f, 2.0085f, 2.1572f, 2.2975f, + 2.4329f, 2.5866f, 2.7380f, 2.9107f, 0.1297f, 0.2532f, 0.4003f, 0.5329f, + 0.6733f, 0.7950f, 0.9557f, 1.0859f, 1.2235f, 1.3538f, 1.5037f, 1.6389f, + 1.7964f, 1.9285f, 2.0898f, 2.2541f, 2.4231f, 2.5711f, 2.6875f, 2.8947f, + 0.0871f, 0.1968f, 0.3425f, 0.4949f, 0.6424f, 0.7959f, 0.9534f, 1.1132f, + 1.2656f, 1.4229f, 1.5785f, 1.7271f, 1.8729f, 2.0355f, 2.1998f, 2.3562f, + 2.5151f, 2.6663f, 2.8145f, 2.9534f, 0.1038f, 0.2204f, 0.3248f, 0.4566f, + 0.5947f, 0.7443f, 0.8811f, 1.0379f, 1.2031f, 1.3772f, 1.5430f, 1.7092f, + 1.8625f, 2.0322f, 2.1904f, 2.3417f, 2.4960f, 2.6458f, 2.7979f, 2.9485f, + 0.1329f, 0.2763f, 0.3943f, 0.5147f, 0.6512f, 0.8071f, 0.9410f, 1.0879f, + 1.2298f, 1.3850f, 1.5282f, 1.6674f, 1.8137f, 1.9993f, 2.1344f, 2.2749f, + 2.4257f, 2.5863f, 2.7410f, 2.9184f, 0.1052f, 0.2142f, 0.3584f, 0.5033f, + 0.6387f, 0.7804f, 0.9320f, 1.0780f, 1.2172f, 1.3764f, 1.5421f, 1.6887f, + 1.8246f, 1.9833f, 2.1245f, 2.2797f, 2.4237f, 2.5779f, 2.7257f, 2.9097f, + 0.1092f, 0.2676f, 0.4071f, 0.5355f, 0.6661f, 0.8142f, 0.9621f, 1.1173f, + 1.2628f, 1.4185f, 1.5696f, 1.7220f, 1.8595f, 2.0178f, 2.1720f, 2.3221f, + 2.4718f, 2.6259f, 2.7775f, 2.9334f, 0.0929f, 0.2017f, 0.3073f, 0.4570f, + 0.5775f, 0.7635f, 0.9299f, 1.0832f, 1.2334f, 1.3935f, 1.5420f, 1.7112f, + 1.8601f, 2.0309f, 2.1735f, 2.3230f, 2.4543f, 2.6034f, 2.7418f, 2.8988f, + 0.0775f, 0.2005f, 0.3490f, 0.5200f, 0.6747f, 0.8383f, 0.9885f, 1.1738f, + 1.3141f, 1.4236f, 1.5892f, 1.7402f, 1.8474f, 2.0210f, 2.1593f, 2.2730f, + 2.4235f, 2.5604f, 2.7128f, 2.9005f, 0.1104f, 0.2292f, 0.3353f, 0.4732f, + 0.6152f, 0.7675f, 0.9164f, 1.0907f, 1.2594f, 1.4064f, 1.5218f, 1.6426f, + 1.8018f, 1.9937f, 2.1362f, 2.2961f, 2.4523f, 2.6083f, 2.7613f, 2.9202f, + 0.0826f, 0.2000f, 0.3384f, 0.5144f, 0.6694f, 0.8377f, 0.9870f, 1.1461f, + 1.2950f, 1.4495f, 1.5872f, 1.7387f, 1.8793f, 2.0329f, 2.1723f, 2.3114f, + 2.4415f, 2.5908f, 2.7354f, 2.9028f, 0.1063f, 0.2268f, 0.3442f, 0.4735f, + 0.6116f, 0.7507f, 0.9028f, 1.0768f, 1.2426f, 1.4052f, 1.5566f, 1.7015f, + 1.8243f, 1.9742f, 2.1276f, 2.2824f, 2.4262f, 2.5953f, 2.7627f, 2.9290f, + 0.1150f, 0.2814f, 0.4543f, 0.6095f, 0.7373f, 0.8592f, 0.9908f, 1.1108f, + 1.2339f, 1.3590f, 1.4864f, 1.6168f, 1.7392f, 1.8752f, 2.0212f, 2.1688f, + 2.3128f, 2.4869f, 2.7019f, 2.9239f, 0.0948f, 0.2074f, 0.3433f, 0.4943f, + 0.6346f, 0.7645f, 0.8809f, 1.0610f, 1.2307f, 1.3487f, 1.4655f, 1.6186f, + 1.7534f, 1.8859f, 2.0486f, 2.2200f, 2.3835f, 2.5581f, 2.7565f, 2.9502f, + 0.1062f, 0.2239f, 0.3683f, 0.5197f, 0.6704f, 0.8184f, 0.9642f, 1.1127f, + 1.2556f, 1.3976f, 1.5405f, 1.6940f, 1.8375f, 1.9888f, 2.1377f, 2.2980f, + 2.4555f, 2.6184f, 2.7849f, 2.9452f, 0.0888f, 0.2005f, 0.2847f, 0.4322f, + 0.5763f, 0.7577f, 0.9262f, 1.1095f, 1.2719f, 1.4331f, 1.5843f, 1.7452f, + 1.8845f, 2.0385f, 2.1805f, 2.3345f, 2.4750f, 2.6217f, 2.7555f, 2.9013f, + 0.1713f, 0.2617f, 0.3868f, 0.5859f, 0.7073f, 0.8535f, 1.0593f, 1.1778f, + 1.3109f, 1.4508f, 1.5910f, 1.7463f, 1.8911f, 2.0651f, 2.2035f, 2.3355f, + 2.4947f, 2.6440f, 2.7424f, 2.8943f, 0.1346f, 0.2549f, 0.4089f, 0.5488f, + 0.6949f, 0.8394f, 0.9810f, 1.1145f, 1.2528f, 1.4044f, 1.5423f, 1.6872f, + 1.8274f, 1.9726f, 2.1403f, 2.2809f, 2.4128f, 2.5564f, 2.6887f, 2.8895f, + 0.0776f, 0.1621f, 0.2553f, 0.4191f, 0.5988f, 0.7921f, 0.9651f, 1.1350f, + 1.2930f, 1.4475f, 1.6011f, 1.7585f, 1.9068f, 2.0638f, 2.2102f, 2.3594f, + 2.5096f, 2.6581f, 2.8099f, 2.9654f, 0.0864f, 0.1778f, 0.2854f, 0.4235f, + 0.5568f, 0.7220f, 0.8963f, 1.0609f, 1.2217f, 1.3830f, 1.5422f, 1.7018f, + 1.8551f, 2.0206f, 2.1783f, 2.3328f, 2.4869f, 2.6366f, 2.7923f, 2.9539f, + 0.1144f, 0.2576f, 0.4186f, 0.5594f, 0.6875f, 0.8221f, 0.9598f, 1.0944f, + 1.2273f, 1.3713f, 1.5152f, 1.6628f, 1.8070f, 1.9525f, 2.0965f, 2.2535f, + 2.4132f, 2.5725f, 2.7250f, 2.9150f, 0.1079f, 0.2221f, 0.3334f, 0.4845f, + 0.6083f, 0.7516f, 0.9018f, 1.0594f, 1.2060f, 1.3673f, 1.5212f, 1.6880f, + 1.8208f, 1.9831f, 2.1269f, 2.2909f, 2.4366f, 2.6027f, 2.7339f, 2.8924f, + 0.0994f, 0.2233f, 0.3634f, 0.5145f, 0.6568f, 0.8131f, 0.9746f, 1.1296f, + 1.2666f, 1.4116f, 1.5748f, 1.7264f, 1.8649f, 2.0217f, 2.1716f, 2.3293f, + 2.4900f, 2.6455f, 2.7818f, 2.9362f, 0.1120f, 0.2079f, 0.3128f, 0.4124f, + 0.5291f, 0.6816f, 0.8478f, 1.0150f, 1.1772f, 1.3456f, 1.5208f, 1.6882f, + 1.8458f, 2.0078f, 2.1627f, 2.3198f, 2.4733f, 2.6251f, 2.7796f, 2.9489f, + 0.0853f, 0.2030f, 0.3669f, 0.5326f, 0.6678f, 0.8086f, 0.9526f, 1.1142f, + 1.2551f, 1.4158f, 1.5694f, 1.7073f, 1.8431f, 1.9686f, 2.1153f, 2.2376f, + 2.3686f, 2.5591f, 2.7320f, 2.9104f, 0.0905f, 0.2166f, 0.3539f, 0.5201f, + 0.6700f, 0.8346f, 0.9883f, 1.1457f, 1.2714f, 1.3845f, 1.5172f, 1.6688f, + 1.8008f, 1.9535f, 2.1019f, 2.2708f, 2.4135f, 2.5974f, 2.7486f, 2.9033f, + 0.0084f, 0.0374f, 0.0164f, -0.0153f, 0.0288f, 0.0107f, -0.0255f, -0.0242f, + 0.0000f, -0.0055f, -0.0081f, -0.0075f, -0.0022f, -0.0052f, -0.0069f, -0.0017f, + 0.0003f, 0.0091f, 0.0028f, -0.0027f, 0.0085f, 0.0043f, -0.0235f, -0.0411f, + 0.0202f, 0.0359f, 0.0376f, 0.0321f, 0.0306f, -0.0358f, -0.0276f, -0.0090f, + 0.0032f, 0.0048f, 0.0309f, 0.0332f, 0.0284f, 0.0237f, 0.0051f, -0.0101f, + -0.0233f, -0.0428f, -0.0585f, -0.0387f, 0.0039f, 0.0081f, 0.0029f, -0.0017f, + -0.0006f, -0.0068f, 0.0044f, 0.0182f, 0.0376f, 0.0387f, -0.0334f, -0.0269f, + -0.0182f, -0.0069f, -0.0026f, 0.0035f, -0.0049f, -0.0212f, -0.0408f, -0.0245f, + 0.0186f, 0.0189f, 0.0153f, 0.0120f, 0.0157f, 0.0055f, -0.0046f, 0.0179f, + 0.0284f, -0.0032f, -0.0261f, -0.0205f, -0.0039f, 0.0174f, 0.0299f, 0.0207f, + 0.0012f, -0.0056f, 0.0010f, 0.0141f, -0.0119f, 0.0190f, 0.0315f, 0.0033f, + -0.0128f, 0.0300f, 0.0328f, 0.0308f, 0.0353f, 0.0266f, 0.0066f, -0.0328f, + -0.0273f, 0.0054f, 0.0145f, 0.0175f, 0.0015f, -0.0171f, 0.0062f, -0.0164f, + 0.0045f, -0.0071f, 0.0025f, 0.0278f, 0.0283f, 0.0117f, -0.0026f, -0.0285f, + -0.0408f, -0.0366f, -0.0059f, -0.0208f, -0.0354f, -0.0334f, -0.0263f, -0.0064f, + 0.0072f, -0.0006f, -0.0235f, -0.0037f, -0.0307f, -0.0294f, -0.0163f, -0.0197f, + -0.0235f, 0.0192f, 0.0013f, -0.0219f, -0.0123f, -0.0004f, -0.0081f, -0.0096f, + -0.0123f, -0.0101f, 0.0021f, 0.0151f, 0.0106f, 0.0151f, 0.0292f, 0.0033f, + 0.0283f, 0.0124f, 0.0058f, -0.0017f, -0.0038f, 0.0152f, 0.0141f, 0.0132f, + 0.0178f, 0.0157f, 0.0073f, 0.0176f, 0.0141f, 0.0097f, -0.0092f, -0.0163f, + -0.0230f, -0.0134f, -0.0099f, -0.0147f, 0.0040f, -0.0183f, -0.0175f, -0.0080f, + -0.0083f, -0.0290f, -0.0417f, -0.0398f, -0.0269f, -0.0199f, -0.0143f, -0.0053f, + -0.0099f, -0.0054f, -0.0199f, -0.0219f, -0.0170f, 0.0107f, 0.0194f, 0.0035f, + 0.0437f, 0.0406f, 0.0215f, 0.0120f, 0.0053f, -0.0028f, 0.0238f, 0.0337f, + 0.0217f, 0.0011f, 0.0227f, 0.0244f, 0.0327f, 0.0378f, 0.0437f, 0.0356f, + -0.0033f, 0.0113f, 0.0407f, 0.0334f, -0.0125f, -0.0003f, -0.0141f, -0.0273f, + -0.0137f, -0.0079f, -0.0145f, -0.0071f, 0.0114f, 0.0181f, 0.0150f, 0.0085f, + -0.0077f, -0.0038f, -0.0219f, -0.0263f, -0.0187f, -0.0233f, 0.0133f, 0.0265f, + -0.0156f, -0.0091f, -0.0110f, -0.0016f, 0.0143f, 0.0177f, 0.0240f, 0.0082f, + -0.0143f, -0.0257f, -0.0014f, 0.0002f, 0.0082f, 0.0180f, 0.0325f, 0.0340f, + -0.0153f, -0.0389f, -0.0240f, 0.0082f, 0.0140f, 0.0046f, -0.0138f, -0.0378f, + -0.0366f, 0.0297f, 0.0252f, 0.0078f, 0.0063f, 0.0006f, 0.0044f, 0.0074f, + 0.0094f, 0.0113f, 0.0105f, 0.0137f, 0.0438f, 0.0262f, -0.0078f, -0.0185f, + -0.0215f, -0.0407f, -0.0435f, -0.0208f, -0.0004f, -0.0144f, -0.0205f, -0.0248f, + -0.0159f, -0.0069f, -0.0153f, 0.0132f, 0.0355f, 0.0298f, 0.0120f, 0.0072f, + 0.0236f, 0.0526f, 0.0479f, 0.0233f, -0.0133f, -0.0283f, -0.0468f, -0.0549f, + -0.0370f, 0.0032f, 0.0056f, 0.0023f, 0.0050f, 0.0024f, 0.0279f, 0.0116f, + -0.0045f, -0.0012f, 0.0107f, 0.0190f, 0.0253f, 0.0191f, 0.0043f, 0.0193f, + -0.0348f, -0.0246f, 0.0123f, 0.0210f, 0.0135f, -0.0096f, -0.0109f, -0.0076f, + -0.0156f, -0.0290f, 0.0160f, 0.0194f, 0.0219f, 0.0259f, 0.0250f, 0.0195f, + 0.4948f, 0.4961f, 0.4940f, 0.4878f, 0.4849f, 0.4727f, 0.4571f, 0.4551f, + 0.4534f, 0.4468f, 0.4412f, 0.4354f, 0.4298f, 0.4272f, 0.4498f, 0.4506f, + 0.4560f, 0.4592f, 0.4758f, 0.4941f, 0.2476f, 0.1771f, 0.1974f, 0.1881f, + 0.1667f, 0.1826f, 0.2067f, 0.2031f, 0.1734f, 0.1534f, 0.1415f, 0.1761f, + 0.1897f, 0.1772f, 0.1651f, 0.1247f, 0.1041f, 0.1231f, 0.1809f, 0.2234f, + }; +} diff --git a/src/main/java/vavi/sound/twinvq/TwinVQ.java b/src/main/java/vavi/sound/twinvq/TwinVQ.java new file mode 100644 index 0000000..34c0219 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/TwinVQ.java @@ -0,0 +1,807 @@ +/* + * TwinVQ decoder + * Copyright (c) 2009 Vitor Sessak + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package vavi.sound.twinvq; + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +import vavi.sound.twinvq.LibAV.AVCodecContext; +import vavi.sound.twinvq.LibAV.AVFloatDSPContext; +import vavi.sound.twinvq.LibAV.AVFrame; +import vavi.sound.twinvq.LibAV.AVPacket; +import vavi.sound.twinvq.LibAV.AVTXContext; +import vavi.sound.twinvq.TwinVQDec.TwinVQContext; +import vavi.sound.twinvq.TwinVQDec.TwinVQFrameData; +import vavi.sound.twinvq.TwinVQDec.TwinVQFrameType; +import vavi.sound.twinvq.TwinVQDec.TwinVQModeTab; +import vavi.util.Debug; + +import static java.lang.System.getLogger; +import static vavi.sound.twinvq.LibAV.AVERROR_INVALIDDATA; +import static vavi.sound.twinvq.LibAV.AV_CODEC_FLAG_BITEXACT; +import static vavi.sound.twinvq.LibAV.AV_SAMPLE_FMT_FLTP; +import static vavi.sound.twinvq.LibAV.AV_TX_FLOAT_MDCT; +import static vavi.sound.twinvq.LibAV.FF_ARRAY_ELEMS; +import static vavi.sound.twinvq.LibAV.av_tx_init; +import static vavi.sound.twinvq.LibAV.ff_get_buffer; +import static vavi.sound.twinvq.LibAV.ff_init_ff_sine_windows; +import static vavi.sound.twinvq.LibAV.ff_sine_windows; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_AMP_MAX; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_CHANNELS_MAX; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_GAIN_BITS; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_LSP_COEFS_MAX; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_MAX_FRAMES_PER_PACKET; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_MULAW_MU; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_PPC_SHAPE_CB_SIZE; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_PPC_SHAPE_LEN_MAX; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_SUBBLOCKS_MAX; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_SUB_AMP_MAX; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_SUB_GAIN_BITS; +import static vavi.sound.twinvq.TwinVQDec.TWINVQ_WINDOW_TYPE_BITS; +import static vavi.sound.twinvq.TwinVQDec.TwinVQCodec.TWINVQ_CODEC_METASOUND; +import static vavi.sound.twinvq.TwinVQDec.TwinVQFrameType.TWINVQ_FT_LONG; +import static vavi.sound.twinvq.TwinVQDec.TwinVQFrameType.TWINVQ_FT_MEDIUM; +import static vavi.sound.twinvq.TwinVQDec.TwinVQFrameType.TWINVQ_FT_PPC; +import static vavi.sound.twinvq.TwinVQDec.TwinVQFrameType.TWINVQ_FT_SHORT; +import static vavi.sound.twinvq.TwinVQDec.twinvq_mulawinv; + + +/** + * TwinVQ. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-04-06 nsano initial version
    + * @see "https://github.com/libav/libav/blob/master/libavcodec/twinvq.c" + */ +public class TwinVQ { + + private static final Logger logger = getLogger(TwinVQ.class.getName()); + + enum TwinVQCodec { + TWINVQ_CODEC_VQF, + TWINVQ_CODEC_METASOUND, + } + + /** @note not speed critical, hence not optimized */ + static void twinvq_memset_float(float[] buf, int bufP, float val, int size) { + while (size-- != 0) + buf[bufP++] = val; + } + + /** + * Evaluate a single LPC amplitude spectrum envelope coefficient from the line + * spectrum pairs. + * + * @param lsp a vector of the cosine of the LSP values + * @param cos_val cos(PI*i/N) where i is the index of the LPC amplitude + * @param order the order of the LSP (and the size of the *lsp buffer). Must + * be a multiple of four. + * @return the LPC value + *

    + * TODO reuse code from Vorbis decoder: vorbis_floor0_decode + */ + static float eval_lpc_spectrum(float[] lsp, int lspP, float cos_val, int order) { + int j; + float p = 0.5f; + float q = 0.5f; + float two_cos_w = 2.0f * cos_val; + + for (j = 0; j + 1 < order; j += 2 * 2) { + // Unroll the loop once since order is a multiple of four + q *= lsp[lspP + j] - two_cos_w; + p *= lsp[lspP + j + 1] - two_cos_w; + + q *= lsp[lspP + j + 2] - two_cos_w; + p *= lsp[lspP + j + 3] - two_cos_w; + } + + p *= p * (2.0f - two_cos_w); + q *= q * (2.0f + two_cos_w); + + return 0.5f / (p + q); + } + + /** + * Evaluate the LPC amplitude spectrum envelope from the line spectrum pairs. + */ + static void eval_lpcenv(TwinVQContext tctx, float[] cos_vals, float[] lpc) { + int i; + TwinVQModeTab mtab = tctx.mtab; + int size_s = mtab.size / mtab.fmode[TWINVQ_FT_SHORT.ordinal()].sub; + + for (i = 0; i < size_s / 2; i++) { + float cos_i = tctx.cos_tabs[0][i]; + lpc[i] = eval_lpc_spectrum(cos_vals, 0, cos_i, mtab.n_lsp); + lpc[size_s - i - 1] = eval_lpc_spectrum(cos_vals, 0, -cos_i, mtab.n_lsp); + } + } + + /** */ + static void interpolate(float[] out, int outP, float v1, float v2, int size) { + float step = (v1 - v2) / (size + 1); + + for (int i = 0; i < size; i++) { + v2 += step; + out[outP + i] = v2; + } + } + + /** */ + static float get_cos(int idx, int part, float[] cos_tab, int size) { + return part != 0 ? -cos_tab[size - idx - 1] + : cos_tab[idx]; + } + + /** + * Evaluate the LPC amplitude spectrum envelope from the line spectrum pairs. + * Probably for speed reasons, the coefficients are evaluated as + *

    +     * siiiibiiiisiiiibiiiisiiiibiiiisiiiibiiiis ...
    +     * 
    + * where s is an evaluated value, i is a value interpolated from the others + * and b might be either calculated or interpolated, depending on an + * unexplained condition. + * + * @param step the size of a block "siiiibiiii" + * @param in the cosine of the LSP data + * @param part is 0 for 0...PI (positive cosine values) and 1 for PI...2PI + * (negative cosine values) + * @param size the size of the whole output + */ + static void eval_lpcenv_or_interp(TwinVQContext tctx, TwinVQFrameType ftype, + float[] out, int outP, float[] in, int inP, + int size, int step, int part) { + TwinVQModeTab mtab = tctx.mtab; + float[] cos_tab = tctx.cos_tabs[ftype.ordinal()]; + + // Fill the 's' + for (int i = 0; i < size; i += step) + out[i] = eval_lpc_spectrum(in, inP, get_cos(i, part, cos_tab, size), mtab.n_lsp); + + // Fill the 'iiiibiiii' + for (int i = step; i <= size - 2 * step; i += step) { + if (out[i + step] + out[i - step] > 1.95 * out[i] || out[i + step] >= out[i - step]) { + interpolate(out, outP + i - step + 1, out[i], out[i - step], step - 1); + } else { + out[i - step / 2] = eval_lpc_spectrum(in, inP, + get_cos(i - step / 2, part, cos_tab, size), mtab.n_lsp); + interpolate(out, outP + i - step + 1, out[i - step / 2], out[i - step], step / 2 - 1); + interpolate(out, outP + i - step / 2 + 1, out[i], out[i - step / 2], step / 2 - 1); + } + } + + interpolate(out, outP + size - 2 * step + 1, out[size - step], out[size - 2 * step], step - 1); + } + + /** */ + static void eval_lpcenv_2parts(TwinVQContext tctx, TwinVQFrameType ftype, + float[] buf, float[] lpc, int size, int step) { + eval_lpcenv_or_interp(tctx, ftype, lpc, 0, buf, 0, size / 2, step, 0); + eval_lpcenv_or_interp(tctx, ftype, lpc, size / 2, buf, 0, size / 2, 2 * step, 1); + + interpolate(lpc, size / 2 - step + 1, lpc[size / 2], lpc[size / 2 - step], step); + + twinvq_memset_float(lpc, size - 2 * step + 1, lpc[size - 2 * step], 2 * step - 1); + } + + /** + * Inverse quantization. Read CB coefficients for cb1 and cb2 from the + * bitstream, sum the corresponding vectors and write the result to *out + * after permutation. + */ + static void dequant(TwinVQContext tctx, byte[] cb_bits, float[] out, + TwinVQFrameType ftype, short[] cb0, short[] cb1, int cb1P, int cb_len) { + int pos = 0; + + int cb_bitsP = 0; + for (int i = 0; i < tctx.n_div[ftype.ordinal()]; i++) { + int sign0 = 1; + int sign1 = 1; + int length = tctx.length[ftype.ordinal()][i >= (tctx.length_change[ftype.ordinal()] & 0xff) ? 1 : 0]; + int bitstream_second_part = (i >= tctx.bits_main_spec_change[ftype.ordinal()]) ? 1 : 0; + + int bits = tctx.bits_main_spec[0][ftype.ordinal()][bitstream_second_part]; + int tmp0 = cb_bits[cb_bitsP++]; + if (bits == 7) { + if ((tmp0 & 0x40) != 0) + sign0 = -1; + tmp0 &= 0x3F; + } + + bits = tctx.bits_main_spec[1][ftype.ordinal()][bitstream_second_part]; + int tmp1 = cb_bits[cb_bitsP++]; + if (bits == 7) { + if ((tmp1 & 0x40) != 0) + sign1 = -1; + tmp1 &= 0x3F; + } + + int tab0 = tmp0 * cb_len; // cb0 + int tab1 = tmp1 * cb_len; // cb1 +//Debug.printf("dq[%3d]: %d, %02x, %d, %02x, %d", i, tctx.bits_main_spec[0][ftype.ordinal()][bitstream_second_part], tmp0, tctx.bits_main_spec[1][ftype.ordinal()][bitstream_second_part], tmp1, bitstream_second_part); +//Debug.println("bits: " + bits + ", tmp0: " + tmp0 + ", tmp1: " + tmp1 + ", cb_len: " + cb_len + ", tab0: " + tab0 + ", tab1: " + tab1 + ", cb0: " + cb0.length + ", cb1: " + cb1.length + ", cb1P: " + cb1P); + + for (int j = 0; j < length; j++) { +//System.err.printf("%d, %d, %d, %d%n", pos + j, tab0 + j, cb1P + tab1 + j, tctx.permut[ftype.ordinal()][pos + j] & 0xffff); + out[tctx.permut[ftype.ordinal()][pos + j] & 0xffff] = sign0 * cb0[tab0 + j] + + sign1 * cb1[cb1P + tab1 + j]; + } + + pos += length; + } + } + + /** */ + static void dec_gain(TwinVQContext tctx, TwinVQFrameType ftype, float[] out) { + TwinVQModeTab mtab = tctx.mtab; + TwinVQFrameData bits = tctx.bits[tctx.cur_frame]; + int channels = tctx.avctx.ch_layout.nb_channels; + int sub = mtab.fmode[ftype.ordinal()].sub; + float step = TWINVQ_AMP_MAX / ((1 << TWINVQ_GAIN_BITS) - 1); + float sub_step = TWINVQ_SUB_AMP_MAX / ((1 << TWINVQ_SUB_GAIN_BITS) - 1); + + if (ftype == TWINVQ_FT_LONG) { + for (int i = 0; i < channels; i++) + out[i] = (1.0f / (1 << 13)) * + twinvq_mulawinv(step * 0.5f + step * bits.gain_bits[i], TWINVQ_AMP_MAX, TWINVQ_MULAW_MU); + } else { + for (int i = 0; i < channels; i++) { + float val = (1.0f / (1 << 23)) * + twinvq_mulawinv(step * 0.5f + step * bits.gain_bits[i], TWINVQ_AMP_MAX, TWINVQ_MULAW_MU); + + for (int j = 0; j < sub; j++) + out[i * sub + j] = + val * twinvq_mulawinv(sub_step * 0.5f + sub_step * bits.sub_gain_bits[i * sub + j], + TWINVQ_SUB_AMP_MAX, TWINVQ_MULAW_MU); + } + } + } + + /** + * Rearrange the LSP coefficients so that they have a minimum distance of + * min_dist. This function does it exactly as described in section of 3.2.4 + * of the G.729 specification (but interestingly is different from what the + * reference decoder actually does). + */ + static void rearrange_lsp(int order, float[] lsp, float min_dist) { + float min_dist2 = min_dist * 0.5f; + for (int i = 1; i < order; i++) + if (lsp[i] - lsp[i - 1] < min_dist) { + float avg = (lsp[i] + lsp[i - 1]) * 0.5f; + + lsp[i - 1] = avg - min_dist2; + lsp[i] = avg + min_dist2; + } + } + + static void decode_lsp(TwinVQContext tctx, int lpc_idx1, byte[] lpc_idx2, + int lpc_hist_idx, float[] lsp, float[] hist) { + TwinVQModeTab mtab = tctx.mtab; + + float[] cb = mtab.lspcodebook; + int cb2 = (1 << (mtab.lsp_bit1 & 0xff)) * (mtab.n_lsp & 0xff); // cb + int cb3 = cb2 + (1 << (mtab.lsp_bit2 & 0xff)) * (mtab.n_lsp & 0xff); // cb + + byte[] funny_rounding = new byte[] { + (byte) -2, + (byte) (mtab.lsp_split == 4 ? -2 : 1), + (byte) (mtab.lsp_split == 4 ? -2 : 1), + (byte) 0 + }; + + int j = 0; + for (int i = 0; i < mtab.lsp_split; i++) { + int chunk_end = ((i + 1) * (mtab.n_lsp & 0xff) + funny_rounding[i]) / (mtab.lsp_split & 0xff); + for (; j < chunk_end; j++) + lsp[j] = cb[lpc_idx1 * (mtab.n_lsp & 0xff) + j] + + cb[cb2 + lpc_idx2[i] * (mtab.n_lsp & 0xff) + j]; + } + + rearrange_lsp(mtab.n_lsp, lsp, 0.0001f); + + for (int i = 0; i < mtab.n_lsp; i++) { + float tmp1 = 1.0f - cb[cb3 + lpc_hist_idx * (mtab.n_lsp & 0xff) + i]; + float tmp2 = hist[i] * cb[cb3 + lpc_hist_idx * (mtab.n_lsp & 0xff) + i]; + hist[i] = lsp[i]; + lsp[i] = lsp[i] * tmp1 + tmp2; + } + + rearrange_lsp(mtab.n_lsp & 0xff, lsp, 0.0001f); + rearrange_lsp(mtab.n_lsp & 0xff, lsp, 0.000095f); + ff_sort_nearly_sorted_floats(lsp, mtab.n_lsp & 0xff); + } + + static void ff_sort_nearly_sorted_floats(float[] vals, int len) { + for (int i = 0; i < len - 1; i++) + for (int j = i; j >= 0 && vals[j] > vals[j + 1]; j--) { + float tmp = vals[j]; + vals[j] = vals[j + 1]; + vals[j + 1] = tmp; + } + } + + /** */ + static void dec_lpc_spectrum_inv(TwinVQContext tctx, float[] lsp, TwinVQFrameType ftype, float[] lpc) { + int size = tctx.mtab.size / tctx.mtab.fmode[ftype.ordinal()].sub; + + for (int i = 0; i < tctx.mtab.n_lsp; i++) + lsp[i] = (float) (2 * Math.cos(lsp[i])); + + switch (ftype) { + case TWINVQ_FT_LONG: + eval_lpcenv_2parts(tctx, ftype, lsp, lpc, size, 8); + break; + case TWINVQ_FT_MEDIUM: + eval_lpcenv_2parts(tctx, ftype, lsp, lpc, size, 2); + break; + case TWINVQ_FT_SHORT: + eval_lpcenv(tctx, lsp, lpc); + break; + } + } + + static final byte[] wtype_to_wsize = new byte[] {0, 0, 2, 2, 2, 1, 0, 1, 1}; + + /** */ + static void imdct_and_window(TwinVQContext tctx, TwinVQFrameType ftype, + int wtype, float[] in, int inP, float[] prev, int prev_bufP, int ch) { + AVTXContext tx = tctx.tx[ftype.ordinal()]; + AVTXContext.TXFunction tx_fn = tctx.tx_fn[ftype.ordinal()]; +Debug.println("ftype: " + ftype + "(" + ftype.ordinal() + ")"); + TwinVQModeTab mtab = tctx.mtab; + int bsize = mtab.size / mtab.fmode[ftype.ordinal()].sub; + int size = mtab.size; + float[] buf1 = tctx.tmp_buf; + int j, first_wsize, wsize; // Window size + int out = 2 * ch * mtab.size; // tctx.curr_frame + int out2 = out; + float[] prev_buf; + int[] types_sizes = { + mtab.size / mtab.fmode[TWINVQ_FT_LONG.ordinal()].sub, + mtab.size / mtab.fmode[TWINVQ_FT_MEDIUM.ordinal()].sub, + mtab.size / (mtab.fmode[TWINVQ_FT_SHORT.ordinal()].sub * 2), + }; + + wsize = types_sizes[wtype_to_wsize[wtype]]; + first_wsize = wsize; + prev_buf = prev; + prev_bufP += (size - bsize) / 2; // prev_buf + + for (j = 0; j < mtab.fmode[ftype.ordinal()].sub; j++) { + int sub_wtype = ftype == TWINVQ_FT_MEDIUM ? 8 : wtype; + + if (j == 0 && wtype == 4) + sub_wtype = 4; + else if (j == mtab.fmode[ftype.ordinal()].sub - 1 && wtype == 7) + sub_wtype = 7; + + wsize = types_sizes[wtype_to_wsize[sub_wtype]]; + + tx_fn.accept(tx, buf1, bsize * j, in, bsize * j /*, Float.BYTES */); // TODO not implemented + +System.err.printf("j: %d, win: %d, size: %d%n", j, ff_sine_windows.get((int) Math.log(wsize)).length, wsize / 2); + tctx.fdsp.vector_fmul_window(tctx.curr_frame, out2, prev_buf, (bsize - wsize) / 2, + buf1, bsize * j, + ff_sine_windows.get((int) Math.log(wsize)), + wsize / 2); + out2 += wsize; + + System.arraycopy(buf1, bsize * j + wsize / 2, tctx.curr_frame, out2, (bsize - wsize / 2) * Float.BYTES); + + out2 += ftype == TWINVQ_FT_MEDIUM ? (bsize - wsize) / 2 : bsize - wsize; + + prev_buf = buf1; + prev_bufP = bsize * j + bsize / 2; + } + + tctx.last_block_pos[ch] = (size + first_wsize) / 2; + } + + static void imdct_output(TwinVQContext tctx, TwinVQFrameType ftype, int wtype, float[][] out, int offset) { + TwinVQModeTab mtab = tctx.mtab; + int prev_buf = tctx.last_block_pos[0]; // tctx.prev_frame + int channels = tctx.avctx.ch_layout.nb_channels; + int size1, size2, i; + int out1, out2; + + for (i = 0; i < channels; i++) + imdct_and_window(tctx, ftype, wtype, + tctx.spectrum, i * mtab.size, + tctx.prev_frame, prev_buf + 2 * i * mtab.size, + i); + + if (out == null) + return; + + size2 = tctx.last_block_pos[0]; + size1 = mtab.size - size2; + + out1 = offset; // out[0] + System.arraycopy(prev_buf, 0, out1, 0, size1 * out1); + System.arraycopy(tctx.curr_frame, 0, out1, size1, size2 * out1); + + if (channels == 2) { + out2 = offset; // out[1] + System.arraycopy(prev_buf, 2 * mtab.size, out2, 0, size1 * out2); + System.arraycopy(tctx.curr_frame, 2 * mtab.size, out2, size1, size2 * out2); + tctx.fdsp.butterflies_float(out[0], out1, out[1], out2, mtab.size); + } + } + + static void read_and_decode_spectrum(TwinVQContext tctx, float[] out, TwinVQFrameType ftype) { + TwinVQModeTab mtab = tctx.mtab; + TwinVQFrameData bits = tctx.bits[tctx.cur_frame]; + int channels = tctx.avctx.ch_layout.nb_channels; + int sub = mtab.fmode[ftype.ordinal()].sub; + int block_size = mtab.size / sub; + float[] gain = new float[TWINVQ_CHANNELS_MAX * TWINVQ_SUBBLOCKS_MAX]; + float[] ppc_shape = new float[TWINVQ_PPC_SHAPE_LEN_MAX * TWINVQ_CHANNELS_MAX * 4]; + + dequant(tctx, bits.main_coeffs, out, ftype, + mtab.fmode[ftype.ordinal()].cb0, mtab.fmode[ftype.ordinal()].cb1, 0, + mtab.fmode[ftype.ordinal()].cb_len_read & 0xff); + + dec_gain(tctx, ftype, gain); + + if (ftype == TWINVQ_FT_LONG) { + int cb_len_p = (tctx.n_div[3] + (mtab.ppc_shape_len & 0xff) * channels - 1) / tctx.n_div[3]; + dequant(tctx, bits.ppc_coeffs, ppc_shape, + TWINVQ_FT_PPC, mtab.ppc_shape_cb, + mtab.ppc_shape_cb,cb_len_p * TWINVQ_PPC_SHAPE_CB_SIZE, + cb_len_p); + } + + for (int i = 0; i < channels; i++) { + int chunk = mtab.size * i; // out + float[] lsp = new float[TWINVQ_LSP_COEFS_MAX]; + + for (int j = 0; j < sub; j++) { + tctx.dec_bark_env.accept(tctx, bits.bark1[i][j], + bits.bark_use_hist[i][j] & 0xff, i, + tctx.tmp_buf, gain[sub * i + j], ftype); + + tctx.fdsp.vector_fmul(out, chunk + block_size * j, + out, chunk + block_size * j, + tctx.tmp_buf, 0, block_size); + } + + if (ftype == TWINVQ_FT_LONG) + tctx.decode_ppc.accept(tctx, bits.p_coef[i], bits.g_coef[i], + ppc_shape, + i * mtab.ppc_shape_len, out, chunk); + + decode_lsp(tctx, bits.lpc_idx1[i], bits.lpc_idx2[i], + bits.lpc_hist_idx[i], lsp, tctx.lsp_hist[i]); + + dec_lpc_spectrum_inv(tctx, lsp, ftype, tctx.tmp_buf); + + for (int j = 0; j < mtab.fmode[ftype.ordinal()].sub; j++) { + tctx.fdsp.vector_fmul(out, chunk, out, chunk, tctx.tmp_buf, 0, block_size); + chunk += block_size; + } + } + } + + static final TwinVQFrameType[] ff_twinvq_wtype_to_ftype_table = new TwinVQFrameType[] { + TWINVQ_FT_LONG, TWINVQ_FT_LONG, TWINVQ_FT_SHORT, TWINVQ_FT_LONG, + TWINVQ_FT_MEDIUM, TWINVQ_FT_LONG, TWINVQ_FT_LONG, TWINVQ_FT_MEDIUM, + TWINVQ_FT_MEDIUM + }; + + /** + * @override decode + * @return block align + */ + static int ff_twinvq_decode_frame(AVCodecContext avctx, AVFrame frame, int[] got_frame_ptr, AVPacket avpkt) { + byte[] buf = avpkt.data; + int buf_size = avpkt.size; + TwinVQContext tctx = avctx.priv_data; + TwinVQModeTab mtab = tctx.mtab; + float[][] out = null; + int ret; + + // get output buffer + if (tctx.discarded_packets >= 2) { + frame.nb_samples = mtab.size * tctx.frames_per_packet; + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + out = (float[][]) frame.extended_data; + } + + if (buf_size < avctx.block_align) { + logger.log(Level.ERROR, "Frame too small (%d bytes). Truncated file?", buf_size); + return -1; + } + + if ((ret = tctx.read_bitstream.apply(avctx, tctx, buf, buf_size)) < 0) + return ret; + + for (tctx.cur_frame = 0; tctx.cur_frame < tctx.frames_per_packet; tctx.cur_frame++) { + read_and_decode_spectrum(tctx, tctx.spectrum, tctx.bits[tctx.cur_frame].ftype); + + imdct_output(tctx, tctx.bits[tctx.cur_frame].ftype, + tctx.bits[tctx.cur_frame].window_type, out, + tctx.cur_frame * mtab.size); + + float[] tmp = tctx.curr_frame; + tctx.curr_frame = tctx.prev_frame; + tctx.prev_frame = tmp; + } + + if (tctx.discarded_packets < 2) { + tctx.discarded_packets++; + got_frame_ptr[0] = 0; + return buf_size; + } + + got_frame_ptr[0] = 1; + + // VQF can deliver packets 1 byte greater than block align + if (buf_size == avctx.block_align + 1) + return buf_size; + return avctx.block_align; + } + + /** + * Init IMDCT and windowing tables + */ + static int init_mdct_win(TwinVQContext tctx) { + int ret; + TwinVQModeTab mtab = tctx.mtab; + int size_s = mtab.size / mtab.fmode[TWINVQ_FT_SHORT.ordinal()].sub; + int size_m = mtab.size / mtab.fmode[TWINVQ_FT_MEDIUM.ordinal()].sub; + int channels = tctx.avctx.ch_layout.nb_channels; + float norm = channels == 1 ? 2.0f : 1.0f; + int table_size = 2 * mtab.size * channels; + + for (int i = 0; i < 3; i++) { + int bsize = tctx.mtab.size / tctx.mtab.fmode[i].sub; + float[] scale = new float[] { (float) (-Math.sqrt(norm / bsize) / (1 << 15)) }; + if ((ret = av_tx_init(tctx.tx, tctx.tx_fn, i, AV_TX_FLOAT_MDCT, 1, bsize, scale, 0)) != 0) + return ret; + } + + tctx.tmp_buf = new float[mtab.size]; + tctx.spectrum = new float[table_size]; + tctx.curr_frame = new float[table_size]; + tctx.prev_frame = new float[table_size]; + + for (int i = 0; i < 3; i++) { + int m = 4 * mtab.size / mtab.fmode[i].sub; + double freq = 2 * Math.PI / m; + tctx.cos_tabs[i] = new float[m / 4]; + for (int j = 0; j <= m / 8; j++) + tctx.cos_tabs[i][j] = (float) Math.cos((2 * j + 1) * freq); + for (int j = 1; j < m / 8; j++) + tctx.cos_tabs[i][m / 4 - j] = tctx.cos_tabs[i][j]; + } + + ff_init_ff_sine_windows((int) Math.log(size_m)); + ff_init_ff_sine_windows((int) Math.log(size_s / 2d)); + ff_init_ff_sine_windows((int) Math.log(mtab.size)); + + return 0; + } + + /** + * Interpret the data as if it were a {@code num_blocks x line_len[0]} matrix and for + * each line do a cyclic permutation, i.e. + *
    +     * abcdefghijklm -> defghijklmabc
    +     * 
    + * where the amount to be shifted is evaluated depending on the column. + * + * @param tab output + */ + static void permutate_in_line(short[] tab, int num_vect, int num_blocks, + int block_size, + byte[] line_len, + int length_div, + TwinVQFrameType ftype) { + for (int i = 0; i < line_len[0]; i++) { + int shift; + + if (num_blocks == 1 || + (ftype == TWINVQ_FT_LONG && (num_vect % num_blocks) != 0) || + (ftype != TWINVQ_FT_LONG && (num_vect & 1) != 0) || + i == line_len[1]) { + shift = 0; + } else if (ftype == TWINVQ_FT_LONG) { + shift = i; + } else + shift = i * i; + + for (int j = 0; j < num_vect && (j + num_vect * i < block_size * num_blocks); j++) + tab[i * num_vect + j] = (short) (i * num_vect + (j + shift) % num_vect); + } + } + + /** + * Interpret the input data as in the following table: + * + *
    +     * abcdefgh
    +     * ijklmnop
    +     * qrstuvw
    +     * x123456
    +     * 
    + * + * and transpose it, giving the output + *
    +     * aiqxbjr1cks2dlt3emu4fvn5gow6hp
    +     * 
    + */ + static void transpose_perm(short[] out, short[] in, int num_vect, byte[] line_len, int length_div) { + int cont = 0; + + for (int i = 0; i < num_vect; i++) + for (int j = 0; j < line_len[i >= length_div ? 1 : 0]; j++) + out[cont++] = in[j * num_vect + i]; + } + + /** */ + static void linear_perm(short[] out, short[] in, int n_blocks, int size) { + int block_size = size / n_blocks; + + for (int i = 0; i < size; i++) + out[i] = (short) (block_size * (in[i] % n_blocks) + in[i] / n_blocks); + } + + /** */ + static void construct_perm_table(TwinVQContext tctx, TwinVQFrameType ftype) { + int block_size, size; + TwinVQModeTab mtab = tctx.mtab; + ByteBuffer bbf = ByteBuffer.allocate(tctx.tmp_buf.length * Float.BYTES).order(ByteOrder.LITTLE_ENDIAN); + FloatBuffer tmp_perm = bbf.asFloatBuffer(); + tmp_perm.put(tctx.tmp_buf); + + if (ftype == TWINVQ_FT_PPC) { + size = tctx.avctx.ch_layout.nb_channels; + block_size = mtab.ppc_shape_len; + } else { + size = tctx.avctx.ch_layout.nb_channels * mtab.fmode[ftype.ordinal()].sub; + block_size = mtab.size / mtab.fmode[ftype.ordinal()].sub; + } +Debug.println("size: " + size + ", block_size: " + block_size); + + short[] bbfs = new short[bbf.capacity() / Short.BYTES]; + permutate_in_line(bbfs, tctx.n_div[ftype.ordinal()], size, + block_size, tctx.length[ftype.ordinal()], + tctx.length_change[ftype.ordinal()] & 0xff, ftype); + + transpose_perm(tctx.permut[ftype.ordinal()], bbfs, tctx.n_div[ftype.ordinal()], + tctx.length[ftype.ordinal()], tctx.length_change[ftype.ordinal()] & 0xff); + bbf.asShortBuffer().get(bbfs); + + linear_perm(tctx.permut[ftype.ordinal()], tctx.permut[ftype.ordinal()], size, size * block_size); + } + + /** */ + static void init_bitstream_params(TwinVQContext tctx) { + TwinVQModeTab mtab = tctx.mtab; + int n_ch = tctx.avctx.ch_layout.nb_channels; + int total_fr_bits = tctx.avctx.bit_rate * mtab.size / tctx.avctx.sample_rate; + + int lsp_bits_per_block = n_ch * (mtab.lsp_bit0 + mtab.lsp_bit1 + mtab.lsp_split * mtab.lsp_bit2); + + int ppc_bits = n_ch * (mtab.pgain_bit + mtab.ppc_shape_bit + mtab.ppc_period_bit); + + int[] bsize_no_main_cb = new int[3], bse_bits = new int[3]; + + for (int i = 0; i < 3; i++) + // +1 for history usage switch + bse_bits[i] = n_ch * (mtab.fmode[i].bark_n_coef * mtab.fmode[i].bark_n_bit + 1); + + bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits + + TWINVQ_WINDOW_TYPE_BITS + n_ch * TWINVQ_GAIN_BITS; + + for (int i = 0; i < 2; i++) + bsize_no_main_cb[i] = lsp_bits_per_block + n_ch * TWINVQ_GAIN_BITS + TWINVQ_WINDOW_TYPE_BITS + + mtab.fmode[i].sub * (bse_bits[i] + n_ch * TWINVQ_SUB_GAIN_BITS); + + if (tctx.codec == TWINVQ_CODEC_METASOUND && tctx.is_6kbps == 0) { + bsize_no_main_cb[1] += 2; + bsize_no_main_cb[2] += 2; + } + + // The remaining bits are all used for the main spectrum coefficients + for (int i = 0; i < 4; i++) { + int bit_size, vect_size; + int rounded_up, rounded_down, num_rounded_down, num_rounded_up; + if (i == 3) { + bit_size = n_ch * mtab.ppc_shape_bit; + vect_size = n_ch * mtab.ppc_shape_len; + } else { + bit_size = total_fr_bits - bsize_no_main_cb[i]; + vect_size = n_ch * mtab.size; + } + + tctx.n_div[i] = (bit_size + 13) / 14; + + rounded_up = (bit_size + tctx.n_div[i] - 1) / tctx.n_div[i]; + rounded_down = (bit_size) / tctx.n_div[i]; + num_rounded_down = rounded_up * tctx.n_div[i] - bit_size; + num_rounded_up = tctx.n_div[i] - num_rounded_down; + tctx.bits_main_spec[0][i][0] = (byte) ((rounded_up + 1) / 2); + tctx.bits_main_spec[1][i][0] = (byte) (rounded_up / 2); + tctx.bits_main_spec[0][i][1] = (byte) ((rounded_down + 1) / 2); + tctx.bits_main_spec[1][i][1] = (byte) (rounded_down / 2); + tctx.bits_main_spec_change[i] = num_rounded_up; + + rounded_up = (vect_size + tctx.n_div[i] - 1) / tctx.n_div[i]; + rounded_down = (vect_size) / tctx.n_div[i]; + num_rounded_down = rounded_up * tctx.n_div[i] - vect_size; + num_rounded_up = tctx.n_div[i] - num_rounded_down; + tctx.length[i][0] = (byte) rounded_up; + tctx.length[i][1] = (byte) rounded_down; + tctx.length_change[i] = (byte) num_rounded_up; +Debug.println("rounded_up: " + rounded_up + ", rounded_down: " + rounded_down + ", num_rounded_up: " + num_rounded_up); + } + + for (int frametype = TWINVQ_FT_SHORT.ordinal(); frametype <= TWINVQ_FT_PPC.ordinal(); frametype++) + construct_perm_table(tctx, TwinVQFrameType.values()[frametype]); + } + + /** @override close */ + static int ff_twinvq_decode_close(AVCodecContext avctx) { + TwinVQContext tctx = avctx.priv_data; + + return 0; + } + + /** */ + static int ff_twinvq_decode_init(AVCodecContext avctx) { + int ret; + TwinVQContext tctx = avctx.priv_data; + long frames_per_packet; + + tctx.avctx = avctx; + avctx.sample_fmt = AV_SAMPLE_FMT_FLTP; + + if (avctx.block_align == 0) { + avctx.block_align = tctx.frame_size + 7 >> 3; + } + frames_per_packet = avctx.block_align * 8L / tctx.frame_size; + if (frames_per_packet <= 0) { + logger.log(Level.ERROR, "Block align is %d bits, expected %d", avctx.block_align * 8L, tctx.frame_size); + return AVERROR_INVALIDDATA; + } + if (frames_per_packet > TWINVQ_MAX_FRAMES_PER_PACKET) { + logger.log(Level.ERROR, "Too many frames per packet (%d)", frames_per_packet); + return AVERROR_INVALIDDATA; + } + tctx.frames_per_packet = (int) frames_per_packet; + + tctx.fdsp = new AVFloatDSPContext(avctx.flags & AV_CODEC_FLAG_BITEXACT); + if ((ret = init_mdct_win(tctx)) != 0) { + logger.log(Level.ERROR, "Error initializing MDCT"); + return ret; + } + init_bitstream_params(tctx); + + twinvq_memset_float(tctx.bark_hist[0][0], 0, 0.1f, FF_ARRAY_ELEMS(tctx.bark_hist)); + + return 0; + } +} diff --git a/src/main/java/vavi/sound/twinvq/TwinVQData.java b/src/main/java/vavi/sound/twinvq/TwinVQData.java new file mode 100644 index 0000000..f03dc91 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/TwinVQData.java @@ -0,0 +1,557 @@ +/* + * TwinVQ decoder + * Copyright (c) 2009 Vitor Sessak + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package vavi.sound.twinvq; + +import java.nio.ShortBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; +import java.util.logging.Level; + +import vavi.util.Debug; + + +/** + * TwinVQ codebooks. They are coded in a struct so we can use code such as + *

    + * float val = tab.fcb0808l[get_bits(gb, 12)]; + *

    + * without risking a segfault on malformed files.
    + * <_pre>
    + * The bark_tab_* tables are constructed so that
    + * 
    + *       /i-1              \
    + *       |--               |
    + *  bark |\   bark_tab[j]  | == i
    + *       |/                |
    + *       |--               |
    + *       \j=0              /
    + * 
    + *

    + * for some slightly non-conventional bark-scale function + */ +public class TwinVQData { + + static final short[] bark_tab_l08_512 = { + 7, 8, 7, 8, 8, 8, 8, 8, 8, 9, + 9, 10, 10, 11, 11, 12, 12, 14, 15, 16, + 18, 19, 21, 24, 27, 30, 35, 40, 46, 53 + }; + + static final short[] bark_tab_l11_512 = { + 6, 6, 6, 6, 6, 6, 7, 6, 7, 7, + 8, 8, 8, 9, 10, 10, 11, 13, 13, 15, + 17, 18, 21, 25, 27, 33, 38, 45, 54, 66 + }; + + static final short[] bark_tab_l16_1024 = { + 9, 9, 8, 9, 10, 9, 10, 10, 10, 12, + 11, 13, 13, 14, 16, 17, 19, 20, 24, 26, + 30, 35, 40, 48, 56, 68, 83, 102, 128, 165 + }; + + static final short[] bark_tab_l22_1024 = { + 6, 7, 6, 6, 7, 7, 7, 7, 7, 8, + 9, 8, 10, 10, 11, 12, 13, 15, 16, 18, + 21, 24, 27, 33, 38, 46, 55, 68, 84, 107, + 140, 191 + }; + + static final short[] bark_tab_l22_512 = { + 3, 3, 3, 4, 3, 3, 4, 3, 4, 4, + 4, 5, 4, 5, 6, 6, 7, 7, 8, 9, + 10, 12, 14, 16, 20, 22, 28, 34, 42, 53, + 71, 95 + }; + + static final short[] bark_tab_l44_2048 = { + 5, 6, 5, 6, 5, 6, 6, 6, 6, 6, + 7, 7, 7, 8, 8, 9, 9, 10, 11, 11, + 13, 14, 16, 17, 19, 22, 25, 29, 33, 39, + 46, 54, 64, 79, 98, 123, 161, 220, 320, 512 + }; + + static final short[] bark_tab_m08_256 = { + 6, 5, 6, 6, 6, 6, 7, 7, 8, 8, + 9, 10, 11, 13, 15, 18, 20, 25, 31, 39 + }; + + static final short[] bark_tab_m11_256 = { + 4, 5, 4, 5, 5, 5, 6, 5, 7, 7, + 8, 9, 10, 12, 15, 17, 22, 28, 35, 47 + }; + + static final short[] bark_tab_m16_512 = { + 7, 6, 7, 7, 7, 8, 9, 9, 10, 11, + 14, 15, 18, 22, 27, 34, 44, 59, 81, 117 + }; + + static final short[] bark_tab_m22_256 = { + 3, 2, 3, 2, 3, 3, 4, 3, 4, 5, + 5, 7, 8, 9, 13, 16, 22, 30, 44, 70 + }; + + static final short[] bark_tab_m22_512 = { + 5, 5, 5, 6, 5, 7, 6, 7, 9, 9, + 11, 13, 15, 20, 24, 33, 43, 61, 88, 140 + }; + + static final short[] bark_tab_m44_512 = { + 3, 2, 3, 3, 3, 4, 3, 5, 4, 6, + 7, 8, 10, 14, 18, 25, 36, 55, 95, 208 + }; + + static final short[] bark_tab_s08_64 = { + 3, 3, 3, 3, 4, 5, 6, 8, 12, 17 + }; + + static final short[] bark_tab_s11_64 = { + 2, 3, 2, 3, 3, 4, 6, 8, 12, 21 + }; + + static final short[] bark_tab_s16_128 = { + 3, 4, 4, 4, 5, 7, 10, 16, 26, 49 + }; + + static final short[] bark_tab_s22_128 = { + 3, 2, 3, 4, 4, 6, 9, 14, 26, 57 + }; + + static final short[] bark_tab_s44_128 = { + 1, 2, 1, 2, 3, 4, 6, 10, 23, 76 + }; + + static final short[] cb0808l0 = initTable("cb0808l0"); + static final short[] cb0808l1 = initTable("cb0808l1"); + static final short[] cb0808s0 = initTable("cb0808s0"); + static final short[] cb0808s1 = initTable("cb0808s1"); + static final short[] cb0808m0 = initTable("cb0808m0"); + static final short[] cb0808m1 = initTable("cb0808m1"); + static final short[] cb1108l0 = initTable("cb1108l0"); + static final short[] cb1108l1 = initTable("cb1108l1"); + static final short[] cb1108s0 = initTable("cb1108s0"); + static final short[] cb1108s1 = initTable("cb1108s1"); + static final short[] cb1108m0 = initTable("cb1108m0"); + static final short[] cb1108m1 = initTable("cb1108m1"); + static final short[] cb1110l0 = initTable("cb1110l0"); + static final short[] cb1110l1 = initTable("cb1110l1"); + static final short[] cb1110s0 = initTable("cb1110s0"); + static final short[] cb1110s1 = initTable("cb1110s1"); + static final short[] cb1110m0 = initTable("cb1110m0"); + static final short[] cb1110m1 = initTable("cb1110m1"); + static final short[] cb1616l0 = initTable("cb1616l0"); + static final short[] cb1616l1 = initTable("cb1616l1"); + static final short[] cb1616s0 = initTable("cb1616s0"); + static final short[] cb1616s1 = initTable("cb1616s1"); + static final short[] cb1616m0 = initTable("cb1616m0"); + static final short[] cb1616m1 = initTable("cb1616m1"); + static final short[] cb2220l0 = initTable("cb2220l0"); + static final short[] cb2220l1 = initTable("cb2220l1"); + static final short[] cb2220s0 = initTable("cb2220s0"); + static final short[] cb2220s1 = initTable("cb2220s1"); + static final short[] cb2220m0 = initTable("cb2220m0"); + static final short[] cb2220m1 = initTable("cb2220m1"); + static final short[] cb2224l0 = initTable("cb2224l0"); + static final short[] cb2224l1 = initTable("cb2224l1"); + static final short[] cb2224s0 = initTable("cb2224s0"); + static final short[] cb2224s1 = initTable("cb2224s1"); + static final short[] cb2224m0 = initTable("cb2224m0"); + static final short[] cb2224m1 = initTable("cb2224m1"); + static final short[] cb2232l0 = initTable("cb2232l0"); + static final short[] cb2232l1 = initTable("cb2232l1"); + static final short[] cb2232s0 = initTable("cb2232s0"); + static final short[] cb2232s1 = initTable("cb2232s1"); + static final short[] cb2232m0 = initTable("cb2232m0"); + static final short[] cb2232m1 = initTable("cb2232m1"); + static final short[] cb4440l0 = initTable("cb4440l0"); + static final short[] cb4440l1 = initTable("cb4440l1"); + static final short[] cb4440s0 = initTable("cb4440s0"); + static final short[] cb4440s1 = initTable("cb4440s1"); + static final short[] cb4440m0 = initTable("cb4440m0"); + static final short[] cb4440m1 = initTable("cb4440m1"); + static final short[] cb4448l0 = initTable("cb4448l0"); + static final short[] cb4448l1 = initTable("cb4448l1"); + static final short[] cb4448s0 = initTable("cb4448s0"); + static final short[] cb4448s1 = initTable("cb4448s1"); + static final short[] cb4448m0 = initTable("cb4448m0"); + static final short[] cb4448m1 = initTable("cb4448m1"); + static final short[] fcb08l = initTable("fcb08l"); + static final short[] fcb08m = initTable("fcb08m"); + static final short[] fcb08s = initTable("fcb08s"); + static final short[] fcb11l = initTable("fcb11l"); + static final short[] fcb11m = initTable("fcb11m"); + static final short[] fcb11s = initTable("fcb11s"); + static final short[] fcb16l = initTable("fcb16l"); + static final short[] fcb16m = initTable("fcb16m"); + static final short[] fcb16s = initTable("fcb16s"); + static final short[] fcb22l_1 = initTable("fcb22l_1"); + static final short[] fcb22m_1 = initTable("fcb22m_1"); + static final short[] fcb22s_1 = initTable("fcb22s_1"); + static final short[] fcb22l_2 = initTable("fcb22l_2"); + static final short[] fcb22m_2 = initTable("fcb22m_2"); + static final short[] fcb22s_2 = initTable("fcb22s_2"); + static final short[] fcb44l = initTable("fcb44l"); + static final short[] fcb44m = initTable("fcb44m"); + static final short[] fcb44s = initTable("fcb44s"); + static final short[] shape08 = initTable("shape08"); + static final short[] shape11 = initTable("shape11"); + static final short[] shape16 = initTable("shape16"); + static final short[] shape22_1 = initTable("shape22_1"); + static final short[] shape22_2 = initTable("shape22_2"); + static final short[] shape44 = initTable("shape44"); + + static final float[] lsp22_2 = { + 0.0712f, 0.1830f, 0.4167f, 0.6669f, 0.8738f, 1.0696f, 1.2555f, 1.4426f, + 1.6427f, 1.8138f, 1.9966f, 2.1925f, 2.3872f, 2.5748f, 2.7713f, 2.9597f, + 0.1894f, 0.3942f, 0.5418f, 0.6747f, 0.7517f, 0.8763f, 1.1189f, 1.3072f, + 1.5011f, 1.6790f, 1.8342f, 2.0781f, 2.2929f, 2.4566f, 2.6613f, 2.9204f, + 0.1767f, 0.3403f, 0.5173f, 0.7055f, 0.8899f, 1.0696f, 1.2302f, 1.4111f, + 1.5989f, 1.7751f, 1.9618f, 2.1544f, 2.3454f, 2.5356f, 2.7362f, 2.9315f, + 0.1240f, 0.2361f, 0.4423f, 0.6326f, 0.7729f, 0.9387f, 1.1142f, 1.2847f, + 1.4746f, 1.7126f, 1.9482f, 2.1642f, 2.3536f, 2.5506f, 2.7593f, 2.9197f, + 0.1213f, 0.2782f, 0.5011f, 0.6910f, 0.8564f, 1.0462f, 1.2315f, 1.4232f, + 1.6178f, 1.8028f, 1.9813f, 2.1766f, 2.3670f, 2.5591f, 2.7475f, 2.9403f, + 0.1382f, 0.2995f, 0.4693f, 0.5874f, 0.6929f, 0.8102f, 1.0094f, 1.2960f, + 1.5511f, 1.7607f, 1.9699f, 2.1680f, 2.3367f, 2.5459f, 2.7370f, 2.9105f, + 0.1428f, 0.2690f, 0.3713f, 0.4757f, 0.6664f, 0.9019f, 1.1276f, 1.3674f, + 1.5471f, 1.6695f, 1.8261f, 2.0572f, 2.2753f, 2.4963f, 2.7187f, 2.9114f, + 0.1669f, 0.3085f, 0.4489f, 0.5724f, 0.6934f, 0.8465f, 0.9680f, 1.1641f, + 1.4320f, 1.6841f, 1.8977f, 2.1061f, 2.3118f, 2.5152f, 2.7329f, 2.9274f, + 0.1128f, 0.2709f, 0.4803f, 0.6878f, 0.8673f, 1.0693f, 1.2749f, 1.4657f, + 1.6650f, 1.8434f, 2.0339f, 2.2300f, 2.4003f, 2.5951f, 2.7762f, 2.9465f, + 0.1201f, 0.2345f, 0.4021f, 0.6379f, 0.8651f, 1.0256f, 1.1630f, 1.3250f, + 1.5395f, 1.7808f, 2.0011f, 2.1997f, 2.3618f, 2.5505f, 2.7561f, 2.9351f, + 0.2575f, 0.4163f, 0.5081f, 0.6484f, 0.8570f, 1.0832f, 1.2732f, 1.3933f, + 1.5497f, 1.7725f, 1.9945f, 2.2098f, 2.3514f, 2.5216f, 2.7146f, 2.8969f, + 0.1367f, 0.2656f, 0.4470f, 0.6398f, 0.8146f, 1.0125f, 1.2142f, 1.3960f, + 1.5558f, 1.7338f, 1.9465f, 2.1769f, 2.4031f, 2.5746f, 2.7335f, 2.9046f, + 0.0868f, 0.1723f, 0.2785f, 0.5071f, 0.7732f, 1.0024f, 1.1924f, 1.4220f, + 1.6149f, 1.8064f, 1.9951f, 2.1935f, 2.3777f, 2.5748f, 2.7661f, 2.9488f, + 0.1428f, 0.2592f, 0.3875f, 0.5810f, 0.7513f, 0.9334f, 1.1096f, 1.3565f, + 1.5869f, 1.7788f, 1.9036f, 2.0893f, 2.3332f, 2.5289f, 2.7204f, 2.9053f, + 0.2313f, 0.4066f, 0.4960f, 0.5853f, 0.7799f, 0.9201f, 1.1365f, 1.3499f, + 1.5119f, 1.7641f, 1.9095f, 2.0911f, 2.2653f, 2.4587f, 2.7010f, 2.8900f, + 0.1927f, 0.3424f, 0.4682f, 0.6035f, 0.7330f, 0.8492f, 1.0477f, 1.3083f, + 1.5602f, 1.6945f, 1.7806f, 2.0066f, 2.2566f, 2.4864f, 2.7021f, 2.9180f, + 0.0962f, 0.1933f, 0.3968f, 0.6077f, 0.8083f, 1.0224f, 1.2307f, 1.4344f, + 1.6350f, 1.8173f, 2.0024f, 2.1894f, 2.3812f, 2.5648f, 2.7535f, 2.9483f, + 0.1469f, 0.2679f, 0.4272f, 0.6080f, 0.7949f, 0.9247f, 1.0741f, 1.2722f, + 1.5144f, 1.7679f, 2.0030f, 2.1944f, 2.3890f, 2.5928f, 2.8116f, 2.9555f, + 0.1618f, 0.3917f, 0.6111f, 0.7511f, 0.8325f, 1.0010f, 1.2397f, 1.4147f, + 1.5764f, 1.7359f, 1.9300f, 2.1325f, 2.3096f, 2.5480f, 2.7725f, 2.9697f, + 0.1561f, 0.2634f, 0.4062f, 0.6139f, 0.8059f, 0.9618f, 1.0948f, 1.3179f, + 1.5846f, 1.7622f, 1.9399f, 2.1476f, 2.3330f, 2.5232f, 2.7412f, 2.9554f, + 0.1076f, 0.2320f, 0.3977f, 0.5798f, 0.7707f, 0.9975f, 1.1884f, 1.3793f, + 1.6059f, 1.8038f, 1.9928f, 2.1942f, 2.3881f, 2.5742f, 2.7717f, 2.9547f, + 0.1360f, 0.2493f, 0.3827f, 0.5644f, 0.7384f, 0.9087f, 1.0865f, 1.2902f, + 1.5185f, 1.7246f, 1.9170f, 2.1175f, 2.3324f, 2.5442f, 2.7441f, 2.9437f, + 0.1684f, 0.2990f, 0.4406f, 0.5834f, 0.7305f, 0.9028f, 1.0801f, 1.2756f, + 1.4646f, 1.6514f, 1.8346f, 2.0493f, 2.2594f, 2.4765f, 2.6985f, 2.9089f, + 0.1145f, 0.2295f, 0.3421f, 0.5032f, 0.7007f, 0.9057f, 1.0830f, 1.2733f, + 1.4885f, 1.6897f, 1.8933f, 2.1128f, 2.3188f, 2.5271f, 2.7284f, 2.9266f, + 0.1705f, 0.3815f, 0.6120f, 0.7964f, 0.9342f, 1.0926f, 1.2741f, 1.4645f, + 1.6552f, 1.8040f, 1.9778f, 2.1931f, 2.3836f, 2.5827f, 2.7905f, 2.9494f, + 0.1284f, 0.2622f, 0.4714f, 0.6559f, 0.8004f, 1.0005f, 1.1416f, 1.3163f, + 1.5773f, 1.8144f, 1.9947f, 2.2001f, 2.3836f, 2.5710f, 2.7447f, 2.9262f, + 0.1164f, 0.2882f, 0.5349f, 0.7310f, 0.8483f, 0.9729f, 1.1331f, 1.3350f, + 1.5307f, 1.7306f, 1.9409f, 2.1275f, 2.3229f, 2.5358f, 2.7455f, 2.9447f, + 0.1159f, 0.2646f, 0.4677f, 0.6375f, 0.7771f, 0.9557f, 1.1398f, 1.3514f, + 1.5717f, 1.7512f, 1.9337f, 2.1323f, 2.3272f, 2.5409f, 2.7377f, 2.9212f, + 0.1080f, 0.2143f, 0.3475f, 0.5307f, 0.7358f, 0.9681f, 1.1489f, 1.3289f, + 1.5553f, 1.7664f, 1.9696f, 2.1780f, 2.3676f, 2.5568f, 2.7493f, 2.9347f, + 0.1331f, 0.2430f, 0.3879f, 0.5092f, 0.6324f, 0.8119f, 1.0327f, 1.2657f, + 1.4999f, 1.7107f, 1.9178f, 2.1272f, 2.3296f, 2.5340f, 2.7372f, 2.9353f, + 0.1557f, 0.2873f, 0.4558f, 0.6548f, 0.8472f, 1.0106f, 1.1480f, 1.3281f, + 1.5856f, 1.7740f, 1.9564f, 2.1651f, 2.3295f, 2.5207f, 2.7005f, 2.9151f, + 0.1397f, 0.2761f, 0.4533f, 0.6374f, 0.7510f, 0.8767f, 1.0408f, 1.2909f, + 1.5368f, 1.7560f, 1.9424f, 2.1332f, 2.3210f, 2.5116f, 2.6924f, 2.8886f, + 0.0945f, 0.1653f, 0.3601f, 0.6129f, 0.8378f, 1.0333f, 1.2417f, 1.4539f, + 1.6507f, 1.8304f, 2.0286f, 2.2157f, 2.3975f, 2.5865f, 2.7721f, 2.9426f, + 0.1892f, 0.3863f, 0.4896f, 0.5909f, 0.7294f, 0.9483f, 1.1575f, 1.3542f, + 1.4796f, 1.6535f, 1.9070f, 2.1435f, 2.3281f, 2.4967f, 2.7039f, 2.9222f, + 0.1614f, 0.3129f, 0.5086f, 0.7048f, 0.8730f, 1.0239f, 1.1905f, 1.3799f, + 1.5697f, 1.7503f, 1.9103f, 2.1115f, 2.3235f, 2.5234f, 2.6973f, 2.8957f, + 0.1199f, 0.2590f, 0.4273f, 0.5935f, 0.7542f, 0.9625f, 1.1225f, 1.2998f, + 1.5361f, 1.7102f, 1.9097f, 2.1269f, 2.3157f, 2.5304f, 2.7212f, 2.9175f, + 0.1087f, 0.2373f, 0.4261f, 0.6277f, 0.8092f, 0.9884f, 1.1954f, 1.4077f, + 1.6048f, 1.7799f, 1.9693f, 2.1662f, 2.3426f, 2.5501f, 2.7459f, 2.9257f, + 0.1262f, 0.2216f, 0.3857f, 0.5799f, 0.7148f, 0.8610f, 1.0752f, 1.3306f, + 1.5549f, 1.7605f, 1.9727f, 2.1580f, 2.3612f, 2.5602f, 2.7554f, 2.9372f, + 0.1445f, 0.2832f, 0.4469f, 0.6283f, 0.7991f, 0.9796f, 1.1504f, 1.3323f, + 1.5313f, 1.7140f, 1.8968f, 2.0990f, 2.2826f, 2.4903f, 2.7003f, 2.9031f, + 0.1647f, 0.4068f, 0.5428f, 0.6539f, 0.7682f, 0.8479f, 0.9372f, 1.1691f, + 1.4776f, 1.7314f, 1.9071f, 2.0918f, 2.2774f, 2.5029f, 2.7152f, 2.9221f, + 0.1274f, 0.3052f, 0.5238f, 0.7280f, 0.9229f, 1.1211f, 1.3071f, 1.4784f, + 1.6564f, 1.8235f, 2.0028f, 2.1999f, 2.3763f, 2.5608f, 2.7510f, 2.9356f, + 0.1076f, 0.2195f, 0.4815f, 0.6873f, 0.8241f, 0.9443f, 1.1066f, 1.3687f, + 1.6087f, 1.8105f, 1.9857f, 2.1486f, 2.3505f, 2.5854f, 2.7785f, 2.9376f, + 0.1755f, 0.3089f, 0.4695f, 0.6648f, 0.8315f, 1.0202f, 1.1774f, 1.3554f, + 1.5393f, 1.7141f, 1.9247f, 2.1284f, 2.2983f, 2.4975f, 2.7296f, 2.9401f, + 0.1636f, 0.3166f, 0.4594f, 0.6199f, 0.8161f, 0.9879f, 1.1738f, 1.3642f, + 1.5680f, 1.7633f, 1.9598f, 2.1695f, 2.3692f, 2.5846f, 2.7809f, 2.9563f, + 0.1219f, 0.2662f, 0.4620f, 0.6491f, 0.8353f, 1.0150f, 1.2065f, 1.3944f, + 1.5785f, 1.7631f, 1.9389f, 2.1434f, 2.3400f, 2.5316f, 2.7359f, 2.9513f, + 0.1072f, 0.2258f, 0.3968f, 0.5642f, 0.7222f, 0.9367f, 1.1458f, 1.3347f, + 1.5424f, 1.7373f, 1.9303f, 2.1432f, 2.3451f, 2.5415f, 2.7444f, 2.9394f, + 0.1393f, 0.2950f, 0.4724f, 0.6407f, 0.8034f, 1.0031f, 1.1712f, 1.3552f, + 1.5519f, 1.7411f, 1.9198f, 2.1160f, 2.3238f, 2.5119f, 2.7134f, 2.9205f, + 0.1358f, 0.2613f, 0.4239f, 0.5991f, 0.7643f, 0.9379f, 1.1213f, 1.3115f, + 1.5067f, 1.7031f, 1.8768f, 2.0836f, 2.3092f, 2.5134f, 2.7237f, 2.9286f, + 0.1267f, 0.2695f, 0.4524f, 0.6591f, 0.8396f, 1.0173f, 1.2183f, 1.4205f, + 1.6306f, 1.8162f, 2.0106f, 2.2082f, 2.3773f, 2.5787f, 2.7551f, 2.9387f, + 0.1314f, 0.2529f, 0.3837f, 0.5494f, 0.7446f, 0.9097f, 1.0489f, 1.2385f, + 1.4691f, 1.7170f, 1.9600f, 2.1770f, 2.3594f, 2.5356f, 2.7215f, 2.9088f, + 0.1538f, 0.2931f, 0.4449f, 0.6041f, 0.7959f, 0.9666f, 1.1355f, 1.3214f, + 1.5150f, 1.7230f, 1.9433f, 2.1408f, 2.3459f, 2.5476f, 2.7273f, 2.9330f, + 0.1771f, 0.2834f, 0.4136f, 0.5856f, 0.7516f, 0.9363f, 1.0596f, 1.2462f, + 1.4737f, 1.6627f, 1.8810f, 2.1150f, 2.3202f, 2.5274f, 2.7403f, 2.9490f, + 0.1248f, 0.2494f, 0.4397f, 0.6352f, 0.8226f, 1.0015f, 1.1799f, 1.3458f, + 1.5654f, 1.8228f, 2.0646f, 2.2550f, 2.4161f, 2.5964f, 2.7675f, 2.9383f, + 0.0933f, 0.1993f, 0.3105f, 0.4371f, 0.6417f, 0.8935f, 1.1244f, 1.3508f, + 1.5649f, 1.7595f, 1.9581f, 2.1648f, 2.3639f, 2.5569f, 2.7573f, 2.9468f, + 0.1794f, 0.3229f, 0.4758f, 0.6238f, 0.7821f, 0.9640f, 1.1205f, 1.3116f, + 1.5054f, 1.6803f, 1.8658f, 2.0651f, 2.2793f, 2.4856f, 2.6867f, 2.9105f, + 0.1252f, 0.2397f, 0.3844f, 0.5398f, 0.7044f, 0.8799f, 1.0526f, 1.2270f, + 1.4269f, 1.6412f, 1.8532f, 2.0784f, 2.2957f, 2.5051f, 2.7139f, 2.9210f, + 0.1391f, 0.3494f, 0.5738f, 0.8024f, 1.0098f, 1.2094f, 1.3830f, 1.5509f, + 1.7222f, 1.8782f, 2.0604f, 2.2479f, 2.4154f, 2.5968f, 2.7767f, 2.9450f, + 0.1122f, 0.2180f, 0.4175f, 0.6074f, 0.7559f, 0.9465f, 1.1513f, 1.3340f, + 1.5215f, 1.7491f, 1.9911f, 2.1894f, 2.3433f, 2.5377f, 2.7380f, 2.9183f, + 0.1595f, 0.3029f, 0.4842f, 0.6324f, 0.7874f, 0.9814f, 1.1992f, 1.3554f, + 1.5017f, 1.7274f, 1.9168f, 2.0853f, 2.2964f, 2.5300f, 2.7187f, 2.9041f, + 0.1350f, 0.2747f, 0.4791f, 0.6638f, 0.8050f, 0.9644f, 1.1238f, 1.2987f, + 1.4844f, 1.6754f, 1.8778f, 2.0987f, 2.3279f, 2.5424f, 2.7410f, 2.9356f, + 0.0914f, 0.1727f, 0.3143f, 0.5124f, 0.7123f, 0.9323f, 1.1706f, 1.3821f, + 1.5864f, 1.7828f, 1.9701f, 2.1560f, 2.3445f, 2.5486f, 2.7433f, 2.9372f, + 0.1222f, 0.2359f, 0.3931f, 0.5912f, 0.7776f, 0.9505f, 1.1623f, 1.3723f, + 1.5484f, 1.7316f, 1.9321f, 2.1283f, 2.3148f, 2.5269f, 2.7299f, 2.9213f, + 0.2089f, 0.3872f, 0.5090f, 0.6413f, 0.7967f, 1.0226f, 1.1897f, 1.3908f, + 1.5954f, 1.7202f, 1.8614f, 2.1030f, 2.2973f, 2.5079f, 2.7491f, 2.8944f, + 0.1288f, 0.2423f, 0.4108f, 0.6062f, 0.7688f, 0.9188f, 1.0876f, 1.2866f, + 1.4897f, 1.6910f, 1.9219f, 2.1076f, 2.2805f, 2.5023f, 2.7155f, 2.9203f, + 0.0192f, 0.0462f, 0.0128f, 0.0054f, -0.0156f, -0.0118f, -0.0135f, 0.0030f, + -0.0120f, 0.0031f, 0.0240f, -0.0451f, -0.0439f, -0.0432f, -0.0527f, -0.0207f, + 0.0253f, 0.0084f, -0.0305f, -0.0144f, 0.0046f, -0.0378f, -0.0467f, -0.0102f, + 0.0280f, 0.0540f, 0.0151f, 0.0437f, 0.0141f, -0.0257f, -0.0058f, 0.0073f, + 0.0107f, 0.0054f, 0.0371f, -0.0105f, 0.0165f, -0.0143f, 0.0148f, 0.0382f, + -0.0054f, -0.0284f, 0.0001f, -0.0218f, 0.0258f, 0.0517f, 0.0157f, -0.0032f, + -0.0190f, 0.0343f, 0.0576f, 0.0346f, 0.0392f, -0.0158f, -0.0323f, -0.0578f, + -0.0617f, -0.0242f, -0.0144f, 0.0188f, 0.0249f, 0.0021f, -0.0422f, -0.0420f, + 0.0750f, 0.0762f, 0.0325f, -0.0066f, 0.0332f, 0.0376f, 0.0388f, 0.0630f, + 0.0525f, 0.0196f, 0.0051f, -0.0484f, -0.0322f, 0.0059f, 0.0132f, 0.0079f, + 0.0237f, 0.0774f, 0.0697f, 0.0184f, -0.0321f, -0.0327f, 0.0274f, 0.0284f, + 0.0057f, 0.0289f, 0.0478f, 0.0142f, -0.0053f, 0.0114f, 0.0292f, -0.0032f, + -0.0111f, -0.0389f, 0.0282f, 0.0613f, 0.0200f, -0.0006f, 0.0111f, 0.0048f, + 0.0273f, 0.0017f, -0.0369f, 0.0655f, 0.0758f, 0.0555f, 0.0238f, -0.0024f, + -0.0100f, -0.0419f, -0.0696f, -0.0158f, -0.0479f, -0.0744f, -0.0356f, -0.0245f, + -0.0400f, -0.0112f, 0.0134f, 0.0001f, -0.0422f, -0.0514f, -0.0081f, 0.0083f, + -0.0151f, 0.0323f, -0.0001f, -0.0444f, -0.0406f, -0.0214f, -0.0050f, -0.0235f, + -0.0205f, -0.0264f, -0.0324f, 0.0334f, 0.0392f, 0.0265f, 0.0289f, 0.0180f, + 0.0493f, 0.0227f, 0.0194f, 0.0365f, 0.0544f, 0.0674f, 0.0559f, 0.0732f, + 0.0911f, 0.0942f, 0.0735f, 0.0174f, -0.0113f, -0.0553f, -0.0665f, -0.0227f, + -0.0259f, -0.0266f, -0.0239f, -0.0379f, 0.0329f, 0.0173f, -0.0210f, -0.0114f, + -0.0063f, 0.0060f, -0.0089f, -0.0198f, -0.0282f, -0.0080f, -0.0179f, -0.0290f, + 0.0046f, -0.0126f, -0.0066f, 0.0350f, 0.0532f, 0.0235f, 0.0198f, 0.0212f, + 0.0449f, 0.0681f, 0.0677f, -0.0049f, 0.0086f, 0.0120f, 0.0356f, 0.0454f, + 0.0592f, 0.0449f, -0.0271f, -0.0510f, -0.0110f, 0.0234f, 0.0203f, 0.0243f, + 0.0242f, 0.0133f, 0.0098f, 0.0040f, 0.0024f, -0.0005f, -0.0075f, -0.0126f, + -0.0393f, -0.0052f, 0.0165f, 0.0016f, -0.0193f, 0.0239f, 0.0336f, 0.0029f, + -0.0586f, -0.0539f, -0.0094f, -0.0664f, -0.0898f, -0.0540f, -0.0066f, 0.0134f, + -0.0074f, 0.0067f, -0.0521f, -0.0431f, 0.0104f, 0.0690f, 0.0663f, 0.0197f, + -0.0017f, -0.0518f, -0.0597f, -0.0171f, -0.0054f, -0.0140f, -0.0080f, 0.0172f, + -0.0362f, -0.0713f, -0.0310f, 0.0096f, 0.0243f, 0.0381f, -0.0062f, -0.0392f, + -0.0281f, 0.0386f, 0.0461f, 0.0069f, 0.0384f, 0.0080f, -0.0141f, 0.0171f, + 0.3368f, 0.3128f, 0.3304f, 0.3392f, 0.3185f, 0.3037f, 0.2789f, 0.2692f, + 0.2779f, 0.2796f, 0.2891f, 0.2643f, 0.2647f, 0.2593f, 0.2927f, 0.3283f, + 0.4978f, 0.4988f, 0.4969f, 0.4997f, 0.4957f, 0.4985f, 0.4970f, 0.4978f, + 0.4938f, 0.4951f, 0.4994f, 0.4971f, 0.4981f, 0.4983f, 0.4967f, 0.4789f + }; + + static final byte[] tab7 = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, + 1, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 + }; + + static final byte[] tab8 = { + 0, 0, 0, 1, 1, + 0, 1, 0, 0, 1, + 1, 1, 0, 0, 0, + 1, 0, 0, 1, 0, + 0, 0, 0, 1, 1, + 0, 1, 0, 0, 1, + 1, 1, 0, 0, 0, + 1, 0, 0, 1, 0, + 0, 0, 0, 1, 1, + 0, 1, 0, 0, 1, + 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 1, 0, 1, 0 + }; + static final byte[] tab9 = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + static final byte[] tab10 = { + 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, + 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, + 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 + }; + + static final byte[] tab11 = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 + }; + + static final byte[] tab12 = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, + }; + + static final class tab { + + final int size; + final byte[] tab; + + public tab(int size, byte[] tab) { + this.size = size; + this.tab = tab; + } + } + + static final tab[] tabs = { + new tab(0, null), + new tab(5, tab8), new tab(5, tab8), new tab(15, tab12), + new tab(5, tab8), new tab(25, tab10), new tab(15, tab12), + new tab(35, tab7), new tab(5, tab8), new tab(45, tab9), + new tab(25, tab10), new tab(55, tab11), new tab(15, tab12) + }; + + private static short[] initTable(String f) { + List l = new ArrayList<>(); + Scanner s = new Scanner(TwinVQData.class.getResourceAsStream(f + ".txt")); + s.useDelimiter("[\\s,]+"); + while (s.hasNextShort()) { + l.add(s.nextShort()); + } +Debug.println(Level.FINEST, f + ": " + l.size()); + return l.stream().collect(() -> ShortBuffer.allocate(l.size()), ShortBuffer::put, (left, right) -> {}).array(); + } +} diff --git a/src/main/java/vavi/sound/twinvq/TwinVQDec.java b/src/main/java/vavi/sound/twinvq/TwinVQDec.java new file mode 100644 index 0000000..86ae82b --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/TwinVQDec.java @@ -0,0 +1,687 @@ +/* + * TwinVQ decoder + * Copyright (c) 2009 Vitor Sessak + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package vavi.sound.twinvq; + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; + +import vavi.sound.twinvq.LibAV.AVCodecContext; +import vavi.sound.twinvq.LibAV.AVFloatDSPContext; +import vavi.sound.twinvq.LibAV.AVTXContext; +import vavi.sound.twinvq.LibAV.HeptaConsumer; +import vavi.sound.twinvq.LibAV.TetraFunction; +import vavi.util.ByteUtil; +import vavi.util.Debug; + +import static java.lang.System.getLogger; +import static vavi.sound.twinvq.LibAV.AVERROR_INVALIDDATA; +import static vavi.sound.twinvq.MetaSoundTwinVQData.ff_metasound_lsp11; +import static vavi.sound.twinvq.MetaSoundTwinVQData.ff_metasound_lsp16; +import static vavi.sound.twinvq.MetaSoundTwinVQData.ff_metasound_lsp22; +import static vavi.sound.twinvq.MetaSoundTwinVQData.ff_metasound_lsp44; +import static vavi.sound.twinvq.MetaSoundTwinVQData.ff_metasound_lsp8; +import static vavi.sound.twinvq.TwinVQ.ff_twinvq_decode_init; +import static vavi.sound.twinvq.TwinVQ.ff_twinvq_wtype_to_ftype_table; +import static vavi.sound.twinvq.TwinVQ.twinvq_memset_float; +import static vavi.sound.twinvq.TwinVQData.*; +import static vavi.sound.twinvq.TwinVQDec.TwinVQCodec.TWINVQ_CODEC_VQF; + + +/** + * TwinVQDec. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-04-05 nsano initial version
    + * @see "https://github.com/libav/libav/blob/master/libavcodec/twinvqdec.c" + */ +public class TwinVQDec { + + private static final Logger logger = getLogger(TwinVQDec.class.getName()); + + /* assume b>0 */ + static int ROUNDED_DIV(int a, int b) { + return (a > 0 ? a + (b >> 1) : a - (b >> 1)) / b; + } + + static int FFSIGN(float a) { return a > 0 ? 1 : -1; } + + enum TwinVQCodec { + TWINVQ_CODEC_VQF, + TWINVQ_CODEC_METASOUND, + } + + enum TwinVQFrameType { + /** Short frame (divided in n sub-blocks) */ + TWINVQ_FT_SHORT, + /** Medium frame (divided in m read_bitstream = TwinVQDec::twinvq_read_bitstream; + // void (dec_bark_env)( TwinVQContext tctx, byte[][] in, int use_hist, int ch, float[] out, float gain, TwinVQFrameType ftype); + HeptaConsumer dec_bark_env = TwinVQDec::dec_bark_env; + // void (decode_ppc)(TwinVQContext tctx, int period_coef, int g_coef, float[] shape, float[] speech); + HeptaConsumer decode_ppc = TwinVQDec::decode_ppc; + } + + /** + * Clip a signed integer value into the amin-amax range. + * @param a value to clip + * @param amin minimum value of the clip range + * @param amax maximum value of the clip range + * @return clipped value + */ + static int av_clip_c(int a, int amin, int amax) { + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; + } + + static final byte[] ff_log2_tab= { + 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 + }; + + static int ff_log2_c(int v) { + int n = 0; + if ((v & 0xffff_0000) != 0) { + v >>>= 16; + n += 16; + } + if ((v & 0xff00) != 0) { + v >>>= 8; + n += 8; + } + n += ff_log2_tab[v]; + + return n; + } + + static float twinvq_mulawinv(float y, float clip, float mu) { + y = av_clip_c((int) (y / clip), -1, 1); + return (float) (clip * FFSIGN(y) * (Math.exp(Math.log(1 + mu) * Math.abs(y)) - 1) / mu); + } + + static final TwinVQModeTab mode_08_08 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 8, bark_tab_s08_64, (byte) 10, fcb08s, (byte) 1, (byte) 5, cb0808s0, cb0808s1, (byte) 18), + new TwinVQFrameMode((byte) 2, bark_tab_m08_256, (byte) 20, fcb08m, (byte) 2, (byte) 5, cb0808m0, cb0808m1, (byte) 16), + new TwinVQFrameMode((byte) 1, bark_tab_l08_512, (byte) 30, fcb08l, (byte) 3, (byte) 6, cb0808l0, cb0808l1, (byte) 17) + }, + (short) 512, (byte) 12, ff_metasound_lsp8, (byte) 1, (byte) 5, (byte) 3, (byte) 3, shape08, (byte) 8, (byte) 28, (byte) 20, (byte) 6, (short) 40 + ); + + static final TwinVQModeTab mode_11_08 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 8, bark_tab_s11_64, (byte) 10, fcb11s, (byte) 1, (byte) 5, cb1108s0, cb1108s1, (byte) 29), + new TwinVQFrameMode((byte) 2, bark_tab_m11_256, (byte) 20, fcb11m, (byte) 2, (byte) 5, cb1108m0, cb1108m1, (byte) 24), + new TwinVQFrameMode((byte) 1, bark_tab_l11_512, (byte) 30, fcb11l, (byte) 3, (byte) 6, cb1108l0, cb1108l1, (byte) 27) + }, + (short) 512, (byte) 16, ff_metasound_lsp11, (byte) 1, (byte) 6, (byte) 4, (byte) 3, shape11, (byte) 9, (byte) 36, (byte) 30, (byte) 7, (short) 90 + ); + + static final TwinVQDec.TwinVQModeTab mode_11_10 = new TwinVQModeTab( + new TwinVQDec.TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 8, bark_tab_s11_64, (byte) 10, fcb11s, (byte) 1, (byte) 5, cb1110s0, cb1110s1, (byte) 21), + new TwinVQFrameMode((byte) 2, bark_tab_m11_256, (byte) 20, fcb11m, (byte) 2, (byte) 5, cb1110m0, cb1110m1, (byte) 18), + new TwinVQFrameMode((byte) 1, bark_tab_l11_512, (byte) 30, fcb11l, (byte) 3, (byte) 6, cb1110l0, cb1110l1, (byte) 20) + }, + (short) 512, (byte) 16, ff_metasound_lsp11, (byte) 1, (byte) 6, (byte) 4, (byte) 3, shape11, (byte) 9, (byte) 36, (byte) 30, (byte) 7, (short) 90 + ); + + static final TwinVQModeTab mode_16_16 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 8, bark_tab_s16_128, (byte) 10, fcb16s, (byte) 1, (byte) 5, cb1616s0, cb1616s1, (byte) 16), + new TwinVQFrameMode((byte) 2, bark_tab_m16_512, (byte) 20, fcb16m, (byte) 2, (byte) 5, cb1616m0, cb1616m1, (byte) 15), + new TwinVQFrameMode((byte) 1, bark_tab_l16_1024, (byte) 30, fcb16l, (byte) 3, (byte) 6, cb1616l0, cb1616l1, (byte) 16) + }, + (short) 1024, (byte) 16, ff_metasound_lsp16, (byte) 1, (byte) 6, (byte) 4, (byte) 3, shape16, (byte) 9, (byte) 56, (byte) 60, (byte) 7, (short) 180 + ); + + static final TwinVQModeTab mode_22_20 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 8, bark_tab_s22_128, (byte) 10, fcb22s_1, (byte) 1, (byte) 6, cb2220s0, cb2220s1, (byte) 18), + new TwinVQFrameMode((byte) 2, bark_tab_m22_512, (byte) 20, fcb22m_1, (byte) 2, (byte) 6, cb2220m0, cb2220m1, (byte) 17), + new TwinVQFrameMode((byte) 1, bark_tab_l22_1024, (byte) 32, fcb22l_1, (byte) 4, (byte) 6, cb2220l0, cb2220l1, (byte) 18) + }, + (short) 1024, (byte) 16, ff_metasound_lsp22, (byte) 1, (byte) 6, (byte) 4, (byte) 3, shape22_1, (byte) 9, (byte) 56, (byte) 36, (byte) 7, (short) 144 + ); + + static final TwinVQModeTab mode_22_24 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 8, bark_tab_s22_128, (byte) 10, fcb22s_1, (byte) 1, (byte) 6, cb2224s0, cb2224s1, (byte) 15), + new TwinVQFrameMode((byte) 2, bark_tab_m22_512, (byte) 20, fcb22m_1, (byte) 2, (byte) 6, cb2224m0, cb2224m1, (byte) 14), + new TwinVQFrameMode((byte) 1, bark_tab_l22_1024, (byte) 32, fcb22l_1, (byte) 4, (byte) 6, cb2224l0, cb2224l1, (byte) 15) + }, + (short) 1024, (byte) 16, ff_metasound_lsp22, (byte) 1, (byte) 6, (byte) 4, (byte) 3, shape22_1, (byte) 9, (byte) 56, (byte) 36, (byte) 7, (short) 144 + ); + + static final TwinVQModeTab mode_22_32 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 4, bark_tab_s22_128, (byte) 10, fcb22s_2, (byte) 1, (byte) 6, cb2232s0, cb2232s1, (byte) 11), + new TwinVQFrameMode((byte) 2, bark_tab_m22_256, (byte) 20, fcb22m_2, (byte) 2, (byte) 6, cb2232m0, cb2232m1, (byte) 11), + new TwinVQFrameMode((byte) 1, bark_tab_l22_512, (byte) 32, fcb22l_2, (byte) 4, (byte) 6, cb2232l0, cb2232l1, (byte) 12) + }, + (short) 512, (byte) 16, lsp22_2, (byte) 1, (byte) 6, (byte) 4, (byte) 4, shape22_2, (byte) 9, (byte) 56, (byte) 36, (byte) 7, (byte) 72 + ); + + static final TwinVQModeTab mode_44_40 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 16, bark_tab_s44_128, (byte) 10, fcb44s, (byte) 1, (byte) 6, cb4440s0, cb4440s1, (byte) 18), + new TwinVQFrameMode((byte) 4, bark_tab_m44_512, (byte) 20, fcb44m, (byte) 2, (byte) 6, cb4440m0, cb4440m1, (byte) 17), + new TwinVQFrameMode((byte) 1, bark_tab_l44_2048, (byte) 40, fcb44l, (byte) 4, (byte) 6, cb4440l0, cb4440l1, (byte) 17) + }, + (short) 2048, (byte) 20, ff_metasound_lsp44, (byte) 1, (byte) 6, (byte) 4, (byte) 4, shape44, (byte) 9, (byte) 84, (byte) 54, (byte) 7, (byte) 432 + ); + + static final TwinVQModeTab mode_44_48 = new TwinVQModeTab( + new TwinVQFrameMode[] { + new TwinVQFrameMode((byte) 16, bark_tab_s44_128, (byte) 10, fcb44s, (byte) 1, (byte) 6, cb4448s0, cb4448s1, (byte) 15), + new TwinVQFrameMode((byte) 4, bark_tab_m44_512, (byte) 20, fcb44m, (byte) 2, (byte) 6, cb4448m0, cb4448m1, (byte) 14), + new TwinVQFrameMode((byte) 1, bark_tab_l44_2048, (byte) 40, fcb44l, (byte) 4, (byte) 6, cb4448l0, cb4448l1, (byte) 14) + }, + (short) 2048, (byte) 20, ff_metasound_lsp44, (byte) 1, (byte) 6, (byte) 4, (byte) 4, shape44, (byte) 9, (byte) 84, (byte) 54, (byte) 7, (short) 432 + ); + + /** + * Evaluate {@code a * b / 400} rounded to the nearest integer. When, for example, + * {@code a * b == 200} and the nearest integer is ill-defined, use a table to emulate + * the following broken float-based implementation used by the binary decoder: + *

    +     * static int very_broken_op(int a, int b)
    +     * {
    +     *   static float test; // Ugh, force gcc to do the division first...
    +     *
    +     *   test = a / 400.0;
    +     *   return b * test + 0.5;
    +     * }
    +     * 
    + * if this function is replaced by just {@code ROUNDED_DIV(a * b, 400.0)}, the + * stddev between the original file (before encoding with Yamaha encoder) and + * the decoded output increases, which leads one to believe that the encoder + * expects exactly this broken calculation. + */ + private static int very_broken_op(int a, int b) { + int x = a * b + 200; + + if (x % 400 != 0 || b % 5 != 0) { +//System.err.printf("center0: a: %d, b: %d, r: %d%n", a, b, x / 400); + return x / 400; + } + + x /= 400; + + int size = tabs[b / 5].size; + byte[] rtab = tabs[b / 5].tab; +//System.err.printf("index: %d%n", size * ff_log2_c(2 * (x - 1) / size) + (x - 1) % size); + return x - rtab[size * ff_log2_c(2 * (x - 1) / size) + (x - 1) % size]; + } + + /** + * Sum to data a periodic peak of a given period, width and shape. + * + * @param period the period of the peak divided by 400.0 + */ + private static void add_peak(int period, int width, float[] shape, int shapeP, float ppc_gain, float[] speech, int speechP, int len) { + int i; + + int shape_end = len; // shape + int center; + + // First peak centered around zero + for (i = 0; i < width / 2; i++) + speech[speechP + i] += ppc_gain * shape[shapeP++]; + + for (i = 1; i < ROUNDED_DIV(len, width); i++) { + center = very_broken_op(period, i); + for (int j = -width / 2; j < (width + 1) / 2; j++) + speech[speechP + j + center] += ppc_gain * shape[shapeP++]; + } + + // For the last block, be careful not to go beyond the end of the buffer + center = very_broken_op(period, i); + for (int j = -width / 2; j < (width + 1) / 2 && shapeP < shape_end; j++) + speech[speechP + j + center] += ppc_gain * shape[shapeP++]; + } + + static void decode_ppc(TwinVQDec.TwinVQContext tctx, int period_coef, int g_coef, float[] shape, int shapeP, float[] speech, int speechP) { + TwinVQModeTab mtab = tctx.mtab; + int isampf = tctx.avctx.sample_rate / 1000; + int ibps = tctx.avctx.bit_rate / (1000 * tctx.avctx.ch_layout.nb_channels); + int min_period = ROUNDED_DIV(40 * 2 * mtab.size, isampf); + int max_period = ROUNDED_DIV(40 * 2 * mtab.size * 6, isampf); + int period_range = max_period - min_period; +//System.err.printf("isampf: %d, ibps: %d, min_period: %d, max_period: %d, period_range: %d, mtab.size: %d%n", isampf, ibps, min_period, max_period, period_range, mtab.size); + float pgain_step = 25000.0f / ((1 << mtab.pgain_bit) - 1); + float ppc_gain = 1.0f / 8192 * + twinvq_mulawinv(pgain_step * g_coef + pgain_step / 2, 25000.0f, TWINVQ_PGAIN_MU); + + // This is actually the period multiplied by 400. It is just linearly coded + // between its maximum and minimum value. + int period = min_period + ROUNDED_DIV(period_coef * period_range, (1 << mtab.ppc_period_bit) - 1); +//System.err.printf("period: %d, min_period: %d, period_coef: %d, period_range: %d, mtab.ppc_period_bit: %d%n", period, min_period, period_coef, period_range, mtab.ppc_period_bit); + int width; + + if (isampf == 22 && ibps == 32) { + // For some unknown reason, NTT decided to code this case differently... + width = ROUNDED_DIV((period + 800) * mtab.peak_per2wid, 400 * mtab.size); + } else + width = period * mtab.peak_per2wid / (400 * mtab.size); + + add_peak(period, width, shape, shapeP, ppc_gain, speech, speechP, mtab.ppc_shape_len); + } + + static void dec_bark_env(TwinVQContext tctx, byte[] in, int use_hist, + int ch, float[] out, float gain, TwinVQDec.TwinVQFrameType ftype) { + TwinVQModeTab mtab = tctx.mtab; + float[] hist = tctx.bark_hist[ftype.ordinal()][ch]; + float val = new float[] {0.4f, 0.35f, 0.28f}[ftype.ordinal()]; + int bark_n_coef = mtab.fmode[ftype.ordinal()].bark_n_coef; + int fw_cb_len = (mtab.fmode[ftype.ordinal()].bark_env_size & 0xff) / bark_n_coef; + int idx = 0; + int outP = 0; // TODO out + + for (int i = 0; i < fw_cb_len; i++) + for (int j = 0; j < bark_n_coef; j++, idx++) { + float tmp2 = mtab.fmode[ftype.ordinal()].bark_cb[fw_cb_len * in[j] + i] * (1.0f / 4096); + float st = use_hist != 0 ? (1.0f - val) * tmp2 + val * hist[idx] + 1.0f : tmp2 + 1.0f; + + hist[idx] = tmp2; + if (st < -1.0) + st = 1.0f; + + twinvq_memset_float(out, outP, st * gain, mtab.fmode[ftype.ordinal()].bark_tab[idx]); + outP += mtab.fmode[ftype.ordinal()].bark_tab[idx]; + } + } + + private static void read_cb_data(TwinVQContext tctx, GetBits gb, byte[] dst, TwinVQFrameType ftype) { + int dstP = 0; + + for (int i = 0; i < tctx.n_div[ftype.ordinal()]; i++) { + int bs_second_part = (i >= tctx.bits_main_spec_change[ftype.ordinal()]) ? 1 : 0; + + dst[dstP++] = (byte) gb.get_bits(tctx.bits_main_spec[0][ftype.ordinal()][bs_second_part]); + dst[dstP++] = (byte) gb.get_bits(tctx.bits_main_spec[1][ftype.ordinal()][bs_second_part]); +//Debug.printf("cb[%3d]: %d, %02x, %d, %02x, %d", i, tctx.bits_main_spec[0][ftype.ordinal()][bs_second_part], dst[dstP - 2], tctx.bits_main_spec[1][ftype.ordinal()][bs_second_part], dst[dstP - 1], bs_second_part); + } + } + + /** */ + static int twinvq_read_bitstream(AVCodecContext avctx, TwinVQContext tctx, byte[] buf, int buf_size) { + TwinVQDec.TwinVQFrameData bits = tctx.bits[0]; + TwinVQModeTab mtab = tctx.mtab; + int channels = tctx.avctx.ch_layout.nb_channels; + + GetBits gb = new GetBits(buf, buf_size); + gb.skip_bits(gb.get_bits(8)); + + bits.window_type = gb.get_bits(TWINVQ_WINDOW_TYPE_BITS); + + if (bits.window_type > 8) { + logger.log(Level.ERROR, "Invalid window type, broken sample?"); + return AVERROR_INVALIDDATA; + } + + bits.ftype = ff_twinvq_wtype_to_ftype_table[tctx.bits[0].window_type]; + + int sub = mtab.fmode[bits.ftype.ordinal()].sub & 0xff; + + read_cb_data(tctx, gb, bits.main_coeffs, bits.ftype); + + for (int i = 0; i < channels; i++) + for (int j = 0; j < sub; j++) + for (int k = 0; k < mtab.fmode[bits.ftype.ordinal()].bark_n_coef; k++) + bits.bark1[i][j][k] = (byte) gb.get_bits(mtab.fmode[bits.ftype.ordinal()].bark_n_bit); + + for (int i = 0; i < channels; i++) + for (int j = 0; j < sub; j++) + bits.bark_use_hist[i][j] = (byte) gb.get_bits1(); + + if (bits.ftype == TwinVQFrameType.TWINVQ_FT_LONG) { + for (int i = 0; i < channels; i++) + bits.gain_bits[i] = (byte) gb.get_bits(TWINVQ_GAIN_BITS); + } else { + for (int i = 0; i < channels; i++) { + bits.gain_bits[i] = (byte) gb.get_bits(TWINVQ_GAIN_BITS); + for (int j = 0; j < sub; j++) + bits.sub_gain_bits[i * sub + j] = (byte) gb.get_bits(TWINVQ_SUB_GAIN_BITS); + } + } + + for (int i = 0; i < channels; i++) { + bits.lpc_hist_idx[i] = (byte) gb.get_bits(mtab.lsp_bit0); + bits.lpc_idx1[i] = (byte) gb.get_bits(mtab.lsp_bit1); + + for (int j = 0; j < mtab.lsp_split; j++) + bits.lpc_idx2[i][j] = (byte) gb.get_bits(mtab.lsp_bit2); + } + + if (bits.ftype == TwinVQFrameType.TWINVQ_FT_LONG) { + read_cb_data(tctx, gb, bits.ppc_coeffs, TwinVQFrameType.TWINVQ_FT_PPC); + for (int i = 0; i < channels; i++) { + bits.p_coef[i] = gb.get_bits(mtab.ppc_period_bit); + bits.g_coef[i] = gb.get_bits(mtab.pgain_bit); + } + } + + return (gb.get_bits_count() + 7) / 8; + } + + /** @override init */ + static int twinvq_decode_init(AVCodecContext avctx) { + int isampf, ibps, channels; + TwinVQContext tctx = avctx.priv_data; + + if (avctx.extradata == null || avctx.extradata_size < 12) { + logger.log(Level.ERROR, "Missing or incomplete extradata"); + return AVERROR_INVALIDDATA; + } + channels = ByteUtil.readBeInt(avctx.extradata) + 1; +Debug.println("channels: " + channels); + avctx.bit_rate = ByteUtil.readBeInt(avctx.extradata, 4) * 1000; +Debug.println("bit_rate: " + avctx.bit_rate); + isampf = ByteUtil.readBeInt(avctx.extradata, 8); + + if (isampf < 8 || isampf > 44) { + logger.log(Level.ERROR, "Unsupported sample rate"); + return AVERROR_INVALIDDATA; + } +Debug.println("isampf: " + isampf); + switch (isampf) { + case 44: + avctx.sample_rate = 44100; + break; + case 22: + avctx.sample_rate = 22050; + break; + case 11: + avctx.sample_rate = 11025; + break; + default: + avctx.sample_rate = isampf * 1000; + break; + } + + if (channels <= 0 || channels > TWINVQ_CHANNELS_MAX) { + logger.log(Level.ERROR, "Unsupported number of channels: %i", channels); + return -1; + } +// av_channel_layout_uninit(avctx.ch_layout); +// av_channel_layout_default(avctx.ch_layout, channels); + avctx.ch_layout.nb_channels = channels; + + ibps = avctx.bit_rate / (1000 * channels); +Debug.println("ibps: " + ibps); + if (ibps < 8 || ibps > 48) { + logger.log(Level.ERROR, "Bad bitrate per channel value %d", ibps); + return AVERROR_INVALIDDATA; + } + +Debug.println("mtab: " + (isampf << 8) + ibps); + switch ((isampf << 8) + ibps) { + case (8 << 8) + 8: + tctx.mtab = mode_08_08; + break; + case (11 << 8) + 8: + tctx.mtab = mode_11_08; + break; + case (11 << 8) + 10: + tctx.mtab = mode_11_10; + break; + case (16 << 8) + 16: + tctx.mtab = mode_16_16; + break; + case (22 << 8) + 20: + tctx.mtab = mode_22_20; + break; + case (22 << 8) + 24: + tctx.mtab = mode_22_24; + break; + case (22 << 8) + 32: + tctx.mtab = mode_22_32; + break; + case (44 << 8) + 40: + tctx.mtab = mode_44_40; + break; + case (44 << 8) + 48: + tctx.mtab = mode_44_48; + break; + default: + logger.log(Level.ERROR, "This version does not support %d kHz - %d kbit/s/ch mode.", + isampf, isampf); + return -1; + } + + tctx.codec = TWINVQ_CODEC_VQF; + tctx.read_bitstream = TwinVQDec::twinvq_read_bitstream; + tctx.dec_bark_env = TwinVQDec::dec_bark_env; + tctx.decode_ppc = TwinVQDec::decode_ppc; + tctx.frame_size = avctx.bit_rate * tctx.mtab.size / avctx.sample_rate + 8; + tctx.is_6kbps = 0; + if (avctx.block_align != 0 && avctx.block_align * 8L / tctx.frame_size > 1) { + logger.log(Level.ERROR, "VQF TwinVQ should have only one frame per packet"); + return AVERROR_INVALIDDATA; + } + + return ff_twinvq_decode_init(avctx); + } +} diff --git a/src/main/java/vavi/sound/twinvq/VFQ.java b/src/main/java/vavi/sound/twinvq/VFQ.java new file mode 100644 index 0000000..2e26bb7 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/VFQ.java @@ -0,0 +1,320 @@ +/* + * VQF demuxer + * Copyright (c) 2009 Vitor Sessak + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package vavi.sound.twinvq; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import vavi.sound.twinvq.LibAV.AVFormatContext; +import vavi.sound.twinvq.LibAV.AVInputFormat; +import vavi.sound.twinvq.LibAV.AVPacket; +import vavi.sound.twinvq.LibAV.AVProbeData; +import vavi.sound.twinvq.LibAV.AVStream; +import vavi.util.ByteUtil; +import vavi.util.Debug; +import vavi.util.StringUtil; + +import static java.lang.System.getLogger; +import static vavi.sound.twinvq.LibAV.AVERROR_INVALIDDATA; +import static vavi.sound.twinvq.LibAV.AV_INPUT_BUFFER_PADDING_SIZE; +import static vavi.sound.twinvq.LibAV.MKTAG; + + +/** + * VFQ. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-08-09 nsano initial version
    + * @see "https://github.com/libav/libav/blob/master/libavformat/vqf.c" + */ +class VFQ { + + private static final Logger logger = getLogger(VFQ.class.getName()); + + static final String TAG_COMM = "COMM"; + static final String TAG_DSIZ = "DSIZ"; + static final String TAG_YEAR = "YEAR"; + static final String TAG_ENCD = "ENCD"; + static final String TAG_EXTR = "EXTR"; + static final String TAG__YMH = "_YMH"; + static final String TAG__NTT = "_NTT"; + static final String TAG__ID3 = "_ID3"; + + static class VqfContext { + + int frame_bit_len; + byte last_frame_bits; + int remaining_bits; + } + + static int vqf_probe(byte[] buf) { + if (ByteUtil.readLeInt(buf) != MKTAG('T', 'W', 'I', 'N')) + return 0; + + if (Arrays.equals(buf, 4, 8, "97012000".getBytes(), 0, 8)) + return 100; + + if (Arrays.equals(buf, 4, 8, "00052200".getBytes(), 0, 8)) + return 100; + + return 50; + } + + static void add_metadata(AVFormatContext s, String tag, int tag_len, int remaining) throws IOException { + int len = Math.min(tag_len, remaining); + byte[] buf; + + if (len == Integer.MAX_VALUE) + return; + + buf = new byte[len + 1]; + s.pb.readFully(buf, 0, len); + buf[len] = 0; + s.metadata.put(tag, buf); + } + + static final Map vqf_metadata_conv = new HashMap<>(); + + static { + vqf_metadata_conv.put("(c) ", "copyright"); + vqf_metadata_conv.put("ARNG", "arranger"); + vqf_metadata_conv.put("AUTH", "author"); + vqf_metadata_conv.put("BAND", "band"); + vqf_metadata_conv.put("CDCT", "conductor"); + vqf_metadata_conv.put("COMT", "comment"); + vqf_metadata_conv.put("FILE", "filename"); + vqf_metadata_conv.put("GENR", "genre"); + vqf_metadata_conv.put("LABL", "publisher"); + vqf_metadata_conv.put("MUSC", "composer"); + vqf_metadata_conv.put("NAME", "title"); + vqf_metadata_conv.put("NOTE", "note"); + vqf_metadata_conv.put("PROD", "producer"); + vqf_metadata_conv.put("PRSN", "personnel"); + vqf_metadata_conv.put("REMX", "remixer"); + vqf_metadata_conv.put("SING", "singer"); + vqf_metadata_conv.put("TRCK", "track"); + vqf_metadata_conv.put("WORD", "words"); + } + + static int vqf_read_header(AVFormatContext s) { + try { + VFQ.VqfContext c = s.priv_data; + AVStream st = new AVStream(s, null); + byte[] tag_data = new byte[4]; + String chunk_tag; + int rate_flag = -1; + int header_size; + int read_bitrate = 0; + int size; + byte[] comm_chunk = new byte[12]; + + s.pb.skipBytes(12); + + header_size = s.pb.readInt(); // BE + +// st.codecpar.codec_type = AVMEDIA_TYPE_AUDIO; +// st.codecpar.codec_id = AV_CODEC_ID_TWINVQ; + st.start_time = 0; + + do { + int len; + s.pb.readFully(tag_data); // LE + chunk_tag = new String(tag_data); + + if (chunk_tag.equals("DATA")) + break; + + len = s.pb.readInt(); // BE + + if (len < 0) { + logger.log(Level.ERROR, "Malformed header\n"); + return -1; + } + + header_size -= 8; + +Debug.println("chunk: " + chunk_tag + ", " + len); + switch (chunk_tag) { + case TAG_COMM -> { + s.pb.readFully(comm_chunk, 0, 12); + st.codecpar.channels = ByteUtil.readBeInt(comm_chunk) + 1; + read_bitrate = ByteUtil.readBeInt(comm_chunk, 4); + rate_flag = ByteUtil.readBeInt(comm_chunk, 8); + s.pb.skipBytes(len - 12); + + st.codecpar.bit_rate = read_bitrate * 1000; + } + case TAG_DSIZ -> { // size of compressed data + size = s.pb.readInt(); // BE + + s.metadata.put("size", String.valueOf(size)); + } + case TAG_YEAR, // recording date + TAG_ENCD, // compression date + TAG_EXTR, // reserved + TAG__YMH, // reserved + TAG__NTT, // reserved + TAG__ID3 -> // reserved for ID3 tags + s.pb.skipBytes(Math.min(len, header_size)); + default -> + add_metadata(s, chunk_tag, len, header_size); + } + + header_size -= len; + + } while (header_size >= 0); + + switch (rate_flag) { + case -1: + logger.log(Level.ERROR, "COMM tag not found!\n"); + return -1; + case 44: + st.codecpar.sample_rate = 44100; + break; + case 22: + st.codecpar.sample_rate = 22050; + break; + case 11: + st.codecpar.sample_rate = 11025; + break; + default: + if (rate_flag < 8 || rate_flag > 44) { + logger.log(Level.ERROR, "Invalid rate flag %d\n", rate_flag); + return AVERROR_INVALIDDATA; + } + st.codecpar.sample_rate = rate_flag * 1000; + break; + } + + if (read_bitrate / st.codecpar.channels < 8 || read_bitrate / st.codecpar.channels > 48) { + logger.log(Level.ERROR, "Invalid bitrate per channel %d\n", read_bitrate / st.codecpar.channels); + return AVERROR_INVALIDDATA; + } + + switch (((st.codecpar.sample_rate / 1000) << 8) + read_bitrate / st.codecpar.channels) { + case (11 << 8) + 8: + case (8 << 8) + 8: + case (11 << 8) + 10: + case (22 << 8) + 32: + size = 512; + break; + case (16 << 8) + 16: + case (22 << 8) + 20: + case (22 << 8) + 24: + size = 1024; + break; + case (44 << 8) + 40: + case (44 << 8) + 48: + size = 2048; + break; + default: + logger.log(Level.ERROR, "Mode not suported: %d Hz, %d kb/s.\n", + st.codecpar.sample_rate, st.codecpar.bit_rate); + return -1; + } + c.frame_bit_len = st.codecpar.bit_rate * size / st.codecpar.sample_rate; +// avpriv_set_pts_info(st, 64, size, st.codecpar.sample_rate); + + // put first 12 bytes of COMM chunk in extradata + st.codecpar.extradata = new byte[12 + AV_INPUT_BUFFER_PADDING_SIZE]; + st.codecpar.extradata_size = 12; + System.arraycopy(comm_chunk, 0, st.codecpar.extradata, 0, 12); +Debug.println("extradata_size: " + st.codecpar.extradata_size + "\n" + StringUtil.getDump(st.codecpar.extradata)); + +// ff_metadata_conv_ctx(s, null, vqf_metadata_conv); + + return 0; + } catch (IOException e) { +logger.log(Level.ERROR, e.getMessage(), e); + return -1; + } + } + + static AVPacket vqf_read_packet(AVFormatContext s) { + try { + VqfContext c = s.priv_data; + int ret; + int size = (c.frame_bit_len - c.remaining_bits + 7) >> 3; +Debug.println("size: " + size + ", blen: " + c.frame_bit_len + ", brem: " + c.remaining_bits + ", lfbits: " + (c.last_frame_bits & 0xff)); + + AVPacket pkt = new AVPacket(size + 2); + + pkt.pos = 0; // s.pb.position(); + pkt.stream_index = 0; + pkt.duration = 1; + + pkt.data[0] = (byte) (8 - c.remaining_bits); // Number of bits to skip + pkt.data[1] = c.last_frame_bits; + ret = s.pb.read(pkt.data, 2, size); + + if (ret <= 0) { + throw new IllegalStateException("read"); + } + + c.last_frame_bits = pkt.data[size + 1]; + c.remaining_bits = (size << 3) - c.frame_bit_len + c.remaining_bits; + + return pkt; + } catch (IOException e) { +logger.log(Level.ERROR, e.getMessage(), e); + throw new UncheckedIOException(e); + } + } + + static int vqf_read_seek(AVFormatContext s, int stream_index, long timestamp, int flags) { +// VqfContext c = s.priv_data; +// AVStream st; +// int ret; +// long pos; +// +// st = s.streams[stream_index]; +// pos = av_rescale_rnd(timestamp * st.codecpar.bit_rate, +// st.time_base.num, +// st.time_base.den * (long) c.frame_bit_len, +// (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP); +// pos *= c.frame_bit_len; +// +// st.cur_dts = av_rescale(pos, st.time_base.den, st.codecpar.bit_rate * (long) st.time_base.num); +// +// if ((ret = s.pb.position(((pos - 7) >> 3) + s.internal.data_offset)) < 0) +// return ret; +// +// c.remaining_bits = (int) (-7 - ((pos - 7) & 7)); + return 0; + } + + static AVInputFormat ff_vqf_demuxer = new AVInputFormat() {{ + name = "vqf"; + long_name = "Nippon Telegraph and Telephone Corporation (NTT) TwinVQ"; + priv_data_size = -1; // sizeof(VqfContext) + read_probe = VFQ::vqf_probe; + read_header = VFQ::vqf_read_header; + read_packet = VFQ::vqf_read_packet; + read_seek = VFQ::vqf_read_seek; + extensions = "vqf,vql,vqe"; + }}; +} \ No newline at end of file diff --git a/src/main/java/vavi/sound/twinvq/obsolate/BFile.java b/src/main/java/vavi/sound/twinvq/obsolate/BFile.java index 66fe03f..b67e72c 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/BFile.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/BFile.java @@ -1,7 +1,6 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano + * (c)Copyright 1996-2000 NTT Cyber Space Laboratories + * Released on 2000.05.22 by N. Iwakami */ package vavi.sound.twinvq.obsolate; @@ -13,14 +12,14 @@ /** * definitions related to the bitstream file operating tools * - * @version 1.1 added function bseek() by N.Iwakami on 1999/2/24 - * @version 1.2 added a member "readable" to structure BFILE to improve bseek - * reliability, by NI, 1999/6/18 - * @version 0.0 written by N.Iwakami on 1994/4/21 - * @version 1.0 modified by N.Iwakami on 1999/1/8 - * @version 1.1 added function bseek() by N.Iwakami on 1999/2/24 - * @version 1.2 bugfix about skipping frames by NI, 1999/6/18 - * @version 1.3 bugfix about skipping frames by NI, 1999/6/24 + * @version 1.1 1999/02/24 added function bseek()
    + * 1.2 1999/06/18 added a member "readable" to structure BFILE to improve bseek reliability
    + * 0.0 1994/04/21
    + * 1.0 1999/01/08
    + * 1.1 1999/02/24 added function bseek()
    + * 1.2 1999/06/18 bugfix about skipping frames
    + * 1.3 1999/06/24 bugfix about skipping frames
    + * @author N.Iwakami */ class BFile { @@ -52,7 +51,7 @@ class BFile { int readable; /** the bit buffer */ - byte[] buf = new byte[BBUFSIZ]; + final byte[] buf = new byte[BBUFSIZ]; /** R/W mode */ String mode; @@ -99,7 +98,7 @@ long bseek(long offset, int origin) throws IOException { long fs_ret; if (!this.mode.equals("w")) { - System.err.print("bseek(): No seek support in write mode.\n"); + System.err.print("bseek(): No seek support in write mode."); return 2; } @@ -166,7 +165,7 @@ long bseek(long offset, int origin) throws IOException { this.ptr = (offset + BBUFLEN) % BBUFLEN; break; default: - System.err.printf("bseek(): %d: Invalid origin ID.\n", origin); + System.err.printf("bseek(): %d: Invalid origin ID.", origin); return 2; } return 0; @@ -198,7 +197,7 @@ int read(byte[] data, int size, int nbits) throws IOException { iptr = this.ptr; // If data file is empty then return if (iptr >= this.nbuf) { - return (retval); + return retval; } // current file data buffer address ibufadr = (int) (iptr / BYTE_BIT); @@ -206,7 +205,7 @@ int read(byte[] data, int size, int nbits) throws IOException { ibufbit = iptr % BYTE_BIT; // tmpdat = stream.buf[ibufadr] >> (BYTE_BIT-ibufbit-1); tmpdat = this.buf[ibufadr]; - tmpdat >>= (BYTE_BIT - ibufbit - 1); + tmpdat = (byte) (tmpdat >>> (BYTE_BIT - ibufbit - 1)); // current data bit // output data address @@ -225,10 +224,10 @@ int read(byte[] data, int size, int nbits) throws IOException { } ++retval; } - return (retval); + return retval; } - static final int BITS_INT = (4 * 8); + static final int BITS_INT = 4 * 8; /** * @param data input data @@ -238,9 +237,9 @@ int getBStream(int[] data, int offset, int nbits) throws IOException { byte[] tmpbit = new byte[BITS_INT]; if (nbits > BITS_INT) { - throw new IllegalArgumentException(String.format("get_bstm(): %d: %d Error.\n", nbits, BITS_INT)); + throw new IllegalArgumentException(String.format("getBStream: %d: %d Error.", nbits, BITS_INT)); } - int retval = read(tmpbit, BITS_INT, nbits); + int retval = read(tmpbit, 1, nbits); for (int ibit = retval; ibit < nbits; ibit++) { tmpbit[ibit] = 0; } @@ -248,7 +247,7 @@ int getBStream(int[] data, int offset, int nbits) throws IOException { int work = 0; for (int ibit = 0; ibit < nbits; ibit++) { work += mask * tmpbit[ibit]; - mask >>= 1; + mask >>>= 1; } data[offset] = work; return retval; diff --git a/src/main/java/vavi/sound/twinvq/obsolate/BStream.java b/src/main/java/vavi/sound/twinvq/obsolate/BStream.java index a9e0289..c9889d8 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/BStream.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/BStream.java @@ -1,7 +1,7 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano + * (c)Copyright 1996-2000 NTT Cyber Space Laboratories + * Released on 2000.05.22 by N. Iwakami + * Released on 2000.09.06 by N. Iwakami */ package vavi.sound.twinvq.obsolate; @@ -14,24 +14,31 @@ import vavi.sound.twinvq.obsolate.TwinVQ.HeaderInfo; import vavi.sound.twinvq.obsolate.TwinVQ.ConfInfo; import vavi.sound.twinvq.obsolate.TwinVQ.ConfInfoSubBlock; +import vavi.util.Debug; +import static vavi.sound.twinvq.obsolate.TwinVQ.asciiz; +import static vavi.sound.twinvq.obsolate.TwinVQ.twinVq; -class BStream { - /** */ - TwinVQ twinVq = TwinVQ.getInstance(); +/** + * @version 24 Feb. 1999, changed header format + * 24 Feb. 1999, added function TvqSkipFrame() and TvqGetBsFramePoint() + * 17 Jun. 1999, bug fix at the function TvqSkipFrame() + * @author N. Iwakami + */ +class BStream { /** * bits table for VQ */ - static int[][] bits_0 = new int[TwinVQ.N_INTR_TYPE][]; + static final int[][] bits_0 = new int[TwinVQ.N_INTR_TYPE][]; - static int[][] bits_1 = new int[TwinVQ.N_INTR_TYPE][]; + static final int[][] bits_1 = new int[TwinVQ.N_INTR_TYPE][]; /** * lookup parameters */ - private ConfInfo cf; + private final ConfInfo cf = new ConfInfo(); private int iframe; @@ -39,16 +46,15 @@ class BStream { /** * get string from the bitstream file - * - * @return none */ - private static int getString(byte[] buf, int nbytes, BFile bfp) throws IOException { + static int getString(byte[] buf, int nbytes, BFile bfp) throws IOException { int ichar, ibit; int[] c = new int[1]; for (ichar = 0; ichar < nbytes; ichar++) { ibit = bfp.getBStream(c, 0, BFile.CHAR_BITS); if (ibit < BFile.CHAR_BITS) { +Debug.println("getString: bits underflow"); break; } buf[ichar] = (byte) c[0]; @@ -68,14 +74,16 @@ ChunkChunk loadTwinChunk(BFile bfp) throws IOException { byte[] chunkID = new byte[TwinVQ.KEYWORD_BYTES + TwinVQ.VERSION_BYTES + 1]; getString(chunkID, TwinVQ.KEYWORD_BYTES + TwinVQ.VERSION_BYTES, bfp); - TVQ_VERSION = twinVq.TvqCheckVersion(new String(chunkID)); + TVQ_VERSION = twinVq.TvqCheckVersion(asciiz(chunkID)); +Debug.println("chunkID: " + TVQ_VERSION); if (TVQ_VERSION == TwinVQ.TVQ_UNKNOWN_VERSION) { - throw new IllegalArgumentException(String.format("Header reading error: Unknown version (%s).\n", chunkID)); + throw new IllegalArgumentException(String.format("Header reading error: Unknown version (%s).", TVQ_VERSION)); } if (bfp.getBStream(chunkSize, 0, TwinVQ.ELEM_BYTES * BFile.CHAR_BITS) <= 0) { throw new IllegalArgumentException("Header reading error: Failed to get header size."); } +Debug.println("chunkSize: " + chunkSize[0]); byte[] chunkData = new byte[chunkSize[0] + 1]; if (getString(chunkData, chunkSize[0], bfp) < chunkSize[0]) { @@ -103,9 +111,9 @@ ChunkChunk getBsHeaderInfo(BFile bfp) throws IOException { byte[] lbuf = new byte[TwinVQ.BUFSIZ]; getString(lbuf, TwinVQ.KEYWORD_BYTES, bfp); - if (Arrays.equals(lbuf, "DATA".getBytes())) { + if (!Arrays.equals(lbuf, 0, 4, "DATA".getBytes(), 0, TwinVQ.KEYWORD_BYTES)) { throw new IllegalArgumentException( - String.format("TwinVQ format error. No \"DATA\" chunk was found. found %s chunk", lbuf)); + String.format("TwinVQ format error. No \"DATA\" chunk was found. found %s chunk", new String(lbuf, 0, TwinVQ.KEYWORD_BYTES))); } return twinChunk; @@ -116,8 +124,9 @@ ChunkChunk getBsHeaderInfo(BFile bfp) throws IOException { */ int initBsReader(HeaderInfo setupInfo) { - TVQ_VERSION = twinVq.TvqCheckVersion(new String(setupInfo.id)); + TVQ_VERSION = twinVq.TvqCheckVersion(asciiz(setupInfo.id)); if (TVQ_VERSION == TwinVQ.TVQ_UNKNOWN_VERSION) { +Debug.println("unsupported version: " + TVQ_VERSION); return 1; } @@ -285,7 +294,7 @@ int readBsFrame(Index index, BFile bfp) throws IOException { // Window type bitcount += bfp.getBStream(index.w_type, 0, cf.BITS_WTYPE); if (twinVq.TvqWtypeToBtype(index.w_type[0], index.btype) != 0) { - System.err.printf("Error: unknown window type: %d\n", index.w_type); + System.err.printf("Error: unknown window type: %d", index.w_type[0]); return 0; } int btype = index.btype[0]; @@ -316,6 +325,7 @@ int readBsFrame(Index index, BFile bfp) throws IOException { iframe += 1; +Debug.printf("bitcount: %d, numFixedBitsPerFrame: %d", bitcount, numFixedBitsPerFrame); return bitcount == numFixedBitsPerFrame ? 1 : 0; } diff --git a/src/main/java/vavi/sound/twinvq/obsolate/Chunk.java b/src/main/java/vavi/sound/twinvq/obsolate/Chunk.java index f36b6cc..0b11224 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/Chunk.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/Chunk.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano + * (c)Copyright 1996-2000 NTT Cyber Space Laboratories + * Modified on 2000.09.06 by N. Iwakami */ package vavi.sound.twinvq.obsolate; +import java.util.ArrayList; import java.util.List; @@ -16,7 +16,7 @@ class Chunk { private final String id; - private List data; + private final List data = new ArrayList<>(); private int pos; @@ -24,7 +24,7 @@ class Chunk { * Gets size byte integer from current position. * @param size default: long integer */ - protected long getNInt(int size/* =sizeof(long) */) { + protected long getNInt(int size /* = sizeof(long) */) { final int mask = 0xff; int ibyte; long retval; @@ -42,7 +42,7 @@ protected long getNInt(int size/* =sizeof(long) */) { * Gets a vector of size bytes from the current position. * @param size default: all the rest */ - protected byte[] getVector(int size/* = 0 */) { + protected byte[] getVector(int size /* = 0 */) { if (size == 0) { size = data.size() - pos; @@ -64,7 +64,7 @@ protected byte[] getVector(int size/* = 0 */) { * Gets length string from current position. * @param length default: all the rest */ - protected String getRndString(int length/* = 0 */) { + protected String getRndString(int length /* = 0 */) { if (length == 0) { length = getSize(); } @@ -75,7 +75,7 @@ protected String getRndString(int length/* = 0 */) { StringBuilder theString = new StringBuilder(); for (int ii = 0; ii < length; ii++) { - theString.append(data.get(pos++)); + theString.append((char) (byte) data.get(pos++)); } return theString.toString(); @@ -86,7 +86,7 @@ protected String getRndString(int length/* = 0 */) { * * @param size default: long integer */ - protected void putNInt(int inputData, int size/* =sizeof(long) */) { + protected void putNInt(int inputData, int size /* = sizeof(long) */) { final int mask = 0xff; int ibyte; byte data_tmp; @@ -124,6 +124,7 @@ protected static class FailPutException extends RuntimeException { /** constructor */ public Chunk(Chunk parent) { id = parent.id; + data.addAll(parent.data); pos = 0; } @@ -178,7 +179,7 @@ public int putData(String theString) { return 0; } - public String toString() { + @Override public String toString() { return "Raw"; } } @@ -202,7 +203,7 @@ public StringChunk(String ID, String data/* ="" */) { putData(data); } - public String toString() { + @Override public String toString() { return "String"; } } @@ -211,7 +212,7 @@ public String toString() { * Chunk type template that stores only one integer, general purpose chunk type. */ class IntChunk extends Chunk { - int m_dataSize; + final int m_dataSize; // Gets integer data. public final long getInt() { @@ -235,7 +236,7 @@ public IntChunk(String id, long data) { putNInt((int) data, m_dataSize); } - public String toString() { + @Override public String toString() { return String.format("Integer, size=%d", m_dataSize); } } @@ -250,7 +251,7 @@ public Chunk GetNextChunk(int idSize/* = 4 */) { if (!(id = this.getRndString(idSize)).isEmpty()) { Chunk subChunk = new Chunk(id); - int size = (int) this.getNInt(8); + int size = (int) this.getNInt(4); // sizeof(unsigned long) TODO if (size > 0) { byte[] theData; theData = this.getVector(size); @@ -273,7 +274,7 @@ public void putChunk(Chunk src) { String id = src.getID(); putData(id); - putNInt(src.getSize(), 8); + putNInt(src.getSize(), 4); byte[] data = src.getData(); putData(data); @@ -299,7 +300,7 @@ public static class FailGetChunkException extends RuntimeException { public static class FailPutChunkException extends Exception { } - public String toString() { + @Override public String toString() { return "Chunk"; } } @@ -329,13 +330,13 @@ public CommChunk(Chunk parent, String version) { this.version = version; this.rewindChunk(); - this.channelMode = (int) this.getNInt(8); - this.bitRate = (int) this.getNInt(8); - this.samplingRate = (int) this.getNInt(8); - this.securityLevel = (int) this.getNInt(8); + this.channelMode = (int) this.getNInt(4); + this.bitRate = (int) this.getNInt(4); + this.samplingRate = (int) this.getNInt(4); + this.securityLevel = (int) this.getNInt(4); } - public CommChunk(int channelMode, int bitRate, int samplingRate, int securityLevel, String version/* ="TWIN97012000" */) { + public CommChunk(int channelMode, int bitRate, int samplingRate, int securityLevel, String version /* ="TWIN97012000" */) { super("COMM"); this.version = version; @@ -345,11 +346,10 @@ public CommChunk(int channelMode, int bitRate, int samplingRate, int securityLev this.securityLevel = securityLevel; this.rewindChunk(); - this.putNInt(channelMode, 8); - this.putNInt(bitRate, 8); - this.putNInt(samplingRate, 8); - this.putNInt(securityLevel, 8); - + this.putNInt(channelMode, 4); + this.putNInt(bitRate, 4); + this.putNInt(samplingRate, 4); + this.putNInt(securityLevel, 4); } /** Gets channel mode. */ @@ -381,7 +381,7 @@ public String getVersion() { static class FailConstructionException extends Exception { } - public String toString() { + @Override public String toString() { return "COMM"; } } @@ -390,9 +390,9 @@ public String toString() { * YearChunk */ class YearChunk extends Chunk { - int year; + final int year; - int month; + final int month; public final int getYear() { return year; @@ -417,7 +417,7 @@ public YearChunk(Chunk parent) { month = (int) getNInt(1); } - public String toString() { + @Override public String toString() { return "YEAR"; } } @@ -426,17 +426,17 @@ public String toString() { * EncdChunk */ class EncdChunk extends Chunk { - int year; + final int year; - int month; + final int month; - int day; + final int day; - int hour; + final int hour; - int minute; + final int minute; - int timeZone; + final int timeZone; public final int getYear() { return year; @@ -490,7 +490,7 @@ final int getTimeZone() { timeZone = (int) getNInt(1); } - public String toString() { + @Override public String toString() { return "ENCD"; } } diff --git a/src/main/java/vavi/sound/twinvq/obsolate/HeaderManager.java b/src/main/java/vavi/sound/twinvq/obsolate/HeaderManager.java index 9db32b0..fbf63ca 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/HeaderManager.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/HeaderManager.java @@ -1,23 +1,26 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano + * (c)Copyright 1996-2000 NTT Cyber Space Laboratories + * Modified on 2000.09.06 by N. Iwakami */ package vavi.sound.twinvq.obsolate; +import java.util.HashMap; import java.util.Map; +import vavi.util.Debug; + /** * HeaderManager */ class HeaderManager { + /** Chunk bank of normal chunks */ - private Map primaryChunkBank; + private final Map primaryChunkBank = new HashMap<>(); /** Auxiliary chunk chunk bank */ - private Map secondaryChunkBank; + private final Map secondaryChunkBank = new HashMap<>(); /** TWIN chunk ID, unlike a normal ID, consists of "TWIN" + "version identifier". */ private String chunkID; @@ -32,7 +35,7 @@ static Chunk getChunk(Map chunkBank, String id) { } // If there are no chunks, the process is abandoned. - throw new FailGetChunkException(); + throw new FailGetChunkException(id + " / " + chunkBank); } /** @@ -60,7 +63,6 @@ private static void PickUpSubChunks(Map chunkBank, ChunkChunk inp } catch (ChunkChunk.FailGetChunkException e) { throw new WrongChunkFormatException(); } - } /** @@ -76,9 +78,9 @@ void init(ChunkChunk twinChunk) { ChunkChunk scndChunk = (ChunkChunk) getPrimaryChunk("SCND"); PickUpSubChunks(secondaryChunkBank, scndChunk); } catch (ChunkChunk.FailGetChunkException e) { - // Debug.pprintln("Fail!!"); +// Debug.println("Fail!!"); } catch (FailGetChunkException e) { - // Debug.pprintln("Fail getting SCND chnunk"); +// Debug.println("Fail getting SCND chnunk"); } } @@ -135,6 +137,7 @@ static HeaderManager create(ChunkChunk twinChunk) { /** Failed to get chunk */ static class FailGetChunkException extends RuntimeException { + FailGetChunkException(String m) { super(m); } } } @@ -239,7 +242,7 @@ public final int getSecondaryCharCode() { /** * Constructor, give all necessary information. * - * @param secondary deault = "" + * @param secondary default = "" * @param primCode default = unknown_code * @param scndCode default = unknown_code */ @@ -276,6 +279,7 @@ public final int getSecondaryCharCode() { StringChunk scndChunk = new StringChunk(theManager.getSecondaryChunk(id)); putSecondaryInfo(scndChunk); } catch (HeaderManager.FailGetChunkException e) { +Debug.println(e); } catch (NoCharCodeException e) { throw new FailConstructionException(); } diff --git a/src/main/java/vavi/sound/twinvq/obsolate/MyTwinVQ.java b/src/main/java/vavi/sound/twinvq/obsolate/MyTwinVQ.java new file mode 100644 index 0000000..daeaf5a --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/obsolate/MyTwinVQ.java @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.twinvq.obsolate; + + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; + +import static java.lang.System.getLogger; + + +/** + * MyTwinVQ. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-07-28 nsano initial version
    + */ +public class MyTwinVQ implements TwinVQ { + + private static final Logger logger = getLogger(MyTwinVQ.class.getName()); + + private static final int id = 97012000; + + private HeaderInfo setupInfo; + + @Override + public int TvqEncInitialize(HeaderInfo setupInfo, EncSpecificInfo encInfo, Index index, int dispErrorMessageBox) { +logger.log(Level.TRACE, "TvqEncInitialize: "); + return 0; + } + + @Override + public void TvqEncTerminate(Index index) { +logger.log(Level.TRACE, "TvqEncTerminate: "); + } + + @Override + public void TvqEncGetVectorInfo(int[][] bits0, int[][] bits1) { +logger.log(Level.TRACE, "TvqEncGetVectorInfo: "); + } + + @Override + public void TvqEncResetFrameCounter() { +logger.log(Level.TRACE, "TvqEncResetFrameCounter: "); + } + + @Override + public void TvqEncodeFrame(float[] sig_in, Index index) { +logger.log(Level.TRACE, "TvqEncodeFrame: "); + } + + @Override + public void TvqEncUpdateVectorInfo(int varbits, int ndiv, int[] bits0, int[] bits1) { +logger.log(Level.TRACE, "TvqEncUpdateVectorInfo: "); + } + + @Override + public void TvqEncSetFrameCounter(int position) { +logger.log(Level.TRACE, "TvqEncSetFrameCounter: "); + } + + @Override + public int TvqEncGetFrameSize() { +logger.log(Level.TRACE, "TvqEncGetFrameSize: "); + return 0; + } + + @Override + public int TvqEncGetNumChannels() { +logger.log(Level.TRACE, "TvqEncGetNumChannels: "); + return 0; + } + + @Override + public int TvqEncGetNumFixedBitsPerFrame() { +logger.log(Level.TRACE, "TvqEncGetNumFixedBitsPerFrame: "); + return 0; + } + + @Override + public void TvqEncGetSetupInfo(HeaderInfo setupInfo) { +logger.log(Level.TRACE, "TvqEncGetSetupInfo: "); + } + + @Override + public float TvqEncGetSamplingRate() { +logger.log(Level.TRACE, "TvqEncGetSamplingRate: "); + return 0; + } + + @Override + public int TvqEncGetBitRate() { +logger.log(Level.TRACE, "TvqEncGetBitRate: "); + return 0; + } + + @Override + public void TvqEncGetConfInfo(ConfInfo cf) { +logger.log(Level.TRACE, "TvqEncGetConfInfo: "); + } + + @Override + public int TvqEncGetNumFrames() { +logger.log(Level.TRACE, "TvqEncGetNumFrames: "); + return 0; + } + + @Override + public int TvqGetVersionID(int versionNum, String versionString) { +logger.log(Level.TRACE, "TvqGetVersionID: "); + return 0; + } + + @Override + public int TvqEncCheckVersion(String strTvqID) { +logger.log(Level.TRACE, "TvqEncCheckVersion: "); + return 0; + } + + @Override + public int TvqEncGetModuleVersion(String versionString) { +logger.log(Level.TRACE, "TvqEncGetModuleVersion: "); + return 0; + } + + @Override + public int TvqInitialize(HeaderInfo setupInfo, Index index, int dispErrorMessageBox) { +logger.log(Level.TRACE, "TvqInitialize: "); +logger.log(Level.TRACE, "setupInfo: " + setupInfo); +logger.log(Level.TRACE, "index: " + index); + this.setupInfo = setupInfo; + return 0; + } + + @Override + public void TvqTerminate(Index index) { +logger.log(Level.TRACE, "TvqTerminate: "); + } + + @Override + public void TvqGetVectorInfo(int[][] bits0, int[][] bits1) { +logger.log(Level.TRACE, "TvqGetVectorInfo: "); + } + + @Override + public void TvqResetFrameCounter() { +logger.log(Level.TRACE, "TvqResetFrameCounter: "); + } + + @Override + public void TvqDecodeFrame(Index indexp, float[] out) { +logger.log(Level.TRACE, "TvqDecodeFrame: "); + } + + @Override + public int TvqWtypeToBtype(int w_type, int[] btype) { +logger.log(Level.TRACE, "TvqWtypeToBtype: "); + return 0; + } + + @Override + public void TvqUpdateVectorInfo(int varbits, int[] ndiv, int[] bits0, int[] bits1) { +logger.log(Level.TRACE, "TvqUpdateVectorInfo: "); + } + + @Override + public void TvqSetFrameCounter(int position) { +logger.log(Level.TRACE, "TvqSetFrameCounter: "); + } + + @Override + public int TvqCheckVersion(String versionID) { +logger.log(Level.TRACE, "TvqCheckVersion: " + versionID); + return versionID.startsWith("TWIN") ? id : TVQ_UNKNOWN_VERSION; + } + + @Override + public void TvqGetSetupInfo(HeaderInfo setupInfo) { +logger.log(Level.TRACE, "TvqGetSetupInfo: "); + } + + @Override + public void TvqGetConfInfo(ConfInfo cf) { +logger.log(Level.TRACE, "TvqGetConfInfo: "); + } + + @Override + public int TvqGetFrameSize() { +logger.log(Level.TRACE, "TvqGetFrameSize: "); + return 0; + } + + @Override + public int TvqGetNumChannels() { + int numChannels = setupInfo.channelMode == 1 ? 2 : 1; +logger.log(Level.TRACE, "TvqGetNumChannels: " + numChannels); + return numChannels; + } + + @Override + public int TvqGetBitRate() { +logger.log(Level.TRACE, "TvqGetBitRate: "); + return 0; + } + + @Override + public float TvqGetSamplingRate() { +logger.log(Level.TRACE, "TvqGetSamplingRate: "); + return 0; + } + + @Override + public int TvqGetNumFixedBitsPerFrame() { + int numChannels = setupInfo.channelMode == 1 ? 2 : 1; +logger.log(Level.TRACE, "TvqGetNumFixedBitsPerFrame: "); + return 16 * numChannels; + } + + @Override + public int TvqGetNumFrames() { +logger.log(Level.TRACE, "TvqGetNumFrames: "); + return 0; + } + + @Override + public int TvqGetModuleVersion(byte[] versionString) { +logger.log(Level.TRACE, "TvqGetModuleVersion: "); + return 0; + } + + @Override + public void TvqFbCountUsedBits(int nbit) { +logger.log(Level.TRACE, "TvqFbCountUsedBits: "); + } + + @Override + public float TvqGetFbCurrentBitrate() { +logger.log(Level.TRACE, "TvqGetFbCurrentBitrate: "); + return 0; + } + + @Override + public int TvqGetFbTotalBits() { +logger.log(Level.TRACE, "TvqGetFbTotalBits: "); + return 0; + } +} diff --git a/src/main/java/vavi/sound/twinvq/obsolate/Player.java b/src/main/java/vavi/sound/twinvq/obsolate/Player.java index dc9a7e4..858782c 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/Player.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/Player.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * Copyright (c) 2007 by Naohide Sano, All rights reserved. * * Programmed by Naohide Sano */ @@ -7,8 +7,10 @@ package vavi.sound.twinvq.obsolate; import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.ShortBuffer; import java.util.Arrays; - import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; @@ -17,18 +19,18 @@ import vavi.sound.twinvq.obsolate.TwinVQ.HeaderInfo; import vavi.sound.twinvq.obsolate.TwinVQ.Index; +import static vavi.sound.twinvq.obsolate.TwinVQ.twinVq; + /** * Dreamplayer - multi format sound player */ class Player { - /** */ - static BStream bstream = BStream.getInstance(); /** */ - TwinVQ twinVq = TwinVQ.getInstance(); + static final BStream bstream = BStream.getInstance(); - private int INIT_ERR_DISP_MBOX; + private static final int INIT_ERR_DISP_MBOX = 0; static final int N = 64; @@ -37,8 +39,11 @@ public static void main(String[] args) throws Exception { new Player(args[0]); } + /** + * @param filename in file + */ Player(String filename) throws Exception { - BFile bfile = new BFile(filename, "rb"); + BFile bfile = new BFile(filename, "r"); ChunkChunk twinChunk = bstream.getBsHeaderInfo(bfile); if (twinChunk == null) { @@ -48,8 +53,7 @@ public static void main(String[] args) throws Exception { if (headerManager == null) { throw new IllegalStateException("theHeaderManager=null"); } - HeaderInfo setupInfo = new HeaderInfo(); - getStandardChunkInfo(headerManager, setupInfo); + HeaderInfo setupInfo = getStandardChunkInfo(headerManager); Index index = new Index(); int errcode = twinVq.TvqInitialize(setupInfo, index, INIT_ERR_DISP_MBOX); @@ -92,11 +96,15 @@ public static void main(String[] args) throws Exception { // byte hours, minutes, secs; int wout_flag = 2; @SuppressWarnings("unused") - int counter = 0/*, acttime = 0*/; + int counter = 0 /*, acttime = 0 */; + short[] bufS = new short[buf.length / Short.BYTES]; + ShortBuffer sb = ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer(); - while (bstream.readBsFrame(index, bfile) != 0/* &&!skip_song */) { + while (bstream.readBsFrame(index, bfile) != 0 /* && !skip_song */) { twinVq.TvqDecodeFrame(index, frame); - froat2buf(frame, buf, frameSize, channels); + fr2buf(frame, bufS, frameSize, channels); + sb.put(bufS); + sb.flip(); if (wout_flag == 0) { counter += line.write(buf, 0, frameSize * channels * 2 /* sizeof(short) */); } @@ -133,7 +141,7 @@ HeaderInfo getInfo(BFile bfile, byte[] marker) throws IOException { TwinChunk.putData(chunkSize, chunkData); byte[] lbuf = new byte[TwinVQ.BUFSIZ]; - getString(lbuf, TwinVQ.KEYWORD_BYTES, bfile); + BStream.getString(lbuf, TwinVQ.KEYWORD_BYTES, bfile); if (Arrays.equals(lbuf, "DATA".getBytes())) { throw new IllegalStateException("DEBUG: get_info . no 'DATA' chumk was found"); } @@ -144,12 +152,19 @@ HeaderInfo getInfo(BFile bfile, byte[] marker) throws IOException { return null; } - HeaderInfo setupInfo = new HeaderInfo(); - getStandardChunkInfo(theHeaderManager, setupInfo); + HeaderInfo setupInfo = getStandardChunkInfo(theHeaderManager); return setupInfo; } - static void froat2buf(float[] out, byte[] bufout, int frameSize, int numChannels) { + /** + * Copies frame data to output buffer. + * + * @param out input data frame + * @param bufout output data buffer array + * @param frameSize frame size + * @param numChannels number of channels + */ + static void fr2buf(float[] out, short[] bufout, int frameSize, int numChannels) { int ismp, ich/* , uflag, lflag */; int ptr; float dtmp; @@ -165,42 +180,26 @@ static void froat2buf(float[] out, byte[] bufout, int frameSize, int numChannels dtmp = 32700f; // uflag = 1; } - bufout[ismp * numChannels + ich] = (byte) (dtmp + 0.5); // TODO float -> short + bufout[ismp * numChannels + ich] = (short) (dtmp + 0.5); } else { if (dtmp < -32700.) { dtmp = -32700f; // lflag = 1; } - bufout[ismp * numChannels + ich] = (byte) (dtmp - 0.5); // TODO float -> short + bufout[ismp * numChannels + ich] = (short) (dtmp - 0.5); } } } } - private static int getString(byte[] buf, int nbytes, BFile bfile) throws IOException { - int ichar, ibit; - int[] c = new int[1]; - - for (ichar = 0; ichar < nbytes; ichar++) { - ibit = bfile.getBStream(c, 0, BFile.CHAR_BITS); - if (ibit < BFile.CHAR_BITS) { - break; - } - buf[ichar] = (byte) c[0]; - } - - buf[ichar] = '\0'; - return ichar; - } - - private static int getStandardChunkInfo(HeaderManager theManager, HeaderInfo setupInfo) { - setupInfo = new HeaderInfo(); + private static HeaderInfo getStandardChunkInfo(HeaderManager theManager) { + HeaderInfo setupInfo = new HeaderInfo(); setupInfo.id = theManager.getID().getBytes(); CommChunk commChunk = new CommChunk(theManager.getPrimaryChunk("COMM"), "TWIN97012000"); setupInfo.channelMode = commChunk.getChannelMode(); setupInfo.bitRate = commChunk.getBitRate(); setupInfo.samplingRate = commChunk.getSamplingRate(); setupInfo.securityLevel = commChunk.getSecurityLevel(); - return 0; + return setupInfo; } } diff --git a/src/main/java/vavi/sound/twinvq/obsolate/TwinVQ.java b/src/main/java/vavi/sound/twinvq/obsolate/TwinVQ.java index edecaa3..61785e9 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/TwinVQ.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/TwinVQ.java @@ -1,11 +1,18 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano + * (c)Copyright 1996-2000 NTT Cyber Space Laboratories + * Released on 2000.05.22 by N. Iwakami + * Modified on 2000.05.25 by N. Iwakami + * Released on 2000.09.06 by N. Iwakami */ package vavi.sound.twinvq.obsolate; +import java.util.Arrays; +import java.util.List; +import java.util.StringJoiner; + +import com.sun.jna.Library; +import com.sun.jna.Structure; /** @@ -14,7 +21,16 @@ * @author Naohide Sano (nsano) * @version 0.00 070202 initial version
    */ -final class TwinVQ { +interface TwinVQ extends Library { + + TwinVQ twinVq = new MyTwinVQ(); // Native.load("TwinVQ", TwinVQ.class); + + /** */ + static String asciiz(byte[] b) { + return new String(b).replace("\u0000", ""); + } + +//#region twinvq.h /** Initialization error code */ enum InitErrorCode { @@ -35,13 +51,13 @@ enum InitErrorCode { } /** version ID */ - static final int TVQ_UNKNOWN_VERSION = -1; + int TVQ_UNKNOWN_VERSION = -1; - static final int V2 = 0; + int V2 = 0; - static final int V2PP = 1; + int V2PP = 1; - static final int N_VERSIONS = 2; + int N_VERSIONS = 2; /** window types */ enum WindowType { @@ -65,310 +81,376 @@ enum BlockType { } /** number of block types */ - static final int N_BTYPE = 3; + int N_BTYPE = 3; /** * number of interleave types, enum BLOCK_TYPE is commonly used for * detecting interleave types. */ - static final int N_INTR_TYPE = 4; + int N_INTR_TYPE = 4; /** maximum number of channels */ - static final int N_CH_MAX = 2; + int N_CH_MAX = 2; /** type definition of code information interface */ - static class Index { + class Index extends Structure { /** block type */ - int[] w_type = new int[1]; + public final int[] w_type = new int[1]; - int[] btype = new int[1]; + public final int[] btype = new int[1]; /** FBC info */ - int[][] segment_sw = new int[N_CH_MAX][]; + public final int[][] segment_sw = new int[N_CH_MAX][]; - int[][] band_sw = new int[N_CH_MAX][]; + public final int[][] band_sw = new int[N_CH_MAX][]; - int[][] fg_intensity = new int[N_CH_MAX][]; + public final int[][] fg_intensity = new int[N_CH_MAX][]; /** VQ info */ - int[] wvq; + public int[] wvq; /** BSE info */ - int[] fw; + public int[] fw; - int[] fw_alf; + public int[] fw_alf; /** gain info */ - int[] pow; + public int[] pow; /** LSP info */ - int[][] lsp = new int[N_CH_MAX][]; + public final int[][] lsp = new int[N_CH_MAX][]; /** PPC info */ - int[] pit = new int[N_CH_MAX]; + public final int[] pit = new int[N_CH_MAX]; - int[] pls; + public int[] pls; - int[] pgain = new int[N_CH_MAX]; + public final int[] pgain = new int[N_CH_MAX]; /** EBC info */ - int[][] bc = new int[N_CH_MAX][]; - - Void manager; + public final int[][] bc = new int[N_CH_MAX][]; + + public byte[] manager; + + @Override + protected List getFieldOrder() { + return List.of("w_type", "btype", "segment_sw", "band_sw", "fg_intensity", "wvq", "fw", "fw_alf", + "pow", "lsp", "pit", "pls", "pgain", "bc", "manager"); + } + + @Override public String toString() { + return new StringJoiner(", ", Index.class.getSimpleName() + "[", "]") + .add("w_type=" + Arrays.toString(w_type)) + .add("btype=" + Arrays.toString(btype)) + .add("segment_sw=" + Arrays.toString(segment_sw)) + .add("band_sw=" + Arrays.toString(band_sw)) + .add("fg_intensity=" + Arrays.toString(fg_intensity)) + .add("wvq=" + Arrays.toString(wvq)) + .add("fw=" + Arrays.toString(fw)) + .add("fw_alf=" + Arrays.toString(fw_alf)) + .add("pow=" + Arrays.toString(pow)) + .add("lsp=" + Arrays.toString(lsp)) + .add("pit=" + Arrays.toString(pit)) + .add("pls=" + Arrays.toString(pls)) + .add("pgain=" + Arrays.toString(pgain)) + .add("bc=" + Arrays.toString(bc)) + .add("manager=" + manager) + .toString(); + } } /* type definition of tvqConfInfoSubBlock */ - static class ConfInfoSubBlock { + class ConfInfoSubBlock extends Structure { /** subframe size */ - int sf_sz; + public int sf_sz; /** number of subframes */ - int nsf; + public int nsf; /** number of division of weighted interleave vector quantization */ - int[] ndiv = new int[1]; + public final int[] ndiv = new int[1]; /** number of Bark-scale subbands */ - int ncrb; + public int ncrb; /** number of division of BSE VQ */ - int fw_ndiv; + public int fw_ndiv; /** number of bits for BSE VQ */ - int fw_nbit; + public int fw_nbit; /** number of sub-blocks for gain coding */ - int nsubg; + public int nsubg; /** PPC switch */ - int ppc_enable; + public int ppc_enable; /** EBC switch */ - int ebc_enable; + public int ebc_enable; /** EBC base band */ - int ebc_crb_base; + public int ebc_crb_base; /** EBC bits */ - int ebc_bits; + public int ebc_bits; /** FBC switch */ - int fbc_enable; + public int fbc_enable; /** FBC number of segments */ - int fbc_n_segment; + public int fbc_n_segment; /** FBC number of subbands */ - int fbc_nband; + public int fbc_nband; /** FBC subband table */ - int[] fbc_crb_tbl; + public int[] fbc_crb_tbl = new int[1]; // TODO + + @Override + protected List getFieldOrder() { + return List.of("sf_sz", "nsf", "ndiv", "ncrb", "fw_ndiv", "fw_nbit", "nsubg", "ppc_enable", + "ebc_enable", "ebc_crb_base", "ebc_bits", "fbc_enable", "fbc_n_segment", "fbc_nband", "fbc_crb_tbl"); + } } /** type definition of tvqConfInfo */ - static class ConfInfo { + class ConfInfo extends Structure { /** frame configuration */ - int N_CH; + public int N_CH; /** window type coding */ - int BITS_WTYPE; + public int BITS_WTYPE; /** LSP coding */ - int LSP_BIT0; + public int LSP_BIT0; - int LSP_BIT1; + public int LSP_BIT1; - int LSP_BIT2; + public int LSP_BIT2; - int LSP_SPLIT; + public int LSP_SPLIT; /** Bark-scale envelope coding */ - int FW_ARSW_BITS; + public int FW_ARSW_BITS; /** gain coding */ - int GAIN_BITS; + public int GAIN_BITS; - int SUB_GAIN_BITS; + public int SUB_GAIN_BITS; /** pitch excitation */ - int N_DIV_P; + public int N_DIV_P; - int BASF_BIT; + public int BASF_BIT; - int PGAIN_BIT; + public int PGAIN_BIT; /** block type dependent parameters */ - ConfInfoSubBlock[] cfg = new ConfInfoSubBlock[N_BTYPE]; + public final ConfInfoSubBlock[/* N_BTYPE */] cfg = { new ConfInfoSubBlock(), new ConfInfoSubBlock(), new ConfInfoSubBlock() }; + + @Override + protected List getFieldOrder() { + return List.of("N_CH", "BITS_WTYPE", "LSP_BIT0", "LSP_BIT1", "LSP_BIT2", "LSP_SPLIT", + "FW_ARSW_BITS", "GAIN_BITS", "SUB_GAIN_BITS", "N_DIV_P", "BASF_BIT", "PGAIN_BIT", "cfg"); + } } /* * Definitions about TwinVQ bitstream header */ - static final int BUFSIZ = 1024; + int BUFSIZ = 1024; - static final int KEYWORD_BYTES = 4; + int KEYWORD_BYTES = 4; - static final int VERSION_BYTES = 8; + int VERSION_BYTES = 8; - static final int ELEM_BYTES = 8 /* sizeof(unsigned long) */; + int ELEM_BYTES = 4; // sizeof(unsigned long) TODO - /* - */ - static class HeaderInfo { - byte[] id = new byte[KEYWORD_BYTES + VERSION_BYTES + 1]; + /** */ + class HeaderInfo extends Structure { + public byte[] id = new byte[KEYWORD_BYTES + VERSION_BYTES + 1]; - int size; + public int size; /* Common Chunk */ /** channel mode (mono:0/stereo:1) */ - int channelMode; + public int channelMode; /** bit rate (kbit/s) */ - int bitRate; + public int bitRate; /** sampling rate (44.1 kHz -> 44) */ - int samplingRate; + public int samplingRate; /** security level (always 0) */ - int securityLevel; + public int securityLevel; /** Text Chunk */ - byte[] name = new byte[BUFSIZ]; + public final byte[] name = new byte[BUFSIZ]; - byte[] comt = new byte[BUFSIZ]; + public final byte[] comt = new byte[BUFSIZ]; - byte[] auth = new byte[BUFSIZ]; + public final byte[] auth = new byte[BUFSIZ]; - byte[] cpyr = new byte[BUFSIZ]; + public final byte[] cpyr = new byte[BUFSIZ]; - byte[] file = new byte[BUFSIZ]; + public final byte[] file = new byte[BUFSIZ]; /** add by OKAMOTO 99.12.21 */ - byte[] extr = new byte[BUFSIZ]; + public final byte[] extr = new byte[BUFSIZ]; /** Data size chunk */ - int dsiz; + public int dsiz; /** extended tags - added by Pawel Garbacz */ - byte[] albm = new byte[BUFSIZ]; + public final byte[] albm = new byte[BUFSIZ]; + + public final byte[] year = new byte[BUFSIZ]; + + public final byte[] trck = new byte[BUFSIZ]; + + @Override + protected List getFieldOrder() { + return List.of("id", "size", "channelMode", "bitRate", "samplingRate", "securityLevel", "name", + "comt", "auth", "cpyr", "file", "extr", "dsiz", "albm", "year", "trck"); + } + + @Override public String toString() { + return new StringJoiner(", ", HeaderInfo.class.getSimpleName() + "[", "]") + .add("id=" + asciiz(id)) + .add("size=" + size) + .add("channelMode=" + channelMode) + .add("bitRate=" + bitRate) + .add("samplingRate=" + samplingRate) + .add("securityLevel=" + securityLevel) + .add("name=" + asciiz(name)) + .add("comt=" + asciiz(comt)) + .add("auth=" + asciiz(auth)) + .add("cpyr=" + asciiz(cpyr)) + .add("file=" + asciiz(file)) + .add("extr=" + asciiz(extr)) + .add("dsiz=" + dsiz) + .add("albm=" + asciiz(albm)) + .add("year=" + asciiz(year)) + .add("trck=" + asciiz(trck)) + .toString(); + } + } - byte[] year = new byte[BUFSIZ]; +//#endregion - byte[] trck = new byte[BUFSIZ]; - } +//#region tvqenc.h // encoding - static class EncSpecificInfo { + class EncSpecificInfo { int N_CAN_GLOBAL; } - native int TvqEncInitialize(HeaderInfo setupInfo, EncSpecificInfo encInfo, Index index, int dispErrorMessageBox); +//#endregion + +//#region tvqdec.h + + int TvqEncInitialize(HeaderInfo setupInfo, EncSpecificInfo encInfo, Index index, int dispErrorMessageBox); - native void TvqEncTerminate(Index index); + void TvqEncTerminate(Index index); - native void TvqEncGetVectorInfo(int[][] bits0, int[][] bits1); + void TvqEncGetVectorInfo(int[][] bits0, int[][] bits1); - native void TvqEncResetFrameCounter(); + void TvqEncResetFrameCounter(); // TwinVQ encoder function - native void TvqEncodeFrame(float[] sig_in, Index index); + void TvqEncodeFrame(float[] sig_in, Index index); - native void TvqEncUpdateVectorInfo(int varbits, int ndiv, int[] bits0, int[] bits1); + void TvqEncUpdateVectorInfo(int varbits, int ndiv, int[] bits0, int[] bits1); - native void TvqEncSetFrameCounter(int position); + void TvqEncSetFrameCounter(int position); // TwinVQ query functions - native int TvqEncGetFrameSize(); + int TvqEncGetFrameSize(); - native int TvqEncGetNumChannels(); + int TvqEncGetNumChannels(); - native int TvqEncGetNumFixedBitsPerFrame(); + int TvqEncGetNumFixedBitsPerFrame(); - native void TvqEncGetSetupInfo(HeaderInfo setupInfo); + void TvqEncGetSetupInfo(HeaderInfo setupInfo); - native float TvqEncGetSamplingRate(); + float TvqEncGetSamplingRate(); - native int TvqEncGetBitRate(); + int TvqEncGetBitRate(); - native void TvqEncGetConfInfo(ConfInfo cf); + void TvqEncGetConfInfo(ConfInfo cf); - native int TvqEncGetNumFrames(); + int TvqEncGetNumFrames(); - native int TvqGetVersionID(int versionNum, String versionString); + int TvqGetVersionID(int versionNum, String versionString); - native int TvqEncCheckVersion(String strTvqID); + int TvqEncCheckVersion(String strTvqID); - native int TvqEncGetModuleVersion(String versionString); + int TvqEncGetModuleVersion(String versionString); // decoding - native int TvqInitialize(HeaderInfo setupInfo, Index index, int dispErrorMessageBox); + int TvqInitialize(HeaderInfo setupInfo, Index index, int dispErrorMessageBox); - native void TvqTerminate(Index index); + void TvqTerminate(Index index); - native void TvqGetVectorInfo(int[][] bits0, int[][] bits1); + void TvqGetVectorInfo(int[][] bits0, int[][] bits1); - native void TvqResetFrameCounter(); + void TvqResetFrameCounter(); // TwinVQ decoder function - native void TvqDecodeFrame(Index indexp, float[] out); + void TvqDecodeFrame(Index indexp, float[] out); - native int TvqWtypeToBtype(int w_type, int[] btype); + int TvqWtypeToBtype(int w_type, int[] btype); - native void TvqUpdateVectorInfo(int varbits, int[] ndiv, int[] bits0, int[] bits1); + void TvqUpdateVectorInfo(int varbits, int[] ndiv, int[] bits0, int[] bits1); - native void TvqSetFrameCounter(int position); + void TvqSetFrameCounter(int position); /** TwinVQ query functions */ - native int TvqCheckVersion(String versionID); + int TvqCheckVersion(String versionID); /** setup information */ - native void TvqGetSetupInfo(HeaderInfo setupInfo); + void TvqGetSetupInfo(HeaderInfo setupInfo); /** configuration information */ - native void TvqGetConfInfo(ConfInfo cf); + void TvqGetConfInfo(ConfInfo cf); /** frame size */ - native int TvqGetFrameSize(); + int TvqGetFrameSize(); /** number of channels */ - native int TvqGetNumChannels(); + int TvqGetNumChannels(); /** total bitrate */ - native int TvqGetBitRate(); + int TvqGetBitRate(); /** sampling rate */ - native float TvqGetSamplingRate(); + float TvqGetSamplingRate(); /** number of fixed bits per frame */ - native int TvqGetNumFixedBitsPerFrame(); + int TvqGetNumFixedBitsPerFrame(); /** number of decoded frame */ - native int TvqGetNumFrames(); + int TvqGetNumFrames(); - native int TvqGetModuleVersion(String versionString); + int TvqGetModuleVersion(byte[] versionString); - // V2PLUS SUPPORT - /** - * TwinVQ FB coding tool control count number of used bits - */ - native void TvqFbCountUsedBits(int nbit); +//#region V2PLUS_SUPPORT - /** query average bitrate for the tool */ - native float TvqGetFbCurrentBitrate(); + // TwinVQ FB coding tool control - /** query total number of used bits */ - native int TvqGetFbTotalBits(); + /** count number of used bits */ + void TvqFbCountUsedBits(int nbit); - // + /** query average bitrate for the tool */ + float TvqGetFbCurrentBitrate(); - private static final TwinVQ instance = new TwinVQ(); + /** query total number of used bits */ + int TvqGetFbTotalBits(); - private TwinVQ() { - } +//#endregion - public static TwinVQ getInstance() { - return instance; - } +//#endregion } diff --git a/src/main/java/vavi/sound/twinvq/obsolate/TwinVQInputStream.java b/src/main/java/vavi/sound/twinvq/obsolate/TwinVQInputStream.java index f691a45..0e94012 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/TwinVQInputStream.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/TwinVQInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * Copyright (c) 2007 by Naohide Sano, All rights reserved. * * Programmed by Naohide Sano */ @@ -17,6 +17,8 @@ import vavi.util.Debug; +import static vavi.sound.twinvq.obsolate.TwinVQ.twinVq; + /** * TwinVQInputStream. @@ -29,8 +31,7 @@ public class TwinVQInputStream extends FilterInputStream { /** byte order of the stream obtained with this class */ private final ByteOrder byteOrder; - /** - */ + /** */ public TwinVQInputStream(InputStream in, int samplesPerBlock, int channels, @@ -44,8 +45,7 @@ public TwinVQInputStream(InputStream in, ByteOrder.BIG_ENDIAN); } - /** - */ + /** */ public TwinVQInputStream(InputStream in, int samplesPerBlock, int channels, @@ -64,8 +64,6 @@ public TwinVQInputStream(InputStream in, // - TwinVQ decoder = TwinVQ.getInstance(); - InputStream is = new BufferedInputStream(in); byte[] packet = new byte[blockSize]; @@ -73,54 +71,49 @@ public TwinVQInputStream(InputStream in, // - @SuppressWarnings("resource") PipedOutputStream pos = - new PipedOutputStream((PipedInputStream) this.in); + PipedOutputStream pos = new PipedOutputStream((PipedInputStream) this.in); - Thread thread = new Thread(new Runnable() { - /** */ - @Override - public void run() { + Thread thread = new Thread(() -> { - DataOutputStream os = null; + DataOutputStream os = null; - try { - // big endian - os = new DataOutputStream(pos); + try { + // big endian + os = new DataOutputStream(pos); - int done = 0; - while (done < -1) { + int done = 0; + while (done < -1) { - int l = 0; - while (l < packet.length && is.available() > 0) { - l += is.read(packet, l, packet.length - l); - } + int l = 0; + while (l < packet.length && is.available() > 0) { + l += is.read(packet, l, packet.length - l); + } - int samplesThisBlock = samplesPerBlock; + int samplesThisBlock = samplesPerBlock; //Debug.println("samplesThisBlock: " + samplesThisBlock + ", " + l); - TwinVQ.Index index = new TwinVQ.Index(); - decoder.TvqDecodeFrame(index , null); + TwinVQ.Index index = new TwinVQ.Index(); + twinVq.TvqDecodeFrame(index , null); - for (int i = 0; i < samplesThisBlock; i++) { - if (ByteOrder.BIG_ENDIAN.equals(byteOrder)) { - os.writeShort(samples[i]); - } else { - os.write( samples[i] & 0x00ff); - os.write((samples[i] & 0xff00) >> 8); - } + for (int i = 0; i < samplesThisBlock; i++) { + if (ByteOrder.BIG_ENDIAN.equals(byteOrder)) { + os.writeShort(samples[i]); + } else { + os.write( samples[i] & 0x00ff); + os.write((samples[i] & 0xff00) >> 8); } - done += samplesThisBlock; -//Debug.println("done: " + done); } - } catch (IOException e) { + done += samplesThisBlock; +//Debug.println("done: " + done); + } + } catch (IOException e) { Debug.printStackTrace(e); - } finally { - try { - os.flush(); - os.close(); - } catch (IOException e) { + } finally { + try { + os.flush(); + os.close(); + } catch (IOException e) { Debug.println(e); - } } } }); diff --git a/src/main/java/vavi/sound/twinvq/obsolate/TwinVQOutputStream.java b/src/main/java/vavi/sound/twinvq/obsolate/TwinVQOutputStream.java index 5e0cc44..5ab110c 100644 --- a/src/main/java/vavi/sound/twinvq/obsolate/TwinVQOutputStream.java +++ b/src/main/java/vavi/sound/twinvq/obsolate/TwinVQOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * Copyright (c) 2007 by Naohide Sano, All rights reserved. * * Programmed by Naohide Sano */ @@ -16,6 +16,8 @@ import vavi.io.LittleEndianDataInputStream; import vavi.util.Debug; +import static vavi.sound.twinvq.obsolate.TwinVQ.twinVq; + /** * TwinVQOutputStream. @@ -58,8 +60,6 @@ public TwinVQOutputStream(OutputStream out, ByteOrder byteOrder) @Override public void close() throws IOException { - TwinVQ encoder = TwinVQ.getInstance(); - try { LittleEndianDataInputStream ledis = new LittleEndianDataInputStream(new ByteArrayInputStream(((ByteArrayOutputStream) out).toByteArray())); int length = ledis.available(); @@ -72,7 +72,7 @@ public void close() throws IOException { ledis.close(); TwinVQ.Index i = new TwinVQ.Index(); - encoder.TvqEncodeFrame(null, i); + twinVq.TvqEncodeFrame(null, i); realOut.write(adpcm); diff --git a/src/main/java/vavi/sound/twinvq/obsolate/readme.md b/src/main/java/vavi/sound/twinvq/obsolate/readme.md new file mode 100644 index 0000000..8795e08 --- /dev/null +++ b/src/main/java/vavi/sound/twinvq/obsolate/readme.md @@ -0,0 +1,6 @@ +# vavi.sound.twinvq.obsolate + +# References + + * https://github.com/enzo1982/BoCA/tree/master/components/decoder/twinvq/twinvq + * https://web.archive.org/web/20021227130132/http://www.twinvq.org/english/k_hchun_en.html diff --git a/src/main/java/vavi/sound/twinvq/readme.md b/src/main/java/vavi/sound/twinvq/readme.md index d2bff9d..24ffcbc 100644 --- a/src/main/java/vavi/sound/twinvq/readme.md +++ b/src/main/java/vavi/sound/twinvq/readme.md @@ -4,6 +4,9 @@ Provides TwinVQ sound related classes. ## References + * https://github.com/libav/libav/blob/master/libavcodec/twinvqdec.c + * https://github.com/libav/libav/blob/master/libavformat/vqf.c + ### License ## TODO diff --git a/src/main/java/vavi/sound/vsq/block/BPList.java b/src/main/java/vavi/sound/vsq/block/BPList.java index 2e2f0a5..cc77831 100644 --- a/src/main/java/vavi/sound/vsq/block/BPList.java +++ b/src/main/java/vavi/sound/vsq/block/BPList.java @@ -48,18 +48,13 @@ public class BPList implements Block { */ String id; - /** */ - public static class Pair { - public long tick; - public int id; - public Pair(long tick, int id) { - this.tick = tick; - this.id = id; - } + /** */ + public record Pair(long tick, int id) { + } /** */ - protected List bps = new ArrayList<>(); + protected final List bps = new ArrayList<>(); /** */ public static Block newInstance(String label, List params) { diff --git a/src/main/java/vavi/sound/vsq/block/Common.java b/src/main/java/vavi/sound/vsq/block/Common.java index 1b29fca..363320a 100644 --- a/src/main/java/vavi/sound/vsq/block/Common.java +++ b/src/main/java/vavi/sound/vsq/block/Common.java @@ -37,22 +37,19 @@ public static Block newInstance(String label, List params) { Common block = new Common(); for (String param : params) { String[] pair = param.split("="); - if ("Version".equals(pair[0])) { - block.version = pair[1]; - } else if ("Name".equals(pair[0])) { - block.name = pair[1]; - } else if ("Color".equals(pair[0])) { - String[] rgb = pair[1].split(","); - int r = Integer.parseInt(rgb[0]); - int g = Integer.parseInt(rgb[1]); - int b = Integer.parseInt(rgb[2]); - block.color = new Color(r, g, b); - } else if ("DynamicsMode".equals(pair[0])) { - block.dynamicsMode = Integer.parseInt(pair[1]); - } else if ("PlayMode".equals(pair[0])) { - block.playMode = Integer.parseInt(pair[1]); - } else { -Debug.println("unhandled param: " + pair[0]); + switch (pair[0]) { + case "Version" -> block.version = pair[1]; + case "Name" -> block.name = pair[1]; + case "Color" -> { + String[] rgb = pair[1].split(","); + int r = Integer.parseInt(rgb[0]); + int g = Integer.parseInt(rgb[1]); + int b = Integer.parseInt(rgb[2]); + block.color = new Color(r, g, b); + } + case "DynamicsMode" -> block.dynamicsMode = Integer.parseInt(pair[1]); + case "PlayMode" -> block.playMode = Integer.parseInt(pair[1]); + case null, default -> Debug.println("unhandled param: " + pair[0]); } } return block; diff --git a/src/main/java/vavi/sound/vsq/block/Event.java b/src/main/java/vavi/sound/vsq/block/Event.java index fc46a1a..f6db5b8 100644 --- a/src/main/java/vavi/sound/vsq/block/Event.java +++ b/src/main/java/vavi/sound/vsq/block/Event.java @@ -74,34 +74,21 @@ public static Block newInstance(String label, List params) { block.id = label; for (String param : params) { String[] pair = param.split("="); - if ("Type".equals(pair[0])) { - block.type = pair[1]; - } else if ("IconHandle".equals(pair[0])) { - block.iconHandle = pair[1]; - } else if ("Length".equals(pair[0])) { - block.length = Integer.parseInt(pair[1]); - } else if ("Note#".equals(pair[0])) { - block.note = Integer.parseInt(pair[1]); - } else if ("Dynamics".equals(pair[0])) { - block.dynamics = Integer.parseInt(pair[1]); - } else if ("PMBendDepth".equals(pair[0])) { - block.pmBendDepth = Integer.parseInt(pair[1]); - } else if ("PMBendLength".equals(pair[0])) { - block.pmBendLength = Integer.parseInt(pair[1]); - } else if ("PMbPortamentoUse".equals(pair[0])) { - block.pmbPortamentoUse = Integer.parseInt(pair[1]); - } else if ("DEMdecGainRate".equals(pair[0])) { - block.demDecGainRate = Integer.parseInt(pair[1]); - } else if ("DEMaccent".equals(pair[0])) { - block.demAccent = Integer.parseInt(pair[1]); - } else if ("LyricHandle".equals(pair[0])) { - block.lyricHandle = pair[1]; - } else if ("VibratoHandle".equals(pair[0])) { - block.vibratoHandle = pair[1]; - } else if ("VibratoDelay".equals(pair[0])) { - block.vibratoDelay = Integer.parseInt(pair[1]); - } else { -Debug.println("unhandled param: " + pair[0]); + switch (pair[0]) { + case "Type" -> block.type = pair[1]; + case "IconHandle" -> block.iconHandle = pair[1]; + case "Length" -> block.length = Integer.parseInt(pair[1]); + case "Note#" -> block.note = Integer.parseInt(pair[1]); + case "Dynamics" -> block.dynamics = Integer.parseInt(pair[1]); + case "PMBendDepth" -> block.pmBendDepth = Integer.parseInt(pair[1]); + case "PMBendLength" -> block.pmBendLength = Integer.parseInt(pair[1]); + case "PMbPortamentoUse" -> block.pmbPortamentoUse = Integer.parseInt(pair[1]); + case "DEMdecGainRate" -> block.demDecGainRate = Integer.parseInt(pair[1]); + case "DEMaccent" -> block.demAccent = Integer.parseInt(pair[1]); + case "LyricHandle" -> block.lyricHandle = pair[1]; + case "VibratoHandle" -> block.vibratoHandle = pair[1]; + case "VibratoDelay" -> block.vibratoDelay = Integer.parseInt(pair[1]); + case null, default -> Debug.println("unhandled param: " + pair[0]); } } return block; diff --git a/src/main/java/vavi/sound/vsq/block/EventList.java b/src/main/java/vavi/sound/vsq/block/EventList.java index 315f351..2a2d899 100644 --- a/src/main/java/vavi/sound/vsq/block/EventList.java +++ b/src/main/java/vavi/sound/vsq/block/EventList.java @@ -22,8 +22,8 @@ public class EventList implements Block { /** */ public static class Pair { - public long tick; - public String id; + public final long tick; + public final String id; public Pair(long tick, String id) { this.tick = tick; this.id = id; diff --git a/src/main/java/vavi/sound/vsq/block/Handle.java b/src/main/java/vavi/sound/vsq/block/Handle.java index e7c2fa3..2ee22fe 100644 --- a/src/main/java/vavi/sound/vsq/block/Handle.java +++ b/src/main/java/vavi/sound/vsq/block/Handle.java @@ -71,40 +71,24 @@ public static Block newInstance(String label, List params) { block.id = label; for (String param : params) { String[] pair = param.split("="); - if ("L0".equals(pair[0])) { - block.l0 = pair[1]; - } else if ("IconID".equals(pair[0])) { - block.iconID = pair[1]; - } else if ("IDS".equals(pair[0])) { - block.ids = pair[1]; - } else if ("Original".equals(pair[0])) { - block.original = Integer.parseInt(pair[1]); - } else if ("Caption".equals(pair[0])) { - block.caption = pair.length == 2 ? pair[1] : null; - } else if ("Length".equals(pair[0])) { - block.length = Integer.parseInt(pair[1]); - } else if ("StartDepth".equals(pair[0])) { - block.startDepth = Integer.parseInt(pair[1]); - } else if ("DepthBPNum".equals(pair[0])) { - block.depthBPNum = Integer.parseInt(pair[1]); - } else if ("StartRate".equals(pair[0])) { - block.startRate = Integer.parseInt(pair[1]); - } else if ("RateBPNum".equals(pair[0])) { - block.rateBPNum = Integer.parseInt(pair[1]); - } else if ("Language".equals(pair[0])) { - block.language = Integer.parseInt(pair[1]); - } else if ("OpusTest".equals(pair[0])) { - block.program = Integer.parseInt(pair[1]); - } else if ("DepthBPX".equals(pair[0])) { - block.depthBPX = pair[1]; - } else if ("DepthBPY".equals(pair[0])) { - block.depthBPY = pair[1]; - } else if ("RateBPX".equals(pair[0])) { - block.rateBPX = pair[1]; - } else if ("RateBPY".equals(pair[0])) { - block.rateBPY = pair[1]; - } else { -Debug.println("unhandled param: " + pair[0]); + switch (pair[0]) { + case "L0" -> block.l0 = pair[1]; + case "IconID" -> block.iconID = pair[1]; + case "IDS" -> block.ids = pair[1]; + case "Original" -> block.original = Integer.parseInt(pair[1]); + case "Caption" -> block.caption = pair.length == 2 ? pair[1] : null; + case "Length" -> block.length = Integer.parseInt(pair[1]); + case "StartDepth" -> block.startDepth = Integer.parseInt(pair[1]); + case "DepthBPNum" -> block.depthBPNum = Integer.parseInt(pair[1]); + case "StartRate" -> block.startRate = Integer.parseInt(pair[1]); + case "RateBPNum" -> block.rateBPNum = Integer.parseInt(pair[1]); + case "Language" -> block.language = Integer.parseInt(pair[1]); + case "OpusTest" -> block.program = Integer.parseInt(pair[1]); + case "DepthBPX" -> block.depthBPX = pair[1]; + case "DepthBPY" -> block.depthBPY = pair[1]; + case "RateBPX" -> block.rateBPX = pair[1]; + case "RateBPY" -> block.rateBPY = pair[1]; + case null, default -> Debug.println("unhandled param: " + pair[0]); } } return block; diff --git a/src/main/java/vavix/rococoa/avfoundation/AVSpeechSynthesizer.java b/src/main/java/vavix/rococoa/avfoundation/AVSpeechSynthesizer.java index 36ca1d8..bf630a0 100644 --- a/src/main/java/vavix/rococoa/avfoundation/AVSpeechSynthesizer.java +++ b/src/main/java/vavix/rococoa/avfoundation/AVSpeechSynthesizer.java @@ -6,7 +6,6 @@ package vavix.rococoa.avfoundation; -import com.sun.jna.Pointer; import org.rococoa.ID; import org.rococoa.ObjCBlock; import org.rococoa.ObjCBlocks.BlockLiteral; diff --git a/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider b/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider index 7315908..5f641bf 100644 --- a/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider +++ b/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider @@ -1,3 +1,5 @@ vavi.sound.sampled.opus.OpusFormatConversionProvider #vavi.sound.sampled.rococoa.RococoaFormatConversionProvider vavi.sound.sampled.opl3.Opl3FormatConversionProvider +vavi.sound.sampled.ldclep.LdCelpFormatConversionProvider +vavi.sound.sampled.ilbc.IlbcFormatConversionProvider diff --git a/src/test/resources/fmparameters.txt b/src/main/resources/fmparameters.txt similarity index 100% rename from src/test/resources/fmparameters.txt rename to src/main/resources/fmparameters.txt diff --git a/src/main/resources/vavi/sound/twinvq/cb0808l0.txt b/src/main/resources/vavi/sound/twinvq/cb0808l0.txt new file mode 100644 index 0000000..b525d9e --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb0808l0.txt @@ -0,0 +1,136 @@ +96, -12592, -12443, 425, 182, -456, -341, -843, +615, 689, 982, 1470, -518, 231, -538, 282, +409, -600, -303, -29, 51, -4, -115, 79, +-27, 450, -937, -461, -554, -159, 426, 710, +-29106, -2148, 99, 3426, 1838, 12427, 585, -2080, +-2524, -474, 1572, 718, 578, -344, 188, 328, +12125, 112, 654, -1232, -1644, 288, 553, 1513, +966, 1012, 49, 631, -111, -238, -116, -182, +-21, -46, 334, 11013, -454, -261, 12, 21, +52, -20440, -295, -502, -516, -329, -230, 465, +59, 270, 971, -127, 505, -194, 43, -30, +300, 38, 665, -613, 33, -172, -153, 323, +-166, 54, 399, 109, 186, -1765, -222, 138, +16, 204, 30111, 208, -564, -612, 156, -146, +-345, 321, -138, 202, -184, 93, 710, -15945, +-13401, 234, -1113, 146, -9, 56, -628, -834, +-1268, 872, 61, -1184, -126, -205, 145, -109, +-8248, 113, -146, 1288, 9142, 857, -782, -686, +-256, -650, 1061, -202, 12, -709, -88, 273, +497, 150, -59, -8807, 240, 532, 16, 1482, +11012, -444, 1918, -1786, 1934, 172, 598, -1324, +5638, -3166, 492, -545, -770, 1067, 0, -356, +-421, 1684, 273, -502, 316, 1116, 807, -529, +-831, -13379, -420, 236, 470, -2590, -193, -47, +580, -1613, 798, 27, -16, -12768, -893, 256, +0, 1659, 1463, 544, 196, -30444, 314, -421, +508, -276, -173, 414, -380, -371, -40, -121, +375, 432, -438, 1, -350, -280, 1198, -373, +452, 100, -68, 9053, 165, 770, 73, 291, +717, 515, 596, -323, -4, -2, 803, 738, +2605, 30, 73, 455, 11280, 1534, -283, 1502, +-9126, -4760, -570, 483, -179, -8628, -1639, 322, +-56, 6149, -3330, 114, 4598, -1976, -34, -56, +840, 753, 12292, -7100, -492, 320, -412, 908, +1186, 444, 6546, -788, 5394, 697, 13105, 194, +-394, 294, 2639, 12, -1009, -1426, -36, 2106, +-252, -31979, -66, 341, 996, 298, 105, 6, +10, 106, -498, -244, -105, -574, 16, -206, +24, -2067, -381, 10265, -103, -762, -785, -2036, +-11927, 16, -710, -35, -270, -99, 4, 772, +-272, -186, -328, -14936, -57, -1357, -175, -606, +220, 918, -11, 398, -189, -278, 138, 429, +509, -701, -43, -42, -630, -560, 11736, -528, +10286, -633, -870, 423, 550, -888, 297, -170, +258, 2234, 486, 292, -446, -11858, 10008, 52, +1203, -164, 810, -1527, -604, -883, -588, -96, +332, 148, -180, 223, 356, 285, 434, -57, +-172, -520, -432, -72, 294, -93, -134, 316, +30647, -351, 278, 84, -439, 589, 105, 1001, +297, 660, 196, 171, 178, -90, -55, 1172, +21100, 227, -288, 372, 162, 458, -555, -1329, +380, 366, -104, 105, 674, -378, 1328, 283, +-1928, 549, 762, 454, 55, 606, 12499, 24, +435, 23, 29, 6170, 1129, -95, 97, 569, +132, 491, 164, -288, -1011, -134, 1234, -427, +-254, -524, 226, -14114, 328, -70, 1666, -189, +-2352, 1097, 619, 632, -981, 745, 587, -27, +-200, -871, 50, 470, -246, 2610, 581, 254, +9893, -586, 880, -11894, 386, 1135, 117, 1072, +116, -830, -160, -1002, -699, -66, -230, -260, +112, 106, 221, 297, -47, 7642, 170, -330, +-599, -51, -476, 33, 475, 624, 6199, -350, +-406, 184, 906, -528, 382, 401, 348, 26, +-186, 33, -130, -62, -50, 1268, -132, -109, +1164, -354, 675, 3, -402, -244, 644, 648, +-132, -4, 45, 20386, -136, 568, 126, 376, +14476, -376, 267, 13518, -260, 111, 1014, 758, +439, 551, -164, 207, 128, -416, 616, 690, +-9460, -1856, 1123, 826, -265, -762, 1596, -632, +52, -622, -894, 367, -433, -100, 1873, 756, +-17436, 168, -541, 550, 145, -5612, -1057, -1344, +-656, -194, 216, -500, -245, 246, 64, 688, +727, 12538, -5492, 252, -908, -424, -532, -659, +-277, -230, -736, -183, 35, -228, 200, -12, +-248, -60, -493, 433, 446, 366, -644, 92, +-324, 29, 833, -21542, -977, 94, 379, 49, +-1058, 248, -178, 85, -961, -1198, -48, 467, +-242, -10202, 1556, 11263, -716, 814, -1686, 3594, +-27, 694, -802, 390, 4144, -663, 44, -546, +312, -28, -484, 981, -307, 496, 408, 203, +12543, 296, -1240, 159, 846, -957, -1493, -618, +1593, 11868, 2616, 1954, 412, -922, -1320, 3325, +-254, -1892, 607, -2223, -8745, -1486, 17, 343, +-50, -562, 22011, -350, -491, -70, -60, 617, +768, -346, 387, 660, 1409, 222, 616, 173, +-1323, 4017, -207, -525, -13243, 11, 440, -614, +-280, 549, -670, -79, 459, 560, -102, -214, +-54, -1201, 230, -526, 857, 1044, -369, 2470, +-11010, -12586, 243, -205, 838, -920, 348, -738, +1319, 86, -78, -428, -1909, -155, 2, 508, +711, -292, 1699, 225, -101, -163, 540, 9692, +235, -183, -38, 198, -466, -204, -8957, -914, +-299, 193, 10, 723, 643, -533, -1418, 323, +20, 334, -886, -331, 368, 130, -30233, -152, +-14, 637, 132, -232, -149, -430, 64, -243, +-376, 370, 388, 196, -1098, 117, -794, -16, +-274, 348, 464, -28156, 184, 322, -101, 2, +-27, -183, 610, 256, -160, -573, -226, 588, +1613, 1028, 9518, -2151, -1602, -528, -356, -116, +-11511, 1828, -2206, -47, -757, -1479, -1429, -14717, +1686, 253, 802, 462, -37, -916, -289, -401, +13383, 353, -74, 114, -189, 636, 434, -639, +1013, 234, 11752, 219, 1464, -132, -12838, 125, +-592, -40, -162, -1772, 506, 479, 422, 36, +15, -960, 799, 517, 1311, -409, 748, 729, +446, 11029, -13039, 1257, -651, -13, -742, 1416, +-388, -274, -795, 163, -572, 74, 430, -90, +-126, -74, -598, 140, 125, -20, -20332, 208, +37, 19, -174, -209, 305, 28, -402, 28, +-315, -1, -134, 440, -832, 79, -635, -304, +8, -32768, 625, 470, -1224, -351, 546, -1171, +-706, 652, 31, 7484, -448, 916, 1244, -379, +-300, 68, 868, 607, 247, 70, -984, 14314, +21, -350, -82, 368, 456, -742, 472, 34, +782, -498, -879, 700, 417, 216, 415, -161, +-181, -608, 1570, 862, -96, -114, 8095, -26, +168, -363, -804, -36, -770, 139, -171, 6645, +-1425, 4826, -5288, 1358, -11747, -64, 650, -3206, +-1692, 789, -2047, -279, 916, -1648, 1164, 2044, +-144, -717, -392, -216, 372, 348, 1052, -175, +668, 308, -15, 29112, -406, -774, 365, -1006, +-526, 1076, 59, -672, -87, -106, 174, 96, +615, 462, -43, -496, 112, 149, -56, -182, +-268, -32768, -205, -676, 165, -1210, -325, 7964, +-44, 546, -699, 285, -418, 355, 238, 550, +67, 425, 384, -950, -330, -208, -452, 212, +11610, -190, 37, -907, -11137, -982, 585, -783, +-864, 164, -24, -514, -211, 2, -510, -580, +595, 128, 100, -229, -55, 290, -539, 40, +-7786, -270, 295, -508, 562, -1196, 218, 33, +3788, -8954, -1082, 297, -906, -322, 123, 1162, +-343, -11655, 88, -28, 1173, 9, -99, 36, +-11987, 356, 12630, 767, -183, -983, -559, 186, +1148, 530, -440, 1230, -456, -133, -424, 35, +-357, 418, 1457, -687, 740, -242, 17855, -368, +-1057, -262, -646, 406, -712, -1058, -84, 454 diff --git a/src/main/resources/vavi/sound/twinvq/cb0808l1.txt b/src/main/resources/vavi/sound/twinvq/cb0808l1.txt new file mode 100644 index 0000000..25e0b90 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb0808l1.txt @@ -0,0 +1,136 @@ +982, -26, -721, 359, 509, 13290, 2391, 727, +325, 328, 269, -156, 346, -242, -31, -356, +741, 396, -98, 108, 35, -237, -29684, 196, +-69, 462, -339, 24, -1221, 352, -658, 396, +243, -1658, -458, -1153, 5, -662, -47, 18, +-572, -567, -2084, -980, -210, 150, -396, 14836, +-210, 0, -162, -539, 588, -868, 248, -8576, +1020, 526, 1056, 262, -149, 818, -1353, -1120, +767, -738, -634, -14742, -105, 811, 1718, -116, +-64, 307, 920, -1244, 2388, 10213, -4505, -250, +617, -1725, -645, 1258, 1146, -590, 707, -12, +372, 1794, 1012, -149, 404, -978, -306, 168, +-1536, 89, 142, 938, -19891, 973, -481, -419, +-904, -455, -1821, -1617, 654, -2022, 1906, -497, +-11346, -330, -11679, -14, 1, 535, -377, 1057, +-214, -213, 430, -13, -3379, -11250, 911, -716, +-240, -10, 260, 132, -611, -64, -594, -8540, +837, -3717, -1154, 906, 10623, -502, -167, 67, +119, 13501, -1469, 213, -1048, -1403, 432, -1079, +45, -230, -730, -203, -595, -1150, -460, -97, +395, -304, 27816, -300, -16, 153, -671, 551, +436, -956, -182, 194, 113, -5504, 194, 263, +-332, -517, -244, -396, 540, 56, -371, 446, +147, -66, 7, -306, 1440, -308, 327, 645, +597, -6642, 72, 392, -138, -50, -144, -262, +504, -230, 114, 2076, 8175, 1188, 290, -872, +202, 69, 82, -281, -126, -291, -158, -152, +-45, 239, 153, -516, -422, -691, 801, 28, +496, -298, -11118, 10430, -227, -851, 214, -801, +538, 834, -137, 942, 573, 405, 1308, 2234, +300, 1269, 12361, -752, 2177, -743, 60, 464, +946, 302, -422, 116, -1200, -110, -843, 284, +-578, 732, -308, 153, -64, 156, 225, -29232, +-452, -466, -130, 888, 240, 305, -83, 236, +208, 417, 1530, 294, 594, 351, 508, 137, +-7274, -184, 201, 44, -635, -891, -652, -596, +380, -652, -8670, -76, -3746, -732, 262, -1860, +-1030, 1366, -279, 444, 911, 209, 330, 251, +-208, -747, 65, -10154, -204, 12960, -325, 347, +-465, -730, -727, 385, -89, -763, -427, 868, +-39, -859, 34, -29, -388, -1324, -218, 2051, +-1593, 5511, 10507, -8516, 2254, 5847, -1474, 1994, +4704, -1876, 880, -3810, -489, -946, -1225, -1104, +125, 139, -668, 2232, -537, 179, -215, 63, +144, 72, 1198, 9750, 248, -709, 308, 10552, +-434, -462, 13569, 1096, -491, -262, 804, -1599, +679, 569, 604, 1326, 213, -2026, 324, -2612, +-373, -12818, -20, 38, -171, 316, 15516, 306, +763, 97, 91, -832, 23, -437, -390, 505, +-1226, 2518, 106, -2065, 315, 86, 523, 172, +-1012, -13851, 3358, 2610, -381, -194, 1200, -4106, +-1298, -3637, -1534, 780, 1367, -544, -770, 1690, +1047, -54, 2136, 12502, 32, 6689, 706, -1172, +846, -4853, 2146, 2548, -39, -465, -596, 177, +213, 421, 28, -388, 11, 69, 31, -83, +-28, -166, -150, -19836, -323, 3, 659, 783, +390, 139, -138, 31, -111, 453, -80, 432, +-519, -259, 686, 11431, 163, -13179, 554, 40, +-379, -120, -692, 340, 169, 120, -476, 643, +778, 501, -128, 543, 1275, -134, 20568, 201, +401, 512, -362, -210, -269, -812, 112, 75, +149, -547, -494, -418, -100, -13621, -1002, 1176, +1634, -395, -4289, -1531, -47, 850, -1102, 13558, +-403, 683, -164, -2215, -1180, -1750, 344, 630, +-968, 669, 540, 26, -594, 192, -17, -336, +19645, 1133, 18, -56, 418, -426, -1535, 409, +732, 186, 268, -20422, -22, 62, -621, 722, +440, 96, -307, -128, 480, 5, 87, 668, +-361, -599, -22, 652, -176, -114, 214, -12233, +-698, 232, 608, -126, -714, -488, -228, 929, +-1582, -19845, 245, -460, 124, 57, 328, -436, +-158, 236, -196, -534, 209, 69, 229, 210, +-251, 1100, 583, 415, 210, 189, -219, 1242, +19482, -105, 190, -374, -43, -232, 253, 561, +-297, -376, -1077, -308, 13486, -12462, 64, -190, +-298, -643, 460, 232, -987, -478, 1596, 168, +-722, 616, -873, -98, -948, 231, -1102, 11915, +746, -495, 1248, 1203, 11067, -32, 160, -94, +-24, -153, -209, -1453, -1059, -313, -922, 1143, +-538, -1348, -323, 679, -54, -232, -470, 2075, +-19135, 628, -774, 35, 247, -86, 721, 512, +1305, 850, 9760, 248, -2404, -220, 6, -73, +-1370, 567, 1432, -2529, -1508, 14358, -992, -1111, +-940, -111, 968, -530, 576, 102, -1045, 453, +180, -94, -7936, -310, 512, 996, -32, -1062, +-150, -26, -6687, -181, -336, -1510, 616, 70, +-332, -175, 624, -546, 171, 364, 1011, 68, +-284, -368, 711, 46, 73, -34, -419, 404, +28270, 283, -324, 335, -131, 316, 212, -27, +-342, -1062, 470, 1269, 454, 286, -1928, -1674, +-739, -389, 1073, -6172, -317, -586, -194, -182, +-13034, -848, 4596, -659, 709, -630, -310, 400, +344, -276, 430, 876, -2047, -1012, -1672, -180, +64, 22005, -736, 829, 266, 182, 436, -112, +-36, 131, 252, -63, 154, 368, 107, 93, +-42, -32768, 0, 200, -230, 271, -1776, 4329, +986, -553, 481, 1888, -2770, 848, -6305, 264, +12244, 1610, -640, 1348, -2742, -2078, 907, -1115, +370, -16539, -1571, -176, 24, -515, 234, 954, +605, 613, -154, 463, 535, -160, 684, 470, +827, 10458, 150, -669, -6684, 339, -542, -730, +-351, 984, 212, 116, -7, 62, 926, 2175, +-185, -552, 489, -209, 5247, 38, 366, 53, +16, 263, -142, -535, -224, 338, -174, -125, +113, -12750, 400, -410, 281, -12, 744, -173, +486, -12159, -107, -183, -484, 2, 150, 1, +-239, 7, -399, -608, -873, 698, -1623, 701, +-773, 272, -832, -94, -921, 885, 13588, 178, +192, 148, 1346, 44, 59, -275, -14, -328, +212, 133, -223, 300, -394, -275, -43, -76, +-47, 322, -208, 21713, 484, 329, 1860, 40, +-916, 502, 130, 477, 1754, 503, 7984, -338, +-323, -230, 354, 928, 430, -89, -94, 108, +-543, 365, -130, 70, 902, -131, 58, 469, +580, -30949, 36, 232, -410, -451, 104, -8698, +113, -1682, -42, -279, -92, -280, -477, -386, +-531, 832, 80, -15002, -56, 93, 164, -721, +8388, -412, -2396, 584, 1004, -310, -2229, -304, +-383, 275, 1062, 1266, 297, -70, -909, 891, +131, -1046, 539, 32502, 1000, -21, -229, 138, +1528, -175, 546, 326, 168, -320, 716, -291, +-298, -227, 1094, -59, -12561, 12943, 786, 600, +-206, 889, -761, 54, 332, -1253, -597, 357, +-1124, -50, -168, 1172, 2266, 75, -174, 583, +408, -157, 14666, 378, 302, -5, 48, 109, +28, -21, 1044, 529, -859, -1182, -202, 1984, +308, 402, 66, -1139, 2595, -380, 1119, 309, +482, -10705, 100, -4591, 11646, -1364, -365, 9521, +-318, -23, 1076, -135, -2742, -833, 78, 910, +96, -20, -599, 46, 855, -1265, 4748, 2394, +-250, -9096, -962, 191, -346, 348, 342, 1909, +15330, 266, 540, 271, 2986, 1356, 1542, -1019, +-895, 737, 281, 684, -538, 10414, -922, 287, +679, 204, -11142, -2321, -346, -1572, -250, -315, +-604, 1336, 311, 1317, -1111, 409, -104, -221, +-14125, -1511, -990, 705, -808, 587, 676, 348 diff --git a/src/main/resources/vavi/sound/twinvq/cb0808m0.txt b/src/main/resources/vavi/sound/twinvq/cb0808m0.txt new file mode 100644 index 0000000..9c1adc8 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb0808m0.txt @@ -0,0 +1,128 @@ +-18656, -461, 236, -1122, -796, -101, 851, -3748, +1374, -8549, -3366, -1482, 1026, 2046, 4394, -521, +232, -486, -1656, 32767, 1954, -1183, -130, 392, +194, -868, 2883, -168, -1674, -910, -34, 819, +-1105, 1628, -4871, -585, -1170, -572, 451, 3911, +10770, -35, -4126, 7124, 7110, -860, -3914, -3294, +272, -647, 220, 11965, -3378, 2726, 1990, 1624, +-3689, 9884, 2394, 3096, -518, 5169, -4018, 3108, +168, 1256, -410, -3851, -11176, -10479, 2042, 1421, +1488, -992, -1562, -653, -1191, 2246, 467, 4732, +154, 729, 7244, -18, 1313, -51, -1824, 1218, +1473, -6763, -11270, -4295, 4118, 1043, -5782, 1370, +46, -11027, 4086, -1501, -11, -621, 464, 781, +13680, 257, 554, 3119, 750, -1857, 1046, -1252, +-512, 739, 14811, 12642, 3841, 2824, 163, 1620, +39, 4766, 1411, -2197, 525, 658, 419, 5, +92, 1544, 290, -2038, 10603, -5764, -3335, -6629, +-2579, 4020, -3107, 2779, 849, 5678, 260, 2804, +99, 1339, 544, 1438, -450, -598, 764, 1568, +-1034, -4560, 2604, -18205, 1644, 1003, -675, 3217, +-334, -832, -1452, 322, 608, 300, -4776, -812, +-36, 627, 1654, -248, -838, 21571, -89, -1626, +530, -1151, 9440, 522, -6138, 2213, -10095, -562, +1000, 5037, -122, -3, 7064, 397, -2118, 362, +15791, -1047, -15010, -1527, -1356, -2805, -560, -3148, +266, -45, 1324, -3312, -1772, 2382, 189, 6537, +124, -1272, 156, 588, -2678, -3106, 2828, -3684, +689, 3884, 4650, 192, -323, -5426, -722, 11486, +-607, 3591, 4299, 2117, 362, -9114, 11700, -3391, +2357, 7639, 2197, 4350, 2970, -2525, 169, -6112, +91, 1520, -19, 1558, -4588, -837, -8163, 897, +-7992, 2080, -3102, 774, -10592, -314, -137, -524, +87, -799, -111, 74, 1312, 862, 266, 243, +199, -288, 1205, -829, 1650, 2880, -24776, 3867, +-13101, 597, -9778, -2084, -3089, -1112, 548, -638, +3727, -446, 4877, 2099, 68, -2736, -4914, -7103, +263, -9228, -782, -2109, 1088, -1881, -1424, -30, +-1353, 586, 4085, -3573, -11921, 2366, 516, -1028, +834, -234, 2150, -15893, 2305, -3619, -2567, -8366, +610, 2946, -2383, 2293, 946, -3550, -6770, -1481, +-758, -864, -232, 2855, 40, -2330, 2069, -345, +1801, -589, -1241, 647, 6988, -2625, 14308, 2801, +759, -2740, -680, 964, 365, -506, 22268, 1766, +-202, -2751, -293, 3754, 1280, -521, -3355, 4615, +594, -1783, -39, -46, 48, -2638, -551, 2548, +-1880, 3730, -1726, 939, -345, -7, -1630, -23405, +-1002, 5655, 2100, 440, 1682, 1020, -594, 344, +1511, -1286, 5518, 473, -11398, -4552, 720, 4701, +7726, 126, -1953, -484, -1648, -1766, 1589, 996, +-688, -381, 1678, 1498, -528, -860, -667, -823, +32767, -463, -243, -1242, 1074, 2460, -1411, -459, +-1533, 1462, -2603, -784, -391, 338, 3444, 2170, +-924, 949, 1972, 1520, -3062, -671, 12908, 2636, +2805, 722, -12016, -26, 616, 1192, 1193, -1028, +-128, -22850, 191, 408, -3105, -592, -440, 1264, +-2580, 847, 850, 2300, -278, 126, 2214, -2693, +-21, -194, -594, -533, 45, 570, 38, 636, +1276, 171, 29846, 648, 911, -358, 300, 602, +413, -10167, -54, -1353, 42, -1770, 491, -12154, +-1808, 26, 425, 2009, 910, -8134, 362, 2001, +-114, -2586, -1049, -249, -312, 160, 1677, 27043, +-44, 160, 834, 243, -606, -272, -979, -1605, +105, -491, 754, -230, 2442, 24, -5139, -395, +-3562, 14436, -1208, -3232, 2555, -12980, -906, 429, +217, -432, -1263, -244, -225, 912, -64, 780, +1101, 854, -240, 308, -28630, 518, 32, 976, +-8642, -3041, 1801, -742, -1513, 128, -3189, 857, +-14277, -1802, 1229, -68, -565, 65, 4094, 1614, +-8254, -1153, -640, 16225, 3508, -1383, -3882, -347, +1346, 3845, 2665, 2340, -1862, -5318, 1402, -1352, +-21682, -694, -1182, 286, -806, 2133, 1848, -532, +-3750, 7564, 1054, 284, -3742, 2559, 2748, 3408, +-1544, -342, -22578, 1225, 958, 2559, 267, 378, +-3608, -1404, -1669, -13, 1135, 153, -625, 1436, +211, 556, 739, 1094, 10452, 850, 5128, 11469, +121, 4937, -3643, 1371, -373, -6686, 229, -3256, +-75, 1304, -1023, -452, 288, 12709, 13572, -501, +1840, -1044, -2014, -4077, -2726, -1010, -3826, -629, +-466, -923, -847, 5784, 898, -12036, 1253, -1741, +1546, -3710, 2782, -3430, -1810, 263, -8254, 3126, +55, -376, 202, 968, -1686, 944, -15300, -2664, +1393, 783, -11080, 1714, -1666, -1064, -4859, -2344, +334, 1313, -1209, 877, -1828, -2130, -3057, 340, +8030, -3222, 11622, -5620, 1469, 3340, 2862, -3945, +-868, 351, -1314, 2277, -2346, 12384, 996, -2460, +1810, 703, -2158, 3168, -9887, 8754, 3503, -1414, +445, 850, -30, 2389, -617, 3271, -1606, -5633, +2993, 10009, 5704, -11589, 4278, 1304, -2418, 479, +-16596, -12349, 2915, 327, 895, 1278, 1412, -310, +-653, -1287, 880, -4294, 38, 2179, -2074, -1810, +198, -1544, -8008, 2456, -2821, -3223, -3713, 11763, +-2081, -141, 4833, 1652, 3598, 551, -1655, -1154, +-60, -302, 739, -1494, 2595, -1006, 2665, 10834, +-11270, -2996, -636, -446, 1816, -1539, 4149, -184, +-100, -55, 265, 2207, 639, -162, -2210, -626, +605, -21149, 2163, -970, -330, -4655, 3396, -3092, +-544, -650, -304, 93, -1484, -888, -8982, 1871, +1701, -1423, 1671, -11, -1287, -14292, 592, 1040, +-622, 13202, -660, -12745, -2836, -1832, 3481, 1546, +235, -646, 2132, -602, 2391, 1534, 3599, -4932, +-296, -1855, -2075, -2646, -219, -10248, 1161, 5955, +6954, 9109, 3498, -5932, -1787, 373, 1234, 1244, +-813, -76, 9083, -5120, -499, -1774, -2150, 10601, +-170, 1160, 982, -597, 95, 151, -534, 6554, +840, -958, -720, 2066, -50, -2877, -74, -2068, +-24760, -725, -357, 1273, 1941, 2525, 46, -819, +-230, 1030, 2291, -287, 1092, -2315, 427, -19, +448, 1698, 9797, 10962, 3034, 2622, -2652, -1128, +-194, -180, -1176, -1794, -22248, 244, -3, -1856, +-1054, -2751, -459, -62, -433, -2274, -1790, -192, +-720, -421, 55, -721, 1960, 1094, 2500, -2353, +-480, -784, -1221, -505, 1738, -9960, -10772, -13657, +122, 387, -667, -454, 988, 30780, -757, -2319, +878, 962, 753, 1306, 716, -771, 539, -705, +508, 1915, 2114, 937, 447, 935, -1432, -1143, +4435, 11759, -2442, -53, -10601, 1979, 5419, -2296, +-172, -5987, -1168, -2012, 2257, -1451, 97, -1253, +5548, 884, -14448, 3134, 2549, 172, 5404, 869, +-83, 597, -12416, 762, -1035, -805, -1369, -804, +664, 9644, -4329, 1130, -1526, -2900, 628, 620, +-6436, -2370, 2107, -11836, 37, 864, 2105, 314, +216, -529, 810, 3141, 3716, 7019, -2653, 1466, +-14940, 13128, 1218, 2287, -145, -443, -923, 476, +2411, 5428, -611, 2212, 1450, -3042, -4750, 3562, +587, -15378, -15151, 600, 1029, -2353, -934, 1986, +1444, -2171, 1020, -700, -1508, 195, -2466, -798, +16460, -2164, 520, 2711, -13832, -2024, -871, -5268, +3556, 117, -416, -8, 2128, -1570, 2052, -3169 diff --git a/src/main/resources/vavi/sound/twinvq/cb0808m1.txt b/src/main/resources/vavi/sound/twinvq/cb0808m1.txt new file mode 100644 index 0000000..9231624 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb0808m1.txt @@ -0,0 +1,128 @@ +16492, -295, 2556, 1303, -440, 7584, 3305, -3422, +-1196, -1809, 2142, -1292, 1048, 314, 1945, 578, +1080, -255, 1109, 617, 1597, 198, -29081, -243, +54, -33, 76, -418, 1332, 475, 1495, 1554, +-782, 308, -1286, 1044, 300, 1544, 646, 9441, +2577, -11140, 1421, 1107, -483, -590, 625, 8544, +446, -1814, 1714, 685, 9620, -4981, -3100, -724, +8439, -2333, 506, 3557, -1160, -2199, -659, 4107, +8620, -1406, -3745, 1729, 10756, 868, -82, 2584, +-3140, 3632, 2617, 3880, -1175, -163, 1864, -980, +551, 201, -433, -1464, 708, 1926, -8471, 3870, +-2376, 15567, 2112, 753, -2450, 72, 1131, 2932, +-139, 6392, 1547, 3, 625, -823, -1750, 811, +-977, -1389, 1300, 1184, 399, 4684, 196, 3679, +-1672, -218, -11023, 98, 492, 4072, 1213, -2004, +3602, -1787, 1288, -9442, 4157, -4267, 3509, 5317, +-574, -11094, 1078, 6240, 1593, -12773, 408, 3960, +1116, 1517, -816, -577, -696, 554, 1645, -936, +83, -20255, -754, 1460, 1110, 1412, -757, 377, +2373, -1608, -1414, -1028, -3152, 1534, -4145, 2274, +-286, -7058, 2286, 4013, 2515, 2681, -5602, 0, +-1740, 257, 756, 11496, 954, 4513, 3968, 4851, +278, -511, 829, 2853, -9743, -3723, -1550, -444, +4256, -679, -11411, -4290, -1470, -4191, -952, -239, +-198, 1361, 9527, 1481, -981, 1403, 991, -255, +9326, 1832, -1936, -135, 1123, 2756, 1932, 2543, +795, 12612, 2429, -498, -13185, 3812, -1628, 196, +1822, 4333, 2760, -676, -2902, 1244, -1974, -7046, +-12216, 1503, -2176, 1916, 365, 636, -11348, -5030, +-3319, -3794, -1016, 1157, -4158, 3424, 344, 4494, +812, -3074, 4356, 293, -3463, 1232, 1746, 2696, +-8269, -961, -4316, 130, -4278, -14007, 3025, -2703, +179, -10176, 1511, -1460, -1100, -1171, -1575, -2596, +-2026, -11400, 2689, 1480, 743, -1669, 2728, 742, +-60, 11452, 84, -662, 1424, -15103, -410, 2141, +-1664, -1378, -122, 97, -358, -820, 382, -3865, +374, 1698, -21, -752, 595, -8771, -731, 9368, +1698, -2586, -6790, -2507, -1776, 4993, -3867, -2807, +-190, 14465, -13938, 3095, -1198, 374, 1682, 1888, +286, -576, -2094, 454, -690, 1396, -1139, -422, +405, 238, 1718, 2048, 13448, -151, -247, 202, +-900, -5630, 3121, -10988, -1615, 1955, -3901, 3360, +1429, 3928, 1951, -1099, -435, 1572, 1500, 19176, +731, -439, 3686, -3039, 244, -4270, -34, 1289, +296, -406, 2216, -1400, -1946, 264, 1536, 2992, +54, 892, -181, -1545, 278, 24923, 989, 1301, +-1279, -188, -198, -661, 612, -1520, 2355, -12972, +-694, -560, 1364, -2988, -6236, 2555, -6630, 1423, +440, -598, -1092, 304, -2529, -1698, -909, 2560, +844, 768, -2988, -661, 18432, 1158, -639, 5070, +11015, -14, 2313, 756, -1941, -10986, -490, -5235, +2646, 2406, 170, -546, 337, 6499, -4450, 5598, +299, -504, 14322, -972, 9356, -2056, 8812, -1599, +-1931, 2084, 119, -983, -305, 1437, 403, 2651, +-159, 229, 209, 1438, -1789, -1159, 1017, 416, +408, 454, 858, -652, -1554, 1198, 18278, 122, +433, -165, 162, -10532, 11563, 4754, -2022, 4246, +-1396, -2417, -1796, -1496, -1279, 3877, -1217, -770, +983, -609, 1766, -184, -5664, 546, 7948, 1978, +-250, 4350, 3498, 2797, 802, 846, -12628, -1092, +-240, 781, -11252, -955, 9944, -222, 1177, 1262, +-534, 1790, -7396, 1452, 4251, 303, -3714, -2295, +-290, -227, 672, 22690, -622, -466, 1599, -496, +326, 871, -1948, 148, 449, 214, -2175, 713, +394, 1921, -28716, -786, 1083, -641, 1232, -246, +1572, 1575, -879, -2962, -57, 369, 1633, -1457, +1194, -1222, 304, -955, 104, -1249, -935, 135, +-758, 3483, -1190, 1457, 1130, -1284, -3709, 18042, +6, 25, 1233, -328, 347, -512, 2071, 328, +-18037, 4582, 3841, -434, -745, 332, -576, 3006, +336, -11505, -646, 3509, -996, 1270, 2041, 1353, +1193, 2976, 11569, -3165, 1450, 4351, 2522, -10022, +-6, 12602, 874, 518, 475, 1251, -3290, -2674, +4802, -11794, -946, -426, -2846, 1619, 1105, -1022, +-1, 1759, 646, 10347, -2937, 13505, 1104, 614, +1149, -800, 2377, -115, 792, -948, -2431, -1779, +-1142, 809, -3130, 447, -15516, 313, 11235, -1346, +-2426, -2737, -1738, 2236, 1094, 802, 1323, 3612, +-213, 1383, 2800, 10394, 1210, -2360, -10203, -1991, +-102, -2669, 2303, -2184, 1830, -1158, -5633, -4083, +-252, 311, 612, -331, -2786, -12421, 9994, -6006, +-4996, -954, 1014, -1147, 860, 1252, 1114, -2069, +266, -230, -591, -4442, 230, 20603, 1386, 1130, +-1468, -3600, 2168, 836, -1754, -511, -542, 216, +26, 3476, 1165, -4293, 3098, -245, -579, 1830, +2248, 5326, -18357, 397, 5466, 734, 3920, -3678, +319, -1062, -610, -7509, -1064, 1456, -5729, 1088, +9099, 2266, 241, 201, -10017, -1545, -2799, 1491, +27098, -60, -1736, 1387, 859, -1474, -79, -1122, +-971, -1302, 906, -1133, -2659, -296, 1344, -2698, +-448, -1476, -212, -1585, 1310, 14353, -2165, -2229, +-656, 5219, -3266, -1850, 7942, 4997, -2295, 519, +608, -9498, -1700, 1770, -15308, 1286, -2914, 2252, +-717, 2136, 2478, -3747, 2362, -5, -237, 2334, +701, -774, -672, -20, -599, 623, -700, -713, +-979, -29926, -1090, 848, -141, 1273, -711, 1782, +-221, -103, 170, -185, -1059, 3066, 1321, 1182, +3641, -217, 1959, 11806, 2390, -10312, -2575, 1612, +596, -352, 2197, -2041, 2385, -898, -9363, -1144, +-10896, 20, -7842, -1047, 3687, 2147, 2584, -249, +-72, 32767, 1936, 446, -889, -845, -896, 1269, +448, 327, -3411, 4, 702, -1900, -646, 799, +-770, 662, -911, -856, 287, 1667, -108, -64, +16, 1578, -2059, -27327, 112, -188, 2504, -692, +250, 360, 564, 868, 4147, 1340, 18080, -3584, +445, 364, -2623, -412, -2918, -116, 2611, -2396, +-44, 10934, -1512, -1166, 239, 913, 190, -14681, +-767, 2610, 2931, -2389, 3590, -1680, 6287, -531, +-616, 1317, -1034, -900, 871, -329, 467, 1200, +-1914, 1108, 3150, -6878, 544, -14411, 2807, 5427, +13361, 1448, -1753, 524, -5851, 1467, -1866, 6888, +-8742, 1372, -1515, 4883, -2248, -1042, 4628, 10768, +149, -358, -1287, -1289, 32767, -1137, 941, -2112, +451, -1436, 174, 294, 475, -3667, 1610, 1641, +-599, 626, 2058, 671, 1626, -985, -123, 2040, +421, 1797, 18448, 2538, -359, -5042, 3096, -1136, +-320, 1823, 30, -12002, -1297, -850, -418, -1497, +-1761, 5073, 10944, 212, -4713, -1614, -1752, -2135, +483, 1043, -1989, -293, 39, -1049, 67, -7482, +712, -5358, 896, 12460, -1744, -1793, 1538, 3577, +-6, 418, -72, 1072, 1367, 1080, 3564, 1468, +482, -1298, -6442, -299, -12934, -757, -4199, 3842, +-11331, -1216, -206, 1598, -1135, -3240, 3294, -286, +-540, 777, 1188, -1189, 4516, 2638, 2071, 9702, +-900, 1002, 18707, -705, -1856, 1185, -4832, -1694, +-3502, -2324, -2826, -4600, 1996, -3110, 110, 117, +405, -16854, -510, -14725, 1699, 1922, -2117, -2718, +45, 1064, 507, -1781, 2106, -2310, 1239, 5860 diff --git a/src/main/resources/vavi/sound/twinvq/cb0808s0.txt b/src/main/resources/vavi/sound/twinvq/cb0808s0.txt new file mode 100644 index 0000000..afa8678 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb0808s0.txt @@ -0,0 +1,144 @@ +-7488, -1327, -5244, -2049, -3736, -45, 446, 1558, +-755, -6052, 6034, -4326, 740, -348, 12369, 2115, +-662, -685, -6592, 10176, 8575, -1035, -2752, -4453, +-283, 1547, 4776, -2932, 700, 3425, -3905, 1073, +2356, -7094, -1705, -435, 4840, -1944, 1188, 780, +-3963, -6170, -1726, 4759, -4356, -2124, -1686, 321, +-901, 1414, -923, -2678, -1198, -14777, -2038, -3528, +123, 11216, 1904, -1914, 7588, 2744, -4265, -4886, +-3530, -1495, -1709, -5857, 3829, 2196, -4842, -817, +-874, -5649, -2181, -3871, 3774, -1368, 322, -1126, +-996, -3873, 13698, -9369, -848, 3797, -667, -1083, +2429, -3351, -1672, -3562, -1590, -3507, 552, 6610, +-4137, -10061, -5452, -6142, -1454, 1726, -1298, -4479, +6126, 1626, -2791, 1584, 1300, 5726, 2584, 11109, +696, -3344, -2418, 9029, 4346, -3554, 1393, 144, +2051, 8916, 6174, 5170, 376, 9778, -2298, -4119, +3733, -35, -2673, 2222, 1383, 2046, 2859, -16131, +1637, -1195, -662, 2800, -2241, 3801, -5062, -978, +5670, -5449, -79, 3479, 606, 3766, -1325, -265, +907, -745, 1005, -14528, -4227, -3955, -7194, 3690, +2166, -2520, 11555, -511, 5900, -388, -3854, -3440, +2136, -868, -2986, 722, 1286, -4027, 10382, -1646, +5193, 2539, 1239, 7819, -67, 3382, -3297, -46, +-3808, 830, 1313, -2188, -4346, 5922, -1057, -6294, +14317, 2001, 968, 4150, -4121, 1412, -302, -8401, +-1388, 10649, -9513, 1042, 840, -4606, 2098, 1166, +1472, -802, -2810, 420, -561, -325, 2652, -2866, +1334, 4878, 958, 83, 456, 1203, -7594, 14590, +-1210, 2202, -1954, -1938, -3413, -1096, 6036, -1675, +-1320, -4485, -10665, 10026, -2484, -3273, 4753, -275, +-3542, 924, 1262, 7348, -2959, -749, -408, 4594, +4876, -491, 3409, 4616, 110, 557, -1378, -1616, +-4532, 1699, 1412, 579, -494, 716, 197, -23346, +-2284, 156, 1096, -151, -1827, 688, -322, 2371, +-7909, -1324, -1683, 7861, 7074, -451, 258, 9088, +1900, 8660, 840, 3491, -3275, 3029, -475, -2122, +-5725, -8668, -6069, -3458, 4240, -3007, -5463, 9395, +-2686, 4718, -717, 42, -1802, 3122, -3197, -5212, +-1572, -243, -451, 8213, -2199, -3372, 4110, -8176, +-10525, -5551, 4312, 682, 2069, 1985, -3713, -6780, +1193, 2831, -2228, 486, -3667, -789, -1691, 4567, +464, -2114, -2340, -1881, 1921, 1602, 18418, 1535, +-567, 228, -9359, -6027, -267, 3628, 32767, 1423, +-74, -2817, 2112, -128, -1516, -2446, 1673, 2812, +-1582, 2125, 618, 2569, 2714, -1710, 340, 3255, +848, 3379, -2317, -2361, -1823, 412, -2496, -18164, +-1224, 2552, -3040, 144, -597, 7716, 4916, -2867, +-2172, 2120, -2776, 675, -11985, 1692, -1384, -3588, +4310, 1020, -4215, -251, -7090, -1916, 1914, -2804, +6189, -6732, -1370, -3704, 450, -2652, 6553, -38, +10348, 1244, -2246, -3729, -2158, -1340, 2357, 3118, +9378, -1727, 3150, -3867, 1277, -15, 769, -2352, +-411, 1428, -14032, -1029, 2828, -1894, 6084, -36, +518, 13159, 1095, -1185, -3207, -555, -3256, -76, +3884, 3394, 1010, 1946, 160, -4863, 4714, -7087, +-3985, 5602, 3350, 7822, -5729, -7701, 9296, 3067, +3582, 5256, 13629, -4012, -2206, -3867, -664, -104, +4397, -7862, 36, 955, -38, -973, 3458, 5004, +364, -9116, -2764, -2168, -1892, -7632, -4834, -5788, +-3565, -1245, -4544, 6552, 4601, 2342, 6625, 1040, +2154, -6985, 5838, -1912, -3439, 1189, -2422, -555, +3286, -14872, -776, 1228, 2434, 120, 13673, 904, +-1354, 645, -1550, -1377, -1888, 1416, -679, -1685, +1731, 2404, -5786, 3285, -193, -123, 1973, 3663, +-1388, -14961, -3597, 5555, -1420, 284, 1527, -2575, +1941, 871, 3900, -2168, -12763, 2970, -408, -3131, +-6426, 1892, 782, 6768, -284, 1034, 9785, 6029, +-3873, -4102, -4349, 2548, -3686, -5622, 4769, -351, +8178, -7253, 3687, 624, -4386, 4028, -2780, -1938, +-4061, -1872, -1264, 7300, 760, 8530, -821, -874, +-14225, -1143, -5400, -850, -2537, 478, 1668, -1244, +-362, 877, 3481, -1338, -5218, 2091, 3996, -577, +390, 8626, 820, 181, -988, 5604, 9694, 1112, +-3064, -266, 1234, -486, 1264, -2173, -13671, 3729, +-3212, 2548, 1745, -9363, 8065, 3713, -3343, -4847, +2808, -4716, -2175, 25, -5718, 4056, 1855, 4663, +2324, -1166, 543, 2, 3931, -3196, 2771, -920, +-2907, -746, -1241, -306, 2793, -22, -2642, 3048, +3256, 1804, -1310, 17876, -1816, 56, -1694, -465, +-534, -2274, 6139, -2247, -2515, -1077, 3305, 1519, +273, 1128, -1637, 2561, -1534, 874, -22808, -1119, +-2551, -10344, -2229, -3510, 194, 2594, 1737, 4713, +13767, 3532, -311, 8097, -1012, -841, -4360, 793, +-267, -206, 12905, -2683, -6424, 196, 7098, -1690, +-690, 1236, -2882, -2668, -2020, 8291, -2714, -4607, +-923, -2077, -2878, 1687, -10457, -1575, 2172, -3974, +5795, 1748, -1852, -5143, 4763, -5097, -2840, -1851, +2634, 5970, 180, -3326, -1655, 1226, 375, 5137, +-2678, -5246, 4327, -3670, 9956, -1976, 2189, 2952, +-6785, -697, 1129, -5768, -5819, 6532, 3650, -1711, +3857, 47, -9618, -1941, 2524, -1244, 7242, 11646, +-64, 2304, 201, -3707, -700, 149, 2692, -805, +3978, 2738, -977, -1004, -5776, 12779, 7454, -353, +-4731, -3866, 7076, 146, -3302, 3065, 1955, -343, +-1459, -426, -5906, -1318, 500, -1014, -1002, -2090, +-2924, -20521, 2610, 1581, 397, -3380, -2885, 510, +-1147, 3398, 1914, 99, -119, 144, -3128, 2445, +1791, 397, 3734, -80, -3410, -3798, -1142, -1515, +-2615, -1540, 5193, 2187, 940, 4969, -2334, -16589, +325, -2186, -4567, 5121, -894, -6848, -6002, 1832, +-568, 8259, 833, 3420, -4459, -748, 3442, 4358, +-3041, -10203, 9303, -1511, -4821, 1950, -966, 3573, +453, 705, 16238, -901, -163, -2866, -104, -1767, +-1779, -1249, 3251, 1975, 1254, -838, -390, -3150, +1020, 2526, -2025, 662, -2817, -1338, -855, -3442, +-21123, 241, -134, -952, -588, 2572, 2080, 8153, +114, 9732, -6774, -5266, -2462, 2286, -599, -426, +1396, -7051, -1228, 312, -4495, -2525, 4649, -1305, +-1106, -2366, 2232, 4065, -18674, -1295, -3259, -1004, +-5136, 206, 1177, -5130, 2394, 2518, -1381, 2564, +-138, 4341, 16988, 2546, 6782, -3433, 850, -970, +-255, 1308, 2228, 1704, -1283, 1452, -2608, 1487, +3106, -2267, -2998, -6814, 1654, 21195, 1555, 968, +154, 124, -1258, 714, -407, 44, 247, 992, +2228, 2824, 1435, -341, 1212, -1612, 6126, 1636, +-8368, 578, -5418, 217, -191, 204, -7147, 5110, +3766, 5055, -5979, 6683, 368, -3597, -4595, 7630, +-3611, -2384, 1369, 6995, -3299, -53, 2036, -4654, +4259, 9618, -1012, -2964, 4397, -2112, 11885, -1648, +-942, -3474, -544, -1410, -1958, -1535, 2981, -1591, +-16787, 335, 4609, -1990, 3821, -645, 1842, -64, +-3485, 3202, -374, -58, -1410, 7304, -1958, -2142, +-11412, -2533, 513, -6149, -6679, 2152, 3153, 5102, +2216, -1361, 2260, 4863, -7031, 1538, -5250, -2511, +96, 3339, -3447, -3708, 7168, -4168, 838, -3134, +3228, -1531, -5598, 14125, 208, -2150, 819, -1085, +12282, 6714, -2778, -9252, -5117, -6623, -1711, -4253, +-6306, -1292, -1370, -1027, -908, -2863, -1832, 4645, +-722, -284, -161, -5106, 7110, -12494, -1514, -5453, +-3308, 3520, 1101, -1096, -2325, -746, -33, 2645, +-4458, -797, -684, 1514, 1716, -6204, 6580, -3427, +-650, -10493, 4868, 5833, -2385, -274, 1530, 3892, +-1940, -1415, -2389, -11499, -2064, 937, -333, 1361, +-1583, 5458, -2296, -3263, -8344, -4236, -6357, -2372, +-3115, 1336, -2184, 194, -4262, -7838, 6946, 4535, +749, 7332, 67, -327, 273, 3211, -1825, -357, +7039, 3346, 6282, 488, -3940, 10196, 6463, 327, +4407, 909, 889, -4943, -622, -4049, 2532, 1870, +652, 1778, 663, 3063, -1012, -1390, 4162, 20486, +-86, 3166, 325, -1912, 511, -634, 1262, -4719, +-1490, 6767, -3314, -125, 4490, -10334, 5386, 9932, +781, 290, 2198, 1695, 3790, -1878, 7760, -300, +2021, 5508, 2200, 232, 7138, 1370, -3268, 3496, +13934, -1230, -2303, 958, 141, 3348, -2867, -987 diff --git a/src/main/resources/vavi/sound/twinvq/cb0808s1.txt b/src/main/resources/vavi/sound/twinvq/cb0808s1.txt new file mode 100644 index 0000000..7b393fe --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb0808s1.txt @@ -0,0 +1,144 @@ +9313, 734, 6610, -3629, -12020, 5317, -244, -1858, +2, -1812, -6486, 892, 926, -236, 1016, -1249, +-469, -238, -1908, -10594, -4704, -907, -7746, 3847, +564, -5956, 3395, 371, -5136, 4001, 1180, 769, +-555, -1872, -2943, -1744, 8620, 1485, 9901, -1392, +3425, -7940, 151, 376, 1984, 3031, 3815, -974, +537, -7038, 1964, -5625, 4457, -10214, -1787, -2768, +-8514, 176, -3692, 6441, 3148, 602, -2000, 13769, +-2792, 1104, -2067, -6219, 1515, -288, 3240, -5490, +11589, 3742, -2343, -1752, 3701, 7525, -1676, 845, +6895, 2884, 3540, 2454, 1010, 2454, -5761, 2035, +3369, -9628, -862, -7060, 1802, 5676, 2396, 2757, +5891, -701, -11896, -4061, 7932, -272, 2562, 83, +560, -5180, -2223, -356, -3343, 2874, -1370, -7612, +1773, 2006, -4258, 5312, 342, 8196, 4939, 519, +3568, 4420, 2768, -11872, -3021, 1893, 1690, -5483, +-8129, 7540, -116, -2064, -4473, 1141, 1930, 656, +-7728, -2742, -3276, 2782, 2860, -6082, 5198, -4751, +-486, -789, -16932, -566, 5116, 1196, 832, 4282, +78, 3088, 2768, 2125, 1027, 1712, 310, 808, +-1595, -106, 3174, 4598, -2945, 1551, -7688, 620, +-1640, 339, 4538, 3339, 532, -351, 260, 249, +-2135, -543, -18362, -648, -3871, 5514, -1782, -11301, +-374, -2078, 1610, 50, -4439, -2546, -3058, 839, +-9221, 2618, 1790, 103, -1061, -363, 285, -3542, +503, -437, 30, 1382, 75, -2852, -1028, 3095, +4318, -2316, 739, 801, -22765, 2162, 913, 1698, +149, 2049, -313, -803, 3393, -1476, 4396, -4003, +854, -1344, 1062, 10009, 6332, -8522, -2616, -9904, +-390, -3146, -2951, 4222, 5538, 495, 3776, -13684, +4687, -2187, -905, 4997, 6209, 4775, -1234, 1956, +-4607, 3006, -370, -670, -12448, -5802, 8151, 140, +1485, -6340, 2139, 1231, 22, -212, 2090, -676, +2366, -701, -4113, 365, 2970, -577, 918, 7324, +-709, 2035, 5162, 7232, -13287, -3259, -908, -1900, +-4255, -2590, 318, 4891, 696, -40, -1647, 1572, +-1221, 4896, 5241, 49, -2083, -5068, 7645, 8978, +1628, 2895, -4930, -8068, 2266, 2025, -1868, 3250, +2642, -785, -14571, 9979, 3481, -2246, 1154, 2646, +2616, -2033, -2936, -1300, 2490, 879, -1237, -1228, +-724, -1780, 524, -6619, -3339, -2526, 3533, 844, +2946, 2208, -3522, -12411, -3062, 2380, 448, 604, +-4708, 2403, 1914, -58, 149, -3704, -2019, 4246, +-7020, -3197, -712, -2219, 10036, -2776, -3166, 2648, +2947, 3386, 6445, 1587, -268, -536, 1895, -9005, +10791, -982, 8215, 6414, 5166, 4751, 160, 3050, +-865, 6216, -1187, -7077, 1640, 5078, 4354, 1762, +-3869, 1174, -149, 1078, 1884, 5149, 15091, -432, +-2441, -1102, -1194, 1078, -1535, 8289, -2702, 4007, +694, 72, 685, 2816, 13244, -422, -7094, 432, +2044, -12004, -276, 2174, -908, -4784, 5725, -250, +22, 5116, -2, 2686, 955, -8509, -7697, -3735, +672, -1202, 4299, 4284, 12352, -2362, 5757, 1317, +4293, 508, 3050, -524, 1097, 3346, -537, -2440, +-1596, -5659, 4188, -625, 1659, 3061, 2791, 1712, +-2991, 966, -16903, 610, -3314, 4160, -3750, 580, +-3407, -340, -11829, -520, -1625, 2905, 674, -147, +-5284, -4278, -5021, 4635, 6299, 2207, 2595, -7811, +-68, 4107, 4314, -1540, -11044, -2214, -803, 232, +-7602, -95, 1130, 4991, -361, 1675, 4487, 3607, +-6192, -130, 137, -1440, 2826, 178, -13834, -984, +1149, 1230, 1587, 1571, 3286, 5293, -2259, 2021, +-6211, -7608, -2710, 2502, 4315, -539, -8530, -746, +-654, -4003, -5917, -3728, 4522, -10350, -1266, 210, +5078, -2988, -3866, 3919, 969, -1063, -6300, -4584, +-2420, -2094, -884, 2338, -3150, 5461, -1145, -734, +1644, 2183, 19114, -1144, -2313, -404, 1236, 3583, +134, 1802, -4088, -2795, 681, 3738, 1831, 16571, +917, -2290, -3648, -1588, -158, -528, -792, 394, +-7432, 2446, 402, -391, -73, -1398, 1286, -6503, +5216, 1094, -939, 1673, -2038, 15842, -1971, 4160, +-1664, 7231, 642, 5770, 4209, -1839, 220, -266, +165, 2055, 5222, -3344, -6544, 5412, 1514, 586, +1591, -15256, -2715, 941, 1308, -9170, -2863, 4935, +-2913, -1291, 2791, 7967, 14, -1101, 3774, 3580, +848, 1337, 1138, -2839, -3564, -5300, 12429, 14, +1466, -7114, 1198, -3474, -237, -2577, -1305, 445, +1069, -174, 1684, 3902, 229, 5842, -690, 978, +-754, 1182, -859, 21078, -185, 710, 797, -2155, +367, -2168, 1002, 3805, -924, 468, -2322, -3590, +1608, 3387, 18, 1536, -858, 642, -7964, 17689, +9843, -4878, -3003, 7373, 5934, 4286, 10484, -63, +-4629, 974, -2227, 2602, 3810, 1905, -1668, -2130, +2020, -2360, 2853, 612, 5070, -1248, -868, -497, +3478, -1937, -3006, -645, 3589, 3019, -3293, 16469, +-5243, -2918, 1788, -2569, 3717, -9630, -1352, -3870, +-416, -4190, -8863, -6888, -498, -814, -783, -4625, +5841, 1562, -2173, 481, 280, 816, 4742, -9962, +11799, -2029, -2460, 4972, -600, -1452, -1901, -2122, +3130, 2686, -819, -2366, 866, -2093, 1052, -58, +284, 3830, -4738, -4114, -1321, 1307, -2820, 4915, +-11701, 522, -1982, 7024, 8403, 1762, -46, 532, +5097, 5013, -615, 3086, 2089, 6899, -1107, -4047, +-2903, 5356, -4802, -965, 6706, 3895, 9022, 1388, +10971, 5927, -2954, -965, -3473, -5177, -2654, 3418, +-5315, -16695, -6587, -416, 404, 1230, -2586, -3292, +1390, 14, -481, -4446, 1335, 109, 1060, 3958, +1275, -5655, 1253, -2411, 207, -12550, 6208, -2447, +-3415, 2503, 848, 3094, 9336, 2647, 2455, 2238, +2356, -2132, 5347, 915, 2227, -103, 5832, -2504, +7562, 9568, -6100, 4091, 2668, -1722, 287, 6763, +4058, -387, -2060, 5522, 3184, 4766, -158, 650, +-11284, 11841, 6230, -4232, 5308, 3174, 4926, -2970, +-4761, -980, 117, 1944, -1974, -5484, 6534, -266, +-7222, 924, -2654, -588, 9609, -2337, 1892, -2110, +5088, 1856, 7964, -4029, -940, 1429, 805, -4705, +-1362, 892, -189, -8354, 3259, 194, 767, -2877, +-4165, -990, 12185, -160, -2002, -1384, -5388, -1604, +226, -6353, -4157, 1773, 2360, -4356, -730, -5462, +-4054, -15669, -1528, -394, 4101, -203, 2792, -787, +3391, -299, 6384, -1630, -7186, -12765, 4618, 934, +-401, 2790, 2284, -4932, -1260, -6009, -2590, -2285, +-1289, 3366, -4192, -4462, 32767, -3135, -1888, 67, +-2874, 150, 4760, -1571, 584, -2187, 358, -1733, +-1286, -4573, -2003, 1872, 940, -1942, -255, -8856, +-1320, -3348, 4854, -509, 2836, -14, 2490, -1537, +882, 1188, -3132, -15209, -1633, -44, -2827, 368, +-1099, -1073, -467, 6318, 5863, 2840, -5200, 569, +-2984, 6587, 9596, -4924, 457, 4879, -4449, 3528, +1868, -3894, -3905, 15420, -2590, -599, -4975, 3892, +-1454, -616, 1890, -2700, -3268, -1386, -1065, -3078, +-2454, -1902, 4726, -34, -4218, 1619, -3074, 5540, +-6392, -3570, 2687, -8742, 333, -106, 2326, -1737, +-3775, 397, -3553, -6632, -6066, 9567, 2904, -889, +1136, 1295, 19390, -268, -3127, -180, 1696, -814, +-775, -4914, -456, -758, -866, 1102, -3740, -374, +469, -6902, 1440, -10243, -6221, -4797, -3074, -1142, +297, 5069, -1547, 5474, 716, -454, 3806, 4100, +2901, -2169, -744, 5032, -5586, -2986, 2286, 2414, +7860, -2672, -46, -10046, 5348, -1018, 1016, 9142, +4543, 5587, 2228, -2684, -4594, -2457, -1850, -3651, +-1806, 4826, -11686, 1940, -3529, 1078, -5234, -2420, +-83, -2322, -5134, -775, 677, -9257, -864, -915, +4494, 411, -4820, 5999, 4472, 5823, -4597, 3121, +-1868, -1539, 2338, -4249, 1154, -13422, 791, -1235, +-1240, 364, 177, -1508, -2527, -2949, -2062, 118, +-3115, 293, -1927, 18644, -1100, 152, -2528, 1914, +-1380, -1624, 302, -831, -920, 320, -879, -1252, +813, -11, 6960, -522, 3092, -119, 1486, 3068, +6690, -3079, 13305, 6342, 937, 1632, -1026, 1896, +-2335, -3961, 5510, 2782, 187, -2448, -1251, 756, +-15856, 3179, -1155, 808, -1748, -6593, 1494, -3122, +-98, -3808, 491, 1752, 3188, 2158, -1924, 763, +1165, 148, -3161, -1284, 18082, -195, -1125, 845 diff --git a/src/main/resources/vavi/sound/twinvq/cb1108l0.txt b/src/main/resources/vavi/sound/twinvq/cb1108l0.txt new file mode 100644 index 0000000..8357f8a --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1108l0.txt @@ -0,0 +1,216 @@ +2354, 8016, 12528, -947, -348, 1760, 2054, -3960, +-2125, -3578, 3932, 1647, -3316, 6053, 392, -3128, +3209, -2445, 463, -2835, -1555, 1259, 296, -1465, +1839, -4811, 420, -215, 469, -1013, -272, 185, +-27061, -1154, 8, 298, 259, -953, -555, 472, +617, -1127, -673, 982, -398, -1681, 328, 882, +614, 800, 431, 84, 880, -240, 15758, -14324, +1301, 1578, 932, -694, -1456, 2435, -1651, 1464, +227, 1527, 527, -128, 698, 2405, -726, 1489, +1016, 1938, -1897, -1478, -238, 932, 2507, -519, +-1147, 557, 2334, 700, -12914, 14861, 158, 255, +1195, -883, 3359, -1045, 2095, 520, 249, 926, +789, 1392, -185, -1654, 902, 9, -2166, -1916, +543, -2126, 2842, -332, 1356, -344, 436, -404, +-174, -489, 858, 258, 229, -45, 327, -316, +-1176, -454, 115, -220, -458, -194, 271, -530, +1572, -574, -25068, 167, 601, -1027, -1705, -3144, +-4231, -1636, -1012, -1002, -519, -825, -458, 945, +546, 193, -17909, -156, -1067, 826, 338, 1152, +562, -506, 848, 239, 188, 656, 97, -174, +-59, 242, 1946, -67, 745, 2043, 424, -192, +574, -524, 1553, 566, 1480, -747, 487, -20623, +872, -1089, 1034, 1357, 919, 153, 154, 498, +54, 555, -989, 707, -85, -21, 700, -1424, +90, 655, -399, 123, -709, 117, 438, 330, +-720, 190, 812, -138, 460, -32768, -162, -410, +-327, -122, -1208, -554, -502, -178, -309, 373, +4295, -945, -5502, -2752, -6615, -1241, 1278, -1315, +-7683, -986, -419, -50, 2384, -4640, -6246, -11804, +-308, -446, 3486, -4824, 1736, -590, 960, 195, +593, 164, 3355, 1655, 1233, 66, -787, -347, +-13751, 74, -1209, -812, -4098, -102, 910, -1659, +-2036, -3147, -2075, -2605, -1240, 4499, 1727, -9484, +549, 728, 3411, 1958, -4439, -1064, 5690, -1600, +-1984, 1695, -588, 4815, -138, -3380, -512, 1553, +1978, 4310, -730, -402, 828, 2124, 14216, -222, +2757, -8686, 523, 2516, 1017, 790, -136, -470, +-252, -717, 808, -1113, 13766, -114, -1182, 3053, +-5238, -2231, 1720, -511, -987, 1592, -1257, -2578, +1777, 1075, 2367, -227, 2330, -672, -2620, -1449, +2122, 362, 1249, 1338, -327, -21631, -1540, 24, +-2356, -656, 1981, -92, -207, -2188, 34, -457, +-1291, 1231, -460, -128, -396, 593, -671, -1513, +136, -335, 560, -1121, 490, 1008, 948, 8629, +-3344, 467, 881, -5731, 1120, -300, -1432, 1227, +1558, 990, -1078, 214, -922, -81, 1120, -15586, +-1176, 1203, -1911, 151, 1484, 1555, -421, -420, +-428, -762, 292, -59, 1075, -649, -841, 494, +194, 27, -768, -356, 54, 163, -73, 293, +-1717, -392, 750, 234, 751, -111, 26858, 911, +-389, 451, 442, 260, -117, 270, 19, -2429, +618, -962, 378, 10, -1954, -1336, 525, -258, +-693, -4155, 10265, 2924, -1361, 3197, 10199, 6870, +-2608, -5792, 619, -1994, -2035, -701, 2598, 465, +-575, 311, 175, 162, -1191, 162, -157, -147, +325, 551, 536, -188, -290, -165, 343, 14, +-268, -27113, 278, 127, -233, -68, 606, 125, +665, 438, -442, 2510, 800, -1991, -641, -386, +-1574, 78, 946, 189, 106, -2249, -268, -1708, +-1192, 986, 3076, 1807, 21, -5884, -964, 256, +-15916, -1320, -2867, -3562, 491, 3502, -337, -1542, +496, -3182, 1676, -2371, -4264, -2053, 14342, -5674, +1744, 1813, -3731, -3761, 1350, 1783, -438, -920, +2366, 1438, -687, 512, -1934, 323, -3158, 1775, +1964, -6742, 10162, 7763, 1469, 1967, 851, 2742, +7413, -3338, 742, 1854, 310, -192, -936, -1770, +-775, -976, -1532, -1436, -670, -4032, 1194, -1336, +-4369, 332, 604, 962, -27563, -972, 842, -743, +275, 713, -251, -799, -1190, 372, -213, -423, +202, 1189, -31, 1084, -974, 756, -148, -1669, +640, -549, -339, -1506, -112, -598, -870, 410, +-13307, 13141, -1911, 2308, -92, -776, 221, 1503, +1578, 803, -308, -1672, -404, -83, -3517, -1327, +-606, -2426, -61, -513, 318, -1805, 2049, 1887, +-777, 1268, -542, -116, 3550, -18840, -2986, -979, +2653, -2875, -922, -10520, 804, 107, 3234, -1270, +-608, 1042, 3599, 965, -342, -2096, -267, 1704, +-3939, 791, 2180, -985, 816, -716, -2661, 99, +1523, 11902, -1782, 775, -12517, 3244, -3762, 2046, +-278, 1539, 2895, -2425, -10, 990, 1484, -1377, +-3399, -984, 3171, 1513, 696, -785, 155, -1072, +414, 2016, -1932, -3124, -1126, 68, 3855, 1360, +4074, 17596, 1714, -596, 4000, 1656, 230, -258, +2266, 843, -1720, 4624, -714, 854, 696, 636, +-1357, 350, -1256, -523, 168, -9933, -766, 198, +2680, 8060, 2168, -2789, -14255, 1444, -520, 169, +1032, 1478, 294, -644, -320, 856, 1282, -216, +-1000, -925, 2, -890, 679, -629, 1152, -1329, +-13941, -16385, -1050, -1022, 106, -1151, -41, -709, +1771, -882, -729, -1420, 1544, -120, 386, -838, +-2744, 1559, 904, 273, -4221, -1065, -312, -1046, +234, 830, 387, 172, -956, -332, 360, 408, +125, 90, 348, 915, -264, 911, 263, 124, +-620, -612, 220, 164, 202, 124, -30252, -159, +1006, -320, 283, -1641, -1312, -9057, 5525, 7520, +-2884, -12194, 2771, -1164, 1842, 1261, -582, 766, +2498, 393, 953, -617, -756, -323, -1862, 1195, +-1326, -436, -965, 366, -6727, -1226, 9014, 400, +-1258, -812, -279, -404, 1621, 86, 1622, -16, +96, -515, -257, -39, -134, 1843, -294, -491, +-908, -120, -720, -1162, -1555, 405, -134, 528, +23596, -77, 183, -444, 2077, 955, 649, 2246, +3236, 735, -1202, 7954, 9440, 6134, -7267, 28, +-3398, 500, 4965, -1230, 306, 357, 2942, -906, +-4733, 903, -3945, 4447, 1046, -1125, 465, 1183, +-12710, -1018, -11302, 5177, -219, -6232, 1552, 2061, +-1372, -1290, -822, 295, 814, -3003, -527, -614, +-856, 802, 167, 1178, -494, -1625, 754, -1550, +682, -1286, -480, -694, 86, -67, -1429, -1235, +-559, -311, 322, -308, -56, 296, -158, -24, +-748, -197, 26954, 1054, 209, -226, 165, 681, +-131, 341, 341, 1510, 615, 907, -264, 1355, +388, 198, -5, 418, -783, 28539, 82, -559, +-459, -344, 279, -114, 966, -529, -423, 286, +-418, -766, 42, 186, 461, 418, -688, 2937, +2793, 146, 1709, -665, 2022, 293, -1522, -2740, +-15926, -600, -1503, -1732, -2827, -1027, 1702, 252, +-643, 470, -815, 858, -1954, 1190, 1847, -16, +266, 29, 486, 25985, 139, 220, 433, -330, +168, -362, -562, 180, 906, 386, -845, 664, +1064, -616, -1498, -335, -164, -930, -854, -869, +-101, -204, 835, 117, -16034, -4478, 2634, 1629, +-1873, -1156, -373, -526, 2537, 967, -2433, -857, +1264, -1670, 113, 845, 7654, -1343, 5245, -1605, +2236, -1190, -48, 3340, -1981, -1606, -1369, -227, +-727, -570, 1136, 1868, 667, 92, -144, 531, +949, -1086, 530, 1764, 302, 190, -28036, 182, +825, 229, -656, 585, 444, 200, -1195, -1855, +-387, -781, 1156, 692, -1164, -517, -464, -275, +-328, 218, -970, 174, -384, -561, -38, -720, +-140, 1021, -271, -57, 463, -25313, -342, -40, +26, 159, -854, 916, -1532, -1033, 265, 105, +-719, -588, 96, -435, -296, -226, 224, 357, +30, 576, -66, -30037, -72, 374, 32, 256, +304, -852, -706, 248, -741, -379, 980, 629, +1344, 3858, -2211, -153, -3914, -3775, 1570, 718, +-1042, -1338, -4409, 1338, 5118, 5186, 3619, 2142, +9081, -2784, 4169, 3598, 6621, 4562, -170, -614, +1196, -1174, 5024, 721, -71, 267, 4, 25598, +-369, 356, 331, 1099, 377, -356, -938, 1161, +-863, 1107, -132, 222, 148, 1410, 908, 60, +377, 1280, 468, 690, 454, 247, -4552, 6122, +-267, 2973, -5932, -6424, -4983, -4193, -3386, 1691, +1349, 1419, -3730, 300, 12150, -2927, 1588, -34, +-2435, -271, -961, -1744, 1881, -73, -453, -788, +-798, 9166, 2744, 858, 342, 991, -287, 822, +-37, 1156, -1493, 723, -14127, -1755, 2029, -933, +-1276, 632, -5249, 464, -272, 1149, -290, 4693, +-728, -1475, 841, 10, -283, 92, -268, -295, +358, 160, 405, 2, -381, 679, 716, -190, +128, 275, 255, 123, -412, -453, -273, 26, +-174, -340, 644, -376, 27584, -25, 66, 3107, +-1707, 911, 500, -1029, 1029, -1557, 9020, -398, +-2512, -582, 1131, -16696, -429, -1284, -3, 2320, +-532, -302, -174, -146, -413, 2152, 1009, 42, +402, -1471, 157, 5742, -782, -229, 2379, 646, +2842, -1776, -463, -2749, -3617, -1710, -12281, -566, +263, -3174, -2337, 9590, -1150, 2465, 4577, 2064, +-648, -2175, -1877, -674, -634, -338, 343, -1492, +878, -530, 1072, 13670, -4542, 746, 9704, -4188, +-7076, 1179, -740, -589, -876, 268, -1080, -986, +-4584, 2692, 3032, -2067, 230, -3533, 944, -4950, +-1908, 1452, -255, -698, 1460, -606, -250, -154, +-22303, -945, 1626, -588, -482, -1549, -129, 978, +-631, -722, 1094, 1771, -311, 532, -508, 696, +-1128, 1270, 854, -84, 4290, 414, 3351, 1061, +931, -2936, -9606, -35, 2514, -1095, 567, -452, +-8520, 4037, -431, 2744, -2276, 2647, -1188, -454, +-400, -3698, -315, 11558, -667, 512, 162, -395, +-13015, -11, -1944, -890, -14358, -3850, -4296, 1310, +-580, -248, 1305, 402, -1049, 115, 2085, -1797, +-1172, -321, -919, -313, -512, -131, 1619, 576, +499, -2024, 130, 14, -76, -6324, 495, 2445, +-16757, -2348, -2706, -1906, 2377, -2252, -619, -2579, +643, -661, -1276, 935, 893, 992, -2204, -2451, +-395, -508, 1163, -216, -13034, -718, -1018, -1675, +-698, 710, -257, 2658, 1178, 2046, -2270, -2588, +-14442, -1142, -1026, 2247, -536, 314, 123, -1175, +-673, 1576, -2600, 5, 964, 619, -1714, -14811, +-1502, -1646, -1151, -93, -11652, -222, 343, -2203, +-351, -928, -289, 2679, 2101, 742, 747, -2245, +146, -1828, -2728, 1058, 1048, 3046, 242, 4432, +246, 350, -13419, 768, -805, 1819, 14332, 1316, +-370, 391, -1421, -1426, -355, -812, -64, 196, +-2917, 1097, -1550, -1246, 436, -62, -813, 1350, +555, -2236, -1589, 980, -1483, 10122, -2434, 7236, +-15225, 1513, 2090, -1224, -83, -2821, 664, 658, +-3242, -1031, 1509, 2667, -160, -1315, 1060, 891, +432, -1311, -2503, 1304, 1295, 1745, -722, -2496, +-4409, -3360, -2776, -2793, -4921, 12616, -1031, -443, +1495, -2416, -4640, 4508, -2944, 2608, 1323, -394, +-415, -2111, -2065, 1030, -3636, -1338, 2916, -3007, +-3680, -3152, -115, 577, 2742, 785, -4429, -1945, +-304, -4883, -133, -3136, -1927, -576, 618, 1780, +2568, -2102, -158, -3986, -1187, 280, 655, 162, +-1352, -5730, 15372, -1314, 1553, 274, -2873, 4221, +4610, -4143, -13699, 2760, -1255, -238, 1487, 1583, +1422, -2272, 4734, -6368, 795, -406, 1498, 1588, +-500, -2744, -875, 2080, 1901, 960, 344, 979, +-258, 952, 2526, -11785, 893, 669, 1361, 518, +-1368, 3854, 2539, 623, -1835, -4177, 2686, -2956, +-2804, 1121, -8890, 1377, 1125, -3990, 140, 3594, +1757, 2271, 366, 1723, 2150, 13557, -1768, -1433, +-6632, -578, 3266, 2509, 7142, 680, 1532, 1318, +-1123, 5668, 1283, -412, -5404, 2893, -2647, -2695, +-1412, 340, -650, 863, 1895, 2867, 384, 626, +856, 508, 1365, -295, 960, -26080, 234, -4, +239, -412, -6, -765, 736, -30, 136, 912, +538, -792, 413, 871, -437, 305, 30, -194, +1105, -1113, 3550, -4854, 449, -549, -7626, 3706, +-3698, 1778, 1441, 2240, 73, 513, -3383, -2346, +-1372, 3955, 2973, 1175, -6087, 5071, -2135, 8552, +4961, -1201, -1458, -2627, -730, 515, -756, 476, +-1104, 2115, -1276, 498, 336, -451, 809, -1030, +556, -211, -70, -93, 89, -755, 296, 872, +-282, 380, -298, 2774, 660, 1339, -545, 429 diff --git a/src/main/resources/vavi/sound/twinvq/cb1108l1.txt b/src/main/resources/vavi/sound/twinvq/cb1108l1.txt new file mode 100644 index 0000000..9d0e5cd --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1108l1.txt @@ -0,0 +1,216 @@ +-13570, -9232, -673, 267, -819, 1633, -33, 623, +-850, -4376, -1135, 999, -262, 1928, 695, -1751, +-2793, 772, 5064, -1158, 280, -2144, 1313, 888, +-2482, 469, 2996, -1406, 12525, -1200, -1202, 939, +-3, 847, 818, -924, 135, -1308, -12000, -544, +-592, -3914, 441, 3372, 3188, 1314, -1836, -706, +-844, -1319, 1029, -1754, 172, 2468, -903, -889, +-14602, -2054, 11694, -1980, -730, -1661, 214, 1243, +-337, -646, -95, 1432, -854, -236, 88, -2, +514, -1643, -84, 3561, 302, 770, -1248, 480, +664, 738, 1728, -1783, -2227, -702, -3582, -16641, +1713, 1506, 660, -2471, 2061, -48, -3161, 1697, +900, -1477, 558, 287, -5515, 1023, -1972, 999, +-1856, -3022, -228, 711, 1270, 2644, -648, 1064, +3899, -1205, -754, 1080, 1262, 18, 860, 2274, +655, 494, -221, -15647, 1334, -473, -1648, -341, +3541, 3109, -1671, 639, -2491, 185, 477, -388, +5198, -5680, 812, 700, 2180, -536, -19468, -2508, +2592, 2901, 32, -1165, 1500, -422, -790, -1914, +971, 111, 1226, -1302, 541, -3862, -832, 642, +305, -3870, 8921, 570, 180, 1734, -1572, -891, +17672, -756, 702, 2740, -647, 2122, 102, -1371, +461, 454, 204, -307, -1248, -2330, 1353, -1783, +-1939, -601, 512, 2118, -2178, 254, 1190, -1252, +923, 1166, 360, 320, 320, 1210, -142, -416, +1260, -205, 1403, -1025, 19252, 328, 58, 21, +-1044, 1786, 2153, 697, -436, -1617, -869, -493, +-2419, -3102, 1995, 1519, -1799, -153, 2689, -665, +-1371, -915, 18486, 941, -2612, -1057, 1076, -3351, +-48, -1478, 575, 728, 130, -168, 40, 898, +2141, 1518, -965, -1910, 896, 838, 1220, 416, +-1494, 1404, -126, 21472, 604, 1740, 102, -812, +-796, -734, 1082, -507, -468, -1732, 1171, 252, +359, 436, -765, 791, 726, -810, 1838, -1798, +5662, -2362, 1275, -2829, -4041, 1398, 2681, 480, +13740, -752, 2252, 1306, -1026, 1834, 54, 9993, +559, 1370, 711, 1918, -1757, 646, 16, -3262, +2676, 1751, -2595, 4782, -1050, 2401, -15131, 1100, +386, 708, -359, 455, -25, -950, 241, -482, +268, 2327, -2766, -142, -1992, -566, -36, 990, +-6302, 3245, -1394, -1579, 760, -757, -2115, -8542, +-2945, -800, -4027, -3102, -1319, -1989, -1787, -426, +590, 1031, 467, 31, 2674, 1686, -14352, 1174, +-1446, -813, -1267, 2919, 2052, -1574, -753, 3369, +-1090, 3830, 2042, 11376, 1140, 895, 1130, -720, +-1284, -2277, 49, -724, 397, 13201, -985, 1599, +-365, 1517, -496, 978, 2152, 1391, 1777, 3032, +-936, 280, 1719, -4551, 4874, -941, -160, 956, +-676, -229, -548, 183, -16606, -855, -3433, 1248, +-578, 2254, -532, 3081, -1406, -1859, -605, 1809, +-1001, -114, -1222, 3890, -609, 3114, -2430, -2142, +440, 1780, 1606, -4211, 1047, -456, 8280, 9, +5866, -1718, -932, -13049, -562, 3097, -583, -21, +-1972, 1254, -172, 527, 2282, 5064, -5391, 1074, +357, 1845, 24, -996, 100, -50, 1098, 2905, +-417, -937, -439, 247, 18502, -2380, -2088, -402, +-580, 83, -282, -70, 969, 540, -219, -1132, +-1701, -195, -3030, -2748, -1974, -1304, -1909, 1080, +1042, 1124, -128, 5816, 2303, 2840, -2420, 35, +16550, 721, -2079, -1489, 1023, -654, 2025, 1479, +-185, -2449, 500, 3034, 2663, 3911, 1203, 998, +594, -533, -163, -262, 739, 13, -426, 182, +394, 350, -30055, -371, 150, -430, 147, -1122, +43, -390, 298, 831, -194, 158, -114, -257, +-1346, -585, 206, -456, 478, -502, -1710, -1719, +-581, -536, 45, -861, 825, 1093, -255, -685, +38, -20, 419, -594, 10, -1408, -526, -19191, +196, -1496, 255, 1844, -8759, -3565, -1009, -926, +-818, -1195, 236, 2898, -182, 14344, -1384, 1064, +1181, -1846, 543, -583, 170, -3305, -1187, -2406, +-40, -1051, -1071, -28, 1482, -1060, -1057, 3028, +-2023, 913, 1052, 980, -5158, 4642, -14067, 3920, +1450, -4497, -1591, 842, -2222, -392, -42, -3546, +-258, -3566, 2595, 225, -2696, 4624, 2283, 1483, +-1506, 2164, 151, 380, -3207, -1086, -10594, 2005, +2379, -2567, -925, -363, -1261, 13174, -73, 1168, +2215, -1721, 726, 525, 1048, 322, -827, 2117, +3890, 1346, -3512, 2243, 638, 2259, -1371, -2260, +10590, 851, -1247, -894, 1871, -882, -1955, 3822, +-3654, -1730, 906, 2074, -548, 885, -2501, -1316, +-3275, -10694, 2031, 1077, 3013, -1105, 2951, 1907, +1218, 194, 1860, -1662, 178, 915, 1092, 809, +-451, -610, -728, 799, -129, -101, -905, -2, +2470, 1292, -137, 544, -18795, -1081, -300, -59, +282, -329, -544, -1324, 2155, 9326, 462, -388, +-303, -2940, -608, -13652, 532, -1350, -1026, 1330, +5559, -333, 4961, 707, -1832, 1070, 2483, -2016, +-315, 2197, 849, -348, 379, -2179, -15691, 903, +3192, 3888, 396, 4610, 3261, -2589, -4903, -643, +3604, -1380, 1524, -2155, 469, -3528, -790, 429, +-3862, 1797, -104, 2364, -1162, -1559, 1011, 1849, +-235, -1952, -2088, 1436, 2502, -3862, -1704, -14859, +-2863, 710, 624, 4373, -6302, -616, -807, -1577, +-2492, -620, -917, 948, 4957, -848, -863, 514, +-2210, 2162, -753, -15168, -2068, 12472, -2611, -723, +2797, -8573, -2270, 978, -2597, 2215, -684, 2535, +3114, -261, -178, 2385, -4869, 1161, -32, -1469, +2074, -1407, 3226, -992, 4546, -3158, 1044, 463, +-5285, 4, -1396, -1395, 1770, -1767, -860, -6, +-2242, -1548, -667, 587, -982, -2246, -1312, 1550, +-542, 5302, -716, 135, -15895, 3382, -478, 1279, +615, 3365, 1620, -12613, -230, 3101, 3230, -1307, +2860, 628, 647, -3595, -214, -1631, 2783, 748, +1088, -57, -6014, 2496, 359, 719, 1476, -750, +-1644, -2125, 3913, -3788, 565, -1118, -1411, 1377, +-1020, -246, 18851, -1438, -1150, -1492, -681, -798, +-776, 960, 911, -1449, 336, -1114, -2111, -877, +-532, 668, 1018, 1098, 408, 2032, -607, -656, +-5997, 3089, 2462, -18368, -1027, 78, -4066, 439, +-845, 1476, 290, 490, -452, 1638, -3381, 80, +1699, 458, 260, 1215, -516, 1883, -62, 35, +-2540, -1703, -1042, 1751, -422, 1222, 207, -104, +1112, 151, -473, -522, 26426, 562, 884, -2201, +-281, 238, -839, 1037, -588, 81, -109, -2, +-32, 75, 654, 489, 524, -388, -1408, -906, +-1193, -936, -273, -40, -100, -662, -522, -145, +119, 614, -922, -25329, -180, -668, -574, 161, +-448, 173, 750, -609, -812, -125, 814, 572, +2602, 20372, 244, 1820, 724, 515, 932, -1290, +-712, -990, -305, -13, -763, -1157, 481, -764, +320, 624, -620, 642, -1494, -568, -601, -655, +-790, -1348, 334, -1302, 382, 782, -1122, -641, +-23549, 180, 463, -634, -666, 599, -356, -1071, +816, -576, 1208, 912, -377, 624, 1049, 42, +-95, 370, 1932, -167, -275, 142, -159, -410, +595, -562, -632, 748, 1192, 614, -41, -18, +-156, -61, 1280, -686, 363, 759, 756, -19362, +-614, 2151, -1185, 169, 327, 1494, 782, -1313, +-134, 841, 218, -76, -2980, 202, 80, 281, +89, -61, -1678, 59, -125, 195, 320, -1310, +-56, 806, 47, -65, 249, 18432, -666, -506, +-204, -194, -560, -416, -3641, 330, -268, 842, +10600, -176, 424, -1744, -3609, -1682, -844, -309, +-538, 435, 14251, -1281, 373, 2748, -702, -1358, +-766, 3480, -679, 4039, 529, -5698, -38, -813, +1203, 4734, 318, -1044, -5109, 2187, -3474, 415, +2436, -3021, -1628, -456, -1451, 3406, -1798, 1001, +-8648, 468, 1188, 497, 4628, -948, -4073, -11894, +-2750, -738, 1520, -4070, -810, -5755, -1370, 2978, +4460, 917, 1221, -324, -1166, 2339, -1221, -2048, +714, 6884, 3096, 6998, 13, -275, -3879, 790, +104, 1383, 2056, 1957, -9216, -430, -199, 261, +764, -109, -210, 795, 884, -334, 1546, -272, +-35, 738, -268, -13, -448, 645, 97, 76, +1284, -343, -654, 112, 643, 22846, 634, -597, +-621, -784, -380, 951, -452, -685, 140, 688, +-770, 247, -679, -228, -26856, 311, -546, -444, +606, 69, -195, 18, -220, -334, -42, 543, +-28, 492, 766, 208, -1206, -554, 213, -1112, +-1675, -608, 382, 2011, 5077, -17442, 1367, -702, +-856, -416, -1728, -1987, 2966, -1952, 38, 152, +712, 210, -589, 3029, -1189, -2016, -8071, 10746, +-2143, -556, -1964, 162, -504, 995, 982, -2565, +-634, -985, -1668, 444, -2098, -411, 488, 1397, +-1134, 1888, -920, -279, 15057, -757, -1258, -3040, +-890, -105, -670, -490, -238, -2419, -1302, 915, +-784, -929, 1653, -89, 1076, 445, 2538, -1424, +19175, -91, 437, 752, 254, 935, 854, -1666, +-86, -543, 1053, 664, -155, -485, -3994, -50, +50, -58, -2626, 1801, -314, -16052, -1831, 1009, +2344, -3030, -938, 1761, -1283, -150, -425, -6660, +-900, 1374, 803, 549, -2683, 837, 483, -655, +4610, 1259, -45, 834, 1103, -3250, -3604, -2882, +-2463, -5331, 11312, -1653, -3505, -1855, -4962, 8579, +2370, -2474, 501, -1282, 985, -924, 3452, 456, +-242, 3878, -2095, 2994, 7076, -459, 2574, 16116, +8277, -88, 572, -38, 0, 1664, -553, 1820, +-2096, 1076, 415, -420, 1900, -1696, -130, 298, +-1555, 201, -404, -1831, -932, 844, 9606, -497, +-16304, 3278, 918, -523, -1573, 2488, -813, 147, +1540, 3795, 1390, 1061, -78, -10, 574, 2620, +-1143, -512, -582, -1496, 736, -4323, 786, -2873, +-1342, 3932, 14508, 12635, -899, 1730, -673, 386, +-676, 2787, -2780, -2960, 375, 475, -2188, 2250, +851, 788, 268, 1264, 2973, -94, 1062, 1006, +-697, 669, -635, -986, -4848, -1486, -6, -3914, +6267, -1560, 8, -503, 5273, -3545, 69, 15146, +2263, -1490, -548, 1740, 1636, -892, -895, 769, +-471, 226, 6497, -2466, -2037, -1068, 1075, -902, +13668, -1213, 12424, -3523, -124, -1090, 972, -1134, +-494, -2568, 881, -3081, 369, -254, -618, -914, +443, -1254, 658, 1322, 546, -14, 778, -116, +-378, -802, -268, 48, 1140, 25942, 503, -637, +-871, 1050, 298, -187, 387, -406, 343, 212, +110, 723, 695, -47, -50, -568, -66, 347, +-1588, 20, 701, -485, -98, -787, 4502, 1046, +-1628, -2526, 185, 1016, -256, -700, -403, -154, +103, -752, -689, 2084, -1463, 2294, 360, 17590, +-698, -1262, 788, 116, 755, 751, -440, -610, +-469, 1235, -2314, 1240, -308, 553, 1065, 24442, +-733, 667, 4, -484, 93, -263, -361, -278, +-1524, 176, 1311, 1561, 435, -436, -1079, 260, +-366, 472, -1049, 647, 158, 302, -931, -36, +-990, 736, -444, 1077, -1560, -251, 148, 1000, +1096, -300, -224, -307, -17646, 39, 206, 74, +505, -3051, -1285, -793, -724, 718, 324, 803, +874, 6062, -2235, -3321, -550, 9264, 3483, -4172, +-4024, -471, 858, 2682, -1078, -1922, 2088, 1135, +-878, 545, 2205, 836, -1088, 547, 12461, 2222, +-828, -3841, 4797, -2360, -2510, -4029, -2213, 13736, +1032, -958, 1895, 264, -1499, -2066, -241, 1324, +-224, -792, 776, 2130, 2600, -2276, -4239, 3260, +1610, -1620, -1220, -2752, 979, -2028, 19626, -2146, +684, -729, -235, -289, 588, -600, 245, -879, +-816, 413, -87, -1158, -246, 69, 970, -111, +500, 1097, 1087, -138, -1356, 30, -434, -452, +-22802, 177, 492, 206, -257, -854, 1445, 37, +1384, 97, -258, 811, -222, 53, 548, 1744, +124, -1031, 1076, 186, 453, -173, 1180, -2235, +583, -392, -1542, -726, 2937, -3635, -856, 1446, +7796, -2779, -962, -2277, 1651, 1960, -1460, -1277, +-9794, -288, 2459, 2350, -2521, 84, 578, 2286, +480, 1620, 6421, -200, 170, 1513, 198, -1001, +-491, -1000, 161, -482, 607, 214, 743, -292, +-394, -192, 92, 73, -415, -316, 593, -42, +-346, 456, 44, 950, 129, -189, 806, -221 diff --git a/src/main/resources/vavi/sound/twinvq/cb1108m0.txt b/src/main/resources/vavi/sound/twinvq/cb1108m0.txt new file mode 100644 index 0000000..0d9dad2 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1108m0.txt @@ -0,0 +1,192 @@ +-2417, 4623, 2916, -4257, 120, -10323, 1198, -10252, +-117, 8767, 3160, 2323, 1162, -650, 2237, -4171, +2386, 432, 1627, -7255, 38, 124, -3658, -1558, +-11711, 10, 8146, 1700, -1975, -16731, 2397, 1056, +-2502, -2660, -2731, -2477, 1488, 1220, 4880, -1156, +1805, -3, -3009, -6233, -2216, 3440, -3082, 2124, +70, -2461, 1125, 1919, 11949, -2506, -622, 2209, +-702, 2685, 9183, -510, -2806, -1129, -1823, -1746, +-3600, 2298, -3360, 10793, -1714, 1662, -62, 395, +14142, -261, -144, -9896, 11481, -884, -2197, 352, +-326, -453, -1984, 2027, -1466, 3290, 94, 3481, +2533, 4401, 5492, 3803, 247, -896, -1688, -3166, +1130, -1125, -1973, 322, 867, -1936, 714, -880, +8, 2313, 23418, -1682, -677, 384, -2140, -386, +920, -2523, -495, -1494, 3027, -707, 1172, -1403, +2177, -2137, -885, -1035, -1637, 375, 2452, -3709, +-1171, 2069, 1095, -1937, -686, -956, 2034, 3410, +-3075, -359, -598, -2084, 18550, 1781, -45, 1400, +-1580, -13180, -609, -1376, -3145, -248, 5661, 6886, +-3915, -194, 9876, 1065, 3879, -1726, -837, -660, +-7467, -3055, 3516, 283, -1604, -625, 1165, 3023, +-1531, -1825, 1430, -561, -881, 1346, -129, -1817, +851, -32768, -294, -188, -116, -646, 1176, 630, +903, 417, -2487, 352, -789, 571, -127, -2054, +-2112, 418, 1631, 266, -270, 362, -2765, -1198, +-182, 3586, -1272, 1470, -66, -18384, -1230, 823, +1171, 1350, 1101, 1410, -3730, 1535, -101, -3234, +2315, -34, -458, 1361, -16497, -990, 1438, 2542, +-1193, 586, -1708, 2689, 2741, 6010, 4209, -5974, +-628, 1556, 2238, 6134, -3040, -2937, 2188, -1660, +1137, 1316, -2650, 905, -502, -93, -1177, -31964, +-1170, 1504, -1284, -104, 168, 55, 3478, -161, +2818, -484, -32, -1536, 1218, -854, -351, 4465, +16922, 681, 4198, 419, -414, 6824, -3906, 11598, +75, 4904, 1374, 64, -2692, -3759, 3065, -1397, +-202, -347, -2466, 96, 1035, -765, -258, 3711, +1437, -18250, 566, 976, 2483, 4, -1096, 1906, +3745, -2621, -2756, 1864, -560, 98, 821, -4094, +5349, 1369, -5245, -2170, 2932, -1052, 3932, -413, +-400, 31206, 1125, 1631, 43, -764, 1666, 780, +2036, -564, 64, 1311, -202, 843, -2030, 856, +1766, -3163, -1158, -626, 316, 127, 1783, 1918, +3384, -2887, -5885, 1763, 4910, -248, 17100, -3022, +-1880, -2927, -1287, -3308, -1767, -2622, -1460, -250, +3597, -4526, 946, -1533, 1059, -8, -807, -1283, +1436, -11184, 643, 398, -1565, 1983, -60, -9862, +1219, 322, 3132, -2043, 1138, 6258, -3540, 790, +-923, -4692, -1401, 2733, -8918, 4905, 6181, 192, +82, -1094, 4, -634, -1323, -2865, 1036, 1484, +-2461, -937, 414, 221, 2179, -438, 1273, -2690, +18442, 2781, 1788, 2264, -1230, 4284, -4708, 1190, +-4810, -975, 230, -3728, 2504, 3602, 3488, 88, +1322, 487, 2965, -3731, -2341, 5937, 8545, 1716, +7308, 9017, 6426, 727, 3992, -4584, 388, 3714, +1164, 18, 445, 1253, 398, -1989, -824, -430, +745, -5447, 2176, -1986, -3963, 2861, 194, 17739, +1891, -5368, 4172, 125, 530, -2766, 1179, 401, +1759, -1609, 31234, 910, 1100, 1036, -948, -1101, +-614, 1768, -344, 840, -696, -842, 320, -1444, +-2560, -3199, 58, -2172, 1375, -3002, -821, -863, +-12096, -2484, -677, -2130, 4450, 3568, -3192, -1114, +-3218, 3121, -503, 5570, -561, 3896, 10566, -3065, +-2768, 1398, 1719, -2708, 1952, -142, 4777, -978, +2238, -5780, -430, 1228, -1298, -2923, 4353, -1621, +-2368, -2908, -8012, 4398, -502, 518, -6964, 622, +-377, 3758, 6598, 4438, 6849, -7696, 470, 3585, +466, -14664, 3438, 14706, -1944, -2544, -785, 3653, +1274, 443, -694, 1968, -3499, 2855, -3930, -1210, +-528, 1931, 3849, -772, -2659, 4499, -3624, -540, +-1645, -949, -382, 979, 595, 165, 429, -80, +-20468, 1040, 544, 2545, -5010, -2122, -2840, -335, +-405, 404, -50, -2996, 1226, 519, -1046, 3745, +-2317, 6211, -14500, 9754, -5802, 5230, -3112, 1506, +3741, 664, -902, 197, 2476, -3618, 2040, -1066, +2338, -257, -2580, -293, 2740, -576, 2050, -865, +-3666, -2090, -1831, -32056, 658, 1549, 1602, 1728, +-534, 390, -1517, -627, -4025, -797, -2351, 2759, +-102, 2574, -56, 796, -232, -886, 1639, -2773, +1007, 830, 5880, -2220, 762, -3834, -2865, -415, +584, -3498, -4546, -16108, 344, -4072, 551, -5435, +2007, -1418, 3838, -1662, 1981, 3545, 1424, 769, +2135, 1705, -15076, -636, 283, 3386, 97, -1048, +-3933, 204, -8616, -556, -2936, 4241, 5100, 1777, +98, 719, 6202, -1496, 708, 2160, -2396, 4060, +1513, 2253, -46, -1823, -132, 709, -756, -944, +575, 1070, -1583, 587, -24575, -1989, 874, -568, +1040, 1116, -4002, 3196, 2826, 117, 1590, 2456, +938, 112, -938, -1268, 5056, -2851, 2995, 2559, +-13121, -8374, 3593, -6684, 3663, 766, 747, 1016, +-921, 2241, -1942, 4269, -3312, -1012, 2340, 2781, +-3881, 2532, -1976, -1436, -3219, 420, 22088, -742, +-640, 3270, 1446, 1935, 1279, 1913, 1377, -3297, +-751, 4209, -1052, 2381, 2938, -1330, 2154, 2784, +-2420, 1270, 2334, -526, 1480, -435, 2206, 252, +-510, -1018, -1469, -1294, -950, 424, 1058, -2317, +-846, -20737, -1877, 88, -431, -1268, 116, -378, +-2326, 3115, -246, 30, -4725, 648, 2084, 14286, +-817, 2496, -1947, -4869, -9703, 1505, -2476, -2108, +747, -449, 3002, -5464, -514, 1805, 2559, 2494, +12782, -1232, 12091, 2118, 3996, 2592, 1058, 510, +-1384, -3050, 2533, -408, 5219, 3044, 3242, -185, +2654, -3723, 16, -1723, 1823, 6144, -4806, 182, +1772, 4841, 16390, -96, 2505, -7713, -5244, -3316, +-6776, 1448, -1470, 4238, 294, 889, -2372, -6281, +-2423, 5423, 2119, 2897, 1378, 817, -993, -1599, +-14662, 3014, -3397, -6182, -245, 4897, 5116, 2285, +-2863, 1174, 415, -6777, 3863, -6009, -4722, -119, +606, -2247, 4447, 1064, -1935, 2705, -2629, -1144, +-11980, 3805, 882, 1634, 5446, -4300, 643, 3436, +7632, 592, 998, 674, -2647, 4644, -6854, 1368, +-146, -3395, 10599, 1369, 3852, 1689, 2437, -3937, +3405, 2517, 1895, -14092, -1142, 2570, 10163, 1608, +-2445, 850, -1678, 3112, -3465, 3138, 4413, -1973, +-4151, 1163, 1822, -3819, -1568, -407, -2642, 424, +365, -3599, 164, -1448, 1062, 1536, 1590, -1982, +200, 18572, -230, -638, -1253, 1650, 2280, 4945, +4527, -2353, -4216, 3752, -3807, 3686, -4816, 2382, +-14833, 1306, 17246, -739, 2012, 3521, 1473, -1436, +1514, -142, -461, 1038, 2462, 971, 1354, 1272, +1787, 2420, -922, 3364, 2250, 497, 1349, 2795, +-32768, 425, 1874, -72, 2461, 389, -306, -1180, +-646, 251, 299, -2735, 577, 1055, 1826, 1620, +-1214, 1422, -901, -1273, -2367, -1241, 366, 521, +-433, 55, 4000, 3035, -1390, 2505, 1786, -15397, +413, -5916, -234, 3559, -6776, -5068, 2251, 36, +-180, 596, 5744, -2450, -1276, -4786, -1872, 24, +252, 464, 2833, -136, -25600, -33, 873, 2646, +1471, -1336, -1330, -276, 1778, -242, -951, 1580, +-79, -858, -927, -4310, -604, 7568, -1713, -948, +192, -260, -1334, -1116, -705, 638, 132, 1186, +-952, 1157, 428, 2039, 1568, 1778, 22453, -2190, +2176, 1674, -3996, 1294, 1162, 274, 415, -2877, +464, 505, -1842, -1066, -2241, -761, -291, 8, +-987, -104, 796, -32768, 1302, -809, 571, 1214, +455, 686, 656, -1752, 886, -790, 644, -1114, +2358, 11452, -4398, 1334, 13095, 3230, -1818, 4053, +-1990, -1093, 878, 3796, 2712, -1523, -1229, 1077, +960, 1250, -75, -3233, -7734, 2783, 8430, -327, +-1428, -1687, -4092, 269, 3161, -569, -1267, 1774, +2772, -2033, 171, -520, 1551, 3719, -3364, -220, +1904, -1282, -2008, -818, 4261, -886, -19201, -3454, +-478, -2645, -2601, -2124, -3977, 2960, 1563, -432, +-989, 2682, 1734, -9085, 4614, -4454, 2535, -7201, +-220, -10022, -431, -7907, 889, -9658, 6653, 762, +-1827, 5886, 862, -1836, -430, -16363, 5709, 851, +1814, 304, 5045, 1685, -1004, 5108, -5936, -3143, +940, 1832, -270, -674, 1441, -241, 3222, -551, +-434, -69, -3584, 349, -1354, -12080, 3639, 5219, +7583, -1023, 2078, 3263, -5807, -873, 4085, -5153, +-3623, -436, -4717, -1803, -6274, -2049, -247, 2516, +1922, 10204, 2194, -1574, -535, 656, 1638, -3091, +1156, 1377, -1220, 4956, -221, 4984, -1154, 4603, +-1618, -5655, -2583, 13494, -2442, -3968, 3086, 1098, +-1625, -13781, -12826, 2659, 3604, -702, -1900, -3508, +-6283, 2320, 1979, -2823, -4890, -1728, 2, -4402, +-437, 1932, -3272, 2853, -3018, 840, -632, -6691, +-484, 9579, 1008, 11677, -2814, -2029, 8048, -1170, +-7366, -2664, 3349, 1319, -1160, -1864, 606, 1568, +5428, -4763, -2470, 2145, 1798, -502, -1538, -3736, +-1376, 1330, -3567, -78, 478, -743, 890, -800, +-44, -1832, -1761, -1022, -996, -846, 1188, -1042, +-3202, -2439, 1602, 3601, 564, 18338, -17, 1327, +-387, -1998, -1260, 3352, 849, -4780, 1932, -56, +2625, 10753, -1676, -10536, 2980, 1542, 1177, -3113, +-859, 522, 3092, 9588, 2882, -4540, -1406, -5183, +50, -4245, 3649, -420, -3612, -5290, -1919, 14559, +-2605, 1169, -2009, 10760, -2372, 339, -2538, 4476, +3001, -4570, -3158, -3465, 2873, 650, -2099, 76, +1166, -1469, -2769, -391, 4215, -630, -1448, -1796, +-1573, 5914, 807, -1580, 2072, 99, 580, -2999, +1079, -202, 17940, -1233, -4909, 1079, 390, -891, +1834, -2155, -2642, -1703, 1856, -14125, 2081, 3178, +-2480, -4342, -11991, -2050, 1046, 2412, 436, 1046, +-2291, -1718, -3087, 1710, -963, -1914, -3423, 6190, +-1238, -4333, 115, -10550, -2742, -919, -4849, 1502, +-3054, -3304, 2300, -1850, 2337, -6643, 1995, -1279, +-238, 738, -124, 13593, 252, -1424, -165, 2786, +-1717, -838, -11244, -10971, -902, -3330, -2580, -2735, +-171, 4041, -2149, 2502, 6726, -738, -4235, 368, +6144, -1718, -8620, -1888, 112, -282, -19, 4126, +10797, 610, -3097, 7783, -2974, -2058, -3558, 470, +-5914, 10322, -20, 85, -1652, 6111, -1398, 2613, +3733, -3716, 1930, -4325, -1199, -921, -446, 1095, +1006, 910, -2323, -351, 808, -32768, 274, 1346, +105, 2360, -1184, 2249, -970, 153, 3180, 1307, +2207, -962, 2209, -921, 1504, -117, -2111, -3734, +5738, 8014, 76, 1566, 3013, -462, -3600, 3939, +4862, 1038, 4312, -790, -426, -1656, 20, -10568, +-6389, -6597, 4230, 2910, 2504, -2962, 256, 814, +-488, 824, -355, 3574, -1890, -2657, -767, 2730, +-1087, -2538, -3522, -4067, 6249, -3354, 13923, 4070, +-11004, 4703, 909, -5968, -5483, -4242, -780, -2489 diff --git a/src/main/resources/vavi/sound/twinvq/cb1108m1.txt b/src/main/resources/vavi/sound/twinvq/cb1108m1.txt new file mode 100644 index 0000000..f9f7f60 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1108m1.txt @@ -0,0 +1,192 @@ +752, -4098, 7726, 592, -9487, 2004, 318, -4322, +6989, -3350, -478, -4308, 2023, 753, -7081, -3934, +-866, 6267, -5710, 2100, -8467, 100, -4654, -6773, +4271, 10728, 11618, 1128, 12733, 1471, -5518, -1162, +-2159, -402, -632, -4720, -28, -1412, -1037, 897, +-1242, -1735, -2632, -3460, 3389, -582, 206, 325, +-2547, 46, 1340, -4424, -13408, -4918, -2832, 1454, +2127, 1276, 2292, -3973, -3230, -7810, 542, 4227, +2673, -8490, -902, 1361, -1398, -1986, -991, -680, +602, -2887, -557, 2656, 3214, 1794, 31241, 1462, +-1457, -3750, -1923, -2381, 1313, -128, -172, -647, +-574, 1045, 2438, 1662, 503, 288, 1535, -1016, +2487, -820, 4692, 2799, -31949, 166, -1655, -2192, +-636, 1357, -2361, -459, -1752, 2782, -293, -144, +1900, 685, 1766, 1900, -347, -4488, 590, 915, +798, 1133, -4494, -1388, 75, 884, 13088, -2392, +679, -315, -7520, 1086, 3873, 3297, -812, -626, +-9443, 2548, -6417, 1619, 7196, -57, 5, 3594, +-1922, 184, 2784, -261, -3310, 2779, 174, 2814, +-965, -2912, -1835, 425, -4285, 896, 2001, 3717, +775, -1192, 22365, -175, 1522, -711, -1135, 5123, +-517, 870, 4323, 585, -437, 260, -1737, -1984, +2522, -2539, -973, -8812, -16173, 4678, -4107, 130, +-7832, 1140, 2792, 3394, -692, -4105, -299, 1488, +1246, 604, 2796, -3767, 579, 188, -1544, 86, +424, 1204, 4441, -1000, 15227, 3459, -3444, -1631, +-2177, 3497, 1684, 925, 2872, -3905, 5729, 647, +913, -758, -547, 566, 1787, 792, -1509, -1641, +-926, -1515, -116, 1266, 481, -3944, 28526, -2279, +5577, 1026, 4082, -605, 696, 1094, -478, 5732, +7247, 1461, 1521, -234, -42, -878, 270, -554, +3702, -71, 1362, 7719, 305, -13654, -4985, -1072, +-2044, 6851, 438, -8435, 923, -537, 1511, -1003, +2056, -2299, -15578, 503, 1944, 3188, 2318, 1761, +1290, -2322, -568, -1591, -2746, -1966, -9784, 1514, +-5596, 4070, -181, -3006, -1903, -240, -1143, 393, +-1530, -822, 520, 989, -1600, -3374, 946, 678, +86, -1957, 1947, 1188, 356, 719, -2874, -2245, +-19010, 547, 9067, 439, -2384, 847, -3307, -116, +-1114, -445, -3505, -967, -1252, 4880, 625, 1478, +-2970, -2275, 1337, 422, 3870, -1906, -1033, 1724, +-532, 1734, 1011, -21848, -477, -251, -615, 770, +7520, 1030, -4372, -446, -3156, -2314, 172, 901, +70, 1837, 1205, -1344, 2933, 1080, -1290, 1353, +10205, 1158, 11135, 560, -3480, -2376, 7539, -5418, +-14092, 2138, -253, -9344, -1907, 2177, 687, 2772, +-2730, -546, -4180, 2021, -577, 2530, -3822, -7080, +971, 2083, -1220, 203, 3187, 3705, -752, -2591, +-704, -17469, -1168, -214, 2518, 308, -585, 1117, +-1893, 2488, 1856, -23, 2418, -2922, 1960, 235, +-1629, -8277, 1088, 2032, 874, 2763, -1867, 60, +1684, 834, -2676, 1574, -3098, 3250, -3723, -126, +59, -787, 2710, 930, 1384, 475, -3915, -1162, +1640, -16818, 2356, -70, 761, 4151, -778, 523, +-183, 19374, -4223, -1379, -1667, -1690, -512, 8742, +-34, 3816, -678, 2749, 2418, -341, -1216, 4280, +-2208, -264, -2884, 4679, -821, 1824, -6724, -1528, +-12042, -9908, 935, 4338, -116, 612, 6, -161, +1935, 1600, -442, 4059, 2510, 2186, -7678, 3600, +-2460, -1072, -122, -1817, -246, 2786, 9079, 525, +-226, 2628, -2549, 1459, 4533, 1111, -17410, 4529, +-2545, -3272, 403, -2758, -1876, 2734, 2136, -6171, +-2055, 1163, -2820, 2992, 2978, 1458, 1572, 2508, +13576, -1545, 14861, -796, -6444, 4022, -4358, -529, +3439, -2630, -2457, 3030, -2972, -398, 471, 2547, +1127, 1344, 202, 420, -1858, -589, 594, 1478, +5590, 1682, -1560, -378, -2198, 400, 2231, 566, +-80, -2042, -4557, -2309, 8743, -4258, 1291, 11770, +718, 2342, 2912, 5170, 2470, 6832, 833, 4990, +2009, -1258, -898, -1414, 1214, 670, -2104, -5068, +788, -18997, -743, -864, -356, 1592, -5786, 652, +4952, -2319, -1097, 2177, -1654, 2879, -1645, -172, +-1581, -3062, -805, -1065, -2222, 20857, -1146, 864, +1690, -1794, 855, 307, 2320, 3618, 6184, -4129, +187, -2423, 4946, -3072, -213, -2621, -2026, -5793, +-986, -1597, 2125, 1474, 1766, 360, -4652, -1030, +1546, -1085, -253, 1016, -96, -1608, -7017, -4855, +1295, -271, 3751, 341, 19804, -2006, 2322, -2298, +353, -2077, -764, 212, 150, -1140, 564, -614, +268, -2023, -332, -699, -937, 1684, -1617, -22863, +1202, -144, 62, 373, -598, 184, 987, 3721, +-611, 86, 3676, 362, -652, -214, -311, -694, +-1973, 2351, -733, -1601, -1189, 28227, -154, 10, +-347, 3400, 1333, -1695, -773, 1362, -447, -2999, +-626, -1776, 2474, 2195, -1041, -797, 1828, 62, +3397, -1779, -2924, 1740, -1694, 4083, 15100, 3871, +-7821, -108, 292, 998, 3141, 5813, -918, -1290, +-902, 895, -1336, -50, 2014, -2066, 2383, 68, +31769, -334, 1243, 1981, -715, 125, -380, -1272, +1068, -357, -1734, -1138, -630, 1042, 688, -438, +-558, -2460, -2894, 4196, -1004, -2177, -2291, -4701, +-13990, 747, -5558, -2754, 1950, -2780, 8414, -1286, +-946, 220, -2507, -192, 3726, -1361, 1296, -2215, +872, 8270, -2797, -6732, 1256, -1957, -2916, 107, +-14847, 1868, 4638, 1292, -1006, 5285, 2947, -5028, +942, 153, 420, -1152, -391, 3612, 4621, 172, +762, -876, -3561, -14406, -552, -2570, -4448, -15704, +-806, -928, 3380, -686, -2604, -3895, -714, -626, +-1763, 1144, 485, 34, -1922, 1528, -213, 5050, +-804, 185, 96, 3320, -621, -329, -1444, 864, +-1684, 16583, 1872, 3327, 2146, 1132, -8216, 73, +6524, 1623, -4147, -4985, 1450, -646, -7189, 4524, +-1596, 2120, 3913, 680, 2094, 1660, 752, -1221, +2414, 3986, -10314, 2096, 129, -5458, 634, -5426, +-594, -9731, 2083, -2284, -5085, -4777, -1323, -1740, +6157, -841, -126, 247, -1163, -7005, 3863, -764, +-1552, 1356, 10788, -745, -12481, -73, 5234, -3220, +2979, 635, 3372, -540, -36, 2887, 5221, 931, +-1724, -4824, 780, -49, 120, -739, 890, 714, +-1438, -458, -1861, -16732, -1858, -13282, 2182, -6796, +-3307, 556, -2968, 542, -2358, 1463, -3536, 1866, +2833, -1369, -1576, -2825, 3561, -1625, 1858, -1052, +-1079, 1302, -2049, 19052, -1188, -4137, 1592, -4705, +1082, -1168, 2355, 649, -1900, -2582, 1000, -3065, +-2399, 3625, 1062, 860, 2586, -2645, 14755, 3147, +5002, -6720, 1728, -2114, 5090, -2838, 3020, -5048, +4182, 2237, 706, -4945, -86, -1908, -1207, 135, +675, -200, -22134, 1492, 2490, -1324, -1135, -842, +1457, 185, 1342, 3516, -882, 1069, 1159, -52, +1844, -1186, 554, 3860, 1824, -2136, -881, -1281, +-13259, -705, -90, 2150, 573, 2787, 1068, -1968, +121, 805, 4382, -1033, -9220, -744, -1446, 7180, +257, -5983, -1643, -6198, 1854, -3524, 1060, -118, +56, -843, 2832, -98, -3493, 368, 6, -1877, +-3615, -1954, 17971, 962, 1532, -1754, 3776, 661, +-2025, -60, -1013, -1222, -3062, -69, -4933, 3064, +-1176, 213, 477, 1081, 1679, -2328, 1984, -21759, +-881, -54, -1101, -1092, 598, 1648, -3384, -213, +379, -1318, -1972, 630, -536, -1970, -461, -356, +-22416, -1855, -113, 876, -2809, -587, -2323, -56, +2177, -797, 1649, -4069, 1350, -2075, 101, -1384, +1703, 1085, 471, 8093, 1020, -4112, 970, 866, +-1456, -341, 1418, -12938, 379, 9787, 1814, 2337, +-1705, 9913, 1026, 1962, -744, -2900, -1690, 1534, +-959, -629, 2330, 3735, 4742, -3139, -2135, 2298, +-2765, -1389, -3634, 27139, 671, 2208, 494, 1015, +-1197, -239, -321, -1145, -679, -637, -3116, 544, +-952, 882, 396, 1087, -3163, -2684, 759, -725, +-2186, -542, 2545, 3669, 24, 1689, 10473, 1836, +-419, 322, 2475, 1908, -1346, 50, -6401, -3644, +552, 2348, 1327, 11853, 2467, 5493, 1544, 464, +1796, -2801, 8217, 1014, -2103, 3764, 8091, 170, +-12422, 1708, -2438, -1873, 1970, 2160, -5027, -647, +-118, 2830, 2379, -1091, -5723, 124, 3017, 417, +55, 1376, -1079, 7122, 3086, 17847, 2468, 3273, +-599, 3302, -922, -2073, -1696, 805, 2022, -1899, +3188, 1425, -4364, -140, -3760, 437, 1393, -1298, +17166, -1283, -2904, -692, 518, -404, 944, -1990, +-968, 1323, 2376, -11708, 2187, 3164, -559, 2212, +1598, -1741, 360, 633, 3075, -660, -1012, 778, +565, -2020, -123, 5, -2217, -2967, 374, 272, +336, -1725, -408, -2270, -2645, -1044, -517, 1911, +-386, -4439, -7603, -1000, 7660, 589, 14931, 2901, +11998, -13102, -1919, 3904, 86, 1617, 7324, 3078, +1714, 4636, -2504, -194, -3274, -710, 33, -1965, +-2298, 2513, 726, 75, 67, 884, 2104, 4110, +1936, 10387, 2722, -1970, -12496, 4799, 3086, -2938, +1719, -2138, -338, -1124, 971, -4200, 480, -3361, +6220, 5954, 1830, 1001, 2996, 4166, -2854, -437, +-1430, 1072, -312, -12949, 3113, -2479, -2034, 6956, +2805, 2128, 856, -8803, -4709, -1274, -120, 1252, +3898, 6526, -3914, -2276, 2754, -2604, -3038, 4136, +2598, -2172, 4861, -2457, 2, -2693, -808, 3527, +-1184, 392, -2202, 2406, 960, -1064, -2589, 1161, +2418, 728, -466, -4865, 211, 14720, -2093, -1977, +85, -12618, -2073, -3028, -1067, 1734, -2491, 9506, +-422, -2718, -2966, 3883, -2852, 336, 1306, -2297, +2009, 2589, 3071, 192, -1239, -10553, 2, -1174, +-3036, 9939, -27, -1278, 1448, 18655, 761, 931, +445, -94, 206, 448, -1865, 232, -4353, 4596, +-260, -976, 594, 648, 796, -1376, -1186, 3056, +3171, -5675, 6179, -1287, 16934, -1478, 1090, 577, +8075, 1119, 2943, -3208, 1852, 1986, 6003, 901, +-962, -3196, -1907, 392, -2605, 2796, 4082, -456, +-3109, -1219, 123, 2470, 174, -1254, -1350, -4919, +1271, 12302, -1154, -6317, -3346, -1315, -144, 1214, +-49, 3491, -1029, -2043, -8373, 4197, 4971, 9808, +9732, 700, 2247, -2755, -2034, 3260, 839, -10554, +1661, 11484, -3180, -1909, 1089, -813, 3116, -2103, +-3726, -4514, 663, 1152, 3902, 4862, 2739, -3828, +707, 2712, -8009, -832, -16492, -1472, -2422, -5593, +322, -1894, 2810, 109, -1788, 2050, 3539, -3112, +-6178, 2487, 2102, -135, 3163, 2096, 4123, -310, +-1090, -2, -2662, -17087, 1373, 1448, 162, 527, +655, -2248, -3530, 194, 1305, 7590, -5515, 1225, +1607, -3816, 2185, -2679, -4486, -582, 4981, -1675, +147, 14790, 119, 11771, -1228, 1012, -6133, -2247, +-3913, 1348, -1846, -513, -6386, -749, 6726, 745, +-809, -799, 3224, 43, -2230, 2598, 2994, -1590, +-11198, -14476, -256, 695, 877, -3680, -2734, -1448, +1336, -1633, 3327, 3497, 2956, -782, 2958, -1866, +2876, 2003, -856, 1282, 5068, 391, -10539, 1703 diff --git a/src/main/resources/vavi/sound/twinvq/cb1108s0.txt b/src/main/resources/vavi/sound/twinvq/cb1108s0.txt new file mode 100644 index 0000000..cd2af75 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1108s0.txt @@ -0,0 +1,232 @@ +-32768, -828, 9569, 331, 6938, 3122, -1008, 2847, +646, -5690, 1712, -795, -4406, 1368, 307, -526, +-2206, 26, -210, 1358, 746, 1920, 667, 3866, +-413, -720, -4328, -2475, -1189, -863, -3809, -5052, +-8567, 2859, 1915, 4895, 12440, -13002, 2757, -5969, +4054, 1100, -9430, 4930, 10266, -1522, 7092, -8778, +-1968, 4325, 8440, 3888, -1966, -688, -2455, 2966, +-2380, 1682, 4956, -2310, -3706, 404, 6774, 17562, +-12437, -2667, 4864, -9411, -6436, -9316, -903, -5526, +3463, -1690, -5250, -12568, 2338, -1310, -3019, 776, +-641, 3483, 54, -10732, -3878, -691, -17615, 4530, +10267, 7830, 8488, -12624, -4514, -17183, 7070, 3115, +4176, 383, -4558, 410, 6379, 6242, 4702, 4853, +-217, 446, -3811, -2396, 244, -2120, 3275, 5122, +180, 4523, 8680, -1868, -6164, 2636, -5056, -4039, +-11618, 4014, 11349, -2616, 8240, -5119, 1988, -2552, +6060, 3206, -662, 2686, 1116, -10447, -3004, 650, +7811, -12148, -327, 856, -916, -397, -600, 4621, +3011, 5539, 5417, -2374, 9667, -4714, 7821, -2819, +573, 4492, 1882, -26770, 1486, -6963, 1103, 2515, +8196, 1849, -7492, -5243, 2106, -5290, -11000, -1410, +-3448, -8548, -4536, -7730, 3083, 6109, -14458, -8624, +-381, 7840, 4694, -3906, 8223, 3315, 5849, 13112, +-13132, 6081, 11801, -7624, -376, -6372, -6817, 6834, +1760, -1435, 1072, 3505, -1494, -709, 5786, 454, +1807, 2650, 7728, 1357, -1002, -5366, -2368, 2052, +333, 6312, -336, 8274, -1653, -4309, -6630, 2841, +2448, 8398, 5376, -7248, -1474, -1842, -4119, 838, +501, -4206, 4052, -1250, -20943, -3338, -592, -2973, +7057, -128, -3235, -4313, -2510, -11313, -4925, 3103, +1448, -5186, -1322, -16815, 1956, -7950, 2641, -2890, +4396, 2322, -1381, -1911, 448, 2543, 3535, 782, +3719, -624, 1610, -2843, 7583, 1794, 700, 3107, +4528, 5461, 2540, -1074, 5976, 741, 576, 4426, +4400, -4920, 5724, -3734, -1186, 10645, 1100, 10537, +2828, 11670, -8391, -32572, -9405, -6807, -875, 2277, +736, -4546, -18693, 1204, -1083, 3422, -3328, 6013, +-2992, 5812, 2744, -11668, -2519, -2384, -3635, 6532, +6874, -2820, -5222, -12261, -14266, -6663, -1150, -2032, +2099, 4642, 1638, -4162, -644, 249, -3133, 11830, +-10712, 12370, 4818, -1924, -5639, -6448, 2455, -4898, +-613, 1760, 2393, 1414, 7039, -7018, 5901, -2900, +3786, -3230, -3718, 3514, -4040, -4676, 6367, -1449, +-2758, -2888, 4066, -7140, 408, -7656, 3156, 19919, +-1858, 6671, 352, -3355, 3074, 5524, -1429, 1954, +-6664, -10082, 4405, -1598, -806, 1779, -6913, 7062, +5064, 6518, -1042, 3400, -5530, -1192, 590, -3298, +-772, 571, -6239, 9810, -12380, 1302, 1344, -3430, +3830, 4106, 5792, -6196, 224, -2604, 3954, -12551, +-5539, -8306, 1801, -4521, 3578, -4349, -5716, 4960, +3620, 1516, 5779, 5550, -3710, 3329, 10542, 4198, +5148, -3291, 196, 6232, 6943, -1303, -10306, 1862, +6547, -1544, -2996, 2868, -4389, -6894, 28557, -13130, +1397, -2331, -4076, 2870, 3592, 6613, 265, -4790, +-3514, -3152, 8710, 230, 3142, -1264, 1822, -769, +6168, -1792, 2189, 2660, -2664, 3402, -533, -3100, +-476, -1164, 6092, -2930, 3372, -5895, 8507, -918, +-4716, -1582, 23959, 1506, 2360, -117, 2029, -452, +-6575, 964, -13132, -2838, 3800, -3355, 3168, 5230, +11116, 826, -1711, -3546, 7398, -4092, -2884, 743, +-1784, -3824, -3437, 1050, -3306, 928, -5109, -7999, +1581, 8609, -4662, -3594, -1618, 9929, -3982, -5591, +-8789, -1444, -12011, 1304, 12668, -5138, 10837, -7951, +-4089, 3921, -5375, -2486, -2590, 11398, -80, 7734, +-4547, -11286, -7098, -7758, 5303, 7380, -11266, -11138, +-8676, 30, 6328, 597, 7852, 3144, -3933, 15142, +3954, 12197, -507, -1667, 5517, -4187, 709, -1330, +2094, 4739, 1341, 8276, 8544, -10107, -10151, 3641, +771, 4798, 4839, -3254, -9246, -7304, 14850, -18155, +3068, 4993, -4930, 10985, 6270, 8528, 5904, -13010, +-7824, 1300, -706, -156, -4228, 302, 9962, -3087, +4472, 4541, 13179, -6576, -2541, 8284, -51, 5366, +-4369, 289, 3890, -3671, 1894, 21820, -3031, 5336, +-8412, 2487, -1211, -6759, 1292, 3749, -8904, 638, +6863, 154, 1145, -684, 6648, -3874, 2005, 4670, +4408, 4191, 3984, 632, 2957, -1532, -3974, -2576, +-1636, -3714, -136, -4946, 3900, 367, 27072, 1864, +1426, -3321, 860, -1768, -2009, -3436, 2666, -9899, +-1328, -2330, -3078, -3258, -4600, 5604, -5248, 1703, +4403, -4781, -8275, 6717, -3860, 10980, -10634, -8360, +-2291, 20311, 7602, -4028, 483, -4886, 2677, -4921, +6065, 5393, -2145, 6201, -472, 1796, 2869, -3578, +3053, -2342, -3193, -2589, -3215, 1322, 536, -164, +-314, 4800, -1903, -1338, -11833, -23399, 5562, 4440, +-1864, 2520, -4251, -1464, 5053, -8553, -3852, -5932, +-849, -7113, -3493, -5338, -1671, 1496, 4504, -1830, +5716, -210, 1397, -2060, 2242, -583, 2604, 5355, +13938, 13150, 1346, 2649, -1527, -4568, 8891, 7399, +-6492, -10371, -4885, 13056, -8262, -1267, -2959, -868, +5941, 299, -601, 8834, 1436, 5404, 1914, -3775, +980, 8848, -2270, -1952, 6902, 8642, -25725, 9556, +14540, 1998, -13157, 308, -13844, -10126, -2147, 8296, +1772, 1094, -9712, -8560, -7552, 5527, -1446, -1097, +-5798, -17270, 2860, -210, 2136, 175, 729, 11775, +-5154, -4202, 13342, 3977, 14494, -5659, 9105, -11067, +-3694, 4794, -593, 6817, 1875, -4975, 3663, 4141, +-8317, -8932, 2127, -4176, 1136, -148, 7640, 8127, +-744, 2354, 389, 1600, -6475, -4558, 10735, 11407, +3896, 13098, 1814, 5191, -3850, 2629, 18430, 8343, +4630, -4624, -702, -3834, -2276, -2894, -1556, 1437, +424, 5652, -6260, 2387, -5845, 7496, 10657, -2754, +4806, 1169, 1308, -4114, -5347, 15076, 5686, 7287, +3004, -6254, 5186, -14096, 10323, -1974, -9355, -5544, +-986, -5998, 261, 4494, 2467, -1911, -603, -4548, +-1344, 1995, -1603, 10464, 5222, 3714, -5342, -8039, +12530, -26465, -1813, 4044, 746, 8123, -12078, -4703, +2971, -4487, 2556, 3904, -2518, 1504, 5774, 5431, +1120, -934, -5202, -6826, -8774, 7156, -2392, 10643, +-2918, -4298, 3361, -3758, -894, 5828, -203, -4905, +6480, 11771, -19830, -17545, -4920, -17263, 10066, 10125, +-8980, -19719, 23554, 27907, 2607, -7014, 6128, -23759, +-4802, -7099, 874, 13103, 21667, -8475, -12938, -13122, +-3694, -18860, -3518, -3586, 12658, -793, 10661, 6925, +-730, -11373, -7845, 94, -2627, -6044, -2213, -4381, +-10198, -5816, -56, -4349, 3722, 3911, -1719, -2513, +-13290, 3218, 105, 1876, -76, -1107, 2563, 4520, +10288, 5862, -7738, 6180, 9863, 1380, 6756, 2632, +-18798, 9314, 7190, -7454, 432, -15141, 8462, 2128, +-2386, -2710, 292, -751, -3125, 6147, 4941, 3146, +3046, 120, 321, -5884, 5105, -4300, 6264, -317, +1667, -694, 7950, 5639, -3284, 1089, -6456, -14694, +-3527, -1104, 4313, -20858, 7920, -10782, -13536, 933, +4523, 2640, 2118, 97, -614, 9834, -9515, 232, +5086, -6720, -1529, 568, 3139, -3665, -8567, -13771, +6274, -4370, -5653, -8920, -7667, -9391, -6653, 12489, +-3666, -5103, -12324, 4796, -540, 10396, 3668, -3467, +7124, -4398, 87, -12139, -204, 1213, -2190, 11948, +-2641, -2434, -5647, 2819, 3148, 3558, -6455, 3705, +1644, -3090, -4225, -5998, 112, 17789, -7220, 2166, +4153, 4516, -1100, -1667, -1402, -8837, 6344, -1586, +-3451, 2357, 616, -392, -8163, -11579, 6160, -2783, +7895, 11321, -11847, 8070, 5231, -6496, -3172, -3470, +-2960, -11437, 465, -470, -2568, 11197, -9417, -4117, +-1162, -1893, -2361, 551, 14478, 3510, -1372, 3117, +-8236, -2904, 14556, 3191, 200, 2166, -13974, 2718, +3946, 2444, 1982, 5320, 2087, -2222, 1573, 742, +-8828, -3917, -11080, -241, -8472, 6119, 290, -2364, +-3163, 1923, -1964, -582, 2564, -5566, -6411, 2069, +7392, 9115, 25316, 1504, 2540, -814, -1746, 566, +-1580, -2290, 170, 698, 105, 9567, -6714, -584, +-4934, -379, -491, -978, 4580, 1180, -3355, 1882, +-4343, 4817, 1503, 9968, -8878, -4908, 3419, -4818, +-2254, 6694, -4368, -10849, -5093, 4510, -3129, 152, +1926, -4490, 1510, -17764, -6699, 962, 3474, 4981, +25, -7128, 1432, 5386, 3108, -4545, 1092, 1663, +-1363, 3076, -8916, 6158, 244, -1181, -825, -933, +-5570, 17221, -535, -2892, -5031, -1297, -3010, 5840, +678, 748, 3944, 1630, -3648, -5457, -2618, 876, +6655, -2834, 2597, -6667, 1330, -40, -4423, 6257, +743, 6083, -584, -3742, -1401, 1779, -5166, 4559, +5558, 8588, -6476, 7521, -1561, 4950, -778, 3564, +11403, -1010, -3151, -14151, -1020, 2595, -3278, 24555, +-4859, -909, 2314, 1301, 2098, -5664, 3938, -4050, +-203, 3368, -2580, 3061, -9266, -6263, -6748, 3890, +1950, -329, 1050, -1106, 588, 23705, -661, 6913, +722, -5820, 2147, 3789, -1689, 661, 5389, -8519, +1152, 3800, 7160, 5234, 1343, 3218, -2900, -391, +-4258, 5084, -4783, 7262, -10013, -811, -5252, 6474, +-17338, -2388, -2596, -8715, 5836, 9523, 639, 4652, +3071, 3114, -1648, 1563, -931, -10143, 4394, -2838, +-11900, -1012, 841, -5812, -3048, -2715, -196, -5794, +-20022, 1949, 3464, -770, 2200, -3564, 1975, -6242, +-1937, 3954, 5678, -2744, 1888, -3825, 5770, 3869, +8315, -7386, 1318, 1302, -5534, -4554, 924, -3804, +-4292, -22757, -7972, -7469, -3543, 7858, -10125, -2637, +-4765, -10644, -5944, 1159, -3293, 4363, -1219, -12248, +5060, -7232, 6947, -1609, -3037, -5084, 6580, 15873, +5336, 7295, 2386, 2961, 4655, 9714, 5080, 11635, +1790, 2897, 687, -914, -692, -6653, -8562, -1412, +244, 4478, 1650, 7175, 1046, -6689, 3693, -3520, +6046, -1336, 1976, 16822, -1176, 792, -1733, 8286, +-7359, -2402, -8536, 1392, -3271, 6580, -4939, 1562, +595, -4237, 4872, 4266, -1798, -6589, 7457, 4207, +9978, -3996, -2236, -3078, 1861, 10101, -2394, -3250, +-7619, -7082, -14305, 5664, -1337, -11019, -3839, 10190, +7249, 3086, -1782, 24, -3566, 10769, -4102, -6408, +-688, -8987, 3018, -5942, 7478, -368, -7931, -3018, +6766, -78, 5705, -3264, -1100, 4850, 4518, -28, +-6276, 4905, 7094, -4394, -2846, -88, 434, 2039, +352, 9827, 12372, 1207, -8561, -4476, 1496, -4927, +2087, -6730, 1134, -81, 57, -8701, -2918, 3953, +-2844, -1842, 4804, -5315, -401, 7060, -16397, -4802, +-9849, 17542, -11715, -12432, -6676, 9323, -13189, -5761, +8054, -620, -7431, 3726, 17790, 7880, 251, 2983, +3736, 7118, 17197, 8613, 1445, -15290, -16184, 11084, +-4971, -5922, -1893, 9067, 9321, -8139, 714, 182, +-3138, 7258, -1874, -2781, 10800, 2915, 5316, -5206, +-2581, 10219, -484, 862, 119, 6628, 1514, 3883, +-880, 7586, -2573, 3279, 3801, 4492, -3850, 9416, +-38, 7518, -574, 4052, -1136, -668, 9672, -9536, +2551, -4223, -1074, -3616, 8446, 158, 3262, 7965, +1311, -8634, -6786, 700, 4973, 917, -754, -1156, +6054, 2067, 10757, 421, 1030, 11351, 2149, -4286, +12075, 4593, 1193, -5290, -8566, -2965, 6824, -6238, +2392, -3395, 5350, -2789, 7529, -1873, 3032, -1494, +-2703, -18535, 1583, 9539, 2556, -4422, -6079, -2699, +-7860, -4573, -8236, 4281, -1079, -17578, -2840, 7468, +4675, -5002, -1268, -1529, -8222, 8285, -766, -4314, +6048, 11507, 5046, -2444, 3186, 1732, 7872, 6598, +2828, -2920, 8278, 13263, -10204, 1334, -5552, 10532, +5412, 2554, -10076, 1128, -3959, -3210, 4091, 1824, +4984, 5558, -2204, 2080, -3802, 6614, -7380, 3612, +-4624, 6366, -1795, 4038, 6227, -4312, -4910, -2127, +15077, 4144, -16885, 3757, 2303, -670, 5625, -2590, +-2594, 2491, -3174, 4199, 1152, -1532, -7308, -8578, +6431, 2975, 6032, 3037, -7451, -2643, 5503, -7856, +-2451, 5309, -3678, 8145, 1864, -8341, -15575, 7716, +-10337, 8935, 12350, -10418, -4092, 734, 10400, 10934, +5724, 1778, 5836, -3203, -10700, 2766, 4178, -18135, +-16589, -5465, -5005, 7239, 25480, 7310, -6408, 6142, +-7748, -1423, -4318, -321, -2899, 3728, -3184, -3578, +-11598, -1223, -8554, 656, -3945, -4084, -724, 301, +9539, 9695, -1799, -2602, -1379, -5282, -4709, 11858, +9562, -7508, 4886, 896, 5780, -160, -12724, -9598, +1220, -5411, -5072, -6476, -11763, -104, 9311, 5230, +591, 4342, 263, 13198, -17801, -1892, 2619, 18194, +-2080, 16536, 18497, -25926, 25541, 66, -6648, 1627, +2794, -3790, 9424, 1387, 20702, 5260, 5211, 1702, +1019, -11143, -6501, -18711, 10869, -4204, 4994, 1722, +8569, 3670, 4386, -16874, 8876, -2297, -2743, -4562, +-9207, 8033, -346, -3586, -9451, 3242, 1552, 4278, +-6787, 7118, 3630, 4602, -7371, -12789, -10424, -14922, +-3010, 1885, 4144, -4490, 4074, 7796, -1201, -7244, +2675, 1221, -7060, -12828, -3520, 1983, -4615, 8207, +1606, 517, 3646, -7252, 816, -3690, -674, 13100, +-16254, 4727, -8184, -968, -5366, -2288, -20260, 1174, +-19384, -4199, -5292, 582, -13118, 1836, 1698, -2034, +-14601, 6642, -10530, 482, -851, 9968, 7050, -13366, +-8354, 4740, -20050, -193, -1881, -1205, -4042, 7067, +12872, 5846, -4792, -1833, 2504, -3222, -1607, 2634, +4587, 6761, 1549, 1124, 9427, 3978, -8305, 7524, +2507, -5744, 3238, 5238, -3664, 694, -28496, -1674 diff --git a/src/main/resources/vavi/sound/twinvq/cb1108s1.txt b/src/main/resources/vavi/sound/twinvq/cb1108s1.txt new file mode 100644 index 0000000..cd08ef7 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1108s1.txt @@ -0,0 +1,232 @@ +-10979, 8698, -630, 4660, 3060, -7292, 10140, 11942, +1448, -5820, -3144, 3100, 10575, 6888, 3505, 9996, +2787, -484, 8057, 1503, 6329, 3074, 3954, 9419, +-736, 2333, -1858, 3264, -4026, 16130, -14501, -5284, +-472, 850, -7258, 1542, 1473, -2348, -7055, -9574, +-2275, -4383, 7542, -360, -2945, -3878, 28, 809, +600, 2246, 587, -1779, -3456, -737, 3242, -2523, +-1862, 6127, 899, 1070, -15614, 10990, -3084, 9546, +7339, 8899, -1490, -10379, -9193, -3857, 8289, 7261, +12489, 7814, -6458, 1223, 15486, -10960, -1880, 4922, +-7819, -527, -2370, 3687, 1358, 10367, -14266, -1496, +1060, -9325, -5582, -3947, -17536, 1470, 4878, 10793, +2904, -2566, -4995, 6549, 6141, 11048, 3177, -494, +9087, 797, -2575, -5616, 1197, 2966, -11287, 4658, +-504, 4571, 1814, 18830, 26254, 2399, 8750, 2656, +8206, -12987, -9119, -1027, -457, 1228, 6137, 2322, +1732, -5694, -892, -249, -178, -7009, -4368, 402, +-5564, -5183, 2470, -4745, 2788, -3255, -5181, -706, +40, -4915, 8926, -3633, -2455, 15054, 5376, -867, +-7270, -979, 7053, -7433, 13749, 5039, -2234, 8474, +7031, -3917, 5127, -7602, 580, 12067, 2252, 149, +86, -582, -5729, 2193, 4178, -9195, -11824, 3897, +1298, -1044, 6450, 1885, -19562, 6205, -4610, -2544, +5192, -4885, 5021, -2373, -102, 7358, -2434, -3512, +-4048, 3070, 45, -1344, 202, -2189, 448, 1172, +2939, -547, 1003, -6370, 3643, -1157, 3932, -6044, +-12882, 1959, -1574, 2574, 14854, -16317, -6627, 505, +1102, -9361, -8087, 7525, -1466, 284, 3756, -383, +5147, 5060, -474, 531, -6144, -1872, -1206, 527, +-4861, -12410, 7508, -7226, 5046, -12233, -4153, 4628, +-14402, -5265, 534, 1528, -13408, -62, -18757, -1280, +-9301, -10254, -8990, -6335, -7724, -3394, 1951, -13271, +-1389, -5274, -4616, -9643, -10295, 1332, -5618, -10737, +-7536, -9314, -7006, -760, 7694, 2955, -404, -2800, +15250, -3828, 5994, 5408, 8411, 16568, -7280, -6901, +-222, -1554, -862, -1871, 939, -3678, -4348, -3200, +3220, 1614, 8598, 8162, 1749, -7378, -1658, 931, +3870, 9183, 1509, -5068, -17, 5733, -8121, 2769, +-3195, -3296, 8940, 2828, -2470, -2448, 7413, -2851, +-1058, -4505, -9653, -5074, 73, -3286, -4014, -1760, +2562, 13690, -3464, 5438, -3394, 16997, -2944, 291, +4224, 1175, -2237, -6894, -5479, -1291, 3390, 5455, +898, 3461, -7914, -4785, 1879, 1059, -3721, -5796, +5054, -3931, 6315, -2460, 1909, 573, -3373, 3052, +-178, 986, 572, -5976, 5781, -4928, -10539, 580, +-18727, 757, 1759, -4049, 2232, 1890, 4115, 699, +-2934, 4926, 2391, 10848, 5103, 4340, -1518, 2288, +2283, 8886, -5131, -4429, -4384, -3265, 11933, 3993, +11474, 3721, 1532, 976, 6112, 1954, -2360, -1783, +2080, -6356, 2482, -4646, -1992, 1590, 1790, 3290, +-2312, -564, 508, -1688, -7522, -9263, 3059, 1883, +-3005, -1303, -9146, 10282, 1333, 4692, -2083, -15792, +2208, 1128, -11574, -7149, -1126, -4995, 18963, -6262, +5045, 2179, -822, -1249, 10092, -338, 5744, 1635, +2535, 6114, -1339, -8337, -4370, 4288, 2468, 3051, +12491, -9554, -4034, 522, -1085, 5852, -2759, 4918, +-10717, -194, -11376, 3059, 12075, 1037, 5260, 816, +5918, -1987, 7924, -6022, -10374, 11607, 25035, -11598, +16894, 2458, -5461, -2039, 385, 6002, 7574, 1229, +-834, -1032, -7453, 2694, -1447, 3632, 4215, 3541, +2936, -3294, 1001, -6451, -4595, -11682, 7880, 2261, +3786, -2849, 2276, -826, 3742, 7586, -334, 2837, +-2331, -12849, 1170, -1150, -5253, -997, -8996, 8124, +2234, 904, -2294, 3144, 7352, -5452, 1536, -8800, +1886, -18282, -9787, -8066, -12066, 1536, 4460, -1345, +1418, 7471, 13451, -7299, 5507, 6795, -184, 8905, +-2040, -4933, 4998, 7317, -6667, -5134, 9094, -8561, +-2534, 3422, 2278, 3118, 205, 5811, 2247, 5946, +1078, -2105, -6946, 170, -1625, -4734, -1447, -4329, +-4553, -2230, -8738, -15289, 7311, 6665, 5047, 1984, +11896, 13922, -10490, -9313, 1424, -2991, 1408, 335, +8914, 3773, 8814, 7917, -4560, -114, -624, 8984, +-1598, -580, 3233, 590, -2172, -3162, -3985, 5394, +13842, -11625, 73, 12826, -1204, 5119, 10304, -10006, +-2695, 1318, 156, 84, -760, -4638, -3804, 3041, +-782, -2994, -3113, 637, -3256, -5831, 452, -1204, +1614, -11626, -4769, 10612, -8710, -20019, 10542, -4279, +6912, -1429, 3812, 2844, 3903, -11622, -8954, 180, +3898, 3858, 119, 1385, 4038, -5899, -969, -5454, +13305, -6748, 5934, 8027, -7348, -3797, -29781, -4956, +2037, -2331, -3292, 8254, 6597, 4446, -7848, 6250, +1400, -1182, -4966, -3490, -1410, -2286, 3334, 350, +9271, 2987, -934, -5702, -3881, -97, -671, 5108, +-133, 1302, 11630, -8858, -3027, -42, 3682, -1507, +3992, 5641, 2778, -8698, -2509, -1360, 77, 2116, +98, 2853, -6334, 5915, -1214, -2721, 8921, 1380, +-4158, -4315, -4740, -21049, 7044, 866, 2094, -9442, +9003, -5147, -4897, 3407, -11558, 4280, 4508, 6697, +1612, 1508, 8547, -14257, -151, -9530, -7250, 11321, +-14430, -4944, -2488, 1349, -248, -1490, 1749, 3970, +-5830, 20767, 4642, 3236, 36, -17079, -11099, 5996, +-10759, -39, 7822, -7527, -1431, 179, -3841, 2298, +1407, -241, -2303, 9244, -3626, 6609, 1959, -518, +368, 1678, -5334, -5849, -4986, -2363, 607, 2809, +-1006, -7695, 10022, 2216, -8992, 4282, 807, 14707, +9528, -11065, 3014, 3157, 5597, 1139, -1298, -3642, +7839, 860, -4336, 2624, -4171, 1791, -2825, 5362, +-529, 1494, 337, -4487, -671, 5360, 3283, 4933, +-14692, 4033, -4365, 2713, -6903, -1784, -10862, 6173, +5278, 14859, -852, 10020, 12304, 8898, -3089, 9183, +1841, 8276, 4929, -261, -1264, 615, 3615, 14535, +6557, 519, 4228, 7382, -1805, -4529, 4992, 4277, +-342, -9610, -5193, -7022, -23264, 2402, -740, 2875, +-5052, 1983, 4987, 3336, -3806, 1335, -2868, 846, +7652, 936, 3510, -4570, -3010, -8805, 6177, -4413, +5879, -15204, -1632, 13416, -4543, 3838, -9293, 1744, +920, 15544, 3820, -5852, 3935, 2357, -6486, 1932, +12044, -6374, -2545, -2389, 2755, -8073, -8203, 4659, +4286, 16128, -987, 434, -4495, -4428, -4816, -10329, +-4529, -13408, -13283, -1136, 4002, -1271, 3547, -5274, +-5577, 701, -365, -2764, 370, -369, 2611, -832, +3862, 4604, -7786, 11170, -1453, -1568, 10758, 168, +402, -1985, 1436, -8858, 10080, -8559, 3998, -4310, +-13478, -3104, -11458, 506, -18194, -3724, -6768, 7960, +-4213, 1121, -1658, -1141, -1874, -383, -5090, 748, +-1032, -1207, 1046, -1865, -2387, 2126, -3672, 6733, +-2794, 3797, 15562, -11989, 170, 6129, 658, 929, +4800, -4296, -955, -2189, -188, 3180, -118, -766, +-2182, -6928, -2254, 6615, -4422, 6324, -31, 3742, +-5832, -5022, 4671, 1574, -6309, 288, -2768, -2492, +-4818, -5192, -248, -3236, -429, 120, 1182, -10486, +-2964, -3713, -5978, 11817, -20052, -6525, 2054, -879, +-602, -2843, 7244, -1372, 417, -172, 3322, -6556, +-7021, 5842, 7357, -2799, 3660, 7579, 4682, -2242, +73, -9247, 21061, -2060, -3614, 2486, 4793, -2959, +-510, -74, -5982, 2274, -4147, 3260, 1994, -1678, +-7494, -13624, 2560, -7375, -896, -4945, -2838, -11096, +-1969, 5879, 444, -3220, 14630, 4915, -2376, -8475, +9854, 11380, 11060, 1534, -14413, 4366, -9544, -10646, +-7654, -17916, 3481, -3240, 1776, -2436, -8403, 3679, +-1914, 12537, -5540, -5294, 5995, 5968, -2609, -16882, +789, -9506, -10075, -12142, -7580, -7090, -2046, 11065, +7617, -3503, -2013, 3516, 6347, -195, -3119, 2444, +14, -4998, 767, 4976, -3974, 9038, 579, 1804, +-8206, 32767, -5633, 1018, 13388, 996, -12737, -3179, +-2058, 13663, 1274, -4475, 7386, -1698, 17927, -6118, +15942, -2922, -3434, 5903, 6333, -9149, 14140, -1488, +2999, 1151, 2361, -1935, -10243, -11566, -5319, 965, +5146, 3652, -441, -2173, -3484, 3685, -13595, -1703, +-78, -1408, 18517, -3788, -3266, 3162, 996, 19950, +-8560, 4989, 6593, -5329, 2950, -13896, -3524, 5590, +4055, 6084, 2493, 12659, -5786, 4858, 7252, -7111, +-7318, 5411, 7393, -8714, -3454, -1562, 1919, -49, +-680, 7285, -398, -2956, 7100, 5563, -538, 1719, +-16, -3824, 437, -6842, 1504, 5694, 1214, 3209, +-15562, -4365, 9329, -25577, 1425, -2598, -8389, -6891, +-3275, 3304, -3993, -6391, -934, 7862, 4844, -134, +9890, -4646, 2468, -9901, -4111, -3080, -5056, 476, +-13099, 1447, 205, -2424, 7098, -12075, -4646, -13725, +8367, -2910, -8461, 1387, 3553, -10228, -2771, 4698, +-6483, 12234, -8086, 3329, 2374, 452, -1805, 5083, +2014, 164, 7143, 81, 6062, 2838, 5318, -4982, +1440, 2014, -3273, -6658, -798, -3204, 1398, -599, +-5834, 2070, 4644, -17238, 390, -1684, -4932, 8961, +-12217, -3079, 6574, 1387, -5991, -7803, 1285, 7439, +-395, -3048, 2038, -847, -690, -5127, 2228, -4180, +-3499, 530, -584, 9884, -323, 446, -15644, -9162, +-1683, 3643, -3578, 2634, 496, 8097, 109, 1056, +1422, 5452, 6517, -449, -2389, 302, 6827, 1507, +-3106, -7188, -4909, -441, 12955, -3933, -5322, 5155, +-23171, -2780, -2655, -4048, 12844, -3709, 6555, -5700, +3780, -6566, -4415, 11091, 11291, 6443, 9146, -796, +-1420, 5600, 12098, -5790, 6619, -10474, -12177, -5890, +21700, 11148, 3427, 3130, -5727, 14646, 13953, -2721, +1404, -3102, -4693, 4762, 1757, 2533, 3998, -530, +-758, 5301, -1426, 8948, -720, 6877, -3863, 2396, +5266, -685, 890, -7188, 2742, -270, 8125, -804, +32292, 6964, 8599, -3466, -1080, -8423, 2070, -295, +-157, -5432, 152, 2478, -3738, 1104, 1500, -5290, +-2463, -6386, -2537, -2331, -3290, -2398, 159, 6588, +-2547, -2424, -2184, 8316, 5670, -5608, -2600, 2659, +166, 14828, 2622, -10490, -16378, 64, 434, 4576, +-3010, 2479, -6798, 3431, 360, -1067, 3421, 664, +4029, -4050, -240, 3875, 672, 3587, 501, 2494, +-48, 9997, 3259, 8551, -7624, 17342, 10765, 4328, +-3721, 1729, -2844, -6330, 5114, 15589, -261, -7554, +2708, 7260, 5852, -8736, 436, -6160, -588, -5919, +5752, 3127, -4558, 540, 74, -4048, 3735, 7873, +-2869, -544, -111, 5182, 1032, 2315, -159, 5105, +4106, -494, 678, -4756, -3865, -7389, -2492, 7193, +5146, -7926, 12043, 11137, 1719, 2307, -5476, 12679, +7996, 726, 933, 3222, 7515, 678, -5858, -2716, +1503, -3014, -2125, 4982, -4984, 467, 986, 5450, +-1472, 5314, -1285, 218, -3411, 4511, 8047, 4268, +-8307, -10587, 17200, 3303, 7553, 5361, 1108, -7982, +8240, -5856, -3376, -3952, -2884, 4401, -7252, 4078, +7538, 3420, -13834, -1139, 10742, -2536, 636, 7758, +4282, -3505, 1190, -7382, -8164, 5306, -408, -5005, +2776, 7806, 4781, -7903, -2370, 13884, 542, 5643, +6948, 6471, 2699, 815, 4454, 1882, 2290, -3856, +-3086, 8215, 3234, 4444, -1580, 2835, -3083, 6706, +7409, 4626, 2658, 2308, 7965, -1034, -2584, 344, +704, 12280, 10344, -8032, -4410, -6168, 6860, 7977, +-5630, -6680, -5001, -6199, -10378, -1764, -3322, -4284, +-1048, 2721, -11738, -11800, -7975, 2754, 3424, -7641, +-2245, -4945, -194, -1948, -2850, 4111, -21846, -8750, +4306, 24494, 10428, 26998, 4976, -2701, -3283, -723, +-1539, 6758, -9730, -3517, 6401, -4546, -410, -9900, +-4947, 6996, 10983, 5110, 19948, -78, -1794, 11051, +-14, 316, 6447, -20430, 9363, 9062, -2134, 13711, +6448, 6655, -5232, 4610, -10352, -3042, -8713, 5777, +-2438, -2602, -7293, -755, 6736, 2960, -3676, -2882, +-9806, 1342, 1242, 2122, 2749, 631, 6502, 2266, +-12996, 13620, 19762, 8096, 702, -4394, -8668, -1460, +-3228, -173, -6239, 4643, -1916, 4098, -2234, 1202, +1763, 6170, -6320, 12984, -5936, 8301, 6021, 2191, +466, -4044, -1913, -3458, 8197, -3249, -5935, 2383, +-4241, 4977, -4415, 704, 3488, -8356, 10229, 562, +14, -4828, -3890, -7599, -4208, -3166, 1132, -16584, +-506, 1397, 6266, 3307, 5782, 2349, 3257, -3017, +7814, 1216, 7440, -10096, 12698, 944, 1221, -1683, +152, 6020, -7910, 3897, -6954, -9439, -9838, -3860, +-5383, -4228, -1980, -4045, 7442, -5504, 2145, 636, +2857, -4538, -820, 4275, -2104, 5076, 5191, -363, +-23254, 1962, -66, 7550, 88, 8721, -1361, 7733, +-2661, 5282, -5112, -24, -975, -3200, -2235, 5144, +213, -6340, -3974, 1266, -2383, 2432, -124, -233, +-3504, 10604, 806, -918, 11601, 19332, 206, 7456, +-8885, -9692, 3087, 3685, -2183, -7538, 11970, -5098, +-7364, -1173, -3099, 6532, -6850, 4622, -828, 390, +467, -5364, 4442, -1878, 8949, -4340, -261, -2720, +6659, 16184, -6552, -3736, -15416, 15774, -306, -4240, +-1807, -10304, 11073, 2743, 3974, -5557, -3499, 5315, +-10742, -378, -4517, -5949, -7664, -2830, -6510, -6096, +2052, 3425, 1971, -3328, 5326, -1362, 1806, -14286, +-12774, 6058, -3365, -735, -2586, -18658, 6664, 9502, +-1590, 323, 6445, -17766, 14694, -9786, 3696, -4547, +1601, 3645, -584, 910, 2516, 8197, 3898, 4306, +631, -2020, 4309, -765, -6591, 2083, 8969, -1474, +-27, 9130, -5808, 8492, -135, 2230, 2296, -4509, +4600, 4951, 1930, -2564, -5889, -1338, -11737, 6387, +-3649, -5447, -2462, -4751, -1012, 3523, -3504, -9510 diff --git a/src/main/resources/vavi/sound/twinvq/cb1110l0.txt b/src/main/resources/vavi/sound/twinvq/cb1110l0.txt new file mode 100644 index 0000000..0dc800e --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1110l0.txt @@ -0,0 +1,160 @@ +-14944, -14950, -73, -1141, 1532, -575, -620, -816, +1185, -1597, -2651, 1426, -1458, 1317, -1320, -19, +-209, -352, -163, 912, -85, -180, -546, -1121, +-435, -345, 229, 364, -850, 632, -426, -359, +-32768, 278, -1021, 310, -31, -355, -442, -234, +415, -202, -10393, 1645, -378, -2270, 837, -1857, +556, -935, -1344, 3016, 3452, 1597, 1378, 466, +-13740, -878, 1475, 237, -1301, 9756, -592, 23, +-192, 335, -58, 285, 376, 40, 24, 292, +426, -1962, -798, 745, 1379, -34, 397, -14748, +-6285, 7343, -6374, 4442, -14800, 1878, -24, 1606, +-728, -476, 1754, -1052, 911, 3139, -1444, -222, +-1968, 1858, 1330, 244, 213, 935, -92, -348, +155, 418, 29128, 236, -190, -226, -309, -178, +-690, 46, 716, -534, 147, -630, -75, -826, +37, 4745, -1056, 2400, 1398, 1494, 460, -221, +2908, -656, -15611, -2940, 2342, -98, 581, -3144, +-471, 3772, 2057, 1583, 13738, -139, 330, 1175, +429, 63, -14544, -374, 1439, -1226, -422, -690, +816, 1279, -592, 1642, 700, 1338, 0, -714, +46, 377, -188, -366, -197, -637, -622, -262, +-69, -637, -1266, 257, 620, -1040, 324, -19064, +-602, -463, -1329, 513, 2699, -421, -1918, 2250, +-404, 403, -1514, 134, 147, 3, 426, 605, +276, 561, -26, -294, 630, -500, -480, -133, +-712, -1144, 238, -633, 173, -29164, -1182, -274, +-138, -271, -232, 30, 706, -168, -848, 704, +-2132, -248, -108, 669, 1165, 234, 1243, -12201, +2208, -1971, -829, 10305, -3964, -1502, -409, -3918, +4520, -2259, -797, 2235, -5560, -1710, -2472, 280, +-1747, -980, -4529, -5208, -1813, 330, 890, -6220, +-710, -5583, -4704, -913, 2920, -12484, -4340, 334, +-1303, 283, -740, -1261, 3556, 3210, -11640, -14438, +-2557, -795, 747, 546, -2488, 1891, 485, 725, +338, 1579, 2092, 2354, 284, 2812, 490, 1442, +187, -2699, 1196, -1783, 1228, 2364, 13364, 258, +2102, -6163, -200, -5475, 2804, -576, 6878, -2852, +2246, 1186, 584, -136, 5258, 3825, 3045, -1661, +-5246, 2548, -5054, -4383, -1542, 12912, -1580, 1268, +-1415, -2012, 1021, -2106, 979, 2390, 3411, -1076, +-439, 5416, 1333, 440, 3422, -13384, 2540, 2544, +-3668, -2308, 1042, 589, 4166, 5090, 1539, -3447, +7003, -4396, 319, -590, 481, -471, 22260, -1936, +-297, 1302, 1163, 937, -164, 847, 768, 827, +-430, 792, 472, -1557, 712, -602, -1007, -278, +-974, -3198, 10560, -2124, 335, -1206, 629, -13712, +12, -1673, -691, -666, -2890, 826, 1792, -1547, +-2016, 807, 1810, 841, -814, 1214, 760, -1056, +404, -94, 144, 297, -584, 106, 116, -132, +236, -507, 86, 853, -670, 413, 32767, 730, +10835, -502, 1297, -3857, -1035, -1602, -164, -1721, +1468, 507, 1064, 1478, 4323, -760, -882, -4331, +2564, -10933, 3000, 2101, -2492, -72, 12636, 2743, +-1113, -8334, 6720, 2348, 491, -23, -1065, 1506, +2090, -1731, -1997, 675, 425, 8165, 695, 2285, +-433, 515, -465, -347, -1006, 357, -55, 57, +481, -31494, -816, 60, 76, -439, -328, -217, +265, 123, 839, 218, 1355, 243, -878, -12819, +5168, 318, 1376, -2931, 12689, -83, -220, 2848, +-770, 150, 1631, 1955, 1552, -1371, -3053, 1752, +-7250, -24, -514, -5568, -1529, -112, 419, -1136, +-672, -1847, -1136, 90, 453, 4810, 13012, -2355, +-2477, 1393, 451, 3390, 12, -2228, 1840, -2543, +-2404, -2969, 186, -444, 204, -265, -11467, 2204, +1821, 3591, 67, 8821, 4015, -183, -5902, -1468, +11394, 3062, -128, -476, 2495, -2888, 13482, 686, +-1320, 371, -884, 1829, -1810, 337, -1124, -1442, +432, 1950, -1203, 663, -10445, 2310, 766, 137, +4418, 2821, 135, 116, -12164, -3592, 686, 2310, +1229, 1930, -1756, -1309, 1439, -3741, -305, 1547, +-9940, 3198, 1333, 2403, -2847, -3892, -259, -1766, +881, 14310, -1711, -840, 2259, 3027, -1527, 1156, +2904, -75, -728, 1536, -127, 152, -3240, -726, +-11914, 1037, -851, -1893, -748, -3294, -1114, 6072, +103, -1539, 4573, -1637, 5242, 2705, -9890, 254, +-1565, -407, 1818, -23004, 1110, 119, 256, -707, +-451, -679, 374, -935, -669, 403, -10, -594, +-525, 1403, -1016, -553, 595, -169, 2523, -82, +947, 11572, -1166, 11668, -4962, 842, -860, 89, +-3308, -640, 558, -851, 622, -1002, -4933, 2762, +1991, -121, 1401, -111, -49, 868, 135, -1392, +-279, -560, 412, -241, 1414, -802, -1256, -298, +447, 17738, -320, -1150, 1650, -398, 5626, 6076, +-8919, 455, 12716, -2094, 157, 1361, -1515, 1494, +-6210, -553, -1785, -424, -3049, -4066, -1188, -732, +1992, -1926, 1495, 1085, -22434, 1187, 391, -1512, +747, -313, -502, 1331, 456, -323, 246, -581, +56, 1448, 2071, 535, 782, 520, -136, -290, +-12350, -11858, -456, 2340, -310, 22, 2210, -2531, +-392, -898, 3919, 1354, -332, -4255, 169, 425, +-476, 2577, -1172, 1984, 266, 514, -516, 2481, +81, 2103, -710, 273, 1405, -14811, 5858, 3621, +-982, 345, 2044, 158, -2050, -602, 954, 342, +239, 157, -317, -35, -260, 307, -31972, 228, +-77, 225, -154, 643, -883, -518, 32, 372, +208, -22488, -458, 530, 104, 254, -775, -1264, +-571, 900, -263, -323, -296, 962, 520, 548, +-2196, 42, 1408, -211, -16117, 2052, 12656, -822, +507, 321, -772, -786, -144, -3539, 892, -3430, +19, -1831, 1161, 1836, 988, -1134, -704, -2994, +692, 765, 457, 1624, 502, 13, 364, 337, +32108, 1517, -225, 189, 141, 985, -572, 262, +-146, 31, 236, 269, -278, -1686, -13968, 1247, +-1009, 1046, 13467, 1276, -268, 307, -1383, 1544, +136, 949, 70, 446, 1391, -2188, 745, -374, +-14231, -712, -15202, -533, -108, -2244, -1232, 450, +-895, 1086, -782, -1082, -718, -660, 796, -2095, +2722, -468, -1717, 147, -23566, 377, -220, -1731, +-1416, 486, -241, 266, -802, -322, 1066, -544, +-167, 520, -1297, -100, 622, 670, -188, 711, +32, 1155, 628, 350, -112, -154, -1048, -44, +36, -454, 304, 32767, 356, 462, -1194, 549, +138, 0, 1044, -119, 195, 1098, 521, 3294, +-3776, -224, 4297, -1256, -303, 2107, 300, -13283, +2933, -3194, -1408, -4152, 4195, 287, -932, 1247, +13453, 277, 418, -598, 87, 1132, -80, -405, +-13400, 656, -1310, -1447, -3974, 1719, 313, 500, +1078, -114, 1449, -293, -120, -4754, 5583, 235, +-5140, -865, -484, 15572, 336, -1854, -154, -454, +-1475, -726, -3718, -4048, 1575, 480, 1094, -2209, +-3202, 420, -564, -48, 964, -2667, 2172, -1666, +112, -730, 203, 3618, -15857, -4853, 48, -1084, +1512, -937, 3353, -453, 223, 2267, 139, 190, +1959, -720, 4389, 681, 10383, -112, 12390, -882, +1695, 3539, -169, 3131, -122, 3627, 252, 185, +-523, 112, -219, 214, -182, -102, 118, 230, +-60, -801, -25, 42, -279, 262, -32358, 344, +-542, 382, -223, -404, 1201, -2646, -163, -803, +3041, -1009, 3818, 756, 5834, 14249, -1828, 139, +-218, -658, -1314, -4980, -3322, -1461, -1598, -91, +2464, -954, -5203, -791, 1339, -13598, 594, 702, +-388, -1115, -2377, -370, -3658, -3322, 1871, 2513, +2910, 4095, -2195, 4291, 886, -567, 1182, -302, +-672, -21, -268, -29244, -199, -1024, -1284, 485, +1432, -1086, 119, 1030, 418, -643, -1165, 1847, +-30, -844, -909, -416, -604, -609, -289, -391, +-238, -94, -391, -810, 413, 356, 954, -1935, +30996, 441, 138, 1381, 1130, -2313, 558, -203, +-248, -951, 408, 1815, 256, -429, -892, -695, +1138, 439, -760, -63, 6498, 570, 15252, -3397, +170, 935, 338, 1, -528, 524, -541, -281, +-3, 499, -333, 685, 436, 32176, 389, -153, +572, 256, 53, 16, -902, 724, 2849, 2503, +80, 667, -1867, 742, 15205, -8715, -2588, -476, +-450, -733, -891, 1178, -1751, -1630, -114, 144, +-138, 10145, -188, -1608, -131, -247, -544, 9774, +-610, -2868, -3472, 345, -9294, 3724, 2634, -5124, +-392, 2551, -649, 782, -18, -160, -351, 12074, +13865, -1294, 1262, -3135, -2861, 18, 753, 167, +620, -2432, 1998, 740, 1902, 400, -206, 3518, +-3563, -632, 72, -1810, 1520, -827, -572, 1604, +-613, 3704, -736, 11100, 12702, -3189, -792, -3552, +1621, 1841, 1236, 1215, -457, 9542, 9278, 2633, +-8801, 862, 1741, -4840, -2620, 616, 324, 2152, +3632, 880, -472, 1927, -3456, -2105, -965, 3426, +-1893, 3095, -1152, -3542, 182, 998, -386, 1202, +481, -1951, -510, -931, 1688, 151, -13664, -3894, +-973, -906, 1524, 9576, 2607, 12497, -819, -5214, +5936, -634, -610, -4148, -421, -486, -1864, -306, +2421, 724, -219, -1304, -2106, -504, 6762, 5266 diff --git a/src/main/resources/vavi/sound/twinvq/cb1110l1.txt b/src/main/resources/vavi/sound/twinvq/cb1110l1.txt new file mode 100644 index 0000000..59d37df --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1110l1.txt @@ -0,0 +1,160 @@ +-2972, -1201, -1388, -1762, 340, 21127, -999, 126, +111, -1224, -1738, 311, -712, -450, -114, -648, +-752, -172, 67, 375, -967, -1032, -10763, -1885, +-2223, -3258, 480, -228, -143, -1299, 13128, -3062, +1418, 6, -649, -1816, -288, 767, 345, 876, +-491, 948, 540, -167, 1969, -1883, -455, 20584, +-656, 114, 308, 279, 1105, -594, 1332, 255, +-356, -186, -540, 1898, -873, -477, 1404, 30475, +370, -322, -337, -206, -440, -894, -54, -466, +-640, -408, -256, -560, -1503, 626, -573, -1684, +419, 407, 2076, 5022, 3143, -1135, -12118, -12082, +-1462, -2060, -5432, -1092, 1575, 1958, -968, 122, +958, -5312, 677, -1952, -12276, -1594, 1211, -1094, +1992, -11032, -2993, -834, -1297, -1139, 312, -1546, +-4253, 1191, 21, 2771, 639, -2514, 6623, 746, +1830, 2967, 1688, -14893, 7988, 4099, -97, 1165, +-2350, 65, -1308, 1834, -2084, 1683, 5118, -1633, +-10, -5282, 403, -1489, -264, 398, -2420, 12854, +-1498, -2642, -1486, 826, 699, -2213, -2296, 11849, +478, -2202, -561, -250, 199, -2433, -948, -402, +433, 403, 13031, -124, -180, 1499, -643, 527, +11368, 5833, 938, 3202, -452, 2875, -1163, -117, +-2047, -1068, 211, 3122, -236, 13548, -702, 352, +-312, -1901, -2145, 2334, -12100, -76, -419, 362, +3501, -220, -3086, 572, 1537, 3240, -1489, -1012, +640, -513, 930, 390, 31019, 724, -78, -706, +183, -157, -122, -847, -1156, 301, 508, -456, +321, 317, 1300, -512, -1743, 10190, -294, -116, +4183, 1374, 13360, -1339, 1832, 2547, -702, -2782, +-1464, 1176, -1287, 2256, 2169, 836, 2096, -248, +1777, 11306, -211, 265, -3834, 336, 1936, -586, +633, 1037, -1915, 12862, 930, -273, 2333, -3239, +429, 374, 2518, -671, 570, -2208, 385, -284, +-15613, -1752, 1341, -531, -744, -1111, 290, -2302, +-1012, -2933, -366, -30, -4595, 1400, 560, 48, +15739, -945, 411, 1876, 2441, -2144, -1222, 12448, +54, -726, -2743, 2548, 2100, 1307, 408, -198, +-1802, -63, -1919, 933, -329, -528, -15918, 1704, +3028, 217, 606, -2804, 2052, 9320, 592, 969, +6836, 647, -671, 584, -1, 3564, -2575, 436, +-2195, 414, -201, 1099, -772, -220, -578, -467, +125, -934, 271, -21476, 288, 215, 216, 476, +-560, 768, 1142, -169, -1112, -14096, -14436, 2769, +-1464, -61, 1373, -3539, -1067, 1175, -1549, -861, +-332, -1876, 3159, 340, 1711, -2453, 457, 2536, +1114, -2278, 2464, -3253, -466, 12291, 12484, -2868, +-800, 1142, -4244, -178, 3781, 1542, -663, 1976, +3105, 145, -100, -1774, -1039, 1627, 15540, 4194, +5392, 741, 1816, -544, -9100, 4255, -1083, -1266, +2580, -4200, 1934, 1721, 129, 2276, -2704, -1341, +-1310, -11926, -1478, 199, 755, 619, 4231, -478, +-1627, -1242, 1842, 13170, -2416, 778, 192, 273, +782, 774, 2188, -838, 3139, -1532, -1639, -1073, +-596, 770, -353, -53, 82, -322, -20584, -344, +-443, 158, -144, -554, 50, 954, -145, -336, +-2050, 596, -950, -2690, 13908, -13783, 4792, 879, +584, -2987, 967, 192, -585, -783, -1341, -3108, +-1622, 2478, -1362, -1470, -1556, -430, -110, -736, +-8097, 2073, 964, -417, 1669, -5425, -7846, 536, +12883, -1690, 1143, -242, -438, -2274, 57, 302, +-574, 637, 2816, -1642, 2166, -172, 893, 421, +-614, -565, -338, -526, -1085, -939, -1138, -991, +1919, 1720, -18845, -1950, -342, 1930, 321, 184, +-956, -374, -462, -216, -6, 26, 386, -50, +603, -720, 634, -252, 261, -860, 218, 22846, +11544, -459, -946, 452, -102, -1203, -1802, -1105, +-310, 787, -220, -1113, -2043, 650, 13767, -3638, +-296, -902, -413, 252, -816, -172, -505, -1335, +890, 768, -523, 808, -331, 20000, -264, 1763, +133, -1, -464, 949, -954, -147, 1780, -190, +30, -7422, -4615, -1006, -470, -742, 500, 7509, +1500, 1550, -3614, 810, 2595, 1506, -12926, 3588, +402, -2547, 1505, 65, 4, 3382, -2201, -2441, +-1521, -5450, -3820, 282, 5212, 1186, -1056, -2334, +988, 12987, 390, 4141, -2680, 1663, -8034, -1792, +-225, -674, -7147, 13254, 1631, 10163, -3332, -7, +-675, -735, 772, -2299, -326, 1641, -1174, -1911, +82, 776, 891, -445, 18590, 238, 1417, -2372, +-9718, -2682, 600, -1401, 604, -1791, -22, 1546, +-1764, 525, -1355, 348, 3260, 1115, 204, 524, +225, -12776, -679, -15595, -1188, 1078, 82, -859, +28, 819, -1220, 563, 2309, 331, -1158, -2010, +-264, -383, 1732, -424, -2742, -775, -329, 132, +391, 1261, 1033, -9812, -11829, 2433, 2690, 606, +-2724, 7216, -296, -1834, -1694, 456, -4732, -400, +-3192, 1428, -316, -13674, -2702, 2320, -6548, -2025, +1222, 1749, 4005, 2924, -3539, -5104, -2333, -1438, +2598, 62, -757, 760, 343, 154, -31947, -534, +1296, 697, 88, 345, -577, -500, -174, -326, +-198, 272, 157, -815, -636, -1163, -867, -273, +1054, 774, 1624, 989, 107, -1088, -673, 2143, +-22962, -566, 151, 72, -27, 1034, -444, 501, +1905, -1455, 21, 289, -10670, -789, -2421, -2686, +-327, 804, -3009, 907, 960, 1379, -43, -552, +2203, -1406, -911, -11094, -529, 4458, -4152, -70, +3162, -12546, 326, 874, 1426, 3019, 2315, 104, +-12516, -1591, -2877, 772, 1982, 1160, -4491, 3417, +-1524, -2139, 130, 930, 9359, -18308, -376, 4090, +-468, 156, -216, 60, -643, -3440, 256, -835, +-2389, 1660, -542, -1628, 4270, 3574, -3136, 433, +1069, 30024, 561, 268, 790, 294, 207, -1552, +-736, -97, -215, -98, 690, 686, -202, -736, +-453, 655, 511, -156, 1006, 361, 1424, -1254, +-361, -1253, -1419, -290, 78, 555, 565, -488, +-923, -18193, -630, -908, 188, 925, -1684, 241, +-319, -14478, 17007, -1415, 274, 592, 1344, 1784, +-731, 344, 992, 141, 290, 481, 628, 623, +-1166, -2092, 140, -1056, 13736, 754, 1980, -238, +2132, -1372, -2216, -12057, -1662, 66, 1742, 2209, +-962, -1574, -3044, 173, -3066, 183, -4476, -1016, +6160, 780, -1193, -3334, 179, -371, 244, 160, +-686, 669, 330, 426, 65, 159, -664, -186, +479, -742, 54, 605, 32603, -941, 370, -91, +856, 825, 1042, 374, 651, 313, 734, -240, +-49, -685, -1994, -604, -875, 44, -884, 886, +13012, -1506, -4317, -1926, 3050, -1027, -482, -40, +137, -2560, 1366, -11812, 2112, 2266, -2690, -1339, +-700, -243, 2322, -1042, 4635, -3210, 4281, 47, +670, 9218, 1165, 814, -62, -2276, 12987, -714, +2481, 1355, 896, 2840, -1664, 2048, -345, 2285, +1754, -669, 2284, -288, -575, 944, -1528, 44, +1071, -706, -543, -1347, 880, 257, 1364, 1444, +-17896, 99, 1539, 1813, -611, 355, -2290, 980, +-787, 132, 300, 2353, 204, -798, -296, -594, +895, 842, 18755, 1129, 79, -189, 515, 882, +-286, 109, 305, 374, 1323, 861, -18, -78, +294, -320, 674, 504, -159, -549, -95, -32403, +-90, 658, 1082, 1611, -137, -74, 1160, -794, +-55, 822, 2627, 1203, -3540, 9829, -7860, -9063, +-4015, -894, -2218, 729, -879, -1869, -2446, 4050, +-488, 13211, -290, -820, 371, 14196, 866, -891, +218, -1838, 2162, 1144, -186, 512, 1416, 546, +3298, -1253, 128, 1202, 557, -1967, 680, 545, +-139, -3008, 18453, -3322, -137, 163, 1377, 1116, +2572, -1577, -1846, 651, -1319, 796, -862, 331, +4383, 2453, -1894, 3264, 14137, 842, -3087, 3740, +-1100, -2400, -1364, 2406, 417, -2393, -868, -3158, +-9712, 3480, -1403, 1896, 201, 1285, -593, -11718, +99, -539, -186, 45, -2266, -12228, -2658, 2802, +-1198, 1022, -3840, 1401, -1918, 1655, 1725, 96, +-205, -913, 1629, 568, -1285, 1264, -1160, 594, +223, -336, -1436, -472, -19792, 553, 1494, -195, +570, 282, -653, -54, -1115, 153, -484, 141, +-188, -278, -173, 464, 13, -634, -42, 390, +-464, -246, 622, 1229, -692, 29175, -574, 1150, +-135, 2685, 2452, 63, -962, -918, -1657, -1978, +-172, -677, -3414, 1345, -3964, 2875, -1412, -654, +-3000, 10739, 11348, -2232, 516, 8303, -189, 2564, +-150, -373, 903, -275, 2394, -1135, 508, 424, +-1704, -2222, -3789, 1938, 216, -12702, 2488, -1364, +-2175, 1114, -819, -2756, 1564, 952, 36, 609, +-933, -1568, 110, 143, -1575, -4236, 528, 15042, +-1920, 348, -2623, 5217, 1911, -1088, 259, -590, +364, 2081, -3585, 662, 249, -119, -111, 778, +2167, 11, 2500, 7182, 14452, 4388, 4121, 3623, +1598, 532, -507, 877, 3830, 372, -2184, -2810, +11748, -2095, -1079, -3070, -768, 2901, -3587, -2572, +10008, 563, -4588, 1026, 1117, 1879, -12004, -416, +317, 2032, 1800, 1058, -84, -296, -1748, 2588, +-11019, -1627, -3264, 2480, 96, 2146, -2672, 2418 diff --git a/src/main/resources/vavi/sound/twinvq/cb1110m0.txt b/src/main/resources/vavi/sound/twinvq/cb1110m0.txt new file mode 100644 index 0000000..67f64f7 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1110m0.txt @@ -0,0 +1,144 @@ +3666, -1078, -175, 1370, 2491, -10050, -685, -7617, +4002, 11104, 903, 5948, 2821, 3050, -2465, 1151, +-848, -2139, 12321, -1408, -1469, 2046, -2693, 2479, +-3498, 3077, -3822, 1841, -2404, -11172, -407, -3062, +-1725, -5475, 597, 1924, -197, 434, -1648, 2678, +-2462, 1148, 599, 1284, -13171, -949, -6508, 754, +7466, 5924, 1411, -536, 10825, 588, 297, -310, +-593, -896, 784, -242, 716, 501, -52, 4043, +-755, -690, 2630, 17762, -2159, 2126, 954, -1316, +11129, 1570, 387, -2639, 13953, -311, 5231, -2297, +-3612, -678, -1117, 690, -279, 2403, -1541, 493, +-1692, -2048, -771, -933, 423, 700, 840, 739, +1956, -944, 612, -2678, 101, 245, -786, 850, +269, 1355, 21773, 463, -2589, 596, -519, 788, +-43, 1220, 10674, 4847, 1192, 335, 875, -106, +10644, 2600, 5391, -262, 2296, -5928, -1072, -122, +2504, 1313, 1117, -981, 350, 375, -810, 8, +1462, -2020, -2368, 8, 22663, 1537, 87, 908, +832, -4884, 312, 620, 1042, -4444, 660, 1582, +-2710, -2954, 10012, -9580, 8102, 5696, -1371, -3035, +-3347, 402, 218, 1096, -1924, 88, -2270, 4175, +-1083, -497, -2437, -3332, -824, 212, -2362, 4600, +-7800, -11501, 7795, 236, -1336, -12920, 705, 4532, +-1488, 11746, -3213, -2650, 2524, -2638, -128, -328, +3402, 453, -242, -2500, 2224, 708, 450, -3014, +-132, 1251, -131, -831, -710, -21985, 222, -2132, +-3261, 490, -3020, -860, 2550, 892, -623, -3666, +-664, -131, 2018, 2817, -12005, 496, -610, -7238, +-3909, -2867, 6872, 1903, 848, 6644, 3812, -5686, +-4055, -377, -2096, -10247, -1068, 1486, 415, -253, +-2186, 1050, 771, -6856, 1044, 7466, 2953, -7514, +1601, 7015, -1778, -1622, -3364, -1755, 2835, 176, +2700, 991, 2560, -554, 4867, 1571, -5610, 2610, +12438, -3751, -9964, -2753, 4856, -2595, -5423, 10025, +812, 687, 2715, 4013, 3086, -12039, 328, -3992, +4044, -3920, -111, -553, -1720, 2454, 1706, -1365, +804, -32329, -471, 897, -4670, 780, -3680, -1409, +-2630, 20, 184, -157, -290, 2794, -546, -160, +1564, 1146, 628, -4787, -239, 11233, -492, 1955, +608, 9273, -3220, 3830, 390, -5982, -3342, -3384, +2356, 1820, -3473, 979, -40, -20190, 47, -200, +5106, -381, 1824, -197, 2280, 2434, -2633, -1409, +-1109, -1072, 857, 1554, 7459, 6, 12130, -1078, +1038, -300, -13748, 3201, -762, 2670, -1051, -445, +914, -172, -558, 2634, -1158, 3129, -74, -3415, +1086, -8892, 118, -647, 285, 186, 3022, -5077, +1342, 3453, -7991, -65, 4690, 944, 3717, -1909, +-9783, -367, -1699, -772, -32768, 1286, -408, 340, +-340, 430, 1274, 596, -109, -727, 276, -946, +139, 1804, -1050, -3562, -1392, -1179, 257, 1639, +25708, 2278, 2415, 2174, 153, 126, -60, 592, +994, -334, -268, 1826, -306, -2241, 2774, -3188, +758, -450, 8023, 542, 6819, -1712, 14195, -2198, +281, -12, -590, -1153, 4568, -3676, 1973, -5221, +-1839, -603, 3324, 2492, -3070, -846, 123, -1184, +667, -10886, -65, -2615, 971, 10219, -1245, 7378, +-2122, -2306, 571, -2298, 1958, -4356, -9210, 4321, +2805, 1888, 11129, 1282, -5819, -2528, -873, 1123, +-5968, -2644, -5515, -2151, -944, -7712, -2007, -2260, +-1920, 2100, -325, 153, 1050, 10, 1462, 650, +-12559, 3530, 754, 4493, 1528, -6991, -4842, 1483, +-2408, 2785, -1651, -830, 1433, -2464, 18899, -1891, +-3137, 996, 2485, 3056, -1061, -4015, -2282, 1356, +-2572, -490, 1209, 1137, 4, -636, -1282, 1001, +-1190, -172, -14049, -4256, -1972, 2225, -4738, -1054, +5254, 8113, 4294, 36, 11765, -3993, -1084, 3864, +-3016, -10356, 353, 2963, -1228, 536, 609, -343, +1246, 3617, -3667, 4794, -20360, 473, 725, -1246, +-1649, 1900, -2589, -2869, -2550, -886, -1164, -1876, +307, 3784, -4782, -476, -700, 2118, -1860, 1533, +-5013, 2356, 3305, 3338, -14312, -1278, -322, 1950, +-954, -1990, 1438, 3358, 7479, 3046, -6677, -3078, +1717, 3113, -12484, -1302, -221, -510, 10423, -3497, +4170, -3606, 6983, -2902, 458, 667, 566, 2415, +-403, -2898, -44, -1832, -110, 1799, 1172, 7, +-1534, 90, 686, -26902, 1601, -822, 658, 182, +-151, 345, 1488, 1416, -272, 1560, 9774, 2084, +16, -14344, 1428, 514, 2658, -1312, 2095, 454, +-1783, -2056, 4529, 1154, -2239, 956, 668, -1396, +-2898, 405, -12659, -12556, -650, -587, 3461, -2470, +0, -3156, 3186, -4104, 1729, 1438, -1842, -422, +4476, 1945, -932, -1439, -702, -1398, 3349, 1876, +-999, -2086, -17879, -432, 4036, -2299, 1133, 88, +-2221, -2730, -938, -998, -132, -426, 2084, 2060, +-1134, -313, 402, -538, -2593, 2022, 725, 1566, +-2070, 21622, 1767, -424, -32672, 205, -1239, -3253, +198, -1257, 2342, -1918, 1505, 452, 1348, -604, +978, 1079, -4, 2476, -1247, -146, -861, -1928, +-12222, -13042, -1384, -1971, -1428, 1224, -639, -83, +1034, 3488, -2310, -565, 74, -335, 2774, 602, +872, -2132, -147, 2160, 244, 162, 12600, 628, +-10194, -1296, 1068, -1824, -4945, 3194, 2066, -895, +-784, 2347, -1982, 73, 1030, 12589, -62, -2272, +3827, -1776, 2546, -1417, 3310, 4726, -3078, -548, +-8522, 1632, -6667, 1008, 1128, 805, 954, 616, +499, -31526, -1327, 790, -190, 1058, -1157, 1432, +-16, 411, -3180, 827, 327, 914, 1716, 1442, +1052, -1635, -1805, -4145, -13678, 3597, -2273, -5920, +3592, 1136, -211, 717, 3901, -5132, 3036, -601, +12976, 1633, 10316, -1674, -468, 905, 2331, 841, +-247, -6053, -593, -3281, 4291, 5159, -1053, -1814, +2613, 2221, 1146, 871, -421, -542, 923, -3567, +-1138, 10051, 10860, -6121, -661, -5677, -890, -266, +2100, 6223, -70, -2658, -78, 3424, 714, 2138, +-1355, -981, 1990, 772, 938, 1311, -1963, 924, +-22516, 260, -341, 1251, -1578, 23, 1375, 1068, +2688, -3965, 713, -5342, -257, 37, -6034, -276, +228, -1240, -7171, -3402, -14677, 1708, -317, -2880, +874, 1466, 524, 2091, 565, -4220, -265, 52, +-3373, -220, -3175, 2646, 448, -1628, -1986, 2200, +3722, -15752, 7120, -2036, -2170, -627, -1079, -4060, +2257, -925, -3418, -13488, -1308, 3476, -783, -3924, +-820, -860, 2418, 2982, -8753, 9001, 294, -11915, +-969, 3329, -761, 1459, -5308, 1811, 379, 306, +632, -2732, 2512, 1188, -3470, -2167, -572, -2274, +-1657, 24074, -159, -138, -1826, -2527, -3117, -906, +-1770, -1182, 1240, -3064, 2313, -790, 336, -3843, +-13384, -423, 13066, -14, -1908, -32, 2607, 487, +-2426, 195, 135, 2742, 1540, -1034, 856, -2288, +-287, -774, 497, 1760, 191, 178, 298, 38, +-30898, 801, -1456, 2311, 1272, -1845, 334, -933, +183, -1614, 739, 1881, -13548, -13589, 1496, -2075, +-1281, -1510, 108, 3683, -1120, 752, -980, -277, +-1289, 2016, -290, 1838, -321, -139, -881, -12391, +-14713, 1906, 990, -3202, 2320, 749, 1872, -2545, +-1457, -1727, 734, -327, -316, 1062, -3149, -2959, +2210, 912, 952, 1926, -8918, 1098, 594, -1439, +-1402, 11097, 3482, -472, 219, -3845, -662, 9715, +3928, 1254, -2009, 12375, -1724, 13938, 1892, -1390, +686, 2174, 1010, -1297, -199, 1855, 463, 2601, +4408, 1978, 1679, -1614, -3, -11965, 16220, 828, +1497, -747, -484, 519, -1804, -3814, 3287, 2104, +1149, 478, -3918, 1504, 2376, -316, -520, -1449, +-3918, 664, 2772, -16434, 334, -540, -778, -2812, +-6026, -4392, -2446, 3479, 3742, -624, 3895, 1145, +-344, 333, 11898, -2725, 12873, -1145, -1807, -279, +-452, -1581, 548, -5180, -2012, 3411, 1188, -1407, +-4016, -468, 1904, -1724, -11390, -30, 14402, 1610, +-2138, 1249, 346, 6097, -1433, -655, -174, 3652, +4010, 954, -1458, -354, -1872, -2689, 880, -846, +-1304, -1725, 1750, -1186, 1520, 499, -583, 18201, +-1083, -3323, 3072, -5440, -182, 1065, -1112, -984, +2501, -529, 613, 2054, 460, -5245, 2827, -1445, +-2403, -12898, 1504, -8428, -1035, -4620, 1704, -2586 diff --git a/src/main/resources/vavi/sound/twinvq/cb1110m1.txt b/src/main/resources/vavi/sound/twinvq/cb1110m1.txt new file mode 100644 index 0000000..fb8b4b2 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1110m1.txt @@ -0,0 +1,144 @@ +1442, 12425, -2072, 741, -3624, 12979, 2031, -364, +3750, -5082, -1968, 146, 670, -3988, -831, 3962, +397, 6213, -1178, 816, -88, -432, -9620, 11572, +194, 289, -1958, -2115, -871, 5372, -3145, 3612, +1644, 826, 525, -2545, -514, -537, 2485, -1014, +1276, 541, -936, -302, -1172, 183, 827, 23939, +1120, -346, -313, 2759, 3934, -3082, -2260, -906, +-967, 1496, 102, -2782, 323, -1109, -37, 2554, +-2920, 998, -930, -1952, -1138, 1842, -1593, 17345, +-1214, -1065, 2182, -1169, 11745, 278, 8310, 1491, +-564, 1169, 8406, 1359, -1249, -2094, -1365, 4069, +1828, 897, 1258, 1083, 4319, 610, 766, 2273, +4057, 621, 338, 1317, -20941, 548, -2012, 563, +1102, -27, 3007, 1129, -1068, 1282, -2939, 2983, +1958, 1800, 1912, 1728, -606, 1804, -4768, 5068, +-1365, 4543, 399, -14152, -6206, 6187, -2205, 1174, +-1892, -3284, -206, 2872, -2622, -43, 11268, -104, +292, -1836, -6276, 725, 2066, -604, 11382, -448, +742, 2854, -910, -838, -1802, 3678, -397, -530, +-10647, 2356, 12161, 1506, 2649, -3335, 3128, 2169, +5942, 2152, 14124, 428, 187, 248, 1592, -44, +-59, -2934, 1883, -923, 2673, -847, 150, -2142, +-7620, 11078, -595, 6490, -13673, 948, 219, -1314, +-3080, 1339, 11020, 1362, 247, -1863, 1069, -3786, +1706, 1064, 320, 4535, 136, 3795, 1465, -1356, +-449, 13, -421, 1769, 20470, 2181, -371, 2444, +-744, 2263, -155, -688, -236, -4481, 1551, 2812, +2476, -1436, -470, -272, 2276, 594, -858, -978, +1122, 2468, -9350, -353, -1020, 494, 13167, 1770, +1734, -70, -4630, 12358, -818, -979, -3931, 1000, +-4343, 2570, 5567, 3322, 2930, -236, -4796, 6987, +-1658, 4291, 1118, 1710, -2050, -13566, -2, -23, +2104, 1101, -316, 1906, 1643, 340, 5940, 3180, +-837, 1978, -10514, 1466, -6936, 3600, 1205, 957, +-211, -8272, 1611, 5330, -5217, -2264, -5681, -3085, +-9201, -62, 3366, 1370, -9494, 244, -5516, 1210, +2930, -432, -1265, 376, -1910, -1016, -845, 3228, +1094, -3168, 634, -265, -3426, 4367, -4004, -277, +-15081, 3998, 9671, 3418, 691, 9124, -2723, 1939, +2311, 581, -4980, 3381, -1502, 878, -1037, 1496, +3002, 904, -5388, -3300, 263, 1277, -694, 766, +1781, 1134, 250, -32602, -285, 210, 2550, -383, +908, 302, 292, -352, 2615, -97, -1863, 1908, +2685, -502, -3767, 416, 990, -602, -1533, 43, +1288, 1326, 16638, 433, -1204, 1850, -1609, 1407, +-7196, 2319, 5770, 1584, 1150, -634, -1686, 1359, +-1396, 438, 246, 186, -11262, -1194, -3790, -3267, +2692, 755, 142, 16276, -2338, -1341, 10433, 38, +-1510, -2520, -3205, 913, 3783, -1622, -4744, 1891, +2502, -8, -2962, 2091, 14986, 1270, 2931, 682, +1073, -10215, 1606, -1010, -822, 1168, -1403, 254, +1156, 3206, 3958, 1739, -402, -654, -4862, -1869, +2643, -2858, 658, -910, -2548, 5428, -1992, -208, +1950, -15526, 520, -4212, 3182, 4160, 1524, -2916, +586, 3213, 675, 185, -629, 669, -838, 502, +-4065, 353, -4072, -1832, -2108, 5034, 2484, 15386, +-2102, 4988, 70, 1011, 2568, 1360, -2821, 3352, +-11074, -2686, 611, 460, 1811, 3093, 34, -9140, +-1163, 26, -875, 2510, 1134, -1322, 2274, -960, +-823, -510, 1092, 1490, 1466, -1978, 32767, -2379, +-1019, -633, -1306, -242, 2050, 1336, -2668, -2195, +-442, 8, 2292, 4344, -2439, -1472, 1035, -14443, +-1820, 6309, -2096, 45, 3617, 1561, 1252, 2828, +10682, -894, 10841, 2373, -101, 913, 2160, 2653, +2960, -4433, 1193, 4892, -2123, -7911, 991, -2643, +-1364, -3641, -9736, 444, 869, 2990, 926, -1220, +-1676, 7492, 4376, -3742, -6964, 4531, 7522, -2686, +164, 1070, -7305, 1863, 542, 146, -800, 18492, +-4849, -3876, 2162, 5111, 2606, 4243, -3035, -2990, +-1710, -426, -5315, -2332, -1020, -268, -1242, -39, +-1684, -32768, 1288, -726, -1768, 304, 702, -2969, +-700, 586, 1541, -1099, -348, -2816, -2181, -1260, +-1658, 2278, 323, -1548, 2513, 11816, -2416, -5837, +-118, 6770, 3360, -4097, -264, -1270, 1064, -9862, +-3669, -56, 603, -1475, 1464, -9553, 6, -3091, +5331, -396, 892, -2774, -4674, 3667, -9982, -5160, +-1146, -4026, -2032, 2936, 1805, -1026, 1065, -420, +-572, 1756, -479, -583, 30760, -732, 750, 270, +-1541, 28, -1114, -96, -264, 1167, 548, 570, +84, -1981, -2110, -1136, 358, -6337, -257, -14658, +1144, -9032, 322, -3730, -3086, -1351, -3320, -4116, +-396, -129, -3202, 1403, -347, 2400, -371, 532, +1555, -2760, 1078, 804, -1314, 21956, 2231, -2808, +-1947, 838, 12428, -14514, -384, -1554, -675, -885, +1358, 1612, -3266, -98, 1876, -447, 2241, 3375, +-1765, 2792, 674, -1513, -1132, -3696, 11368, -1916, +-2778, -466, -377, 2090, 3897, 5422, -2550, 2360, +3279, 8657, 990, -2128, 2592, -970, -2397, -269, +22742, 694, 310, -2433, 920, -690, 1478, 1370, +-450, 445, -1379, -1244, 2374, 1400, -1040, -5692, +-1700, -1630, -4068, -1193, -719, -2953, -3562, 264, +-13247, -4629, 5, 3245, -5724, 2449, 3190, -5375, +-3560, -3834, 1271, 1568, -762, 2938, 782, -1390, +243, -466, 1376, 974, -1646, -1784, 249, -514, +-13543, 1904, 10778, -772, -155, 7838, -30, 3634, +-473, -9100, -112, -3990, -840, 1495, -2346, -326, +3655, 1292, -292, -10972, 3431, -262, 171, -9775, +-985, 578, 312, -2553, 3375, -8316, 1410, -1326, +2459, -3116, 1079, 7194, 2720, 1998, 2742, 4672, +-1589, -8932, -124, -652, -72, 2409, -926, -3661, +-3762, 14832, -1350, -2234, 1258, -1604, 169, 103, +1263, -400, -765, 144, 824, 855, -13344, -1629, +1977, 2995, -1964, -650, -219, -11607, -6062, -792, +-1243, -1438, 1757, 1436, -3739, 812, -856, -9603, +-2428, -11372, 3273, -2318, -8263, 1551, -2054, -3646, +3149, 2255, 594, -412, -3030, 1558, 694, -1211, +618, 3256, 6526, -1572, -9054, 6655, -3208, 3616, +2162, 3137, 4254, 4610, -10040, 1188, 335, -615, +640, -1990, -314, 6014, -2392, -2174, 343, 6730, +-1320, 183, -97, -3566, 2988, -13343, -1573, -9070, +428, 2839, 6728, -1109, -1113, -1102, 5012, 1308, +-3943, 3207, 764, -2928, 1144, -3044, 4033, 1846, +6460, -4165, 8509, 9824, 15708, -642, 748, 124, +-406, 13033, 807, -299, 1319, 1499, -1206, -1102, +-3129, 3795, 47, -2483, -2470, 2287, 4028, 1656, +-364, -1712, -1568, -3940, -2770, -13688, 796, 3380, +363, 1673, 1160, -3934, 2884, -5060, 832, 4799, +364, -3030, -10596, -1805, -3256, -2492, -1831, 1088, +11108, 3236, 5128, 3052, 4486, 84, 2078, 200, +-4071, 1713, 1539, 24597, -1019, 32, -48, 82, +81, 1171, -1261, -1783, -1693, 2194, 1714, -225, +-1989, 402, 2611, -708, -15901, 222, -507, 12855, +1162, -1536, -2884, 1911, -1256, -926, -1875, -1448, +-2730, 3059, -1231, 1680, 1824, 1288, -215, -9, +40, -957, 27662, -1844, -1927, -846, -1144, -439, +-3507, -2844, -1880, 637, 1042, 237, 1007, -387, +-11913, -2584, -142, 624, -494, 1439, 2225, -13017, +-1901, -1253, -1071, -7083, -2154, 814, 3867, 1130, +-2611, -2260, 1548, -12389, -1018, 102, 1178, 1058, +-14863, 2020, 4094, -1259, -861, -886, -3119, 2638, +1725, -1364, -2086, 183, 507, -978, -3086, -14966, +759, -1341, -70, 8538, 2974, -140, 2509, -4460, +2724, -1372, 491, -6138, -345, -2170, -1187, -330, +-11090, 15657, -300, 2105, 496, -2093, -447, 2000, +3451, 1482, 758, 4142, 562, -4042, 1491, 3183, +1685, -2729, 1611, 11698, 14918, 25, 842, -2766, +-667, -1564, -2619, 646, 1391, 862, -909, -2141, +-589, 1468, -755, 1324, -765, 634, 195, -19622, +-1006, -1161, 2434, -1808, 4168, 4108, -2580, -635, +-2533, -2170, -3701, -1047, -363, 769, 5064, -8, +-654, 2346, 752, 13736, -4056, 7, 5492, 7326, +-4894, -3860, 3325, -3947, 4721, 5557, -3699, 194, +-12957, 1052, -1317, -2642, -2931, 1050, -3951, 2392, +-9683, 2519, 2880, -3700, -1820, 831, 4370, -1177 diff --git a/src/main/resources/vavi/sound/twinvq/cb1110s0.txt b/src/main/resources/vavi/sound/twinvq/cb1110s0.txt new file mode 100644 index 0000000..684ac61 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1110s0.txt @@ -0,0 +1,168 @@ +-32746, 360, -2774, -672, -1808, -14, -1037, -1327, +1409, -2215, 172, 1557, 945, 2031, -702, 1844, +-1106, 472, 2603, -978, 2782, -5691, 1473, -5668, +7129, 6600, -2160, 108, -1844, 2062, -2395, -740, +1690, -45, -725, 77, 7236, -12903, -3356, -764, +1870, 720, -2201, 790, 9950, -3694, -5340, -4031, +4115, 6863, 2352, 1484, 3606, -4855, 714, 4104, +6240, 7261, -6855, 4919, -2847, 6701, 7469, -616, +-11442, -1935, 9157, -4072, 133, -5976, 2455, -9360, +-2898, -4353, -7721, -3098, -3505, 2568, -5432, -576, +-10072, 250, 2173, -4196, -4322, 2688, 5220, -6026, +-346, 11678, 2071, -7344, -2182, -530, -180, -2568, +1524, -1617, -8825, -4845, 2794, -2813, -2669, -2423, +-2709, -8985, 2105, -4629, 708, 2040, -5680, -2470, +-7277, 6841, 6523, 4196, -6788, -1982, 3844, -5000, +156, 1930, 1780, -3824, -286, 3908, 1703, 7304, +1145, 144, 1180, 7145, 3175, -13823, 6580, -3066, +-6321, -9739, 4432, -1145, 2923, -2636, 3838, -7037, +-3913, 1262, -1398, 363, -141, -886, -5667, -212, +-2118, -2717, 2724, -18802, -2098, -155, -1399, 782, +797, 766, 2613, 5374, -3767, -1711, 624, 693, +2544, -6153, 7179, 6835, -762, 5061, 655, 2600, +9208, -7030, 7047, 1654, -3404, 176, -5486, 1374, +-15378, -487, 7456, -1954, 2404, -2994, -1608, 2362, +-498, -7952, -6143, -3996, 1596, -3013, 1181, -1534, +-5265, 220, -2677, 1047, -4629, -15066, 3966, -446, +-11713, -5694, -393, -250, -1336, -7394, 1508, 6239, +3788, 6273, 6215, 822, 2657, 8057, 8391, -658, +-2561, -11587, -2589, -6702, -9227, -1016, -2220, -9702, +5988, 1859, -6100, -4594, 221, 2529, 2217, 8273, +1804, -6128, -2859, -8259, -4707, -2494, 1913, -352, +-4561, -289, -1801, -994, -4445, -1001, 5422, 10868, +-7366, 1679, -5195, -6859, 2982, -406, 2400, 4520, +-3611, -1892, 4900, -3504, 771, 2774, -772, -1929, +-7354, 375, 628, 4522, 1069, -969, 8083, -155, +3178, -1138, 1752, -17288, 4390, -2483, -2071, -1353, +-1155, -456, -2683, 6798, -1908, 1797, -6657, -2770, +5610, -14518, 5922, -3964, -938, -853, 1416, -1077, +-4562, -160, 5820, -3031, 5091, 1987, -2746, -3779, +238, -264, -3074, -11718, 9370, 9806, -6302, 3979, +-2938, 4034, 393, -1399, -4466, 2181, 756, 394, +2264, -3664, 78, 470, -3228, 3942, -1714, 708, +4988, 1938, -2722, 4555, -5054, -1026, 19312, 354, +107, -5357, -4364, 597, -2566, -2812, -2278, -446, +1384, -371, -2566, -388, -3964, -8989, 9136, 3389, +8440, -5570, -1262, -5874, 2056, -5973, -185, 4540, +-4924, 154, -3653, -1113, -3048, 7099, -2734, 2940, +-6704, 1543, -8120, 10134, -9485, -6645, 4816, -442, +-32, -2430, 4932, -6129, -5050, 6120, -2147, -6910, +-1342, 1075, -2458, 50, -4747, -3080, 1886, 1490, +18972, 48, 787, 2441, -405, 1668, -1399, 2202, +2175, -3592, 1548, -2728, -4864, 504, 383, 376, +-1073, 2142, 504, -3114, 6378, -5516, 13462, 196, +1840, 7087, 792, -3583, 302, 1012, -5504, 270, +3354, -4486, -2312, -2522, -2872, -3899, -2261, 5211, +1417, -3075, -151, -985, -772, -1630, 164, 659, +1496, -349, -621, -32, -2982, -1720, -3475, -7370, +-1541, 1122, 20474, 1726, 4474, -3228, 7024, 3265, +522, -2193, -2113, 5388, 1912, 5929, 11768, -1162, +2600, 4048, 652, 3360, -3215, 376, 10028, 6054, +-3814, -1155, 93, 4512, -3581, -4037, 7484, -1481, +2797, 2635, -12275, -2780, -6235, 5739, 2687, 376, +5984, -2547, -8834, 4332, 2752, 1942, 1002, -3312, +5251, -86, -7794, 918, -2413, 3131, -3316, 2095, +-4569, -15382, -5534, 1290, 5179, 2928, 3034, 2365, +270, -7476, -3024, 6910, 1355, -6262, -2040, 10490, +1432, 12284, 1125, -3160, 4518, 973, -2351, -1726, +1967, 1488, 382, 3559, -3742, -2908, -944, -1662, +682, 902, -4360, 5026, -4252, -1212, -3269, -6024, +-3788, 9128, -2638, -1625, 315, 3087, -3265, -10441, +-7207, -4078, -3266, -7543, -5223, 5460, 2496, -9258, +-227, 4048, 860, -520, 13616, -3458, 3837, 809, +-104, -4062, -4846, -136, -1631, 13977, -1136, 3380, +1099, -4022, 1831, 3360, -9034, -52, -516, 10144, +5074, 4866, 8282, -972, 2496, 2336, 8766, 2881, +2417, -5588, 3064, 3934, -4202, 627, -986, 1750, +958, -2348, 5006, -2597, -90, 133, 23271, 2431, +-3984, 1894, -2094, -1816, 5007, -3164, 2526, -1862, +2651, 1809, 7173, 3410, 154, 14930, 3032, -5314, +44, 8868, -543, -2158, 5341, 258, -8188, 3772, +2804, 7544, 8339, -3560, -63, -735, 1300, -4308, +-1085, -4986, 1564, -6744, -2605, -310, 1275, 1166, +-640, 4814, 4373, 3103, -1242, 6049, -4786, 597, +182, 2371, 6950, -2265, 389, -14669, -1942, -2733, +-485, -865, -597, -1376, 1626, -3956, -1244, 1532, +3918, -3311, 1574, -88, -20573, -5471, -71, -1731, +1436, 2428, 3982, -4576, -914, 5460, -4973, 1650, +-2364, -2486, 3212, 5424, -2501, 4595, -937, 728, +-5140, -9948, 1437, 10560, -5704, -264, -2752, 949, +5229, -1445, 430, 827, 4103, -1999, -4625, -4171, +-8769, -8927, 7161, 4539, 6968, 5975, -4626, -2793, +10080, -10386, -2479, 1724, 2992, 354, 3650, 3328, +4490, -1931, 7348, 7283, -3304, 4446, -1698, -1224, +-3002, 4340, 1041, 607, -454, -4261, -18071, -1199, +-3902, 570, 5808, 5582, 6710, 235, -205, -4288, +3472, -686, -103, -3658, -436, -9680, -190, 275, +-919, 2522, -2087, 9096, 5060, -6450, 10282, 3344, +-8167, -7688, 11881, 3101, -1280, -9942, -11741, 2213, +712, 3976, -4218, -5285, 2797, 2996, 4006, 2053, +2344, 6200, 141, 2616, -3981, 6970, -4194, -1621, +-13724, 7772, 2800, 2220, 445, -266, 4030, 444, +-228, 2642, 1617, -2511, 1699, 8740, 3438, -2063, +-2093, 1806, 950, -7112, -1513, -2886, -8789, 870, +3456, -4126, -3330, 541, -10173, -1789, 3156, 4466, +-5965, 479, 5177, -2806, 2506, -1646, -3609, 1617, +-7373, -3146, -2389, 3601, 7850, 89, -3373, 4670, +-4180, -3186, 3056, -1691, 1314, 9234, -7799, 1323, +-4360, -9866, -1930, 8091, -13452, 8503, 1980, 11247, +7688, -5953, -4165, -3192, 540, 1631, 131, 2250, +5330, -146, -8724, -3148, 2834, 1148, -3886, 374, +-1836, -3898, 9649, 1119, 10221, 128, 8868, -7301, +2601, 1252, 2340, -3789, 4682, 181, 4434, -1740, +4368, 879, -620, 2046, 1842, 844, -925, -2506, +-3344, -8820, -722, -451, 521, 903, -1286, -3059, +-5308, -4759, -2706, -1429, 2762, 927, -1459, -7274, +-12028, 8838, 3987, 2406, 8626, -3128, 6505, -4322, +-197, -2464, 2738, -46, 161, 13919, 2252, 2059, +981, 204, 1161, 4910, 683, -4311, 2081, -1932, +1119, -6067, -5325, 8528, -4704, -5522, -6183, 5744, +-3407, -2021, 2688, -3230, 2490, -976, -500, -7834, +2064, 3191, 4740, 3686, 1762, 2604, -2442, -5720, +-7550, 457, -3478, -8097, -6510, -9105, 8031, -4895, +500, -2436, 1483, -4415, -2023, -3768, -2497, -1911, +789, 566, -969, -4204, 6128, -5076, 2664, -4222, +6755, 1774, 6881, 64, 1205, -9243, 4782, 4432, +5193, -2258, -4787, -7433, 1755, -794, 1297, -7535, +12773, 9124, 806, 2348, -8112, 7874, -4348, -1410, +-350, -2528, 576, 661, 272, 4598, 691, 1913, +-3349, -1881, -1854, -779, -821, 8444, 60, 2570, +-1813, -1354, -4512, -5471, 4728, 3289, 2617, -9326, +-6670, -859, -2713, -9839, 4676, -2657, 3106, -1393, +10278, -3069, -2253, 1015, 2246, -2227, 16, -388, +7962, 1493, -3122, -2707, 7982, -6106, -1462, -1665, +-1302, 2347, 3640, -15122, -2211, 417, 6819, 959, +-2876, -6868, 11060, -2329, -302, 1595, -4610, 9514, +12677, -4614, -2899, -141, -4857, 1447, 6400, -2894, +1696, -2888, 1889, 3489, 2775, -504, -6597, -5258, +-7256, -379, -1249, -136, 3118, -3537, 3295, -3458, +2103, -399, 15281, -222, -1809, 172, 2257, 1947, +707, 3562, -5691, 3575, -2210, 5750, 815, 4059, +-16, 1306, -13308, -1733, -1338, -3477, 5247, -1950, +-5148, -678, 8074, 1740, 290, 2033, 4639, -4240, +-536, -5214, -1366, 2491, 501, -59, -4480, 430, +-285, -5947, -755, -14559, 5696, 6960, 4462, 2317, +6414, -13174, 4962, -899, 5924, 11100, 5303, -970, +-2528, -6239, 2253, 2236, 553, 458, -2229, 8016, +-7082, 2869, -4209, -4460, -6536, 3557, -1766, 7815, +-655, -6029, -5250, -1627, 2646, -3466, -3584, 901, +10305, -895, -427, 949, -2776, 3436, 769, -4131, +9019, -4898, -3562, -7978, -359, 1358, -1528, -3095, +5840, -6214, 2591, -2086, 9480, 640, 2858, 216, +-3625, 5740, -7008, -1097, -2091, -143, 4832, 6210, +-1358, 3998, -714, 835, -4004, 3664, 1980, 1240, +2902, 510, -1565, 427, -2052, -4208, -1505, 1187, +-1229, 3732, -932, -1014, 4784, 18474, -5111, 3047, +-54, -1547, -3892, 8612, 274, 1446, -3548, -7689, +-423, 1192, -4508, -10403, -8735, -446, 444, -6353, +4008, -1462, -8906, -1161, -2395, 2442, 2204, -5472, +-17376, 2471, -689, 1394, -3657, -2119, -769, 2872, +1393, -2701, -3536, 3650, -378, 859, -3338, 1412, +3010, -3243, -335, -3619, -511, -1931, -7126, -5018, +-9332, -4440, 1906, -2265, 1386, 8072, -6576, -1300, +5458, -4894, 630, -7146, 2263, 810, 2968, 1124, +-2219, 2292, -3914, -1836, -6683, 1511, -2755, 1396, +2425, -23842, 2249, -53, -891, -1678, -1766, -1788, +502, -4210, 211, 10376, -5507, 837, -6196, 2132, +-472, -10153, 7234, -1456, -148, 4886, 2427, 2371, +1234, -962, 6298, 1016, 1735, -566, -878, -8071 diff --git a/src/main/resources/vavi/sound/twinvq/cb1110s1.txt b/src/main/resources/vavi/sound/twinvq/cb1110s1.txt new file mode 100644 index 0000000..463497a --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1110s1.txt @@ -0,0 +1,168 @@ +2525, 12164, 4861, 9505, -7371, -414, 3002, 576, +-347, -998, 2861, -804, 3034, 810, -788, -539, +-2092, 4970, 1828, -2869, -2802, 6649, 3673, -193, +-4034, 722, 1642, 3792, 8770, 10428, -3303, -3849, +-4520, -234, -4190, -1219, -1300, -4128, 8384, -1150, +1578, -6174, -1072, -4871, -8180, -6698, 3806, -7386, +-2545, 1052, -550, -1148, -1308, -8834, -2654, 1982, +8716, 6579, 1360, -2404, 1893, 2680, 3801, 11097, +1455, 2453, -7585, -7503, -12710, -420, 2023, -656, +1124, 2872, 9676, -4309, -202, 1458, -6526, -534, +-1535, 924, 3068, -1142, 5073, 1284, -5632, 869, +-1637, -2898, 4900, -10202, -10488, -1097, 1890, 11006, +-44, 1368, -1979, 6507, 316, 961, 8, -4085, +2561, -2034, -1077, 2594, -465, -5134, -868, 54, +-6694, 9608, -3516, 7165, 11011, 9542, 4780, -2800, +-1130, -1714, -2684, -369, 4746, -2688, 4146, -7652, +984, -3263, -276, -9134, -2848, -3983, 9994, 3608, +3234, -596, 263, 3102, -178, -2264, 3820, -4293, +-5752, -3577, -3914, 1095, -1562, 22110, 4610, 69, +-2999, 254, 2178, -2901, -1203, -1292, 2642, -3254, +-1389, 2955, 1340, 542, 810, 1369, 3208, -795, +-3272, -2717, -1129, 8781, -6854, -3028, -616, 729, +529, -6946, 1621, 9574, -14909, 5398, 854, -774, +-9978, -5417, -2516, -4683, 5715, -66, 3336, -5040, +640, -7566, 3494, 7016, -2269, 1376, -13994, 6448, +-3948, -1697, -3988, -6559, 2376, 4231, -3131, 2045, +-2417, -5919, -7016, -1695, 9046, -7966, 5187, -2553, +1402, -2351, -220, 5931, -1823, -2270, 584, -3784, +2924, 6166, -3035, 2370, 4923, -1080, 682, -7899, +-10827, -1824, -908, 1568, -3565, 4033, -4266, -1948, +923, 5488, -203, -2396, -907, 2783, -3278, 1415, +7710, -190, -5208, -2279, 1266, -1132, -3392, 10251, +-1064, 11283, 2162, 2213, -5088, 4479, -4658, -1803, +1534, -4233, -4073, 6938, 3966, -4878, -332, 5961, +9217, 488, 6520, 4430, 7988, 9383, -2586, 1206, +-6983, -873, 1251, 1849, 5945, -2144, -2032, -1852, +416, 3720, 2419, 8462, 3173, 11524, -2894, -5517, +-211, 17830, 3170, 1098, -721, -2066, -1956, -3097, +-1061, 2815, 447, 701, 449, -485, 2609, 1239, +2257, -1760, 3091, 7538, 3710, -2689, -3092, 6903, +-2457, 3271, 6355, -1486, -828, 1994, -3575, 3949, +3185, 2606, -4912, -16039, -8833, 1831, 2580, 1993, +-1117, -3408, -7590, -7278, -141, 2696, 805, 1896, +308, 378, 9308, 2894, -4324, 1042, 837, 4716, +-4702, 2493, -5173, 8616, -468, -14829, 3759, 3251, +-4237, -1340, 5224, 2099, -764, -8263, -1699, 76, +-1464, 2115, -582, 3286, -3653, 1017, 1696, -1414, +-668, -9748, -5730, 2413, -1270, -6070, 17002, 2164, +-5440, 1801, -2123, 800, 2135, 4801, -887, -2141, +-647, -4846, -463, -577, -1846, -555, -1929, 2046, +8272, -8399, 3886, -5950, -4202, -12600, -2805, 477, +65, 6140, 1089, -4737, 8967, 1952, -1968, -3660, +6641, 850, -3304, -1775, 4010, 10819, 14365, -696, +-1331, -1724, -237, -3611, 244, 3005, 4349, -182, +-4124, 2466, 2746, -61, 3391, -1392, 3788, 1582, +3723, 7140, -2207, -3678, -2675, -252, -7476, 9426, +-6196, 3226, 3554, -6326, -4284, 6346, -4432, 5199, +-2633, -2499, 1200, -1140, -3910, 6624, 16732, 5946, +-766, 2630, -1200, 1988, 5510, -1199, 4126, 1287, +454, -1795, 2664, 5001, 1058, 500, -437, 2992, +-2012, -160, 796, -4846, -6572, -10088, 603, 483, +-4510, -12799, 3502, -1784, 3510, -3956, 6038, 9044, +-6029, 7170, -1608, 120, 914, -200, 3939, -6274, +3020, 6235, -2754, 5368, -1693, -6028, 386, -2006, +1898, -11704, -9973, -525, -2624, 1799, 4140, 3248, +-57, -3731, 3764, 5582, -3830, -2484, -2066, 1517, +-900, -8250, -8191, 2676, 1147, 6752, 6908, 1196, +-2634, 3408, 2980, -1042, 3971, 632, -4946, -5690, +133, 2445, -446, -1294, -777, 3356, -5628, -6020, +-8042, 5069, -1421, -2701, -15117, 3074, -912, -2574, +2643, 5252, -2118, 3849, -3793, -850, 4170, 6240, +-697, 6976, -3752, 1155, 7769, -8912, -7728, 4224, +-2362, -3760, 3688, 2402, -3411, -3165, -2550, -8, +-209, -334, -837, 5688, 3425, -4564, 9999, -4780, +3093, 4346, -5556, 1636, 1755, -14696, 1810, 6547, +-60, 4054, 10539, 6118, -4414, 1760, 3581, -841, +4471, -23, 180, 259, -4439, -13230, -1326, 1913, +-621, -1641, -2882, -4934, 516, -3886, -4468, -110, +-4526, -5157, 7550, -4449, 813, -4364, 1768, -8829, +2003, -1372, 1873, -209, 1539, 1076, -12408, -1464, +-1878, 1563, 2020, 704, 1425, -275, -3718, 4618, +-1120, -5057, -3590, 4022, -1977, 620, 143, -2507, +3697, -3263, 616, -3002, -3347, 21051, -4398, 364, +-1924, 284, -2724, -2297, 4916, 2702, 4866, 4293, +-2781, 1094, -1525, -562, 5487, -2098, 4658, 1362, +-597, -3426, 3173, -5174, 3922, -3844, 1482, 4711, +5853, 1490, 5499, -17537, 956, 544, 268, -4782, +-504, -4003, -911, 599, 1746, -7322, 1907, 1990, +16985, 3171, -2645, 1040, -7239, 5618, 304, 3606, +-3377, 3630, 7319, 108, -496, 1026, 3062, -392, +2366, 1948, -530, 806, 2700, -2676, -2717, 5238, +-16008, -823, -264, -1560, -1014, -760, -3684, -330, +5644, -1668, -10239, -2583, 7411, -593, 2193, -1479, +-2892, 3834, -3625, -12234, -1103, 1868, -5121, 3879, +2748, 1936, 2026, 4572, -6037, 3310, -8678, 11724, +5290, -2316, 4131, 834, -3915, 869, -1734, -5752, +1255, 9534, -3625, -115, -5912, -125, 2298, -1494, +5910, -496, -2719, 1320, 3175, -3012, -3906, 4602, +-4760, -5918, -2568, 6632, -8802, -5876, 6358, 2349, +207, 5191, 8369, -5932, 2710, 7950, 3673, -2592, +1311, 8384, -4360, 8614, -5662, 1180, 2147, 1044, +1591, -5555, -1597, 4418, 38, -1579, 4675, -1725, +-1693, -6470, 3066, -7601, -12822, 524, -2986, -3406, +8860, -1266, -930, 4316, 1171, -2908, 199, -1785, +-2851, -3588, 3072, -3585, -2668, -1123, 1508, 460, +6780, -19480, 2854, -1574, 1004, 5074, 1907, -1988, +1177, 74, -1436, 2224, 1232, -3008, -3454, -862, +604, -653, 2778, 2349, 3242, 8426, -430, 3684, +4814, -1886, 5118, 1487, 442, -2322, -900, -2854, +-234, -10350, -7922, -745, -1490, -5638, -6014, -4079, +-2979, -351, 9493, -2274, -11362, -8166, -7364, 8261, +1554, -1722, 4651, -831, 2276, 1502, 2600, 1266, +4456, -4145, -3837, -3584, 4242, 4058, -2395, -6971, +4486, 3233, 6226, 1306, -11506, -6223, -5132, 1537, +-4407, 1510, 5732, 2808, 5817, -4972, -2900, 897, +-2441, -1819, 5651, -6988, -10063, -2288, -5820, -1250, +925, 3120, 6125, -9901, -137, 3684, -6601, 1077, +3272, 21, 3341, -838, -3643, -1727, -4417, 660, +-6551, -184, -8125, -1780, 5232, 6077, -7968, 6423, +3823, 3026, 4555, 464, 3318, -5504, 837, -3571, +3853, -2277, -1864, -742, -5380, 6096, 6856, 1076, +877, -642, 1926, -4712, -14482, -3323, -2672, 7485, +-2116, -3932, 2233, -3270, 326, 2221, 132, -1893, +-748, 453, 3597, -2308, -4371, 5632, 3609, -1033, +-444, -2591, 17359, -3120, -2604, 3157, -370, 9242, +-1606, 2675, -853, 1475, -416, -3280, -1159, 191, +-3670, 282, 4282, -957, -2978, 3564, 91, -20520, +-3046, 1248, 1277, 3368, 1118, 311, -598, 1406, +-2377, -1444, 1417, -3626, 167, -6440, 3341, 629, +-2523, 4398, -1187, 4322, -383, 1934, -3298, -8530, +2195, 5220, 510, -1256, -6932, -1061, 5141, -16242, +-1390, -546, -3760, -2029, -929, -6044, -3503, 312, +8478, 701, 8865, 4715, 1987, 1342, 1400, -71, +-5229, -1547, -8827, 2349, 12836, -1479, 4621, 6003, +-6749, -3184, -5667, -2930, -1074, 3204, 330, 4692, +2872, -10808, 75, -1260, 18003, 4100, -1462, 1391, +-1667, -2039, -687, -4806, 5913, 2682, 7730, 7034, +2703, 1666, 120, 1601, 2123, 1402, -4702, -11229, +7875, -5591, 4634, -2274, 3015, -597, -7520, -1095, +-4814, -173, 5562, 1533, 2807, 8466, 5195, 7806, +2585, -2877, 6938, -3942, 402, -3825, 4162, 9149, +-6423, 2447, 7041, 2932, -9813, 2124, -58, -3, +-12856, -7973, 1484, 907, 180, 8042, -2124, 4356, +-4117, 1126, -9706, -2101, 3957, -1877, 1139, 7148, +3707, -1341, 4509, -1220, 4570, -1650, -6504, 7036, +-10268, -328, 4678, -12205, 5062, 6089, -496, -7740, +2207, 4489, -205, 1386, -2695, -1442, 4730, 892, +12061, 3818, -3305, 4431, 9300, 3470, 4608, 4315, +892, 866, -1714, 1529, 2569, -11398, -3068, -282, +1626, 587, -1568, -1630, -220, -2033, 7141, -2732, +-3541, 3404, 15514, 1883, -2697, -926, 5972, 6485, +-6794, 2111, 2490, 1201, 5467, -2352, 3264, -97, +2400, -728, -3364, 3417, 1481, 2862, 462, 2855, +-5233, 5740, 7208, -10508, -3254, 1450, -1270, -293, +3400, -6978, 10035, -1213, 4308, 2641, 8579, 8518, +-2919, -351, -459, -2069, -617, 638, -1347, 107, +6009, 2035, -280, 2009, 3280, -1236, -14960, -5177, +-2440, 965, -2646, -2095, 5274, 1825, 3705, 3831, +-446, -4018, 7178, -2415, 4344, 1850, -509, -500, +1056, -4374, 5709, 1336, 3352, 7915, -2302, 12209, +-14362, 6429, 1423, 2912, 6474, -1599, 1116, 2280, +-1738, 3108, -5792, -3554, 623, -1110, -6114, 4488, +8941, -3176, 13670, -3320, -327, -2657, -7349, 3782, +-1481, 5737, -200, 2968, -9474, 5752, 5056, 4688, +-5352, -432, -906, -3832, -8519, -7, 3667, 3583, +6250, 8724, 10737, 9371, 950, -1630, -10740, 5788, +4111, -2910, 437, -2482, 1910, 185, -2168, -3155, +-3515, -1754, 4978, 4298, -6921, 476, -2778, 546 diff --git a/src/main/resources/vavi/sound/twinvq/cb1616l0.txt b/src/main/resources/vavi/sound/twinvq/cb1616l0.txt new file mode 100644 index 0000000..02b33a1 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1616l0.txt @@ -0,0 +1,128 @@ +-185, -20290, 476, -272, 31, -638, 806, -61, +220, 176, 178, -788, -441, -333, -360, -263, +-116, -512, 9794, -727, 8904, 1192, -277, 756, +-670, 795, -311, 240, -617, -675, -970, 756, +857, 529, -166, 674, 890, -522, 837, 79, +-618, -1308, -13832, 744, 5422, 2688, 531, 398, +1500, -1965, -209, -346, 613, 2147, 10053, -1398, +189, -108, 471, -1202, 999, 178, 762, -601, +1116, 9468, -281, 763, -1204, -822, -20, -160, +-806, 14720, -269, 143, -1362, -532, -788, -1532, +-405, 85, -271, -4959, 276, -34, -28, -66, +112, -188, -582, -678, 128, 680, 982, 596, +12154, -10468, -167, -380, 734, -296, 282, -223, +-86, -342, -812, 514, 387, -418, -364, -1216, +14, 373, 357, 10897, 11235, -714, 206, -618, +-607, 596, 190, 726, 496, -300, 95, 1022, +-153, 212, -540, 252, 281, 238, -234, 28, +24, 184, 32767, -627, 569, 323, 486, 544, +-348, -589, -284, 238, 228, 475, 83, -7753, +182, 745, 400, -633, -207, 137, 382, 90, +78, 715, 448, 463, 937, 10203, -12047, -667, +-370, -1516, -360, 94, 832, 1027, 1013, 92, +-5446, 834, 302, 764, -94, -462, 8095, 1057, +308, -635, 308, -877, -946, -616, 51, 1090, +-13351, 490, -819, 15182, -384, 411, -546, -242, +460, -323, 76, 277, 1582, 900, -1119, 345, +1316, 1138, 2020, 1612, -148, 812, 1241, -10350, +-9495, -965, -69, 1967, -168, -128, 1042, 447, +491, -133, -5083, -450, -164, 50, 326, 269, +-283, 226, -40, -334, -110, 60, -47, 169, +9166, 1188, -942, -14, 2112, -230, 634, -741, +-214, -336, -606, 3102, 59, 216, 1805, -1176, +211, -8, 564, 156, -261, 300, 597, -21842, +66, -232, -506, -1126, 1057, 603, 1448, -391, +249, -9445, -10240, 694, 167, -1158, -645, -385, +-209, 330, 519, -345, -600, 192, 78, -229, +208, -9053, -383, 10646, -264, 84, 295, -148, +87, 1292, 257, 1080, -564, -2395, -1200, -484, +-48, -513, -383, -11, -516, -17356, -1172, -218, +124, -327, 31, 328, -80, 231, 58, -951, +560, -501, -392, 30528, -56, 382, -515, -50, +-155, 338, 0, -414, -899, 95, 11, 378, +-350, 459, 673, 76, 86, 379, 32222, 143, +-48, 425, -394, -60, -348, 450, -489, 220, +56, 1129, -125, 322, 168, -16, 322, -293, +294, -38, 328, 141, 692, -82, -160, -32768, +-140, -1543, 1079, 1052, -924, -569, 168, -1782, +815, 706, -1318, -3436, 2860, 10922, 236, 10311, +882, -1911, 11, 1638, -189, 245, -858, 11060, +-826, 696, 224, 1707, 1766, 472, 10832, -265, +-161, 163, 478, -258, -284, -86, 496, 425, +-71, -10344, -141, 425, -1457, 1145, -63, -713, +-583, -327, 628, 368, -18, -1746, -525, -338, +-110, -359, 92, -233, -21328, 460, -275, -98, +-58, 51, 208, 56, -1145, -51, -242, 65, +76, 214, 141, 28, -86, 26, 925, 193, +9980, -326, 11342, 176, -534, -303, 130, -1575, +189, -496, -699, 381, 411, 644, 229, -147, +694, -1998, 523, -1576, 8028, -10385, -1924, 1174, +608, 2402, 575, -1753, 437, -816, 1267, 147, +1448, -614, 865, 1076, -156, 5000, 2020, 2021, +10283, -460, -2381, -3226, -3991, 4904, -284, 105, +-268, 1049, 203, -646, 732, 6490, -128, 932, +10, -866, 74, -64, 834, 204, 159, -162, +-170, -110, -28908, 52, -512, -72, 327, 615, +534, -484, 131, -262, 31, -407, 284, 33, +11118, -170, 318, 12848, -1126, -659, 500, 310, +-403, -234, 237, -544, 1232, -243, -1178, -965, +-117, 108, -1304, 11728, -2254, 1231, -1077, -136, +-632, -103, -256, -1644, -300, 1680, -1175, -956, +-43, 1718, 175, 144, 275, -802, -223, 1116, +321, -871, -1174, -1175, 1008, 255, 31172, 28, +-621, -222, -12473, -10995, -712, 247, 1762, 418, +-181, 90, 92, -406, -435, -105, -596, 2262, +-116, -1574, -3402, 6796, 7944, 973, -2661, 2260, +621, -6984, 382, -1375, -2604, 1550, -1453, 1133, +966, 403, 284, -72, -36, 174, 457, -90, +38, -437, -476, -370, 469, 32767, -267, 350, +694, -169, -782, 2110, -620, -782, -669, -6478, +10550, -3294, 485, 177, 553, -3232, 1628, 2335, +-870, -360, -1112, 2197, -474, -5113, 3346, 878, +566, -3823, -1175, 357, 10509, 1077, -514, 1012, +38, 59, 669, 654, 349, -1046, 355, 192, +57, 95, 11869, -702, 10201, 204, 45, -608, +-444, 921, -1070, -316, 1286, -2566, 2026, -127, +-79, -954, 93, -1288, -10024, 693, 8820, -366, +-84, -6378, 1682, -627, 386, 254, 503, -152, +-336, 38, -341, 373, -85, 1088, -1707, 119, +-242, 242, -326, -162, 109, 70, -114, -831, +-279, -32768, 62, 58, 214, 136, 194, -103, +-10047, -610, 91, -310, 12059, 346, -656, 986, +478, 364, 1777, -173, -663, -103, 1011, -373, +200, 1632, -13098, 3651, 418, 478, 68, -217, +169, 78, -1176, -1191, -1664, -328, 152, -1053, +547, 527, -10435, -176, 11131, -137, -36, 1062, +33, 71, -730, 2080, 2061, -372, -637, -84, +744, 109, -357, 550, 309, -239, -134, 135, +-20461, -177, -690, -488, -36, -415, 275, 64, +378, 11250, -802, -569, -200, 1499, 13103, -1090, +-175, 189, -162, -751, 1052, -949, -98, 1249, +479, -1304, 3293, 771, 1642, -381, 1423, 2258, +1184, 4806, -10950, -3873, 348, -815, -5315, -3306, +-3307, 2337, 776, -125, -48, -435, -155, -30, +294, 116, 96, -47, 1022, -391, -183, 252, +826, -32, 293, -1369, 18310, -146, 239, -266, +34, -154, -704, -498, -135, 228, -563, -210, +-158, -514, -201, -571, -341, -428, 74, -152, +297, -162, -644, -216, -252, -13810, 705, 464, +21097, 74, -169, 792, 12, 131, 320, -398, +-446, 44, -362, 388, -22, -13, -209, 1205, +9341, 590, -683, -351, 177, -1618, 495, 14, +-319, 755, 11352, 249, -989, 1574, -922, -364, +366, -10348, 337, -558, -124, 12056, 102, 802, +-548, -254, 1532, 7, -282, -459, -839, 171, +-4445, -1610, -1515, -37, 970, 306, -881, -238, +-154, -58, 27, 435, 166, 571, 225, -844, +-9967, -192, -874, -459, -1283, -1431, 1552, -38, +-686, -207, 709, 11982, -383, 1922, -92, -60, +708, -900, 867, 39, 1470, 517, -182, -456, +90, 1026, -192, 9988, 942, 48, 789, 981, +74, -692, -1283, 1239, 1625, -1121, -286, -1115, +294, 13228, 980, 312, -745, 11711, 1055, 1052, +-907, 201, 688, 364, 1171, 96, -591, -981, +-246, 875, -352, 677, 881, -397, 12890, 10, +0, 412, 76, 464, 275, -721, -28, -197, +104, -238, -372, -272, 490, 1426, 963, -13232, +-1190, 790, 161, -321, 1138, 646, 359, -183, +-659, -129, 348, -22703, 1016, -147, 26, -80 diff --git a/src/main/resources/vavi/sound/twinvq/cb1616l1.txt b/src/main/resources/vavi/sound/twinvq/cb1616l1.txt new file mode 100644 index 0000000..270a274 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1616l1.txt @@ -0,0 +1,128 @@ +292, 310, -255, 305, 69, 25001, -16, -668, +210, 17, -12, 45, -758, -76, -544, -882, +61, 26, -1682, -8820, 154, -11775, 64, 472, +-464, 245, 478, -1560, 869, 2192, 98, 645, +-95, -9369, -594, -635, -11132, 900, 1606, -904, +841, 2570, -1464, 961, 1056, 669, 461, 3307, +-157, -644, 121, -694, 170, 116, 393, 1507, +-233, -654, -162, 108, 98, 17471, 347, -11344, +-701, -284, -246, -337, -1903, 14, 9865, 453, +-11318, -3662, 2373, 1106, -1424, -1709, -2743, -860, +11008, 1579, -38, -1381, 467, -487, -1306, 369, +426, -424, 128, 1078, 1085, 683, 12552, 792, +-184, -278, 186, 2006, 363, 310, -75, 862, +377, 490, -256, -1568, -124, -10785, -1456, -524, +-1259, 517, -1844, 914, 769, 945, 739, -1053, +-691, 177, 96, -1070, -162, -707, -594, -9885, +103, 452, -734, -6774, -753, 192, 88, -292, +201, -532, 231, -281, -691, -1232, -1768, -753, +369, 1556, -139, 668, 941, 264, 10372, 9740, +976, 2519, -88, 941, 446, -130, 2131, -631, +325, 285, 176, -236, -634, -91, 112, 32767, +-233, -726, 156, 881, -217, -497, -236, -1106, +283, 164, -328, -629, -27442, -17, 176, -338, +-192, 538, -773, 634, -180, 872, -190, -530, +586, 6994, 3060, -336, 736, -1268, -1142, -69, +-1359, -1047, -975, -86, 12489, 1162, -509, -478, +717, -514, -502, -1755, 11064, 7668, 340, 230, +-127, 1490, -63, 680, -297, 125, 1700, 2505, +3, -2043, 255, 1547, 569, -2483, 733, -896, +881, 4780, 1544, -13442, 1328, 1937, -4448, -384, +749, 173, 7350, 156, -144, 52, -527, -34, +-3, -173, 118, -528, -75, 39, 42, -874, +-14636, 474, -413, -106, -115, -431, 54, 722, +156, -468, 369, 149, -68, -791, 1318, 2150, +69, 454, 19032, 3, 111, -40, 349, 88, +385, -54, -395, -224, -519, 0, -219, 179, +-253, -11379, 11005, 1857, -126, -248, 304, -616, +351, 324, 500, 1494, -1390, 2349, -1257, -1114, +-213, 8156, -2066, 9746, 763, -848, 349, -7, +723, -966, 469, 91, -252, 1336, 579, 1816, +1372, -941, 364, 276, -33, 7, -425, -433, +-21, 546, -671, -31271, -926, 101, 147, 302, +-552, 224, 568, -2386, 519, -458, 13171, -1464, +1161, 639, -10, -877, 331, 3372, -72, 5158, +-706, 906, 2668, 1008, -2732, 3264, 105, 630, +673, -1948, -196, -13130, 1726, 737, 4829, 93, +654, 2175, 3858, -5, 245, -471, 369, 5435, +356, -12934, 61, 1984, 975, 706, -2454, -642, +-93, -780, -443, -1487, -460, 1112, 385, 309, +-10268, 197, -1692, -1870, 50, -1934, 5380, -1193, +775, -493, -992, -557, 2952, 408, 4616, -1341, +10774, 5305, 854, 3031, 67, 617, 2436, -2072, +-1469, 804, -578, 243, 264, 9150, 200, 10753, +-350, 182, -52, -406, 508, -761, -161, -1142, +25, 484, 127, 126, 477, -341, 110, 371, +32767, 1090, 678, 175, 146, 1020, -897, 878, +-137, -507, -534, 658, 678, 505, -753, -207, +391, 60, -23279, -772, -1323, -1578, -3, 196, +-749, 220, -482, -785, 456, 38, 1034, -579, +-58, -1539, 421, -746, 238, 1531, 21290, 586, +-441, -276, 1512, 553, -1407, -276, 60, -1068, +299, 650, -25, 12590, 2058, 925, -295, -1744, +5152, 4935, -419, 272, -383, -665, -194, -255, +574, -267, 541, 1031, -282, -648, 622, -1464, +-28, -269, -533, -80, -476, 282, -336, 125, +104, 464, -8948, 849, 171, 1518, -296, 51, +-27, 3097, -5103, -412, -494, -194, -713, -1277, +102, 1740, -445, 3432, 1180, 6404, -10908, -970, +31, 142, -242, -79, -78, -76, 124, 1031, +83, -55, 1522, -613, -32768, -394, 1306, 287, +701, -4725, -1085, 415, -122, -538, -675, 82, +116, -728, -99, 500, 659, -329, 292, -106, +9243, -340, -11933, -498, 341, -825, -401, -402, +142, -13, -309, -722, 141, 0, -681, 494, +671, -1210, 1466, -1335, 11743, -280, 1616, -11481, +52, 317, 902, -653, -967, -494, -162, -685, +-438, 756, 81, -207, 577, -7476, -353, 918, +-31, -107, 181, 523, -46, -752, 373, -908, +-1808, -916, 632, 1508, -35, -6943, 64, 13072, +-655, 163, 1221, -1655, -2568, -446, -401, 470, +-622, -944, 3744, -458, 203, 125, 238, 5196, +21, 12193, 1095, 1091, -787, -1157, -980, -1154, +7707, -29, 106, 1226, 696, -974, -379, -537, +56, 95, -477, -528, -11245, -1014, 140, 380, +89, 540, 84, -619, -322, -572, -240, -26, +727, 310, 43, -790, -31, -24318, 110, 618, +44, -108, 89, -191, -33, -201, -490, 43, +-136, 1366, -2, 162, -832, 469, -140, -278, +600, -15775, -1699, 184, 1825, 728, -1803, -876, +152, 60, -813, 3063, -929, 972, -282, 718, +8426, -888, 1383, -664, 571, 958, 982, 236, +-548, 66, 1898, -274, 10715, -1693, 79, -1254, +296, 609, 682, -1074, 272, 157, -18972, 377, +-12, 438, 536, -672, 292, 719, -464, 1106, +-296, -812, 6, -334, 67, 678, 382, 678, +301, -22165, 184, 80, -671, -86, 139, -298, +416, -610, 1057, 15, -230, 376, -768, 643, +58, 27, 178, -742, 60, -500, 485, -19923, +-1016, 717, 1126, 287, 2171, -388, 1453, -21, +-268, -1555, -263, 713, 1709, -1103, -10699, 1788, +-8, -501, -892, 11476, -2006, 466, 8070, -286, +163, 35, 494, 76, 1428, -2249, 100, -1542, +319, -214, -701, 10130, -294, -11962, -656, 227, +-512, -1014, 213, -600, -720, 63, -180, 1286, +1063, -9671, -1056, 1269, 1484, 20, 790, 29, +-9906, -373, 608, 361, -659, 43, -1034, -96, +-219, -65, 392, -19615, -464, 212, 820, -182, +-227, 463, 301, 642, -219, 386, -1170, 108, +-5583, 422, -507, 530, -1058, -131, 20, -14487, +101, -14, -415, 32, -1133, -917, 944, -832, +580, 2509, -959, 470, 1184, 432, -1238, 193, +-13382, 2329, 1993, 1035, 80, 3139, -553, 1683, +390, 1480, 642, 564, -11173, 422, -984, -559, +-686, 168, -777, -810, -1278, -427, -96, 1691, +29172, -435, -50, -968, 221, 685, 52, -373, +525, -563, 350, 528, 305, 705, 313, 612, +-254, -220, -1638, -156, 24, 109, -893, -697, +245, 2579, 667, -142, 12315, -694, 3799, 5, +-438, -473, -426, 59, -5381, -56, 200, -280, +-276, 96, 435, 729, 336, 123, -714, -372, +-12609, -12053, -238, 223, -242, 230, 663, -645, +98, 515, 3, 724, 510, -48, 1090, -173, +-5024, 536, 635, -143, 702, 172, -196, 164, +190, -152, -180, 238, -142, -329, 191, -296, +-416, 11775, -496, -95, 392, 994, -584, -925, +-963, 286, -458, 3104, -1990, 968, -1430, 998, +-407, 28485, 436, 42, 378, -210, 148, -149, +-532, 94, -628, 186, -186, -274, 250, -316 diff --git a/src/main/resources/vavi/sound/twinvq/cb1616m0.txt b/src/main/resources/vavi/sound/twinvq/cb1616m0.txt new file mode 100644 index 0000000..6b9216d --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1616m0.txt @@ -0,0 +1,120 @@ +-16476, -11442, -305, -196, -767, -2167, -1, 378, +-2200, 22, 2405, 944, -1786, -806, 669, 952, +10435, -2752, -1625, 1060, -12314, 1283, 234, -2405, +627, 798, -1058, 311, -2794, -2715, 73, -214, +813, -2749, 10732, -445, -12147, -2507, -1972, 1652, +-1920, 215, 298, 1106, 826, -7445, 69, -1679, +-675, 1249, 1444, -1109, -48, -1452, -2368, 3034, +-492, 13068, 311, -3446, 326, -1426, 2384, -2146, +2916, 8957, -196, 2212, 447, 1775, 2607, -11962, +-278, 4335, -1743, 135, 212, -41, -92, 164, +-11, -504, 828, -519, -834, 251, 1919, 762, +24917, -180, -132, -330, 138, 225, 1038, 3, +32138, -388, 208, -638, -1338, -165, 200, -230, +225, -777, -2270, 8198, 583, 3946, -1534, 1666, +-1032, 11384, 202, 30, 2758, -505, -2815, 1265, +64, -17, -360, 636, 134, 502, 259, 872, +-28148, -1046, -348, -86, -739, 55, 448, 168, +-656, 1094, -1074, 4552, -834, 2296, 2356, -572, +-1917, 10979, 3127, -52, -9969, -527, 1994, -1626, +1041, 3310, -2319, 2232, -11444, -2400, -1788, -1254, +5265, 3198, 7088, 4522, 1292, -191, -15886, 2787, +22, -1610, 184, 380, 521, 336, -158, 877, +468, 6515, -756, -5484, 100, -464, 9244, -2726, +-1644, -2741, -5362, -1635, 894, -1849, 10118, -3264, +-4472, 1255, -3571, -437, -1050, 1505, -11178, -193, +-11513, -24, 719, 212, -1999, -725, 502, -1164, +-1060, -618, -91, -738, 740, -2254, -4635, 2700, +95, -853, 1093, -11620, -968, 9492, -25, -664, +367, 1105, 5501, -112, 7516, 10286, 821, -484, +204, 1425, -3491, -1234, -4240, 3807, 2877, 1824, +423, 466, -428, -845, -86, 13276, 8436, -690, +-688, 574, -2874, -552, 4540, 926, -5443, 629, +-395, 2090, -17468, 335, 2419, 1275, -3750, -1589, +470, -1735, 330, 2532, 1094, -6218, -884, -236, +-9678, -9945, -447, 542, -728, -1922, 108, -2193, +-946, 3270, 2121, 2624, 1010, -10742, -102, 2813, +-13070, 1523, -1532, -1291, 420, -1999, 262, -1194, +-4226, -1450, -275, 83, 1168, 1590, -1517, -426, +-1424, 152, 676, 11463, 824, -2092, -1106, -11502, +-2327, -278, 2597, -11, 793, -118, 393, 580, +-499, -743, -77, -427, -408, -692, -29195, -247, +-2014, -922, 97, 581, 5469, -1419, -698, 1490, +-3814, -2818, -13816, 680, 3595, 1544, 2366, -3018, +2479, 323, 346, -260, 337, 2730, 12214, -1118, +-11301, -3028, 212, -41, 1764, -580, 553, 5454, +-8, -366, -1202, 901, -796, -8350, 4380, -1452, +-300, 1152, 3058, -3476, -27, 13046, 34, -11438, +-1321, -1528, 13237, 114, 2514, 976, -571, -1192, +-2050, -1635, -964, 416, -23, -1083, -9, 32767, +-548, 556, -1217, -56, 325, 1048, -145, 202, +1520, 44, 402, 400, -611, 8667, -1083, 1068, +1224, -12031, 2318, -1109, 1266, 1306, 4673, 285, +-5603, 1555, -100, -1059, 403, -213, -680, -904, +11443, 581, 12160, -638, 309, -65, 933, -2280, +1958, 2642, 1808, 7945, -2088, 850, -428, 785, +-989, 1234, -1413, 745, -10756, 1943, -184, 3252, +-96, 932, -664, 13222, 11326, -1374, -327, 1901, +1069, -1540, 104, -139, -904, 106, 1664, 925, +46, 353, -835, -554, 1618, -956, -437, -727, +-3403, 1038, 968, 436, 46, -4385, 340, -16903, +-498, 47, -554, -399, -2418, -347, 358, 23280, +234, -172, -338, 1058, -2172, -1, 1710, -64, +-583, -2224, -780, -637, 3500, 108, 1045, 828, +-728, 9466, -2487, -12773, 1924, -1158, 208, 49, +136, 12055, 42, -1381, -375, -11534, -249, 1602, +996, 204, -710, 4761, -511, -15761, 166, -1184, +-192, 50, -105, 890, -9566, 2062, -1536, 133, +-185, -643, -172, -894, -355, -16, -1395, 542, +2160, -481, -1104, -793, 517, -20454, 698, -181, +-135, -434, 1677, -181, -415, -738, -1574, 1664, +-14058, 597, -12354, -460, -313, 1724, -686, 85, +-1162, -648, 865, 165, -225, -1947, 2818, -778, +-4010, 402, 686, 11170, -332, 10336, -757, 4794, +2204, -477, -292, -366, 8412, -2476, 494, 510, +10514, 769, 642, -441, 1079, 6954, 4246, -2272, +-290, -224, 1312, 398, 1536, -692, 330, 157, +-946, -100, -1830, 214, -25652, 1382, -1836, -440, +110, -506, -438, -2370, 126, 562, -3515, 1014, +8526, -1641, -2493, 4411, -9210, 2110, 625, 114, +323, 2450, 2407, 682, 1999, -9424, 2480, 69, +-2091, -11845, -3684, -429, -1622, -919, -518, 70, +1450, -3523, 5126, 5706, -1451, 2633, 820, -204, +11338, -8014, 753, -103, 290, -923, 1408, 298, +-1962, -887, 9691, -1366, -11048, -55, -223, -1040, +-163, 132, 676, -760, 4990, -310, -9286, -2427, +14442, -418, -802, -359, -323, 2877, -210, -1436, +1574, -1206, 265, -155, -225, -32768, 347, 222, +-1165, 200, 924, 1135, -843, -66, -343, -334, +-113, 209, 14, -203, 1214, -896, 910, -1496, +1831, -7833, -841, -10453, 1605, -8514, -477, -48, +-241, -58, -32768, 213, 108, 450, 1155, -30, +89, 240, -768, 1332, 290, -1377, 951, 586, +-8939, 1298, 496, 705, -1661, 1798, -1906, -2233, +-1716, -986, -2204, -1149, 2686, 8578, 32767, 645, +-661, -135, 770, -432, -550, -385, -272, 625, +1234, -729, 19, 1753, -284, -106, -655, 750, +-442, 23143, -328, -520, -506, 790, -1048, -730, +-471, -438, 483, -374, 939, -226, -397, -849, +-12054, -772, -40, -11776, 232, -540, -2497, -679, +337, 1357, 458, -341, -7542, 1001, 492, -416, +-1496, -8966, 9814, -1752, -674, 2526, -544, -2900, +-1318, -1578, -238, 75, 11181, 1750, -3182, 564, +-570, 528, 1004, 146, 1144, 7430, 158, 9524, +-36, -340, -441, 596, -1659, 1420, -686, -36, +-596, 2215, -1295, -19722, -2149, -1046, -2339, -1166, +3057, -370, -556, -33, -322, 260, -23, -106, +-323, 147, -57, 179, 458, 684, -1283, 1251, +1231, -18548, -513, -480, -695, 593, 3072, 1960, +322, -702, -1043, -544, 6005, 1378, 100, -225, +-848, -1294, -3346, 828, -2610, -3010, 9623, -1329, +1956, -1098, -3730, 1137, 12413, -1260, 2457, -10844, +6824, -4289, -653, -302, -4415, 650, -1684, 6129, +-370, -652, -3245, -473, -150, -3018, 1864, -1258, +928, -2379, 14451, -119, 2282, -248, 3139, 6502, +4318, 2214, -1627, 126, -422, 326, -622, -302, +32252, -268, 456, -260, -260, -968, 391, -497, +152, 1764, -10580, -369, 277, 70, -13137, -1114, +-1111, 464, 2266, -2968, 728, -1216, 1726, 1044, +344, -16436, 1558, 3178, -551, 604, 442, -891, +9570, 1596, -541, -2182, 730, -906, 242, 935 diff --git a/src/main/resources/vavi/sound/twinvq/cb1616m1.txt b/src/main/resources/vavi/sound/twinvq/cb1616m1.txt new file mode 100644 index 0000000..35fb041 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1616m1.txt @@ -0,0 +1,120 @@ +-116, -53, -24868, -544, -783, 97, -912, -1202, +-622, -147, -215, -362, -16, -522, -1694, -358, +-724, 2628, 439, -18106, -1566, 3048, 4133, -1238, +-3233, -1130, -2884, -2762, 1031, -1037, 63, -2219, +10701, -1518, -10322, 1425, 792, -1820, 380, -777, +-3017, 1531, -1052, -3491, 1085, -428, -765, -113, +42, -265, 365, 99, -859, 35, 610, 44, +-495, 262, 1689, 2082, 21605, 412, -717, -1163, +-3285, -5062, -1583, 599, -277, -62, 615, 6014, +-1781, 465, -544, -14114, 11277, -20, 696, 663, +1156, -240, 631, -2802, 333, -2544, -1628, 775, +-960, -553, 496, -378, 526, -421, -426, 290, +555, 403, 390, -31714, 25, 449, 654, -334, +-1317, 165, 496, 1554, -88, -777, 626, -1511, +-9020, -1725, 12705, -798, -1240, 195, 1932, -833, +-939, 43, 182, 2547, 4879, 9234, 370, 2058, +-7757, 544, 1106, -660, 546, 9983, 225, 124, +952, -2153, -1732, 2760, -1270, -176, 3334, -6735, +-526, 10475, -627, 7835, -2263, 475, 731, 908, +8264, 1605, -192, 5026, 2414, 5223, 595, 1093, +2345, -796, 8663, 1028, 8188, -185, -1506, -3044, +-100, -1818, -6369, -170, 1728, -9249, 886, -2111, +-349, -1146, 2127, 11622, -8043, 2880, 2215, 1693, +-2303, 1698, 1121, -3575, -927, -716, 1940, 2514, +-11672, 1619, 916, -7, -585, 508, -1316, -972, +778, 9774, -2126, 2368, -56, 6716, 1169, -3656, +-1330, 9530, -12158, 1188, -11426, -353, 945, -1941, +1750, 962, -1133, 1793, 2318, -2641, 1109, 933, +804, 505, 60, -1642, -2238, -2328, -1558, -1568, +-27, 952, 4, 1376, -862, -18404, -1828, 4107, +-454, 52, -1202, 1150, 686, -1950, -497, -10883, +400, -422, 1734, -54, 11165, -3309, 6402, -877, +-19967, -400, 1642, 1305, -2432, -3115, 375, 3898, +1812, -5305, -946, 1717, -757, 3322, 126, 747, +1836, 9957, 1904, 658, 13043, -1779, 675, 716, +-453, 670, -1572, 210, -1533, -133, 294, 546, +-24084, -1036, -485, -117, -184, -624, 273, -901, +866, 609, -1119, 28, 250, 13, 70, 1178, +882, -632, -21624, -1339, 926, -1814, -1279, 1868, +-181, 383, -679, -1070, 5091, 1148, 1034, 2144, +-2779, -3810, 4536, 1713, 1003, 13322, 2866, -3217, +2508, 4395, 480, 14, 167, 763, -34, 1034, +-1342, -1349, -100, -225, 464, -914, -1403, -1851, +23767, 770, -457, -257, -1072, 1201, 583, -59, +2627, 1469, -7, -11642, 3352, -1003, -6, 11588, +-311, -2435, -2180, -2352, 1952, 5532, 1945, 7281, +504, 11882, -603, 45, 42, -1396, -1115, -1041, +-1061, 566, -2733, -765, 687, 118, -1174, -20412, +-244, -986, -151, 2888, 1102, -1303, -135, 529, +1186, 13220, -183, 906, -4209, -4455, 2247, 246, +-6474, 2794, 1450, -6495, -1819, 598, -438, 244, +-1064, -673, -672, -1563, 543, -2278, -3087, -811, +1866, 80, -18987, -682, 569, -551, 514, 6876, +7582, 839, -4031, 823, 2342, -1300, 1180, 702, +-10168, -1957, 485, -374, -151, -11066, -461, -12824, +-1221, 1281, -718, 2012, 330, -289, -487, -207, +-722, 394, 156, -2023, -11006, -373, -4, -238, +10581, 991, -1236, -814, 553, 1295, -2269, 2783, +-1973, 681, 9759, 3674, -1680, -12118, -1340, -2372, +-288, 2143, -328, 809, 312, 2038, 736, -10, +908, -11319, 74, 6362, -1122, 1546, -184, 1630, +-1851, -2143, 1048, 8858, -462, -6458, -1540, 811, +130, -3542, -10424, 9353, 388, 1168, -1797, 1796, +-4151, -2329, 1, -272, 846, -642, 248, -1144, +-9863, -1684, -190, 7611, -4147, -692, 5354, -2363, +609, -4926, 3166, 2094, 857, -369, 118, 725, +-899, -601, -6, 556, -32540, 950, -478, 757, +136, -560, -754, 562, -448, 223, -704, 616, +365, 22610, 1191, -1264, -94, 927, -294, -1270, +-16, -2520, -2026, 420, -6621, -504, 9666, 452, +-379, -1888, 536, 1161, -3021, 609, -4890, -231, +3926, -943, 32767, -615, 300, 870, -742, 429, +-42, 155, 1060, -900, -347, 34, 491, -3625, +-1529, 10175, 178, -7938, -406, 1628, -362, -7340, +-433, 489, 568, 674, 536, -2886, -6118, -16, +-531, 182, 1498, -4194, -306, 63, -1429, 1109, +631, -10386, -16, -5938, -52, 10638, -793, 35, +-874, 1633, -252, 709, -286, -780, 17172, -32, +912, 137, -1684, 2781, -5637, 338, 10961, 1401, +176, 1890, 563, -371, 578, -235, -882, -616, +-591, -672, -821, 12194, 917, 778, -427, 358, +-1411, 2032, -1372, 1891, -1784, 1830, -1808, -464, +13973, 2016, 8606, -914, -7329, -1853, -2627, 2219, +2628, 2161, 2185, 2414, 8857, -273, 1016, 2253, +1070, 907, 367, -430, 574, 1039, 93, 170, +255, -267, 550, -668, 287, 1827, 19833, 244, +-3731, 4, 21365, -127, 356, 643, 2016, 3290, +1242, 46, -734, -2298, -316, -6618, -296, -1465, +657, -1451, 469, 212, 2823, -2803, -11862, 931, +44, 660, 1576, 1848, -10529, 2813, -1163, -260, +-195, 16320, -3447, -262, -76, -439, -3487, 1292, +3330, -616, 1477, 1900, 8843, 81, -846, 6845, +-95, -112, -231, 129, 6982, 165, -3115, 2456, +2032, 12201, 2747, 1691, -728, -1935, -239, 968, +15578, -2260, -1813, 440, 2188, -3845, 1278, -136, +-1388, -7850, -462, 2921, -1740, -136, 164, 103, +-206, 32767, -459, 1249, 736, -590, -797, 628, +612, 327, 396, 552, -128, -76, -258, -557, +429, 170, 532, -347, 169, -593, 28319, -633, +-1339, -997, -258, 324, 628, 3254, -1118, 8902, +-63, 4762, -2820, 2429, 820, -46, -5366, -2193, +-9005, -1304, -597, -10143, 555, -3000, 294, -1577, +-871, -140, 726, 3700, -2226, 903, -253, 10330, +-2946, 656, 725, -668, -920, 1653, 1312, 1623, +-1150, -11970, 2157, 4532, -340, -8648, -616, -1429, +-980, -30, 647, -474, 442, 5098, 188, -1258, +-8172, -10927, -4207, -112, 2501, -3241, -1949, 159, +-525, 1090, 420, 10418, -11897, 1072, -78, -1028, +3367, -2647, 3421, 2021, 2358, -973, 272, 27911, +472, -402, 1397, -927, -1032, -1274, 848, 221, +-2745, -710, -692, -409, 1922, 142, 594, 1053, +-11350, -791, 3767, 1569, 541, 11921, 134, 368, +-948, -2689, 896, -1193, 1190, 8514, 1436, 1017, +599, -3358, 4002, 12936, -675, 1044, -1210, 296, +-1109, 1992, 1282, 774, -13102, -608, -11145, 134, +278, 944, -888, 350, -1574, 189, -2542, 3476, +-3018, 3368, -9304, -1839, 533, -2, 1057, 686, +-11819, -1146, -973, 1594, 3526, -2890, -1528, 3489, +-475, -259, -9610, -475, -984, -3559, -742, 408, +-130, -2291, 899, 12177, -1934, -162, -3238, 1610 diff --git a/src/main/resources/vavi/sound/twinvq/cb1616s0.txt b/src/main/resources/vavi/sound/twinvq/cb1616s0.txt new file mode 100644 index 0000000..b4c18f1 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1616s0.txt @@ -0,0 +1,128 @@ +5604, 1491, -2064, 1321, -2846, -3007, -1899, -896, +556, 1969, -2225, 18515, 4156, 1333, 3489, -2168, +1897, -1440, -1514, -13837, 1017, 4797, 453, -2101, +-6822, 923, 185, 754, -201, -4151, 126, -793, +-437, 2474, 4286, -6405, 4007, -1644, -757, -13106, +2460, -1874, -1867, -1099, -5146, 2945, 2162, -4427, +1692, 763, 1756, -821, 66, -348, 2001, 702, +1046, -1365, -570, 1073, 32655, -9, 450, -761, +908, -200, -572, -1306, 2589, 2406, 1926, 1772, +11042, -1989, 3914, -1192, 1817, -11710, 2985, -2942, +15684, 1919, -667, -1267, 5212, 444, 864, -3844, +438, -2382, 974, 983, -887, -822, 185, 245, +-3192, 1030, 1441, -28152, -2616, -380, 300, 1990, +-94, -999, 285, 553, 2107, 960, -859, 1001, +-1632, 2208, -1302, 1331, -3956, 10593, -1931, -4486, +9376, -6587, -463, -3605, 2460, 1306, 2, 1987, +1643, -552, 1327, 1124, -581, 1347, 650, -29514, +278, 1062, 1459, 951, 2416, 396, -594, 930, +434, 3308, -2816, 5466, 4831, -2869, -68, -894, +58, -13036, 210, -1940, -2524, 1139, 2044, -32, +969, 2187, 516, 581, 8185, 2080, 176, -708, +1529, 1132, -675, -1384, -10949, 1174, -5245, 580, +7490, 3258, 4314, 2706, -13676, -1735, 1937, 577, +-108, 2676, 612, -966, -966, 3255, 1401, 1443, +-1850, -252, 9270, 5037, -1492, -1957, -2134, 1198, +3470, 10482, -468, -671, -1655, -955, 3248, 3360, +448, -1854, -25145, -2771, -3318, 561, -672, 1791, +2194, -598, 1673, -420, 547, 122, -160, -172, +1686, -397, 1187, 11, -879, -58, 323, 180, +-2588, -2139, -1794, -2924, 999, -26969, -1280, -1401, +-770, 6159, -4449, -4174, 5270, -4813, 4139, -2023, +2694, 2884, 3418, -5948, 3118, -1176, 4691, 8566, +-32768, -681, -553, -216, -216, -931, -507, 579, +-932, -740, 349, 81, 2120, -1222, 564, -1576, +1241, 159, 2579, 3236, 19205, -744, -1727, -1803, +1247, -575, -261, 261, 540, -255, -60, -1428, +-14184, -5194, 863, 997, 1043, -828, 466, -12553, +2106, 56, -566, 1142, 401, 1360, 2322, 629, +937, 2954, -10086, -12, 2554, -5760, 523, -15184, +636, 156, 165, -2638, 1134, 658, 4398, -1385, +-1924, 1179, 3222, -908, -1153, 18082, 1011, 1948, +-1007, 352, -172, -6446, -22, -228, -264, 73, +76, 2229, -1349, 6103, -11588, 576, 3374, -1616, +7904, 3146, 984, 1056, -1626, 3113, -3674, 203, +-452, -938, 2074, 2409, -1228, -8186, -2766, 11098, +1598, -8658, -735, 556, 1610, -7419, -5267, 1158, +2841, 4497, 7551, -2066, 1105, 761, 2549, -1764, +2870, 3889, -1478, 1912, 2504, -1417, 963, -14602, +579, 28, -2953, 1589, 3962, -1372, -3304, 566, +2687, 9700, -2464, -13110, 3005, -772, -3775, -138, +-4244, 5031, 2523, -2883, 582, -446, -274, 3311, +-157, -784, -948, -292, 3085, -781, 954, -2133, +-6693, 13909, -2236, 416, -2589, -3194, 668, -1988, +-2234, 2365, 1034, 1201, -100, 1688, 372, 156, +-254, 931, 576, -4680, 566, -1823, 294, 1645, +27678, -1353, -1230, 1744, 570, 1679, 608, -35, +-7150, -4383, -11992, -2910, -2096, 512, 1838, 3129, +-410, -2306, -551, -3904, 4140, -12782, -1743, -106, +-4190, -5554, 12975, -573, -3532, -4050, 15, 1307, +62, 1643, -1988, 5774, 2064, 4734, 1009, 2038, +-2794, -2704, 2275, -279, -1588, -910, 31315, 1249, +-1642, 78, 164, -260, -878, 698, 1189, 159, +-6137, -1994, 775, 3484, 1635, 1121, 4391, -5883, +-11300, 3722, -422, -2180, -3206, -3181, -1490, 291, +1326, 399, 1952, -8405, 2240, 175, 3541, 4258, +1518, -781, 1105, 498, -348, 771, 15918, 120, +379, -2036, -3723, 10948, -1827, 3220, 40, 210, +-294, -813, -2349, -707, 967, 953, 2625, -13614, +-1519, 9454, 11606, -903, 817, 6237, -8878, -160, +-1768, 444, -2812, -1697, -1010, -964, 1846, 2997, +2633, -1924, 501, -1464, 2402, -986, -1143, 527, +1187, -929, 20923, -563, 785, -486, -940, 1625, +-796, -697, 348, -428, 1451, 1087, -2252, -2481, +939, 890, -2508, -1357, -1868, 1395, -6386, -21986, +2574, -384, -324, 7752, 2996, -641, -7903, -5745, +-4226, -4178, -4394, 9307, 3906, -227, -496, 4556, +1099, -838, -2546, 1190, 9937, 11057, 3846, -156, +433, -2873, -1769, 36, 3188, 4490, 4369, 4714, +-4681, -2804, -1525, -947, -5064, -4180, -1348, -1404, +-1097, -3922, -1088, -444, -13636, -1547, 1685, -1625, +-8494, 2492, -72, 9893, 2470, 705, 105, 5609, +-5403, 846, 90, -688, 1184, 6286, -253, -1610, +3348, -2082, 8838, -2453, -1315, -1235, -719, -4607, +-2138, -5522, -10466, 1900, 1541, -2688, 729, 368, +-8845, 1282, 438, -2532, -2328, 4833, -6145, 4037, +3584, 7965, -1495, 6999, -5037, -1364, 7095, 4253, +2711, -8336, 3946, -1347, 192, -820, -328, -1152, +1554, 869, 5053, 9707, -5888, -4294, -3858, -3344, +8344, -644, 1750, -1796, -149, -3706, -14823, 656, +-1487, -2466, 640, -2286, -2902, 2906, 44, 211, +-336, 29976, -298, 2092, -688, 1857, 1807, -1705, +3211, 425, -1046, 128, 1191, -1966, -726, -3040, +-3632, 1212, 2986, 5266, 1086, 3624, 3068, 422, +989, 24479, 3791, -2229, -3713, -2379, -1370, -1799, +2742, -3259, -4973, -626, 2287, 5655, 663, -918, +13266, 7762, -1131, 2490, -3123, 2869, -846, -2828, +119, 14540, 4588, -2784, -3713, -2547, 3698, 3189, +3372, -5436, 856, 4382, 4124, 3406, -336, -911, +-137, 4268, -4436, 1566, 1169, -3020, 13980, -162, +-7226, -2550, -946, -2408, -1056, -587, -273, -932, +-219, -8021, -1086, -2587, 3852, 1235, -22, 222, +-1100, -1594, 137, -1985, 10225, 4998, -348, -450, +6651, -2217, -7705, 2508, 10061, -4512, -2262, 6156, +2962, 150, -2456, 1089, -927, -609, -3130, -1682, +-1215, -9251, -130, -3776, -309, -13872, -276, -6922, +-82, 2660, -1255, -6562, 2640, 2646, 422, -84, +-6020, -11551, -1710, -3462, -2666, 12510, 3145, -218, +2956, 447, 30, 2268, -2410, -1400, 660, 431, +3068, 258, -2862, 3919, 2693, -744, 3070, -2179, +-1192, -932, -2095, -279, 2045, -8205, 15263, -4415, +2116, 4047, 10308, 3110, 1368, -1547, 10919, 988, +-81, -907, -1728, -1052, -3539, -4769, -2576, -1038, +9255, 152, 431, 2455, -1544, 1880, -312, 2724, +-13336, -4197, -1199, 709, -695, -1687, 442, -2564, +-1626, -1888, 1870, 3539, -2922, -3506, -7890, -5486, +-1640, 2178, 2173, -3200, -4626, 1116, 13161, -5221, +-852, -1047, -3328, -3975, -4441, 2870, -1458, 5664, +-28, 3853, 1809, 2721, 658, -15262, 3611, 3223, +595, 44, -5327, -2486, -1806, 606, -2474, -1236, +983, 1741, -8390, 1948, 1875, -1806, -6294, -814, +-747, 2209, -1332, 2058, -1326, 5808, 1113, -10765, +-584, 4038, 1412, -3356, 24, -12826, -4322, -2287, +-10793, 3008, -6903, -1273, 1590, -608, -514, -309, +-144, -2024, 1822, 4375, 1122, -631, -76, -595, +192, -11323, 8168, 10180, -646, 2478, 4516, 1095, +94, 6, 1251, -658, 2620, 626, 3078, 727, +7769, 966, -3593, -6990, -2358, 1022, 1288, 2733, +-259, -291, 2482, 297, -1268, 10338, 739, -1862 diff --git a/src/main/resources/vavi/sound/twinvq/cb1616s1.txt b/src/main/resources/vavi/sound/twinvq/cb1616s1.txt new file mode 100644 index 0000000..ca2354c --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb1616s1.txt @@ -0,0 +1,128 @@ +-12873, -2429, 6659, 4401, -2250, 1684, 1508, 1780, +-1081, -10, -6012, 895, -2373, -1263, 125, 1448, +4744, 1556, -7267, 2354, -11368, 1155, -7699, -1424, +-914, -591, 2472, 538, 1431, 953, 5, -3066, +-1063, 3, 406, 979, 922, -668, 1633, 2, +649, -139, 964, 860, -18807, 1944, 2183, -1358, +1395, -1167, 5369, -3525, 735, -2698, 10556, -1137, +-3979, 1383, -1997, 5995, 6465, 2310, 1781, -311, +3376, 7199, -2745, -1656, -5702, 3180, 3017, -5673, +-712, -8902, 2058, -570, 170, 2276, 3869, -9332, +-7965, 1130, 2111, 5638, -1507, 2944, 1574, -919, +-1459, -970, 11093, 544, -2952, -146, -4684, -303, +-528, -1199, -890, -2720, -1665, -10952, 373, 1657, +1960, -1386, 299, -4356, -4527, 8948, 7378, 1580, +1301, -6057, 7650, -7399, 4646, -1768, 2756, -263, +-286, -334, 1369, -786, -3760, 824, -13524, -5099, +-1693, -347, -1821, 1992, 3462, 1421, 4900, -462, +-13331, -1617, -2350, 4083, -8721, -5880, 4900, 2912, +235, 10369, -1340, 776, -2598, 14344, -3805, -568, +-3788, 3591, -394, -1077, 3908, 6080, 1953, -1454, +-1013, 507, 10097, 3396, -4662, -763, 2506, 1486, +3088, 580, -86, 1117, 1606, -3454, -10782, 4870, +6170, 4020, -5675, 6848, 439, -8765, 3877, 6250, +734, 3245, -874, -4312, -879, -4368, -1287, 3212, +-2130, -1435, 1619, -280, -3082, -1070, -18921, 940, +-2428, -1548, -1142, -271, 193, -240, -890, 918, +-4350, -5042, -8994, 5060, -6495, 3455, -259, 892, +-1290, 1348, -1049, -12681, -49, 18286, 75, 791, +1830, -4116, 10240, -12, -459, 2477, -2582, -3344, +-1598, 982, -324, -48, -4229, -8476, 11120, 100, +-6238, 1164, 2369, -2052, 247, 626, 2213, 2279, +-2627, 289, -471, -1136, -1818, 15413, 579, 1034, +-6835, -8645, -12667, 758, -932, -4398, 565, 458, +-2024, -4050, -3100, 1897, 1324, 3191, 1876, 7660, +385, -1066, -1539, -1317, -2632, 766, 63, 389, +-189, 1136, -653, 802, 755, 70, -29812, 640, +-11953, 10901, 2078, -529, 10373, 2509, -2776, -104, +-2232, 174, -837, 158, 1507, 1963, -273, 1534, +1084, 8469, 2568, 12662, -2276, 2808, 2052, -7430, +434, 3777, 991, 664, 2724, 1631, -3632, 2099, +-582, 4140, 757, 11248, 540, -1425, -10204, 1604, +600, -2034, -1060, 977, 1843, 3831, -933, -816, +2975, -6413, 1589, -915, -696, 2155, -556, -17893, +3348, -1239, 1014, -2539, 1588, -320, 2402, -1485, +-8062, -1046, -1458, 200, 1323, 357, -3752, 2836, +5774, -11638, -913, -648, 1676, 246, -1277, -1065, +2334, 14911, 228, 880, -2172, 3072, -2520, 1445, +1442, 2568, -1254, 730, -1950, -192, 12003, -1587, +2558, 714, 33, 4324, -4642, -231, -279, -255, +17824, 1292, 3530, -766, -64, 245, 1677, 1716, +2507, -3594, -3532, 3000, 1996, -5342, -1868, -5642, +-21, 1132, -1202, 1104, -6543, 1242, 457, -1711, +-32768, 49, -458, 295, 858, 2043, 1268, -1257, +-346, 793, 554, 1260, -1082, 985, -1453, 1704, +2431, -2858, 1466, -5424, -8870, 4714, -1539, 5767, +110, -2568, -1482, -348, -11580, -2838, 1213, -599, +-1591, -3472, -6907, 6191, 3928, 4708, 1326, -1510, +6322, 3849, -4112, 7689, 5976, -3298, 372, -5450, +-2208, 6564, -6915, 911, 4216, 1682, -739, -2146, +203, 350, -816, 351, -3386, -3016, -15045, -10824, +-553, -4969, 138, 256, 1672, -1840, 2851, 15838, +2934, 1871, -600, -3293, -845, -2696, 1463, -1075, +720, -1177, -1538, 2415, 7315, -484, 1082, 962, +766, -845, -10687, -5932, -4410, 3840, 362, 194, +-4576, 10209, -3548, -127, -1202, 246, -734, 770, +311, -3126, 772, -2422, -1141, -12330, 960, 1567, +2816, 80, -4414, -778, 665, 2308, -420, -180, +-1242, -423, 12138, 113, -1477, 2899, 214, 348, +-927, -764, 26, -1127, -2288, -32768, 1302, 394, +646, -453, -946, -838, 1649, -2292, 1182, -1558, +-6413, -265, -1942, -3467, 1863, -3526, 3446, -863, +886, 202, -202, 15706, 2226, 1763, 894, 936, +16191, -693, 1682, 6678, 1742, 1365, 700, -1765, +-803, 299, -2194, 1259, 689, 1670, -635, 28, +11890, -14, -878, -5439, 103, 11124, 528, 1179, +-62, 868, -664, 749, -1128, 1429, -485, 1920, +-866, 1176, 1051, 379, -29470, 2354, -252, -1648, +-412, -804, 1339, -383, -812, 959, 893, -1741, +1462, -1868, 470, 2112, -1889, -2236, -1668, -755, +-2562, 1354, 6183, -10964, 5651, -1062, 2550, -6225, +-194, 1687, -782, 1568, -85, 10, -8, 1128, +-521, -1090, -1933, -3441, -2698, 3049, -5822, 20847, +710, 789, -1872, 1082, -1242, 4152, 1624, 10795, +-2149, -134, 1087, 900, -7943, 5178, -3429, -11622, +-3617, -7444, -824, 3462, -579, -830, 1010, -3301, +12202, -5446, -1763, 340, -744, -509, 554, 1140, +12266, -1328, 4652, 992, -1931, -708, 1074, 2762, +2931, -414, -217, 10166, -4167, -903, 660, 1000, +27, -1037, -1532, 1308, 8655, 9087, -2998, 9928, +-3722, -556, 4812, 3062, 600, 1281, 3879, 114, +-5404, 1869, 2174, 2083, -11631, -301, -3609, 2443, +2300, 4863, -838, -29, 2166, 1319, 2110, 1387, +-741, -1225, -1729, -13536, -7376, -1520, 619, -4919, +2517, -4338, -1650, 475, 456, 4372, 792, 3224, +1963, -547, -2071, 2142, -254, 1549, -6846, 2430, +-96, 19844, 595, 1197, -1367, 2019, 2014, -1547, +-3775, -1186, -9690, -394, -4106, -1728, -1036, 2945, +509, 14242, -1893, -2494, -3004, 458, -1753, 2628, +9790, 3450, -1652, -322, 8263, 3952, -2156, -2110, +-442, 1256, 1561, -4913, -3452, 74, 3051, 8907, +-3376, -96, 16654, 557, 520, -446, -2520, -1712, +2151, -2423, 3761, -3507, 487, 2103, 777, -416, +509, 468, 3629, -3155, 11460, 2106, -2191, -1014, +1154, 9317, 704, -282, 3098, 2722, 84, 150, +-5922, 3063, 8373, -11896, -1157, -2286, -1781, 7331, +1331, -334, -974, -1653, 752, -1970, -89, -3470, +2418, -1334, 3615, 12770, -116, 1965, -1643, 1480, +-2225, -10686, -1174, 530, -972, -933, 719, 722, +1530, -317, 105, -14155, 2569, 4506, -8502, -681, +-1544, -542, -2814, -1161, -629, -1776, -3540, -1366, +-3681, 1838, -1630, -703, 12613, -12335, -2020, 2173, +27, 315, 4766, 4590, -1603, -68, 1154, -2940, +1198, 7884, 2502, -586, 440, -5124, -2454, -2597, +-826, 7401, 2803, 4552, -3212, 2966, -5567, 588, +2216, 7444, -2633, -5922, 434, 3423, 4084, 2296, +13258, 2070, -4624, -1226, 166, -367, -527, 1110, +-1407, -150, 140, 584, -373, -2649, 862, 500, +3292, -3506, -679, -20109, 1775, -726, 3378, 754, +-1962, -5764, -1338, -3628, -691, 4554, -1890, -6021, +-6566, 2590, 262, 2509, 257, -4386, -2480, 6352, +-2026, 1234, -399, 22808, -2221, -626, -714, -339, +-1196, -455, -80, 713, 1662, 474, -2324, -527, +4101, -10526, -4617, 10492, -1143, 805, 1360, 3796, +942, 684, 2596, 1313, 1589, -570, 5476, -27, +9220, -1493, 2631, -6726, -2976, -14295, 137, -734, +-2015, 658, 323, 83, 2539, -1230, 1714, -2080, +658, -18803, 2978, 996, -3374, -28, -1335, 150, +2154, 1069, -852, 293, 535, -1004, -993, -3692 diff --git a/src/main/resources/vavi/sound/twinvq/cb2220l0.txt b/src/main/resources/vavi/sound/twinvq/cb2220l0.txt new file mode 100644 index 0000000..fcdd915 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2220l0.txt @@ -0,0 +1,144 @@ +-12528, 350, 1782, -474, 1439, -14269, -8, -1782, +-753, -1720, 167, -440, -2706, 222, -1629, -288, +671, -111, 10270, 878, 152, 330, -1000, 639, +-1280, 1111, -2072, 1439, -476, 553, -2974, -614, +1666, -466, 11811, -1393, 154, 624, -697, 176, +1108, 504, 250, 572, -6, 704, 16, 647, +-1143, -1407, -411, 23745, 319, -189, -404, -641, +-86, -707, -770, -302, 13, -398, 76, -681, +-525, 354, -1225, -757, -23170, -484, -965, -430, +13477, 898, 505, -17, 13812, -890, 357, 662, +1000, -935, -60, 944, 400, -432, -221, 1047, +307, -180, 5260, 16509, 650, -269, 1563, -6002, +-3082, 186, -3334, -5770, 1010, -394, 128, -699, +537, -27, 1014, -531, -50, -163, -1664, -1026, +732, -1296, 21856, 574, 416, -745, -443, -1382, +272, 791, 1308, -308, -1636, 168, -10922, 119, +-1190, 1123, 1492, 1706, 1076, -2016, 3270, -994, +876, -2316, -2992, 12625, -412, -159, 5249, 1424, +-304, 557, -431, -360, -340, -561, -292, 1748, +-224, 1789, -352, 386, 136, 76, 1309, -270, +-24204, -515, 1142, 2119, 1144, -173, 1008, -693, +-430, -1052, 1890, -12483, -11416, 2918, 1591, -1202, +-1782, -1335, 1354, 1703, -510, 4287, -854, 1153, +2018, -518, -960, 11825, 1295, -563, 11252, 190, +4078, 222, -3115, 3306, 747, 2638, 1015, -1674, +8032, -2386, 573, -349, -832, 96, 9564, 11708, +-483, 1326, 1804, -2903, -2024, -234, 1009, 3229, +-232, 803, 275, 444, -629, -192, 381, -1289, +-109, -29019, 270, -420, -408, -466, 113, -537, +-266, 296, 180, 506, 1015, -565, -517, 1494, +-11053, 3968, -1735, 3474, -1991, -8326, 8075, 1740, +-3995, -1287, -2558, 1030, 3742, -618, -2600, -1783, +2696, 1480, 1054, 341, 3762, 4225, -1742, -11582, +4348, -8756, 493, -404, 3840, -1049, -683, -962, +163, 10997, -97, -848, -4632, 2794, 2684, 2540, +739, 8534, 3688, -878, 3138, 2576, 6444, 3674, +-2371, -218, 2864, 12270, 2866, 189, 4549, 4894, +-6378, -1050, -3166, -5897, 2245, 2803, -70, -1909, +2783, 3951, 153, 11221, -658, 12780, -238, 3418, +-2235, 754, 311, -739, -2414, 702, 1076, 303, +-320, 47, -3288, -234, -1376, 3022, -103, -1780, +716, 11886, 10942, -5402, -5431, 1196, -624, -885, +-652, -3248, 74, -435, -686, 154, 8675, 3325, +-1779, -341, 564, -901, 1335, -639, 3494, -1820, +290, -92, -3088, 4775, -2140, 2334, 710, 10536, +-15042, 14823, -1082, -1045, 1008, 734, 241, -1048, +-933, 245, 913, 114, 322, -1798, 246, 1067, +348, 408, -183, -728, -12915, 685, 1525, 1694, +183, -168, 12703, -1268, 1613, -2072, 1546, 743, +2356, 2135, -550, -153, 1327, 2, 12487, -3111, +2347, -1722, -300, -193, 2222, -1928, -658, -384, +-5738, -1141, 3634, 10312, -69, -1549, 10879, 1795, +-361, -1838, 143, 1202, 327, -15549, -1268, -194, +3284, -12, -344, -2042, 1663, 334, -798, -873, +1736, -324, 195, -417, -382, -22936, 812, -478, +-962, -451, 730, 382, -135, 1311, -290, 122, +148, -775, -305, -32218, -84, 98, 374, 369, +-44, 923, -432, 156, -1471, 236, -39, 143, +-146, 835, 135, 229, -297, 1690, 6786, -12169, +815, -176, 1868, -9, -3052, 108, 114, 260, +11337, -2689, -132, 765, -239, 54, 691, -9737, +-627, -474, 12212, 2222, -7595, -239, 1793, 2115, +563, -2390, -1991, 2906, 675, 923, 146, -3605, +981, -1725, 92, -562, -21192, 304, -450, -323, +-889, -726, 688, -1186, 2590, 466, 326, -734, +308, -782, -3219, 963, 454, 1348, -513, 953, +-1414, -320, 1012, -1148, 1185, -17356, -15, 1546, +1346, 2182, -2457, 1426, -1690, 155, 8793, 1394, +510, 2608, -203, 2697, 608, 2612, -13542, 177, +4642, -824, 1877, -1864, 1681, -1033, 1487, -749, +356, -11, -1, -366, -215, 1531, -38, -922, +-378, -296, 1245, 19967, -2389, -459, -3729, -163, +6578, 354, -1471, 195, 353, 1831, -605, -2291, +-359, 947, 8409, 3454, 12416, 2434, 3485, 40, +350, 1640, 738, -9827, 935, -171, -944, 1407, +-399, 571, 2805, -13108, 784, 678, 2405, 328, +-417, 1188, -1596, -649, -1358, -1130, 341, 202, +-2459, 11307, -2250, -3518, -1812, 3338, -924, 10027, +3004, 703, -184, -666, 223, -1644, -7221, 3507, +10108, 1324, -412, -371, -92, 2496, 3182, 10, +10269, -998, -1010, 610, 3296, -1842, 407, 406, +-1609, -181, 2202, -662, -1450, 1360, 1488, -212, +1501, -214, -555, 168, 275, 301, -950, 3272, +-323, 20632, -21, -1729, 11013, 2149, -9278, 6735, +-593, -7374, -430, -2776, 2343, -1374, 519, -4876, +827, -2477, -1971, 1249, -23380, -1810, 199, -761, +2182, 1654, 447, -488, -1219, 364, -53, -382, +-989, 154, -545, -872, 776, -211, 7706, -767, +8006, -138, 1989, -180, 306, 486, 1112, -648, +-12, 1538, -300, 2458, -5833, -1181, -7680, -6700, +-621, -308, -29995, 602, -24, 94, 752, 517, +86, -249, 1058, 704, -404, -387, 106, -632, +-159, 1275, -197, -1263, -1210, -1689, -10488, 1950, +-2037, 5974, -3960, 38, 1284, 2851, -2813, -1613, +-1646, 10164, 138, -2956, 196, -118, -484, 860, +124, -262, 30, -1448, 128, 287, 327, 590, +27272, 391, -738, -1631, -481, -1511, 82, -574, +-737, -614, -447, -80, 292, -19, 252, -2, +-28117, 332, 141, 1485, -154, 1382, -1755, -422, +-1692, -2144, 910, 1004, 1894, -1537, 897, -458, +19483, -1321, 2280, 622, 288, -2253, -1001, -976, +-408, -394, 132, -250, -428, -22, 140, 287, +-141, 30981, -293, 631, 729, -2, -231, -127, +377, -879, -294, -107, 253, -964, 1258, 570, +71, 9421, 8358, 9295, 8354, -546, 1153, -1807, +1577, 2911, -1808, 1808, -1631, -1348, -6977, -382, +1625, -2793, 10633, 1977, -1793, -12480, 1, 2010, +23, 423, 1102, -1920, -478, 1845, 1016, 465, +758, 800, -1540, 5448, -10472, -2749, -989, -6362, +9283, 373, -2560, -5478, -1618, 20, -564, -1074, +4075, -471, -515, 409, -2069, 359, -788, -11618, +2524, 917, 2757, 243, -3261, 6922, 6268, -3148, +-2804, -3412, -4262, -1903, 1043, -12255, -162, 1598, +496, 454, 1401, -1635, -12711, -673, 3392, 1255, +1602, -1206, -297, -2066, 3009, 1149, 1285, -1307, +412, 27971, 183, 569, 1304, -706, 824, -635, +-358, -340, -28, -1344, 955, 14, 676, -243, +-20, -11947, 1350, 8122, 196, -10161, 4925, -3764, +1661, -401, 145, 253, 680, 718, -614, -613, +498, -293, -4257, -684, -14853, -10522, 698, 1537, +-2016, 1162, -2684, -1578, 8, -238, -3214, -2749, +-1577, -1187, 113, -1457, 1068, 590, 25, -644, +1000, 2430, -1612, 13246, -2684, -1642, -4648, 816, +-1103, -7556, 5753, -3998, -1338, -776, -1958, -9652, +-1288, -290, -4240, -2788, -8191, 1625, 2558, 1238, +-1824, -39, -3129, -8916, -3302, -5632, -1768, 866, +708, 684, 3530, -8772, 1485, 677, -10398, 686, +-852, -6974, 5286, -2658, 612, 1180, -3367, 4285, +5708, 1416, 166, 2787, -3697, 1431, 1648, 7942, +-544, -1064, -514, -840, -870, 1246, -3582, -9310, +-3802, 4025, -8251, 5978, 132, -619, 2792, 9786, +1244, 242, -1948, -4701, -5904, 951, 7486, -3494, +48, -4468, -2403, 6090, -2343, -4175, 1336, -2546, +-281, -736, -1758, -1720, 11066, -918, -1354, 3885, +-33, -4116, 1246, -218, -8082, -766, 7796, 1505, +1559, -964, 1741, -454, -1628, -762, 3034, -804, +-888, -9682, 9603, -2556, 2874, -5456, 3066, -7747, +956, -660, -1538, -381, -760, 1747, 547, -517, +-697, -1411, 410, -514, -3988, -219, 13358, -2393, +-280, 11230, 2640, 795, 2534, -8094, -1838, 71, +16, -203, 4224, -96, -2829, 2010, 1961, -1312, +-1266, 3952, 6894, 6996, -8062, 4708, 1193, -3439, +1549, 935, 170, 614, -868, 43, -246, -188, +-940, 130, 126, -736, 697, -510, -56, 1596 diff --git a/src/main/resources/vavi/sound/twinvq/cb2220l1.txt b/src/main/resources/vavi/sound/twinvq/cb2220l1.txt new file mode 100644 index 0000000..5535b43 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2220l1.txt @@ -0,0 +1,144 @@ +-13582, 1049, 15596, -101, 707, 2677, 542, -522, +-636, 194, -2361, -1252, 524, -32, 227, -419, +-652, -601, 84, -10428, -1417, 13117, -573, 3774, +-3632, 2025, -1237, -692, -1486, 192, 1221, 452, +436, -764, -2636, -153, -685, 118, -424, -635, +-458, 209, -577, -12042, 4240, -10861, 49, -1534, +-991, -2416, -280, 2095, -1841, 1278, -94, -423, +-572, -949, 734, -1087, 12449, 6514, -4582, -7845, +-3722, 1446, 2531, -1238, -2070, 1515, -1331, 2382, +1066, -1298, -1189, 6811, -1868, -1082, -1732, 356, +-2622, 493, -3345, 1367, 1737, 4497, -14734, -1350, +-354, -1340, 8478, -1152, 1832, 1793, 830, 974, +-13918, 522, -1472, -2502, -2625, -157, -360, -17, +-830, 673, 36, -1339, -14860, 522, -13377, 851, +937, -1103, -44, 408, -364, -953, -392, 1837, +2342, 1236, 111, -218, -919, 985, 10077, -1065, +1840, -124, 3780, -11015, 204, 437, -830, 6712, +-1720, 288, -991, 1094, 5647, -1296, -2284, 1642, +1000, -35, -115, 208, -244, -1099, -832, -2092, +802, -163, 3343, -964, 314, 126, -1204, 754, +-17838, -826, 4414, 8331, -770, 1246, -3500, 1680, +833, -108, 494, -910, -6314, -2832, 2553, -6230, +1165, 3631, -1717, 2404, -32768, 520, -38, 1228, +-708, 58, 260, 771, 588, -448, 389, 156, +606, -830, 400, -488, -188, 536, -1428, 11982, +-156, -1407, 1796, 1036, 905, 1371, -1472, 325, +3098, -1436, 6449, 2105, -11183, 1632, -1848, 1019, +1247, 1308, -1351, -823, 1679, -651, 978, 296, +1088, 3965, -1414, -11838, 139, 8664, -3452, -1804, +3088, -2044, -221, -1347, 1232, -909, -1323, -1409, +1399, 2557, 14552, 1535, -5088, 1699, 1012, 3333, +3940, 2294, 1189, -2256, -484, -3307, -1333, 464, +-305, -744, -24, -20464, 332, 2968, 308, -649, +292, -402, 1226, -2575, -1505, -100, 1413, 733, +-1024, 616, -121, -322, 67, -161, -708, 251, +462, -26697, -1112, -1381, -324, -286, 1091, 662, +15830, 13124, -1049, -1816, -355, 1848, -801, -1710, +2513, 458, -798, 386, -726, -356, -1240, -1133, +-388, 631, 91, 1867, 2511, -306, 3097, 14399, +-571, 2191, -2916, 2850, 761, -2442, 698, -2193, +-2739, -1914, -4077, -4631, 12702, 333, 1162, -6248, +-12466, -310, -107, -2465, -163, 1970, -998, -1253, +2007, 79, -426, -276, 365, 568, -520, 23642, +276, 1059, 184, 1081, 650, 2286, -191, 883, +-1946, 246, 64, -225, 800, 910, -136, 1187, +955, -15604, 12847, -747, 874, 506, -646, 1920, +-449, -321, 1152, 1341, 1653, 341, -32, 907, +673, 1045, 1245, -499, -10331, 4683, -1121, -3164, +3382, 6397, -1341, -769, 1186, 229, -1354, -7370, +155, 1858, 5617, -3487, -247, -783, 724, 508, +14029, -528, 1853, 1572, 580, -708, 528, -1394, +8922, 2284, 550, 3084, -1726, -3235, -700, 7132, +-3540, -200, 3288, -815, -2189, 1232, 2412, 2088, +-1101, 12592, 806, 1508, 1741, 13, 1124, -3883, +-687, -8180, -3094, -3346, 1781, 11836, -657, -3469, +1429, -1822, -3433, 87, 3871, 651, -965, -1757, +6778, 109, 112, -131, 710, 11943, -12107, -3460, +-726, 1002, -3803, 580, 2756, -1293, 116, 457, +581, 3834, -1678, -977, 1242, -2040, 232, -10034, +1644, -2290, 1368, 172, -3012, 1423, -2620, 3608, +-10831, -303, -1610, 3246, 562, 5212, 448, -877, +954, 688, -8981, 579, 717, 1315, -952, 6817, +662, 3218, 7213, -2116, 10446, 1012, 2270, -858, +10, -1066, 10618, 6108, -547, 3221, -893, 3888, +-1088, -10085, -247, 1064, -3500, 3123, -2480, -2128, +2788, -2253, -9756, -472, -166, -680, 727, 74, +-14151, -189, -1734, 610, -1169, 845, 94, -786, +394, -581, 500, 1981, -10940, 354, 500, 399, +-1952, -373, 2197, -4712, -2582, 2751, 654, 613, +-1254, 1406, 2056, -12518, 1583, -582, 4834, -1541, +508, -20580, 270, 1214, 515, -1082, 5, 7, +-533, -28, 1270, -1307, 497, -57, -331, 933, +92, -856, -10458, -4576, -9991, 2426, 6552, -3022, +279, -562, -192, 1878, -2237, 4978, -1753, 332, +-1462, -853, 238, 478, 9746, -7385, -10290, -8278, +457, 3121, 841, 48, -3745, -1298, -637, -1820, +-468, -248, 1400, 394, -125, -950, 11524, -1860, +426, -773, 12669, -1620, -158, 1625, 1045, 768, +-66, -12, 1625, -770, 559, 54, 593, 14468, +14994, 490, 543, -811, 700, -277, 900, -178, +-2000, 475, 241, 950, 106, -1260, 874, -862, +18907, -1947, -844, 205, 1253, -83, 1966, 2300, +-2694, 852, 2450, 661, -334, -518, -1136, -2377, +325, 1152, 511, 881, -22205, 898, 574, -582, +-265, -1362, -253, -40, -780, -1967, 469, 1484, +-818, -926, 958, -415, -7934, -330, 330, 1439, +1643, 77, 1034, -156, -12094, 3782, -5725, -520, +-598, 2345, 3506, 5333, -322, 99, -48, 1490, +20, 11393, 3468, -1144, 7013, -3728, 7145, 1432, +1810, 26, -912, -6530, -1079, 1771, 95, 4007, +-11346, -43, 249, -14616, -249, 1, -725, 244, +1053, 1815, -626, 408, -344, 1972, 2222, 2288, +-2324, -411, -3993, 494, -706, -5078, -11695, -3645, +-2090, 2465, 5893, -5096, 6815, -537, 5003, 1258, +185, -1555, -875, -2047, -170, -433, -194, -1020, +349, -724, -31811, 197, 251, -418, -222, -618, +278, 554, 363, 183, -898, 14, 350, 745, +-2054, -1623, 806, -770, -1246, 1594, -54, -18501, +1516, 840, -86, 484, 514, 1209, 978, 564, +-537, 34, -431, 128, 938, -1807, 832, -90, +-29509, -642, 1397, -52, 523, -393, 216, 908, +9, -63, 710, -949, 3, -184, 175, 613, +-687, -408, 27, -855, 18258, 1282, -948, -219, +2374, 1668, -4567, 1063, -2045, 12026, 461, 3074, +1050, -1788, 169, -13442, 612, 19, -2019, 685, +452, -152, 299, 310, -2327, 348, -215, 1634, +-201, 2162, -10300, 12452, -3733, -420, 2388, 518, +-2308, -160, 1552, 3347, 1650, 3293, -1108, 2065, +-12618, 20, -42, -643, 202, -1298, 251, 2489, +1322, 2362, 3698, -190, 592, -12484, -937, 2072, +1531, 302, -409, -899, -1016, -388, 1103, 30006, +789, -1609, -548, -1002, 1055, 605, -955, 1557, +452, -623, 810, 597, -696, 10628, -1174, 606, +2628, -553, -2297, 6668, -2600, 787, 3504, -3606, +4087, 1052, 6276, -7619, 337, 2565, -13, 1205, +-124, 1222, -28082, -79, -553, 628, 542, 1315, +-609, 322, -895, -377, -694, 610, 239, -152, +-2901, 9890, 716, 1030, -3306, 988, -738, 562, +-2209, -1676, 4507, 1165, -12924, 866, -154, 3664, +-367, -2580, -7286, -572, 2167, 118, 508, -4429, +-480, 842, 2489, -1636, -2042, 1125, 1847, 2586, +-5639, 3361, -760, 11189, 623, -282, 1353, -279, +515, -816, 713, 322, 417, -2820, -1114, -1563, +401, -21604, -1300, -972, -2298, -483, 2176, -830, +2135, -4084, 1095, 1950, -1937, 539, -374, 3197, +682, 472, -1368, -8095, -12026, 4833, 5586, 467, +2400, 148, 381, -138, 954, -459, -724, 970, +156, -1955, -1363, 560, -761, -1708, -1599, -17408, +-1064, -1372, -500, 1160, 735, 441, -773, -228, +420, -1128, 260, 930, 12879, -926, -231, 1355, +-850, 559, 11377, -1729, 2478, 961, 336, 1056, +5081, 9788, -555, 4067, 8664, -2720, -1462, 3012, +-7280, 965, 1462, -4703, 3649, 2084, -699, -262, +408, -188, 2193, -2216, -4509, -736, -1039, -4848, +-8243, -7958, -172, -1318, 9566, 4665, 3363, -3672, +1581, -551, -2024, 1630, 1543, 90, -1728, -792, +-1799, 2571, 80, -412, -301, -2870, 1796, -5327, +111, 17342, 592, -2108, 477, 1541, 1266, -1062, +-215, -2210, 223, 1215, -197, 87, -18340, -67, +804, -398, -118, -3457, -741, -1935, -704, -274, +566, -872, -1821, 12874, 5057, 2069, 1742, -6205, +-6115, -1614, -294, 187, -5210, 1734, -1466, -2162, +-2266, -642, -148, 440, 2, 233, -319, -637, +-734, -230, 301, 508, -433, 311, -313, -1206 diff --git a/src/main/resources/vavi/sound/twinvq/cb2220m0.txt b/src/main/resources/vavi/sound/twinvq/cb2220m0.txt new file mode 100644 index 0000000..666d33c --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2220m0.txt @@ -0,0 +1,136 @@ +-26430, -533, 1599, 208, -293, 2303, 704, 1586, +-1064, -1630, 690, 1697, 623, 1786, 332, 682, +199, 12695, 475, 1288, -2471, -797, -68, 9659, +-816, -2465, 546, -1421, 1596, -926, 4471, 2360, +5551, -900, 297, 96, 400, 936, 1548, -1066, +-1625, 652, 1416, -118, -525, 683, 1545, 1340, +20684, 936, -1033, -773, 8416, 954, -4822, 4223, +-10815, -312, -896, 531, 3140, -1649, 508, 10294, +-315, -2078, 584, 1523, 118, 997, -11837, -605, +-262, -1732, -613, 12220, -2666, -1802, -507, -4410, +-100, 2127, -114, -886, -2806, 500, 1034, -2811, +12642, 1015, -9193, -4201, 238, 1096, -1159, 1619, +2534, 1644, -3465, 4797, 639, 2583, -1316, -9884, +948, 1479, 1186, -1760, -343, -1286, -1653, 678, +-7439, 4542, -6295, -1600, -6978, 48, 448, 369, +1597, -3696, -2121, 1002, 2428, -11368, 5385, 827, +-10674, -2252, 2240, 1230, -3074, -1894, 296, -2216, +571, 114, -497, -1675, 1311, -2297, 1843, -350, +-856, 2067, 1198, -588, 270, -470, 2640, 274, +19586, -762, -11471, -623, -506, 4236, -10981, -214, +-1856, 409, -1276, -935, -1681, 5116, 774, 3008, +4388, -112, -9493, -1108, 1454, 1385, 1065, 519, +-486, 308, -1141, 289, 1424, -3672, -15989, -3738, +-1592, -258, 3304, 62, 1441, 45, -686, -1070, +-1616, -701, 2313, 1918, 4843, 654, -16902, 263, +1837, -4062, 2727, -709, 1524, -1628, 2025, -281, +264, 1238, -1023, -11981, -2990, -1293, 801, -9606, +-604, -210, 1248, 4014, 3652, -11286, -2094, -470, +-1330, 14523, -2388, 1413, -3968, 641, 2936, 161, +-1687, -1260, 1722, -1968, 364, -854, -14386, 10146, +792, 133, 1746, 261, 3345, -408, 2036, 272, +1412, 720, -3302, -1495, -4334, 2210, 799, 17546, +2600, 1314, 764, 1327, 3433, -377, 4296, 2402, +-1074, 470, 7220, -2556, 3326, -4338, -2086, -1945, +11865, 3525, 1513, 1520, -1814, -13020, -929, -2001, +-1496, 580, -3293, -3146, -2185, 1442, 390, -2026, +-2141, -192, -18700, -2039, -4330, 1691, -250, 1451, +-2913, 2832, -3284, 2899, 1529, -888, 486, -2381, +-1459, -2663, 530, -717, -248, -1714, 12662, 1820, +-11488, -1044, 3035, 3872, -2430, 679, 1075, 475, +-593, 930, -1751, 405, -2308, 2148, 510, -2798, +445, -240, -6865, 2106, -11323, 670, 4342, 154, +-7748, -1805, 5381, -842, -697, -709, 688, -498, +5525, 15212, -2006, -4146, -2452, 2392, -3522, -2023, +1306, 5522, 916, -3616, -287, -653, 333, -330, +4, -24886, 635, 119, -1949, 899, -36, -37, +2658, -133, 2064, -534, -549, -1745, -70, 32767, +1089, -869, 150, -599, -1146, -574, -424, 377, +-648, -303, 590, 453, 1910, -351, 553, 304, +-752, -752, -502, -42, -31211, -634, 449, 638, +1086, -1406, 1220, 802, -924, -1874, -212, 86, +-200, -1140, 618, -621, -605, -10976, 1699, -603, +2056, -4448, -1519, 2564, -743, 12304, 1482, 547, +-1589, -817, -217, -1633, -1089, -2270, 181, -634, +3890, 734, -1319, -2035, 3304, 13144, -9076, -4067, +70, 1309, 1067, -354, 1529, 1379, -1002, -3324, +-525, -817, -1438, 10834, 1036, 12441, 1242, 2461, +2858, 2257, 430, -1177, 1142, -870, 844, 1102, +1208, -1482, 830, 17622, -2753, 6, 174, 4385, +-339, 2157, -155, -68, -190, -1181, 29, -2046, +-2140, 27, 949, 1889, 446, -54, 16696, -49, +-3304, -1929, 1833, 3735, -495, -1225, -11743, -2259, +891, -1954, 2848, -504, 1164, -2489, 861, 579, +-11547, 976, -42, 1477, -2428, -1561, 112, 74, +-2721, 12046, 632, 1283, -1900, 1990, -1193, 1606, +-1370, -2812, -1309, -1419, -12526, 3391, -4213, -2710, +269, 90, 14575, -345, 820, 6118, 892, 6302, +-2825, 332, -3071, 2279, 3756, 185, -3029, 2402, +245, 1010, -273, -32751, -140, -600, 482, 1516, +-462, 1931, 1941, 272, -310, 544, -422, -815, +-1116, 803, -617, -1640, -4336, -11735, 3656, -1176, +1170, -6209, 2139, -1571, 2067, 1011, 9842, 790, +1702, -191, 911, 2771, -253, 794, -3862, -1885, +-494, 2070, -2682, 772, 763, 4304, -15657, -2194, +-1998, -963, -5222, -175, 238, 32, 10067, -692, +2824, -474, 3016, -11994, -51, 713, 2423, 2864, +-338, 4838, -1095, 215, -13471, -2, 704, 752, +-14654, 1396, 484, 564, -886, -775, -1099, 775, +-1035, 1661, -1013, -1118, 449, 822, 14253, -13238, +-1084, -1107, -1672, 996, 472, 2237, -440, 1186, +1200, -2112, -1388, -1093, -1902, 555, -328, -1493, +-2034, 426, -2144, -388, -20028, 1285, 1122, 730, +1661, -1576, -2084, 2930, 337, -66, 1591, 8685, +2361, 146, 1370, 22, 1371, -105, -4190, 371, +-13252, 328, 1301, -995, 3689, 6422, -79, -1407, +-384, 828, 840, 854, 266, 1222, 796, -550, +-729, -1213, -87, 524, 1070, 22334, -2333, 574, +680, -624, 463, 4047, -236, 114, 1020, -692, +1575, -320, -3229, 222, 520, 996, 2104, -5404, +-18197, -1105, -184, -1057, 10712, -2509, -7140, -2307, +1333, 3041, 183, 1241, -7861, -3060, 1432, 9, +-1431, -2605, 2663, 273, 250, 770, -740, 6699, +-10929, -7227, 105, -2983, -1203, 1637, -6072, -6630, +933, -1526, 658, 2612, 5377, -91, -66, 4944, +3025, 2723, -869, 142, 10532, 9858, -207, 3072, +-2610, 0, 81, 1078, 2136, -266, 223, 931, +-385, 983, 1029, 108, 2290, -491, 26685, 565, +-140, -662, 680, -2206, -803, -777, -250, -467, +98, 2944, -12296, -4190, -2254, -748, -2076, 4780, +-510, -221, 1428, -6162, 2693, 6238, -4030, 266, +6540, 2502, 5147, -4649, 1804, -10514, -3413, 2503, +2143, -1924, -3811, 3674, 4341, -1054, -3130, -1260, +-576, 887, 25908, -773, 1186, 548, -606, -744, +-995, 1320, -507, 279, 1803, -2451, 880, -31, +-5, 1615, 770, -11818, 1062, -1126, 472, -297, +-12126, -1197, 1912, -962, 1241, 2348, 2332, -3047, +1561, 3844, 720, -387, 371, 2942, 1174, -2347, +1244, 10148, -1620, -11788, 1315, -31, -1867, 3450, +-1589, 5180, 3184, -2614, -13, 130, 107, 297, +113, -1407, 29190, -544, -173, 990, 913, -1848, +-990, 1230, 264, 1896, -6974, -102, -2232, 3826, +-2269, -5027, 94, -12612, 436, -5979, 1757, 1757, +-724, 2378, 2584, 728, -1022, -7274, 668, 744, +-516, 420, -11866, 246, -1357, 2406, 3674, -2594, +1638, -3037, -2402, 1525, -7304, -1078, 1772, 9264, +12366, 202, 2, -728, 684, -437, 1446, -3546, +828, -2106, -2736, 964, -180, 6524, 2250, 514, +-782, 675, 1418, -11225, 2760, -3970, -545, 9128, +-6601, -556, -1966, -4625, -149, -198, -3330, -1575, +-6198, 656, 674, 367, 1809, 155, -5126, 6109, +-572, 4927, 1448, -1855, 1636, 8648, 2010, 8973, +3087, 10172, 34, -1183, -12, -1057, 192, -2955, +1034, -374, 2500, 9318, -4090, -5220, -404, -1022, +-1458, -1367, 765, -1193, 1542, 302, -1337, -34, +1449, 1434, 2210, 404, -3277, -8024, 1363, -7591, +9096, -9179, 1176, -7311, 544, -8942, -713, -56, +2623, -35, 1623, 2212, 1733, -712, -1327, -320, +-1966, 11352, -1276, -3804, -550, 520, -4848, 550, +1488, 944, 10756, -782, 5643, -2647, -6513, -3500, +-2877, 1880, -6634, 2349, 256, 440, 188, -8428, +-4580, 2479, 4763, -1807, -513, -4292, -1729, -6878, +448, -6706, -1162, 4938, -721, 5465, 1409, -8759, +-898, -4254, -5230, -3886, -7969, 1730, 3656, 1198, +3537, 33, 4091, -2088, -7646, 1160, 2922, 855, +-1254, -2616, -770, -685, -100, -577, -4927, -792, +-2107, 9613, 2563, 5096, 6143, -3404, -8630, 4164 diff --git a/src/main/resources/vavi/sound/twinvq/cb2220m1.txt b/src/main/resources/vavi/sound/twinvq/cb2220m1.txt new file mode 100644 index 0000000..730b72b --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2220m1.txt @@ -0,0 +1,136 @@ +32524, -324, 411, -34, -697, 818, -71, 2326, +-142, -989, -1512, 358, -260, 3791, -575, 93, +224, 208, -1101, 32767, 1147, -203, 2015, 461, +668, -296, -3340, -38, 720, -993, 1765, -1344, +1323, 648, -997, 729, 581, 349, 861, -2035, +1791, -2142, -822, -1425, 820, -6555, -811, -15708, +-912, 4835, 1500, -604, 527, -937, -640, -1240, +4692, 1259, 174, -12040, 450, 8196, 2796, -5123, +1595, 538, -101, -218, 5581, 367, -2700, 277, +2111, 2718, 1458, 155, -100, 3284, -498, 9961, +-1505, -10336, -1170, 5337, 1032, -14947, 1154, -578, +-11773, -945, -660, 669, 2340, -1038, 1520, 713, +2663, 422, -1242, 1918, -234, -1793, -1580, -271, +-5628, -2010, -12209, -1784, -4417, -2804, -3123, -4316, +126, 6353, -2391, -2088, 836, -2550, 521, -1258, +918, 4471, -528, 4243, -615, 3453, -6683, 1784, +790, 13200, 700, 322, -815, 6049, -290, 928, +-1121, -1531, -878, -1150, 1404, 325, -530, -435, +-254, -804, -2536, 589, 8439, -1087, -16248, -637, +-1528, 305, -1577, 642, -22699, -139, 1319, 588, +-3079, 800, -597, -1408, -1150, 3145, -868, 3244, +-1004, 1004, -1459, -11618, -4557, -3643, -914, 4238, +-626, 4025, 3227, 537, -4285, 2010, 747, 1595, +1599, 5994, -797, -911, 2854, -3426, -8488, -1899, +-301, -2146, -111, -522, -1852, 3075, -3864, -1531, +654, 193, -11264, 5561, 304, 525, 346, -2761, +-1124, 1134, 8354, -12460, -1023, -7634, -2750, -1518, +5001, 1480, -1039, -502, 1455, 586, 1012, -1270, +12435, 895, 1169, 466, -10696, -3861, 4381, 1790, +767, -1808, -537, -1057, -2374, -2058, 9992, -858, +-1568, -678, -3812, -1520, 1521, 230, -1716, 13418, +-1930, -979, 3272, 1116, -4555, -559, -320, 12080, +13696, -286, 652, 2420, 1725, -277, 213, -1046, +1642, -576, -1514, -973, -1501, 77, 537, -606, +1144, -680, -568, 1104, 2176, -969, 1657, -784, +1107, -1056, -59, -5607, 64, 11913, -178, 8703, +3744, 276, -50, -12807, 1122, -6138, 1901, -439, +733, 6829, 3001, -61, -1005, 3816, 3987, -3588, +-778, 2257, 12101, 196, 13796, 355, 1407, 989, +101, 1041, 988, 1274, -1478, -1127, 1320, -442, +3452, -1717, 1244, -466, -868, -323, 502, 1243, +-70, 897, 958, 2781, -2492, 788, 744, -12324, +1111, -11704, -452, -734, 19574, -45, -584, -2387, +-830, 603, 380, 787, -2962, 2046, 2524, -2403, +699, -4144, 1587, 573, 588, 238, -88, 31, +-278, -32768, -1173, -745, 667, -188, 1221, -369, +-261, 322, -2054, 651, 100, -2092, 315, 1558, +596, -407, -146, -1234, -30970, -71, 633, 536, +-1345, 1819, 655, 680, -1453, 492, -1265, -1292, +1780, -68, 1008, 215, -19980, -521, -3148, -256, +193, 916, 453, 86, 116, 108, 1518, -1420, +-1501, 688, 669, 1196, -1579, -942, 868, 804, +110, 1126, 202, 1086, 23516, 1070, -1623, 747, +-38, -116, 1176, 554, -2361, 1008, 1085, 1972, +-1794, -96, 464, -20910, -1208, -3857, -466, -2173, +2461, 2364, -931, -684, 3056, -719, -936, 887, +-3149, 1004, 7085, -2985, -9393, 5142, -9621, 150, +174, 572, -2232, -390, 1356, 160, -10796, 2256, +2238, 242, 1663, 485, 12378, 1236, 688, -2908, +1084, 1047, 4850, -72, -642, 1604, 152, -850, +670, 968, -3207, 1690, 105, -2516, 11539, 390, +-1117, -588, -10771, 2879, 4742, -8351, 1571, -850, +-605, -1959, 395, 12324, 1750, 2290, -92, 774, +-2897, 1025, -1841, 546, 3904, 3908, 11494, 9, +1340, -11976, -525, 1522, -43, -43, -1860, -6160, +-199, 2479, 4593, -2876, -2985, 1044, -62, -812, +10424, -2489, -1098, 796, -1292, -2070, 1096, -1944, +-2145, -4374, 1041, -1014, 9036, -2142, 328, -8232, +152, -13336, -2225, 13716, -367, -558, -1942, 161, +-472, 2224, -748, 3550, -809, -493, 2121, 1234, +772, 5146, 2485, -2282, 7546, -1441, 1595, 9176, +6208, 1292, 1704, 3968, -1500, -1974, -3519, -2826, +149, -903, 504, -187, -940, 121, -215, -615, +-257, -1954, 958, 2057, -191, 21258, -726, 2081, +1278, 1670, -854, 2730, -8132, -530, 1004, 2574, +1430, -2536, -10851, 1389, 155, -140, 2158, 2762, +3807, 3850, -3728, -954, -11366, 709, 14727, 514, +694, -87, 857, -249, -419, 617, -418, -1144, +-32, -2182, -839, 1449, -1072, -785, -246, 13634, +12488, 358, -447, -2262, 926, 1023, -901, -345, +2260, -1530, -1466, -2973, -2170, 2090, 44, -23476, +603, -1740, -345, -438, -3004, 1322, -3088, 1274, +341, -348, -534, 1055, 3026, -932, 514, 8958, +-15489, -374, 1077, 1166, 48, 1016, -918, -27, +-410, -266, -1401, -3888, -2918, -2146, 2815, 1834, +-875, 162, -678, 1876, -2033, 1999, -12854, -1563, +192, 414, 782, -3109, 1432, -4197, 2358, 8517, +784, 1256, -1362, 2938, -11355, -5184, -10314, -39, +-2182, -1686, 241, -195, -232, -6169, 206, 181, +-470, 1008, -599, -284, 733, -836, 648, -138, +2078, 313, 24432, 548, -441, 1446, -1628, -1218, +-64, -716, -2456, 1987, -352, -1025, -1951, 1320, +350, 744, 2598, -984, -18328, 622, -4, -1572, +893, -3043, -4365, 127, -1, -226, -1696, 1332, +-1360, 6756, 2596, 12059, 370, -3690, 497, 585, +1619, -778, 9174, -2046, 2214, 2004, 1133, 1069, +132, -250, -1555, -906, 561, -12904, -1039, -8006, +1876, 2300, -1116, 1895, 1782, 3734, -1108, 1338, +-1409, -248, 16117, -1458, 156, -2626, 64, -1199, +-3544, 4283, -3390, -404, 1426, -907, -2768, -780, +-34, -18656, 2003, 515, 3171, -653, 762, -3352, +-154, -1171, -452, -1590, -5936, 519, 1210, 502, +-409, 2262, 695, 1028, 8652, 2532, -2636, 3472, +-1186, 1350, -651, -639, 8382, -3234, 630, -10323, +-2285, -1916, 826, -1449, -738, -344, 1022, -3248, +-20921, -200, 568, -84, 777, -1570, -2756, 2834, +26, 3878, -1709, 101, 1433, -2238, 305, 61, +-1041, 2399, 628, -1509, -388, 946, 733, -1538, +-650, 19935, 478, -10696, 850, -682, 447, 2311, +35, -1258, 2332, -11417, 1743, -834, 660, 3170, +2378, -2734, -762, -1151, -1802, -9324, 4625, 2304, +-1186, 1180, 4894, 662, -7067, 869, 613, 1802, +4839, 3412, -5460, -862, -4202, 7876, -1057, 2872, +-1336, 1731, -10788, 1088, 3433, 42, -939, 2479, +6425, 991, -1621, 3222, -2464, 2988, -29, 481, +11606, -2800, -8315, 7660, -3385, 1217, -728, -3670, +684, -2295, -724, -567, -2150, -106, -1920, -2143, +3465, 1968, -1089, -11953, -2704, 3049, -1351, 7225, +5727, -525, 2639, 1955, 2259, 6489, -1867, 1544, +-3199, -4992, 2420, 4119, -2860, -9505, -2152, 10204, +-1133, -1201, -1468, -2989, 4658, 578, 1115, 368, +1570, -776, -503, 1554, 1329, -696, -760, 575, +-1527, -3865, 8372, -3378, -8137, -8392, -3471, -1854, +-4852, 5270, -634, 608, 1289, -7660, 4983, -1266, +-2070, -906, 3291, 2459, 4807, -4241, 5773, -2258, +-4500, 2634, -13176, 6412, 282, -5849, 294, -626, +888, -1088, 656, 192, -630, -3405, -12469, 2882, +2184, 3920, 2715, -6852, -1111, 869, -161, 341, +1856, -9450, 2719, -579, -3840, -8763, 1153, -3532, +-571, -766, 8301, 2936, -10501, -1073, 10068, -2930, +6308, -2747, 3093, -1710, -3865, -1464, -4447, 446, +898, 5386, -1074, -4651, 6205, 455, -1773, -1270, +6986, -2493, 4076, 10605, -2522, 977, 4098, 1153, +-434, 4071, -2890, 2920, 9175, 2276, 4699, 642, +-1067, -968, 508, -1752, 728, 3260, -500, 1414, +5554, 2761, 1973, -4704, 2127, 1397, -1070, -14536 diff --git a/src/main/resources/vavi/sound/twinvq/cb2220s0.txt b/src/main/resources/vavi/sound/twinvq/cb2220s0.txt new file mode 100644 index 0000000..6e7634d --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2220s0.txt @@ -0,0 +1,144 @@ +-15119, 7508, 1337, 4182, -2914, -3733, 2686, -470, +2249, -3901, 1444, 3805, 99, -1771, -354, -903, +-2755, -709, -4980, 214, -2750, -652, -1042, 1434, +-1090, -612, -2574, 1274, 1310, -760, 1420, -112, +2776, -4843, 15060, -4929, -3942, -5721, -1628, -1142, +3023, -1435, 1402, 1010, 623, -3527, 2624, 184, +988, 98, 340, 16676, -1262, -1162, 3183, -4816, +-592, 1019, -1406, -2478, 2371, -1004, 3944, 803, +5665, -2261, 16427, 349, 3113, -916, 442, -1754, +-3551, -1351, 1563, -1316, 532, 343, -392, 1509, +-717, -122, 2462, -929, -185, -683, -18780, 2682, +-123, 518, -379, -5160, 245, 1940, 13964, -12311, +590, -30, 159, -1558, -1940, 36, -1528, -515, +-1178, 856, -395, 29, -5854, -12943, 13286, -2572, +1049, 768, 3292, -3921, -52, -462, 1968, 4933, +630, 930, 1026, 2606, 319, -277, 6333, -2119, +-4700, 2164, 1583, 154, 2107, -1467, 339, 634, +-17240, -595, -3525, -2690, -1788, -476, -41, 165, +-1016, -1456, -348, 11289, -2920, -3804, 2357, 12012, +3848, 1796, 2164, -5555, 4527, -201, 965, -4893, +3419, 6441, 1691, -77, 348, -769, 27319, -345, +-336, -541, -320, 972, 926, -1026, 1052, 702, +224, 76, 742, 220, 6292, 8625, -3742, 4139, +-5989, -5615, -641, -231, -837, 6156, 4141, 3792, +4746, 9972, 1800, -397, -2237, -2218, -7595, -2761, +-496, -1451, 1178, -970, -1226, 2527, -2105, 1778, +1446, 1986, 9970, -13107, -985, -1142, -1367, -329, +-4498, 590, 36, 2073, -1069, 862, 133, 2516, +-27, 4494, -11602, -1638, 2524, 1449, 5684, -611, +-9452, -2618, 5006, 3481, -639, 379, -2333, -498, +-713, 382, 784, 269, -5692, -350, 524, -18705, +-1042, -1349, 1210, 1770, 3964, 4908, -1131, 17535, +-788, -1896, 30, -2682, 1044, 1604, -3740, 18, +1771, 331, 4279, 2634, -368, -447, -6995, -1224, +-688, -5368, -236, -8872, 2449, -12189, 4465, 1895, +2484, 1315, -5446, -457, -575, 101, 2356, -1585, +3204, -104, -7244, -1678, -801, -2620, -4603, -11876, +-1787, 2962, -1796, -3385, -411, 5796, 2900, -562, +835, 293, 7127, 4939, 721, -2972, -482, 121, +-2694, -2277, 412, 12770, -342, 718, 3306, 502, +-7281, -307, 552, 7158, 3289, -5051, 5230, -1185, +3024, -942, -1347, -283, -13937, -208, 2576, -906, +1848, 5692, -2434, 175, 7837, 1872, -4536, -3341, +-957, 14787, -1598, 9058, 3776, 407, -1734, 1259, +-3011, -131, -3589, -614, 272, -2968, -1611, 3645, +-8126, 2120, 4868, -5462, -13235, -3452, -6077, 5064, +-1593, -1395, -2427, -1139, -958, 1585, -1330, 2178, +-778, 3545, 2836, 7712, 5993, -432, 3575, 929, +-7951, 115, 2180, 3904, -193, 1556, -252, -913, +2574, 11948, -4525, 1391, -8513, 4540, -12815, -3379, +-4676, 1838, -5676, 1321, -6168, 1397, 1020, 438, +-141, 3424, 392, -512, -1614, -1396, -318, -2451, +1545, -7132, -1763, -424, 3575, -828, 19216, 1978, +1624, -1969, -1667, -772, -2031, -781, 1732, 244, +-212, 416, 900, -8960, 1002, -1077, 4667, -3527, +1586, -13109, -2442, 3829, 4358, 1056, 2960, -1087, +-662, 4775, -6316, 6157, -3736, -2040, -187, 904, +1254, -636, 2032, -734, -1271, -2691, 3376, 564, +-7769, -5482, 840, 14171, -5828, -966, 1685, -10192, +-388, -434, 3706, 594, 2188, 365, 209, 298, +1825, -236, 12762, 1644, 3199, -468, 12876, 130, +-2169, -3406, -3571, -4655, 2339, 10757, 1292, 2920, +289, -314, -591, -1631, -1778, -1296, -254, 469, +-9408, 1154, 334, -4, -1922, 2787, 317, 416, +-1703, 14075, 1601, 638, -2260, -973, -824, 2816, +-2954, 3282, -3716, -882, -3447, 3058, -6701, 1233, +177, 3579, 3508, -3539, -10511, 7507, 7608, -1928, +2482, -719, 2278, 5167, 9828, 10572, -3635, -2750, +3407, -116, 3343, -3432, -3375, 982, 903, -3239, +-444, -1574, -333, 9613, -1914, -532, 1879, -78, +-17944, -7029, 1586, -3122, 360, -401, 1219, -2086, +3066, 878, 5780, -948, 102, 1952, 418, -416, +1002, 1380, 1297, -92, -640, -555, -1159, -28517, +-1757, -696, 124, -618, 1590, 300, -598, 924, +-190, -1734, -4196, -5345, -14068, 5971, 8293, -3878, +-1448, -1777, -174, 921, -1555, -866, 560, 232, +-1914, -4002, -772, 1960, -4945, 3424, 6492, 3675, +-800, 5346, 4404, -639, 10697, 1631, -1446, -4469, +-7804, 3721, 4824, -620, 1099, -2956, 5175, -2453, +-4894, 2562, -1842, 4940, 1391, 2818, 1095, -4285, +6469, -1966, -14564, -2232, 592, 5570, -2682, 2651, +4678, -7444, -2387, 6812, -12757, -5664, -42, 134, +-2861, -1780, -158, 1410, -4990, 673, 2083, -2639, +3019, -2, 8305, -1981, -2114, -54, 2892, 1659, +-14913, -74, -1092, -1187, 2465, -2218, 791, -608, +3077, 26, -1096, -1692, 3234, -7116, -1835, -5244, +398, 10137, 698, 2298, 498, 7060, 6430, 1393, +2540, 487, -1534, -1926, -5139, 3425, 4533, 5067, +-535, -924, 938, -1799, 16120, 2037, -3727, -821, +2986, 2314, -223, 1358, 9, 2697, -1806, -940, +-3630, -1843, -2776, -2246, 580, -1678, 2427, 2126, +-1935, 2956, 849, 18234, 638, 342, 1036, 249, +-24, 2713, -1973, -134, -4469, -2014, -6162, -19776, +703, -50, 2295, -2294, 1971, 1179, 1014, 2374, +-1480, 1513, 630, 1542, 24716, 3534, 2926, 662, +-2886, -521, -348, 402, 1112, -371, 1587, 1822, +1880, 1284, 302, 1873, 1284, -924, 6420, 4650, +7986, 427, 361, -8276, 304, -11911, -1305, -2018, +189, 258, 839, -942, 479, -3162, -1195, -1138, +1560, -1850, -5304, -10132, -10533, -1301, -3147, -680, +56, 4260, -6867, -1350, -1094, -1385, 1831, -2, +-941, 3740, 7701, -855, 3304, 3444, -4467, 269, +-4092, 588, 13957, -1566, -3561, 1936, 2816, 2982, +1804, 2710, 419, 685, 4468, 488, -9520, -2738, +3974, -9978, -1681, -2418, 2340, -717, -899, -2855, +-10470, 1030, -2346, -5555, 2559, 2180, -5324, 1832, +10294, 342, 11318, -2376, -3904, -1524, -3806, 1078, +-1896, 7199, -3522, 1364, 2291, -911, -156, -4327, +-778, -30451, -577, -158, 560, 2749, 799, 2689, +337, -301, -1218, 1243, 687, -880, -419, 40, +-280, 4, 1834, 9908, 1953, 408, 1080, 8777, +3861, 552, -6906, -3546, -6666, 35, -1903, 4788, +5080, 2865, -233, 1031, -4519, -13752, -2417, -1742, +-7389, 3191, -626, -411, -7351, 3063, -1801, -4377, +-2974, -124, 2778, 2733, 349, -1191, -6528, -1699, +6907, 239, -2765, -5706, 3627, 2096, -20, 2285, +7164, 3523, -11582, 3616, -614, 6266, -285, 3643, +1506, 3665, 1261, -2338, 418, -5062, 4893, 2945, +1923, -2990, -4531, -8858, 2769, -5029, 2202, 3337, +10703, 716, 5614, -14982, -2366, -5415, 25, -1665, +4353, 3060, -2159, 1005, -1587, -368, -949, -2788, +1063, 1307, -59, -46, -6337, 500, -1194, 2914, +2372, -1393, -1914, 3820, -1160, -135, 3777, -14151, +5208, -2290, 5738, 1018, 385, 1883, -2626, -9289, +1082, 1558, -1756, 2720, -519, -13050, -3672, 1759, +-13, 3471, 4071, -5977, 167, -4210, 2219, 1344, +-2412, 4497, -6946, 660, 8774, -3141, 6080, -4478, +2520, -609, -3080, -741, 7864, 7428, -333, 1154, +-1849, 1478, 460, -338, -6651, -2480, 1692, 2104, +1642, 2720, 1017, 2759, -1822, -2668, -2265, -1019, +-8926, 1487, 733, -15128, 5543, -4214, -7044, 666, +7108, 2222, -2454, 4995, 5108, 1481, 2242, 5743, +-487, 9669, 295, 3539, 4836, 487, -1541, 824, +-5946, 6692, -368, -1390, -6103, 4545, 2671, -12272, +3160, 760, -2080, 3523, -2752, -2940, -718, 2202, +-5523, 2346, -5580, -5007, 6212, -5406, -11348, 1272, +5389, 2331, 3691, -1184, -3585, -4500, -603, -38, +-5285, -531, 4844, -3850, 3944, -6525, -5723, -2313, +-985, 879, 578, -3217, -3600, -2814, 1432, 11568, +-1461, -1761, -4110, -4104, -103, -1803, 5195, -1477, +1348, 107, 3902, 1215, 3522, -3404, 9098, -237, +68, 34, -2524, -12040, -6183, 2122, 470, -1257, +346, -232, -1725, 5913, -1525, -5873, 1846, -11368, +1043, -1027, 4201, -3864, -4294, 7756, 1847, -3688 diff --git a/src/main/resources/vavi/sound/twinvq/cb2220s1.txt b/src/main/resources/vavi/sound/twinvq/cb2220s1.txt new file mode 100644 index 0000000..206d901 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2220s1.txt @@ -0,0 +1,144 @@ +32767, -2256, 16, 2156, 267, 1128, 1394, -1936, +-488, -405, -345, 1068, 578, 1504, -1192, -405, +292, 1149, 4243, 152, 1036, 1782, 2655, -23349, +-1100, -1933, 354, 966, -1554, 1173, -1186, 495, +618, 1009, -2715, 461, 5974, 939, 3552, 1325, +3385, -956, 2177, 2101, -145, -1000, 2326, 2466, +2822, 15822, -581, -713, 4398, 828, -3249, -3942, +1990, -862, 2272, 348, -2972, 241, -2678, -1881, +-22307, 417, -587, 312, 280, -2524, 2380, 299, +3931, 178, 2910, -2544, -356, -786, 546, -73, +-862, 240, -1653, 1286, -3875, -2072, -1477, 16800, +-1148, 2099, 3216, 5174, 2177, 3042, -796, 414, +-506, 883, 1837, 1451, 2864, 850, 2395, -414, +3254, -1937, -16379, -3976, 2178, -1473, 4759, -832, +8890, 3324, -3053, -407, -1530, -431, -1220, 128, +-3472, 980, 52, -14716, 1732, 1931, -6518, -1784, +-11113, 4466, -24, -8559, 105, 5478, -4116, -2213, +-3006, 1738, -4189, 3310, -753, 1869, 580, -885, +3089, 8146, -4990, -1825, -524, 3620, -6920, 621, +-1064, 4633, -1509, 80, -10949, -2752, 476, -3684, +3547, -1967, 3364, 2887, -729, 7921, -4216, -3681, +-14417, -3978, 261, -1146, -1124, -901, 777, 783, +-2, -989, -1582, 3988, 7785, -6371, -2258, 3344, +354, 13289, 3339, 316, -3186, -2088, -1951, 310, +-545, -704, -40, 4416, -392, -1033, 5650, 99, +-3008, -3716, 2448, -3758, 9463, -1793, -130, 1705, +6501, -2214, 2970, -10476, 564, -5952, -541, 2077, +-90, 6588, -2858, -1733, -9247, -345, -3170, 4986, +3353, -4868, 8873, 113, -5223, 1562, -163, -2446, +-4459, -8052, 1106, -10883, 1185, -1756, -152, 3109, +181, -1427, 8291, 11419, -6265, 2116, -469, 5150, +1355, 182, -740, 779, -7754, 1868, 144, 3936, +-60, -784, -231, 879, 17032, -2273, 1886, -538, +1015, 1798, -633, 1090, 1910, 128, -6094, -1946, +-1570, -727, -18457, 498, 784, -4419, 1656, -21, +154, 2430, 3815, -41, -2708, -1594, 228, -784, +7284, -452, -7634, -12868, 3564, 5473, -1244, 2231, +28, 4321, -1464, 1402, -1358, 2241, 656, -1128, +1160, -2352, 3641, -680, 1816, 6864, -42, 1269, +-280, -1265, -2048, 238, -653, 13571, 3874, -269, +7977, 2238, -1246, -2066, 4741, 1706, 3498, 595, +2559, 55, 593, 1681, 1612, 43, -2756, 2702, +2439, -2471, -809, 1890, 17032, -787, -4280, 1167, +-1926, -4973, -1181, -2764, -4151, 2962, 3444, 844, +2446, 14013, 3326, -1195, -1829, 1588, 1765, -3140, +8562, -14425, 4040, 2003, -738, -1032, -3314, -2236, +548, 768, -2348, 436, 1755, 31, -4616, 1259, +269, 1543, -1393, 5338, -16463, 2900, -2480, 1659, +217, -5864, 3878, 5268, 1244, -520, -1202, 1238, +182, -1049, -695, -320, -6832, -5904, 2914, -2616, +2586, -10958, -3258, -1846, -4633, 2371, 3251, -3583, +2631, -4162, 3035, 2718, 616, 2890, 206, 16128, +979, 3551, -6864, -3221, 5881, 3692, 1718, 234, +-2844, 1668, 102, 2687, -838, 988, 1116, 533, +4026, -7235, 5972, -13781, -3394, -3518, -294, -6383, +1675, 4507, 5444, 385, -1931, 930, 699, 1639, +415, 6720, 7854, 1514, 3192, -2253, -14786, -1307, +871, 1329, 1881, 6628, 2851, -85, -2284, -4538, +-837, -2232, 269, -2227, 13930, -2063, -7540, 8978, +1195, 2717, -1282, -972, 1305, 3864, 2412, 2308, +-4824, -3282, -864, -489, -1458, 2192, 15903, 2460, +2792, -4137, 1034, -359, 5, 2297, -6, -3859, +478, -1535, 2080, -741, 2030, -603, -2640, -1902, +-8208, 3818, -1273, -8138, 2015, 9169, -3440, -1779, +4076, -576, -93, -1718, 744, 2563, 6744, -3841, +1355, 1590, -4196, -13924, 356, 13381, 2552, -2862, +2790, -578, 3562, 2711, -686, -3783, -489, 1230, +896, 1208, -1101, -3482, -2478, 772, 1254, 320, +-1825, -327, 1070, -1712, 295, -18141, -2618, 1537, +-603, 3782, -1272, -1901, 414, 169, -6574, -6966, +2711, -3292, 13204, -1324, 3620, 4962, 2835, 4177, +4861, -2378, -5534, 3701, -4224, -631, -3199, -653, +4785, -1045, -2097, 580, 2190, -140, 48, 3075, +-1346, -810, 2016, 566, -2543, 235, -5930, 1956, +481, 19003, -3938, 6489, 2697, 4796, 3435, 7102, +3062, 1460, -5814, 2723, 4181, -4979, -2534, -2058, +-136, 3554, -2684, 15252, 4112, -3146, 2812, 7182, +-2642, 5443, -1043, -803, 2786, -1622, 1988, -780, +1482, -13015, -1762, -1377, -4005, 161, -9568, 8166, +1832, 330, -6484, 945, -4388, 1090, -524, 1556, +-582, 320, 770, -938, -8757, 977, 1084, -7062, +3552, 775, -4708, -2281, -552, -10027, 4263, 1197, +-672, -93, 5716, -3825, -4526, 1781, 9799, 4450, +1981, -3149, -9664, 3119, 3794, -91, 6710, 840, +-1098, 11310, -2933, 785, -2573, 748, 1803, -1401, +-1547, -4118, 849, -580, -1404, 1536, -9382, -1610, +2335, 403, -2939, -3015, -3753, -7593, 1640, 3346, +-2594, -8028, 5485, 2189, -3369, 2106, 5369, -2573, +-515, 1459, 6996, 1344, -389, -7009, 10332, -840, +-3869, 901, -6449, -2348, -2461, -4103, -810, -2060, +1040, 117, 32241, -231, 945, 999, -1183, 180, +1443, 188, 855, -1634, 774, -202, 99, 1714, +286, -849, 1968, -9743, -15458, -859, -3726, 2257, +355, -167, -1674, 1808, -488, 1118, -1416, -1685, +2928, 1471, -1145, -536, 2307, -972, -1191, 1625, +-1436, 378, 20178, -638, 1826, 472, -300, -845, +-1045, 1074, -1041, -510, -39, 516, 4548, 2741, +-10197, -2336, 3828, 2093, -4148, -9138, 4239, 2520, +-3536, -3807, 2998, -2226, -6898, 4838, 2552, -2024, +-5579, 1370, 11706, -7626, 1566, 989, -4934, -1345, +-5962, 4259, 1158, -3712, -2710, -1037, 105, -2733, +1068, 3682, 3904, 2044, 184, 537, -3438, -1376, +332, 17812, -3170, 2386, -2090, 3481, -1352, 431, +-1016, -1062, -564, -1752, -2602, 1299, 6720, 789, +1275, -9801, 5320, 2327, -4048, 4443, -7820, 1112, +1232, -1139, -920, -744, -845, -3754, 5958, -5388, +3336, -3578, -4027, 688, -7043, -136, -163, -1395, +13400, 1729, -1862, 2612, 321, -3874, 947, -990, +-3164, 11487, 46, -1978, -2139, 1222, 3897, -9664, +3692, 5431, -3364, -3706, 180, -4009, 2563, -313, +3228, -1631, -9763, -9184, -6058, -4594, 1040, -3323, +321, -3233, 5035, -1919, -5525, 1899, 1196, -1834, +-391, 549, -2114, -1436, -2624, 2441, 618, -27606, +-841, -936, 1067, 1157, 230, 784, -755, 1798, +-219, -1026, -1119, 320, -2611, -1382, 8776, 1151, +3739, -607, 2997, -7704, -5870, 1800, 1357, 4973, +-9674, -5182, -50, -886, 2056, -802, -1909, 574, +-1716, -6388, -2882, -3526, -3188, -543, 244, 9648, +5129, -5069, 598, -9049, 1834, -3375, 1369, 1461, +-1295, -380, -274, 7258, -9353, -2401, 11915, -5087, +1505, 4211, -719, -902, 1762, -168, 642, 699, +-2067, -933, 1092, -958, 715, -1978, -1968, -1613, +-1263, -777, 1170, -9652, -9570, 612, -3935, 237, +386, 4237, -1468, -10172, -4964, 2919, -6428, -7184, +119, 3610, 59, 3168, -5474, -853, -5735, -1765, +3063, -1352, 944, -1934, -3500, 9282, 5920, 784, +90, 275, 3211, 2418, -8570, -10498, -2026, -1020, +-2989, 1511, -41, -11462, -1980, 5296, 2614, -21, +770, -156, -2817, -4748, -8672, 3447, -7231, 4598, +-1347, -689, -3198, 434, 56, -2065, 1798, 13761, +-533, -1280, -796, 2481, 56, 1377, -5473, 9116, +-1185, -602, 2547, -3693, -8880, 2978, 9093, 1829, +4844, -649, 316, -162, 1520, -5814, 4860, 199, +-1330, -5182, -6269, 2642, 1220, 2816, -4098, -3981, +-13264, -398, 361, 2768, -4786, 1023, -97, 655, +-397, 2403, -1576, -386, -1112, 792, -1195, -759, +742, 729, -2916, -1020, 21350, -26, -3577, 659, +-1263, 1378, -4339, 1880, 4842, -669, -1203, 5936, +816, -8356, 3660, 1673, -677, -2370, 1652, 8710, +-1254, 6171, -6868, -891, -6752, -169, -5678, -7588, +-3247, 2982, 5281, -4941, -359, -3354, 851, -1609, +-11194, 610, 261, -1936, 2715, -3540, -2488, 2086, +6110, 914, -3224, 1777, -1558, 937, 3736, -3109, +1903, 4250, -4478, 2636, 2292, -1451, 10231, 7600 diff --git a/src/main/resources/vavi/sound/twinvq/cb2224l0.txt b/src/main/resources/vavi/sound/twinvq/cb2224l0.txt new file mode 100644 index 0000000..72dc925 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2224l0.txt @@ -0,0 +1,120 @@ +-12451, 389, 917, 1238, -626, -904, -1877, 2328, +-12808, -1345, 406, 80, 383, -3841, 1188, -907, +2369, -13409, 11191, -2547, -532, 762, -1627, 680, +-2305, -811, -1118, 3232, 3413, -2010, -453, -6816, +-4100, 1643, 11209, 933, -2272, 1440, -2465, -6862, +186, 1563, -8468, -1832, -1166, -596, -326, 105, +-115, -352, -624, 31621, 129, -301, -615, -313, +-176, 620, -5, -1354, -3563, 678, -301, 621, +904, -769, -1314, -956, -2294, -362, 381, -2398, +17085, 100, 3962, -830, 18705, 237, -1296, 3534, +1452, 259, 1690, -3106, -3624, -316, -16, 5900, +2195, -1008, 14335, 14173, -1637, 1130, 1110, 499, +-1516, 500, -720, -494, -1010, -1264, -773, 1389, +212, 8036, 780, 608, -415, 931, -301, -2186, +2256, -706, 12972, -3461, -3695, 2073, -2768, -1525, +-7539, -441, -753, 4558, -8171, -1751, -6885, 4077, +6714, 53, 1090, -3006, 3688, -1162, -59, 302, +928, -450, 238, 10809, 353, 698, -476, 172, +-2198, -4377, -7518, 1605, 6348, 5147, -165, 165, +-463, -93, 1251, 671, 587, -402, -227, -462, +-27960, 215, -56, -958, -657, 508, 98, -2811, +-1443, 3076, 6218, -9760, -10465, -770, 345, 3076, +-116, -2884, 2215, -2652, 1306, 2638, -124, -317, +366, 1461, -295, 5073, 460, 1920, 12216, -7032, +6816, 3037, -2630, -1087, -1315, 123, -582, -2137, +5061, 291, 1740, -214, 1920, -3470, 10895, 9491, +3558, -1256, -448, -10304, -2391, 1890, 484, 11057, +6636, 422, 2316, -1663, -348, 633, 1200, 1788, +-1124, -24435, 140, 869, 738, 223, -1429, 602, +433, -196, -1127, -1937, -879, -310, -564, 1022, +-4380, 7247, -3938, 4461, 2219, -8465, 9266, -4564, +-3169, -3463, -477, 749, 2460, -776, 294, -171, +1072, 1748, 1000, -208, 1908, -998, -1898, -10485, +2360, -11950, -2412, -2609, 3885, -2738, 1348, -559, +-1342, 9366, 1560, -816, 1178, 342, -175, 1286, +3014, 10641, 246, 3128, 6618, -305, 10906, 6359, +-4395, 1415, 196, 11136, 1772, -3047, 3313, -1231, +-1974, -3021, -1480, -1345, -830, 1551, 2521, -506, +7821, 7715, 5078, 8215, 2102, 1552, 2247, 3766, +-3158, -1811, 631, 3980, -397, 9030, -1267, -1974, +1539, -360, -315, 796, -4749, 2076, -1017, 717, +2290, 11212, 9365, 1626, 379, 2060, 1329, 4, +-25, -1348, 566, -1266, 1670, 2166, 13123, 42, +2416, -2170, -6380, 172, 316, 40, 300, -487, +402, -220, 846, -894, -1413, -2227, 1962, 19478, +-14756, 14377, -582, -770, -186, -1008, -1520, -722, +-885, 2622, 311, -753, 480, 539, -1011, -1748, +-832, -603, -2015, 869, -14860, -600, 2110, 484, +-5874, 1532, 3290, -222, -4670, -33, -794, -2061, +-1185, -96, 337, 515, -1887, 26, 20283, -455, +-799, -62, -1083, 236, -1721, -569, -1259, 361, +1090, -226, 1480, 13367, -638, 940, 3736, 6419, +-5995, 830, -6599, 4549, 1583, -9001, 1104, -1281, +-1270, -94, 1104, -2076, 652, 2263, 1465, -25, +9046, -8139, -2646, -13200, -534, -15244, -1448, -1390, +452, 584, -314, -1192, 951, 885, 396, 776, +1303, 1298, -448, -32641, -234, -62, 31, -164, +-1042, -82, -26, -272, -559, -164, 669, -500, +516, 1347, 9615, 1123, -1346, -1898, 8341, -10583, +2286, -5233, 1503, 454, -2024, 4248, -2298, -2117, +13390, -849, 2078, 1096, -651, -12232, -374, -812, +-3729, -829, -144, 1213, -469, 1112, 1146, 816, +818, -912, -967, 907, 12, 2443, -759, -1833, +-174, -838, 488, -1560, -18242, -558, 5510, -1316, +1758, 3957, -7130, -1394, 4962, 3870, -1907, -9247, +2217, -3880, -4413, 1893, -3085, -202, 599, 1307, +1574, -1070, -2593, -2722, 9506, -10170, 1105, 4879, +2208, 38, 5596, -5990, -3205, 35, 9405, -219, +618, 1308, 353, 3457, 1712, 717, -12937, 25, +2176, -2590, -1223, 528, 1318, 4588, 7678, 5743, +-8430, -4487, 1364, 8082, -1727, -387, 469, 3172, +401, -2771, 694, 14554, -2278, 3640, -11084, 924, +-593, -3841, -4338, 227, 750, 2974, -2834, -1765, +2133, -1181, 5149, 11758, 11949, 3538, 2442, 2801, +1457, -822, -3419, -2468, 191, -646, -975, -1271, +832, 3088, -495, -10022, 1817, 1319, -880, 1342, +-1448, -3597, -3310, 8753, -161, -6550, 1422, -640, +-508, 11542, -277, -165, 837, 7389, -942, 11009, +-97, 1548, 1418, -445, 2105, -946, -8676, 5274, +8842, 576, -1392, -1737, -1276, 5491, 312, 3624, +2806, 2157, -537, 1656, 1982, -1300, -146, 463, +496, 16792, -140, -1755, -832, -2123, -399, 5811, +-702, 2891, -3630, -1843, 346, 508, -364, -498, +-558, 32048, -744, 90, -372, 430, 704, 871, +139, 772, 696, -108, -18, 310, -411, -798, +465, -165, -321, 745, -27861, -752, 499, -215, +172, 35, -196, -770, 274, -546, -96, -470, +-8976, 9156, 581, 904, -4644, -7801, 3525, -607, +6444, 4058, -696, -1107, -632, 1475, 196, -933, +883, 1101, 278, 433, 544, -497, 4, -1882, +1504, 594, -30386, 218, 211, 850, -989, 319, +-867, -42, 754, 498, -70, -562, 660, -11561, +54, 803, 425, 966, -1017, -1224, -12630, 1834, +-41, 98, -1083, 3508, 1750, -1751, 72, -503, +-38, 22211, 252, 88, 221, 690, 82, -1340, +508, 638, 832, 482, 51, 7954, 2702, -1176, +8830, -311, 2536, -6072, -4147, 5234, 494, -157, +-1289, -5678, -1617, 1508, -140, -55, 713, 440, +-32583, 105, -394, -613, -972, 578, 1122, -32, +114, -228, 342, -1237, 1123, 1126, -188, -106, +11308, -3787, 563, 3423, -9926, 1623, -2551, -1448, +-4125, 918, -1366, -476, -66, 4, 761, 164, +-61, 20445, 238, 296, 492, -1126, -98, -1201, +14, -1840, -865, 1178, -869, 105, 907, 248, +1538, 2990, 11691, 7783, 1566, -6704, 2397, 594, +-1825, -383, 4264, 1911, 468, 1018, -676, -2676, +-7756, -2623, 10705, 2710, -8078, -5256, 1699, -2100, +-355, -2086, 10828, 611, 18, -830, 978, -4181, +1324, -5262, -327, 1796, -9777, 1306, -1934, -8930, +9520, -2364, -3997, -10209, -6326, 1394, -1758, 868, +1192, -2916, -23, -1586, -296, 438, -279, -14171, +-1554, -206, 2383, 506, 1181, 8298, -491, -2771, +-4286, -7116, -1680, 506, 1729, -12965, -925, -985, +420, -1746, -267, -478, -11763, -1030, 187, -3878, +1516, 2472, -371, 29, 809, -1700, -152, 560, +1833, 14397, 968, -96, -3242, -2497, -76, 2096, +9593, -1200, 446, 1505, 8058, 1722, 501, 923, +-1171, -9516, -2536, 7368, -2, -5304, -2440, -352, +510, 320, 301, 120, 687, -942, 137, 824, +-316, 1312, 510, -1133, -27448, -404, 1041, 272 diff --git a/src/main/resources/vavi/sound/twinvq/cb2224l1.txt b/src/main/resources/vavi/sound/twinvq/cb2224l1.txt new file mode 100644 index 0000000..ddeac76 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2224l1.txt @@ -0,0 +1,120 @@ +-14840, -1361, 12733, 798, -496, 1691, -1668, -1730, +928, -3233, 338, -578, 156, 784, -787, -242, +-618, -853, -1282, -11766, 3970, 12178, -2034, 244, +-3411, 300, 159, 3494, -3060, -1459, -2484, -10680, +752, 227, -1612, -922, -549, 158, 2260, -7640, +-4479, -4075, -2412, -7707, 600, -12358, 93, -1666, +-795, -13060, 61, 511, -2102, -2122, 364, -157, +2310, -1552, 1260, 158, 9503, 7050, 7, -5902, +-7098, 444, 3736, -1836, 3109, -2328, 457, -871, +-327, -780, 661, 8684, 2530, -268, 954, 1380, +-1029, 418, -136, -3515, 1953, -1688, -8623, -3292, +7758, 2796, 11643, -931, -501, -873, -444, -1342, +-13900, -246, -283, -1779, 998, -1318, 408, 1505, +-462, 10667, -1813, 78, -16514, 360, -2029, 942, +1674, 171, 317, 244, 1183, 724, 760, 1634, +863, 793, 126, -326, 980, -629, 22219, -649, +1274, 717, 1355, -1853, -1792, -1017, -2104, -768, +-1708, 2302, 2353, 11167, 10734, -3412, -2266, 75, +-104, 425, -880, 2072, 2934, -930, 270, -2414, +-925, 1023, -746, -236, -1620, 825, 1324, -101, +-19348, -1291, 585, 2165, 2891, 3662, -577, 1800, +408, -1486, 107, 351, -319, 1104, 956, 403, +628, -277, -57, 938, -32768, -71, -441, -208, +-32, 191, 314, -171, 613, 749, 844, -472, +-444, 952, 42, -8026, 2720, 1911, -2780, 12311, +-122, 3569, -91, 6048, -776, 1694, -63, -1272, +3581, 1622, 2538, 190, -13108, -820, -3056, 1189, +-1428, -244, -752, -6187, -3473, -697, 1368, 1043, +7702, 352, -140, -12999, -80, 12672, -1473, 3113, +1505, 667, 2392, 1767, 537, 1949, 657, -130, +980, 1743, 8269, 2380, -2311, 197, -651, 2531, +553, -1117, -396, 472, 4565, -12672, 2322, -360, +-12766, 2205, -2651, -10690, -218, 586, 5229, 34, +59, 1730, 1226, 2106, 4008, -1878, -9520, -1366, +-1174, -290, -1037, 1642, 1234, 305, -1279, -642, +1126, -13199, -29, 642, 2928, 1936, -260, 588, +11690, 9282, -3362, 7732, 1073, 2738, 4688, -1507, +-1461, -2271, -1131, 1969, -2152, 1637, -774, 66, +-1190, -206, -491, -1080, 644, -378, 367, 17980, +-1583, 2162, 918, -121, -432, 115, 5, 791, +1968, -2287, -1574, -9545, 11146, 3540, -4700, -515, +-4548, 881, 591, 1044, -259, -978, 2, 232, +778, -198, -1161, -378, -83, 421, 282, 26564, +-801, -1628, -1983, -301, 931, 886, 2196, 1453, +752, 2956, -3478, 490, -1420, 13303, 1293, -9466, +462, -12829, 11130, 8061, 593, 3697, -611, -534, +-698, -1148, 1598, 293, -726, -698, 289, 180, +876, -369, -43, 234, -21629, -1448, -753, -480, +956, 994, 531, -916, 630, 720, -2300, -9544, +-1418, 993, 2130, -2359, 2460, -339, -277, 1577, +12206, -3507, -1280, 1938, 871, -1850, -809, -3364, +6918, 1134, 5010, 8772, 2103, -9775, -1404, 5148, +-1494, 1549, 1761, -812, 654, -611, 822, -229, +-384, 10466, -337, 2207, 131, 2818, -2925, -3374, +-8786, -8552, -2282, 88, -1058, 8571, 2900, -529, +-1569, 1882, -981, 204, 2955, -4227, 4196, -3041, +10804, 1822, 82, 1936, 2380, 12992, -5659, -3449, +1329, -1668, 1291, -1726, 8328, 314, 2737, -677, +2384, -910, -878, 687, 640, -721, -912, -12772, +-2079, -398, -1788, -2516, -8711, -1038, -985, -7151, +-9057, 890, 459, -298, 918, -10061, 848, -716, +1822, 836, -9516, -985, -1379, -409, -2237, 1036, +-1082, -1704, 1333, -1432, 11463, -2355, -5975, -1674, +-640, -554, 8352, 2732, -5251, 4243, -354, 3662, +-592, -9317, -1205, -1084, -995, 11288, -2098, -1620, +2367, -1286, -5312, -64, 540, -2327, -2703, -2013, +-8649, -1306, -948, 1443, 664, 2400, 4706, 4061, +387, -20, 1859, 9283, -18175, 806, -1401, 1253, +596, 2176, -1682, 2209, 733, 1404, -6652, 2754, +950, 2346, 3629, -6875, 5069, -9302, 1472, 942, +1184, -10432, 960, 3987, 1985, 421, 300, -716, +938, 500, -160, 226, -87, -1648, -1857, -1977, +-323, 2305, -13843, -4148, -2978, 5430, -3422, -1138, +-2146, 1548, -1430, 734, -339, 8598, -4568, -496, +477, 4969, 2593, 2842, 8645, -2365, -7455, -2687, +249, 7516, -53, 219, 1139, -668, 566, -522, +1289, 33, -141, -920, 2526, -2797, 16456, -2000, +-758, -194, 10984, 187, 1686, -4799, 9671, 1838, +-1224, 1325, 656, -5434, 3207, 1813, 1833, 14375, +12259, -95, -536, -1746, -3568, -442, 964, -1472, +1345, 2692, -589, 520, 616, 357, 326, -1363, +28603, 700, 473, -908, -1129, 1046, 1106, -471, +-472, -980, 29, 574, -350, -545, -585, -1936, +279, 882, -880, -52, -30552, 371, -154, -1275, +-1914, 104, -110, 1122, -719, 729, -743, 360, +766, 198, -11674, 612, -10602, 1157, 186, -3132, +3070, 1535, 155, 774, -9432, 4966, -6717, 320, +5167, 112, 2727, 11228, 1368, 1864, 1197, -1519, +1504, 17863, 49, 2212, 611, -1788, 2932, 395, +32, -566, 2425, -9457, 673, 670, -247, 1617, +-12578, 1408, 462, -14935, 1438, -808, -1850, -784, +1856, -1648, 767, -1452, -1652, -1621, 1016, 1428, +-11203, 4217, -6410, 2570, -1016, -1720, -9036, -390, +62, -1245, 3027, -255, 1646, 1358, -907, -864, +-118, 874, 268, 252, 104, -926, -552, -1206, +965, -208, -24472, 890, -1516, -630, -885, -804, +-374, -22520, -1143, -777, 532, 185, 603, 1775, +-1887, 413, -458, -1036, -211, 2693, 6976, -9498, +1437, 10163, 2450, -1574, 4941, 884, -470, -3366, +4664, 420, -568, 5703, 10, -1692, 143, 1592, +-10966, 2891, -2961, 3938, 1990, 1726, -5247, 3326, +-6575, 584, -277, -441, 1679, -520, 1339, 1077, +-11462, -267, -351, 201, 10939, 4150, 3890, 1484, +2615, -676, -448, 2316, -1278, 9734, -3039, 2841, +964, -7557, 156, -7228, -120, 5533, -4322, 1796, +2555, -9912, -3038, 2236, 1190, 222, -1684, 3273, +-1768, 6233, -6442, 8545, -49, -45, 2366, 293, +308, -689, 308, 368, -452, 1125, 2326, -2335, +-17793, 2027, -779, 734, -2032, 1246, -2898, 4174, +-74, -40, -3105, -2135, 996, -12714, 3614, 4936, +-1928, 1528, -4158, -1791, -2318, 907, -326, 22513, +-660, 1022, 434, -564, 28, -112, 252, 372, +-842, -2, 648, 2323, -614, 23377, -263, 486, +-408, -362, -821, -724, 972, 1248, 444, -1741, +-420, -1371, 1088, -565, 22, -394, -64, -292, +-103, -501, -30510, -294, -266, 433, -700, 742, +-756, -407, -961, -148, -1416, -1041, -481, 121, +346, 10240, 12629, 1476, -2647, 1350, -2012, -262, +-5621, 714, 4398, -2732, -10473, 9834, -5165, -991, +-557, -2733, -3460, 5779, 659, 1472, 2029, -2339 diff --git a/src/main/resources/vavi/sound/twinvq/cb2224m0.txt b/src/main/resources/vavi/sound/twinvq/cb2224m0.txt new file mode 100644 index 0000000..2154440 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2224m0.txt @@ -0,0 +1,112 @@ +-17338, 5737, -912, 5906, -5315, 920, 2743, -2232, +1943, -753, 1696, -1818, -2272, -564, -1306, -527, +-156, 9952, 36, 2524, 2053, 1841, -1670, 10622, +2532, -5616, -324, -1132, -1148, 1920, 10232, -75, +-630, -10796, 1618, 1104, -2557, -603, 2115, 966, +-3763, -3183, -851, 4502, -1565, 10062, 313, -709, +10707, 867, 3820, -2747, 3470, -1942, -486, 4092, +-6289, -2363, 556, 3190, 5046, -1869, 2886, 10572, +-948, -4191, 1544, -1727, 721, -3153, -712, 934, +1610, 1070, 1248, 10645, 2340, -11102, -2744, -353, +-65, -4973, -1782, -1037, 1210, 1192, 1138, 1106, +9422, 652, -9595, -1663, 460, 9107, -2827, 775, +1131, 4732, 93, 476, 387, 32767, -161, 266, +-406, 604, 675, 83, -589, -639, 220, -830, +2200, -142, -2000, -128, 902, 823, 287, 717, +1857, -1626, 208, 2784, -72, -19310, 6190, -2063, +-9101, 3419, 1721, -2092, 332, -6533, -7594, 1138, +807, -2582, -668, 410, -497, 1526, 96, 944, +3319, 1294, -335, 1964, -380, -618, 3069, 101, +18964, -2298, -10304, -1190, -998, -1384, -11466, -256, +-4475, 4027, -3532, 1828, -1311, -3417, -3925, -221, +27688, 2277, -1227, 1043, -399, -3327, 515, 1665, +-616, 2724, -546, 4608, -576, -103, -9064, -1281, +-563, -3588, 2174, -824, 3379, -2360, 354, 844, +-7044, -2295, -2613, -11152, 1006, -1064, -17007, 1180, +387, -8448, 836, -578, 2621, -356, -1476, 2362, +822, 4547, 118, -11628, 352, 367, -958, -12423, +-65, -1591, -2304, -2880, 1684, 1708, -1693, -781, +-71, 10012, -534, -3672, 417, -2048, -1955, 10491, +-1257, 861, -414, -4058, 3042, 1529, -5823, 6877, +-3918, 993, 221, 2576, -7780, 170, -648, -139, +-3410, 7974, -756, 2657, -596, 12527, -199, 13752, +2198, -938, -2265, 1736, 257, 1517, -676, -1165, +-2874, -2433, 123, -829, 2605, -10270, -3158, 3624, +2072, 6960, 1490, 4634, 455, -8175, 1139, -4545, +-1491, 3727, -8738, -1951, 593, 14, 2897, 2490, +-2273, -1436, -10992, 3005, -4392, -3434, -4561, -1014, +-9506, -1609, -1248, -1593, -190, -10472, 3264, -2274, +5097, -633, 473, 427, 725, 1577, 11032, 318, +-12228, 78, -1116, 441, 1930, 4041, -648, -4324, +-224, 2738, 8826, -40, 327, 1761, 2371, 171, +4039, -3411, -2495, 1150, -12181, -1704, 35, 528, +417, 626, 1866, -472, 466, 905, -854, -875, +1194, 24371, 488, 26, 695, 1777, 798, -169, +-16, -1252, 395, 871, 1170, -635, -1637, 2094, +-5427, -16393, -384, 3872, 33, -687, -1777, -4160, +3020, -1906, 3868, 699, -400, 6755, -3253, 12699, +1474, 7312, 991, -646, 26770, 2524, 2144, -500, +1096, -1869, 1036, -1707, 521, -2091, 1445, 2335, +107, 238, -227, -120, -32768, 591, -257, 867, +-1231, 650, -465, 356, 431, 762, -516, -594, +512, 242, 2298, 1012, -1538, -11748, 3551, -5608, +-2174, -2428, 10557, 625, 1002, 27865, -589, -1527, +-1552, 156, 1905, 1041, -4190, 2300, 1603, -980, +-1764, 484, 1555, -2664, 381, 11676, -8848, -3060, +675, -646, 736, -1279, -1261, -1988, 543, -1880, +1917, -2165, 2846, 11863, 2076, 10381, -307, 4354, +73, -2788, -2464, 964, -218, 1552, 1846, 1470, +577, -594, 725, 30798, 43, 13, -1474, 260, +1218, 1433, -114, 1020, -648, -678, -1879, -65, +791, 366, 8547, 931, 1091, 1018, 16312, -1116, +-777, -1098, 404, 180, -899, -2865, -10089, -751, +40, -2358, -2980, 3574, 7905, -190, 9207, -18, +-18766, -270, -5300, -2023, 2422, -1189, 1267, -1085, +-704, 6823, 2164, 2, 125, -2319, 411, 591, +-488, -566, -3394, 304, -12375, -268, 11098, -150, +-2392, -1255, 3172, 162, 1295, 5897, 7944, 6019, +3329, -2014, 2957, -4933, 4805, 2780, -5453, 2680, +3220, 2784, -549, -19908, -1222, 550, -3540, 1822, +4082, 2399, -6844, 2145, 938, -597, 122, -20, +-14986, -1620, 1575, 561, 408, -6305, 760, 1634, +2652, -8301, -2988, 1864, 2524, 3228, 7466, -2620, +410, 1364, 1740, 2204, 1999, 1704, -2601, -351, +-104, 10688, -7166, 134, -346, 11852, -13322, -3171, +-1230, 1109, -2336, -962, -563, 1030, 2832, -969, +-1997, 3233, -414, -8246, -2074, 2737, 3557, 1625, +1036, 845, 1848, 1710, -10388, -4586, 6915, 2734, +-8693, -667, 1568, 1758, 2396, -3262, -2497, -1472, +-11848, -689, 3379, 1692, 1449, 2844, 8524, -15598, +337, 590, 3303, -1594, -2548, 4529, 433, -1921, +920, 1061, -1693, 191, 44, 957, -2397, -1126, +41, 2164, -1587, 568, -17290, 4687, -1028, -403, +1169, -1282, -1602, 242, -1234, 1870, 1067, 2444, +1752, -2552, 8775, 1384, 5683, -4770, -12436, -680, +-13344, -196, -276, -299, 734, 12378, 2364, 327, +-1494, 560, -90, 3394, 496, 2357, 629, -17, +1040, -706, 589, 294, -1135, 25012, 444, 1206, +-298, 1424, 1524, -2188, -64, -1101, -1998, 374, +1377, -1382, -11349, 1456, -171, -2369, 6966, -2808, +-8987, 3390, -811, 671, 3032, -3396, -9815, 2246, +4418, -678, 1851, -1592, -11038, -1194, -3612, 2589, +-250, -495, 1203, 1348, -805, 1853, -345, -555, +-8755, -9695, -3768, -1506, -8172, -322, -7163, -6319, +2052, 116, -4459, -2328, 4857, -2569, 1419, 959, +1138, 7034, 4836, 3449, 6826, 13411, -893, 981, +-2060, -3710, 3177, -761, -1128, 4386, -127, 6698, +3426, -2922, -61, 408, 1426, -1238, 15468, 94, +373, 3597, -2432, -1989, -859, -8976, 2938, -777, +409, -206, -7758, 3384, 295, -466, 29, 7925, +2048, 930, 2296, -10030, 330, 7864, -1004, -385, +2130, 388, 3587, -4480, 1560, -12768, -2606, 8178, +771, -3519, -1590, -592, 2192, -1126, -77, -3947, +1868, -1304, 11107, 781, 6240, 4134, -3314, 407, +-6125, 5168, -503, 2155, -990, 143, 219, -9950, +-1186, -1446, 1930, -8963, -4084, -6141, -976, 153, +-13665, 564, 13631, 138, -269, 379, 1333, -1710, +-940, -511, 1214, -2190, 1347, -1397, -1321, 94, +-1802, 6627, 1306, -12347, 2780, -1091, -4362, 5047, +-446, -3472, 6064, 1075, 478, 769, 58, 802, +562, -1581, 28580, 194, 1338, 573, -555, 617, +-409, -1249, -8, 1133, 952, -120, 2502, 5313, +969, -1664, 1769, -12199, 5551, -402, 4862, 3270 diff --git a/src/main/resources/vavi/sound/twinvq/cb2224m1.txt b/src/main/resources/vavi/sound/twinvq/cb2224m1.txt new file mode 100644 index 0000000..d26e2c9 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2224m1.txt @@ -0,0 +1,112 @@ +32767, -54, 1385, -206, 19, 522, -1176, -667, +-260, -1388, -1751, -2234, 228, -343, -893, -898, +-1004, 2517, -232, 20996, 507, -1857, 2574, 840, +-615, -1922, 660, 844, 52, 1272, 609, -692, +21805, 938, 678, -399, -22, -1839, -996, 1560, +218, 3973, -6547, -1151, -3914, -789, 938, -11509, +-2282, -606, -327, 3088, 797, -1540, -7598, 1378, +-100, 2108, -1907, -11671, 1538, 11136, 310, -2096, +-3037, 3181, 1731, 2043, 3424, -1098, 2046, 545, +-1778, 605, 932, 832, -2356, -1498, 1129, 11542, +119, -10994, -3720, 4316, 346, -9141, 3921, -918, +-5476, 372, -318, 9254, -681, 4896, 1587, 1620, +1850, 4057, -1507, -362, -1074, -328, -1502, -3092, +2735, -378, -11572, -1292, -2575, -3397, -7566, -8977, +1670, 8659, -655, 884, 1815, -9348, 570, 394, +1670, 1942, -195, 386, 553, 8885, -9206, -624, +-2312, 15852, 782, 562, -1497, 720, 1804, 1415, +-3809, 3783, -1918, -3496, -637, 581, 1161, 961, +-960, -930, -1673, 904, 11510, -2286, -9964, 2964, +-5752, 2229, 786, -1479, -18882, 1517, 128, 3282, +157, -2178, -564, -6029, 766, -4599, 3620, -4380, +-20114, -677, 2134, -93, 1486, 648, -4790, 1862, +-1476, -56, -3443, -2622, -2806, -1185, 122, 1801, +-1547, 12241, -2785, 2386, 56, -4075, -10964, -832, +-4744, -1350, 2849, -255, -1375, 163, 1306, 37, +2304, -1396, -11234, 9712, 1732, -2262, 3632, -431, +-579, -4045, 806, -12168, -1309, 840, -1474, 918, +-1240, -1601, 48, -4137, 6934, 3968, 7370, 4088, +8648, 2351, 1466, 615, -12314, -2347, 4382, 862, +-4288, -3138, 1886, -4357, 375, 1949, 73, 287, +135, -60, -1498, -2427, 1263, 3322, -582, 17508, +-1202, 1558, 3351, 484, -439, -571, -370, 11952, +11656, -1407, -1410, -2976, -459, 397, 1980, -1374, +1237, 5044, -2074, 405, -10650, -174, -12556, -1962, +4569, -1293, -200, 3106, 343, 748, 1918, 1084, +-670, 3, -1070, -397, 3965, 9966, -609, 9691, +-900, 137, 2305, -5944, -944, -1500, 638, -703, +-582, 10098, -523, 776, 1266, 4860, 6213, 1181, +-5634, 518, 9116, -4740, 10683, -547, -1295, -91, +104, -3115, -1724, -17, 1953, -745, 694, -474, +12248, -596, -674, 765, 674, 4494, 1205, 5883, +-1638, -3996, -664, 8694, -5620, 3968, -717, -10425, +-285, -12605, 368, -3904, 12363, -1288, 1242, -1497, +-3117, 2396, -220, 1700, -2788, 250, 107, -150, +345, 681, -44, -2466, -389, 2098, 312, 54, +2734, -22225, -1232, -1778, 1063, -1586, -6658, 344, +-2889, -4348, -3685, -2100, 12, -1755, -6401, -149, +8150, -10689, -748, 1443, -32768, 1698, 1461, 216, +1373, -2814, 1014, 1135, -227, -1309, -616, 1566, +395, -724, 852, 1579, -9647, -1214, 728, 329, +9244, 179, 7204, -836, -3954, 168, -5722, 152, +-2886, 472, -651, 5114, 8734, -71, 11406, 1098, +-1452, 1190, 598, -880, 14611, 12540, -1523, 1340, +1015, 1510, -208, 206, 1314, -1532, -246, -3210, +-1637, -197, 197, -32768, 1448, -191, -1720, -217, +1021, 973, -2099, 56, 606, 39, -1569, -1205, +-2375, -2156, 4798, 2504, -11914, 933, -6015, 2657, +-2911, -5173, -1964, 1576, 5268, 1190, 675, 856, +-1718, -4332, 166, 1556, 19005, 2040, 1198, -2170, +1824, -3409, 121, 830, -252, -525, 289, -1701, +292, 854, -1150, -1108, 171, 511, 22114, 662, +-1263, -540, -2306, -2332, 869, -5191, 186, 536, +410, -7576, 590, 13625, 3519, 3858, -2787, -376, +-6506, 891, 5025, -2054, 8316, -2115, 7668, -5808, +-2464, -2422, 1541, -3851, 1578, 420, -617, -6507, +-858, 160, 3876, -2830, -5970, -3295, 9829, 1099, +1617, 3502, -3124, -4116, 138, 287, 914, -548, +1056, -1546, 1218, -227, 11632, -574, -996, -9894, +808, -5868, -1457, 8374, -2086, -280, 1038, 528, +1862, 284, 3926, -144, 7168, 1224, 11628, -221, +1018, 1683, 922, 561, 6910, 1895, 3044, 12613, +-74, -1424, 1654, 8872, 2255, -990, -2039, 269, +9558, 10122, 958, 466, -1948, -1242, 1042, 886, +-1143, -3444, -8720, 1918, -300, 19074, -1629, 991, +908, -896, 1207, 3602, -4802, -2912, 4100, 2936, +-1344, 459, -6904, -714, 524, 171, -1430, 1454, +-2725, 1130, -757, 2861, -11174, -2768, 5466, 3662, +110, -1999, 12376, -2173, -2508, -2838, -2025, -4378, +134, -9856, 1738, 1027, 1428, 38, -1560, 12824, +13932, 549, 586, 720, 923, -1040, -2827, -3272, +1902, -2113, 2624, 3296, -34, 12291, 1449, -12138, +-796, 186, 2777, -1007, 3276, -587, -1917, -130, +2120, -564, -364, 1005, -615, 1504, -2412, 9219, +-11412, -2490, 1262, -2720, 1608, -3276, 1294, 1882, +-188, 7090, 6029, -4207, -2739, 72, -10035, -1672, +1509, -124, -1649, 420, -3623, -1069, -11225, -754, +-388, 790, -3209, -330, -2632, -11920, 3178, -1788, +2585, 4146, 1944, -2757, -10616, 220, -14136, 2158, +-274, 2010, -362, 1107, -348, -1990, 96, -985, +1599, 1566, 1393, 304, -1380, -924, -285, 620, +-30, -902, 26210, 1485, 1042, -1160, 352, -177, +1245, 1879, -18, 727, -421, 223, -1298, 1066, +962, 1306, 3866, 870, -18780, -3873, 107, -1408, +-1261, 808, -818, 1738, 1439, -2156, -1499, -2108, +-4626, 4039, -964, 16682, -1169, 266, 9373, 1238, +-2728, 2381, 12159, 2155, -472, -2293, -513, 3808, +-690, -2190, -1139, -6, 1379, -22803, 1380, -612, +308, 1394, -902, -1454, -2620, -1080, -2864, -3301, +108, 218, 8718, -617, -1098, 1436, -2005, -3966, +-2658, 6152, -874, -4636, 8705, -3382, -12072, 418, +-1837, -12582, 270, -788, -1174, 2156, 461, -297, +478, -632, -356, 5796, -12024, 416, 2602, 3544, +-1240, -970, 4874, 7221, 704, 8940, 2316, 1174, +2537, 5380, -5, -1818, 3020, -4120, 7042, -9618, +-1622, 3576, 2455, -298, 451, -5298, 7371, -1570, +-12956, 9758, -216, 889, 5395, -2779, -4036, 1736, +-1871, -2036, -1119, 1847, 912, 2292, 850, 220, +1300, 2228, 399, -2885, -2696, 2399, 3179, 6266, +1629, 13091, -232, -5322, 1397, -724, 1666, -2012, +3643, 1400, -2724, -18007, -506, -103, 1318, 2473, +965, -587, 1135, -904, -510, -10767, 1937, -585, +-73, -1662, 3021, 340, -12475, -1618, -1, -1914 diff --git a/src/main/resources/vavi/sound/twinvq/cb2224s0.txt b/src/main/resources/vavi/sound/twinvq/cb2224s0.txt new file mode 100644 index 0000000..05b60be --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2224s0.txt @@ -0,0 +1,120 @@ +-27522, 2628, -2486, 277, 874, -2351, 2725, 915, +994, -1209, -439, 2936, 46, 1014, -1816, -3561, +-14386, 3113, -10400, -1025, 2114, 1328, -278, 1182, +-1820, 3928, -1062, -282, -1327, -1468, 5975, 2342, +-630, -4217, 10116, -1254, -2646, -5210, -9942, 1904, +21, 504, 2325, 1443, 6470, 2598, 8130, 810, +304, -1059, -645, 14634, -3198, 4277, -669, -7170, +1554, -2321, 2386, -1072, 2483, -4141, 2841, 3414, +8014, -3141, 10857, 6634, 3138, 3199, -320, 36, +-1366, -4129, 3157, 2602, 4273, -2435, 2645, 2986, +-3712, -3995, -5476, -4693, -1664, 6384, -11201, 1320, +2184, -5102, -2984, -1569, -2116, -1513, 14284, -11182, +-2925, -731, -1321, -6363, 1483, 3463, 1292, -2065, +-357, 9108, 6371, 3840, -6905, -8918, 2906, -1658, +757, 1998, -580, -708, 2198, 1867, 960, 4522, +1896, -1674, -4943, 2695, -2465, -2078, 9755, -4853, +-2602, 3466, 3897, -3633, 4918, -2049, 3730, -1982, +-10085, -3458, -1866, 32, -1706, 3648, -308, -942, +-1630, 1730, 512, 14612, 3415, 974, 3079, 765, +897, -270, -1813, -1533, 1118, -2805, -2764, 1130, +-1798, 4594, -3134, 964, -20082, 2574, 32450, -1379, +52, 358, -226, 1902, 257, -1071, -650, -399, +-381, 2073, 2310, 2164, 8221, 1433, -629, 1440, +1120, -3362, -4642, 2000, 378, 1208, -2648, 4534, +3307, 13200, 2780, 3100, -3194, -10606, -11563, -4491, +2218, -4500, 622, 1313, 2682, 3003, -1387, -3886, +-1567, -4864, 10899, -20606, -1606, -60, 602, 125, +-730, -1112, 979, 325, -13, -185, 1241, -288, +-552, 6042, -7049, -7359, -1456, 493, 11204, -65, +-2170, -5248, 2248, -1046, 591, 2085, -2844, 244, +-3454, 581, 1315, 3043, 304, -620, 405, -19944, +769, 1076, -1456, -694, 2560, -1046, 2514, 14552, +1586, -7027, -4710, 1366, 1552, 4354, 3296, 462, +600, 500, 3225, 5083, -792, 3199, -698, -3589, +-2596, -3350, 2758, -3019, 5664, -9387, 4716, -3125, +3306, 6268, -592, -622, -4144, -6290, 4990, -748, +1854, -1042, -2996, -4279, 338, -1864, -8639, -11208, +932, -722, 1788, -1927, 450, 2191, 11828, -6400, +5364, -2236, 3212, 8340, -3229, -2846, -4676, -1825, +2628, -303, -589, 7728, -4216, -3866, -4400, -194, +-11316, 5646, 3716, 4827, 232, -583, 308, -1833, +2153, -2508, -46, 857, -9587, 2768, 5136, 1462, +5142, 7990, -3424, 1067, 7462, 4944, 98, 1014, +-4750, 13824, 1130, 2334, 9393, 2416, -4519, 27, +2000, 929, -204, 481, -2780, -3720, 1267, 269, +-5383, -1999, 1249, -4238, -9351, -7440, -5964, 6154, +-6827, 3112, -2613, -164, 1604, 1245, -50, 8619, +-4044, 4652, 2846, 8359, 5345, -2902, 2295, 4801, +-5016, -6270, 2893, 2732, -3510, -2613, 4548, -6376, +4510, 10566, 1859, 1038, -8381, 2782, -1622, 159, +-1035, -3232, -3766, 1580, -720, -4476, -3863, -920, +-2135, -458, 352, -2645, 3029, 301, -1145, -478, +3696, -11700, 9930, 6649, 7290, 2362, 17226, 3238, +1786, 662, 971, -736, -647, 1745, -506, -777, +1458, 2406, -1417, -7933, -846, -2654, 1104, 618, +-2783, -10168, -3322, 9498, -939, -2342, -1876, -1914, +84, 3468, -6533, 7796, -3797, -1318, -2183, 1310, +-895, 4943, 1062, -4468, 142, -244, 884, 613, +-13963, -5853, -947, 18703, -964, 1090, 1070, 1388, +-1572, -1110, 671, 1706, 620, -262, -2421, -2277, +-5665, -5212, 4994, 2379, -593, 2048, 14489, 1165, +-1775, -2093, 2466, 419, 404, 5429, 3089, -1350, +1975, 2281, 60, 599, -1600, 2286, 2358, 6698, +-16423, 3760, 666, -1309, -1346, 2786, 2364, 1448, +1114, 17956, -5301, 2430, 1178, -164, 2195, 3927, +-122, -737, 1468, 307, -1863, 1592, -7714, -2428, +958, 220, 59, 4124, -1945, 11151, 8604, -2077, +-4787, -4578, 1096, 2685, 6478, 8314, -6221, -3842, +2173, -43, 104, -2510, 3109, -2324, -4238, -4709, +-3233, 3228, 11454, 2428, 578, 780, -1096, 72, +-22624, -1421, -4104, 226, 464, -1726, -1971, 2068, +1142, 1412, 1412, 798, -2605, -3451, -1104, -2224, +-2250, -3470, -572, -1420, -1292, -58, -217, -21417, +-172, -6368, 30, -2170, 95, 378, -2926, -2180, +2820, -683, 2018, -4313, -13469, 5396, 1808, -592, +4732, -6602, -5602, -983, -4130, -477, -1236, -2263, +3992, -12962, -1778, -2631, -2421, -746, 1964, 1754, +-760, 2753, -116, -3860, 10246, -448, -1318, -100, +-10372, 1420, -210, 2768, 48, -2373, 7721, -3217, +-328, 1543, -2527, 3709, 4024, -916, -4588, -726, +-4302, -982, -14714, 3615, -1190, 9051, 199, 2252, +1348, -4204, 693, 1241, -14160, -2460, -2017, 2997, +766, -360, -450, -2919, -7976, 3210, -179, 8935, +670, 1155, 6888, -2249, 2729, 1810, 6283, 684, +-9717, -1763, -921, -4578, 3941, -6408, 1431, -2742, +-91, -2094, -2118, -9752, 2801, -2497, 147, -5901, +-5270, 13170, 2810, 1576, -3191, 10253, 4226, -1340, +2456, 1079, 12541, -5124, -8356, -1000, -558, 180, +-2070, -1880, -5718, -687, 10549, 1066, 220, -4147, +-695, 3648, -3460, -3143, -1623, 2150, -11222, -2566, +-6395, 3552, -4176, -698, 1248, 112, -4628, -960, +-724, 1191, 2084, 15207, -346, 371, 190, 5345, +-4283, -7482, 1354, -4424, -3775, -4143, 1444, -14876, +-589, 2498, 1305, -486, 1628, -867, 1584, 1094, +-10, -1260, -1046, 2528, 27472, 910, -1069, 829, +-117, -1097, 770, 252, -1412, 2353, 2200, -11, +624, 8459, 6320, -9465, 1225, 2532, 5415, 9252, +-1441, -1378, 1081, -1997, -3904, -14740, -5220, 3627, +5725, 6180, -5336, 72, 4638, 915, -496, 628, +1880, -420, 2800, -7143, -7578, 3180, -4210, -1111, +2979, -442, -182, 2778, 2398, -13878, 2209, -282, +-888, 180, 3584, -1005, 2, 999, -3074, 1205, +-4605, 5250, 17255, 2839, 2718, -678, -2651, 160, +1596, 4685, 2324, 3100, 3744, -1954, -11674, 621, +-678, -6242, -3449, -1890, 3134, -289, -7162, 2268, +-8437, -624, 4999, -5946, 13013, 244, -200, -1494, +-1108, 3768, 445, 2429, -1264, 786, -2993, 3482, +2448, -968, -1184, 213, -772, 4931, 42, -3850, +2020, -17970, 84, 3016, -602, 1805, 731, 3522, +-2606, -637, 25535, 680, 1083, 4138, 1602, 190, +-1854, -962, -379, -2499, 2453, -362, -4552, 4689, +2168, -5930, -10552, -5585, -4694, 2447, 2047, 5420, +3908, -1449, -90, -68, 496, -12713, -2127, 1406, +-10766, 2438, 2278, 2962, -6411, -22, -1966, 2814, +-1746, -383, -2381, -5981, 10920, -12354, -656, 2260, +5200, -1908, -2275, 4276, 1174, -932, -532, 2832, +601, 1551, -8434, -4170, -6411, 9099, -6886, 2243, +561, 2026, -3598, -1125, 646, -5188, 6017, -632, +772, -2919, -3776, -9938, 2461, -122, 128, -1416, +-1533, 343, 1318, -13738, -1528, -6418, -1196, 832 diff --git a/src/main/resources/vavi/sound/twinvq/cb2224s1.txt b/src/main/resources/vavi/sound/twinvq/cb2224s1.txt new file mode 100644 index 0000000..ca35852 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2224s1.txt @@ -0,0 +1,120 @@ +32767, -749, -1885, -806, 739, -1858, 3902, 1029, +332, -2122, 1240, 2705, 1362, 190, 1058, -1404, +1224, 1122, 1208, 190, 1984, -1355, 1694, -21000, +-1012, 2418, -1269, -1154, 1113, 2291, -2317, 315, +12872, -2296, -1510, 1104, 11324, -1146, -1018, 1326, +-902, 168, 647, -1828, -3838, -5682, 2732, -238, +-134, 13450, 1570, 2424, 996, -3494, -3720, 4897, +5875, 149, -6367, 6659, -2329, 6916, 1134, 425, +-19014, -479, -1900, 3470, -1777, -811, 1723, -46, +-2103, -1298, 2929, -4279, -639, -2443, 7231, -1187, +-2145, -777, -3287, 4895, 8878, -9318, 289, 4015, +-3148, -598, 2226, 11700, 114, 3237, 9586, -4570, +2592, 3614, -2272, -2829, -3356, -1095, -5290, 4709, +-1867, -1930, -20722, 937, 892, 1415, 1544, 2950, +5090, 937, -1411, 123, -31, -1568, 338, -938, +5465, 5796, 480, -2782, 3351, -2489, -383, 1529, +-5686, 2446, -693, -12796, -599, 1894, -1576, -2244, +-4686, 10165, -1085, 10050, 2681, 1138, 2544, -1809, +-806, 5278, -8730, -3740, -2343, 971, -3254, -165, +-212, -4164, 850, 233, -13694, 442, 1073, 3854, +-12926, -2001, 3468, -765, 829, 2174, 1531, -6036, +-10848, -11009, 803, 1713, 2884, 1992, 75, -2989, +268, 346, 1998, 4798, 8976, -4632, 1863, -4127, +-612, 4790, 10946, -1296, 8009, -1351, 356, -1711, +313, 2301, 1318, 8050, 700, 1218, 2270, -2156, +67, 1537, 1941, 3442, 13321, 691, 2344, 2594, +1551, 3853, 7279, -10441, 1006, -11862, 5532, -611, +-582, 2257, -2873, 3993, -5133, -2264, -2478, 1576, +1834, -4931, 10264, -1429, -10404, 393, -3715, -1470, +-2003, 384, 4869, -6780, -1297, 1572, 1043, 6980, +-4382, -3005, 3698, 4176, -1348, -4972, 1574, 9815, +-5995, -979, 3609, 3702, -8503, 668, 3354, 2552, +9183, -1175, 1224, -2859, 11176, 6088, -1355, 84, +1271, -380, 5336, 299, -690, -365, -8047, -3679, +-3204, 1334, -13451, -1392, 2200, -3646, -1046, -4292, +741, -1701, 1722, 2061, -1358, 7266, -6356, 963, +2190, -1349, -1882, -14128, -4662, 3552, 565, -1109, +5413, 1239, -2618, 794, -2064, 11805, 9004, -2134, +2804, 946, 80, -2387, -1205, 11, 1642, -1825, +-2324, -5018, 4208, 5285, 661, 12430, 1907, 784, +10864, 340, 18, -138, 2885, -2247, 17, 334, +-3172, 2977, 970, 536, -1540, -516, -488, -512, +-1334, -1930, -2418, 1078, 24837, 12, 2060, -252, +-2536, -2206, -3179, -6785, -8842, 8736, 1393, 119, +1652, 10126, 856, 855, -742, -289, -2208, 3831, +6909, -6556, 2472, -245, -1729, 1460, -3014, 59, +-58, 132, 3903, -3762, -1419, 13273, 2708, -7752, +84, 3525, -1305, -334, -13421, 5931, -4845, -2697, +666, 558, -1102, 632, -2946, 4153, -4018, 4516, +4875, 4460, -1567, 2233, 386, -754, 1256, 2145, +-1692, -13046, 1581, -518, 4397, 1215, -723, 3413, +-640, -5088, 1711, -714, 2536, 2433, -691, 10758, +-8764, 5541, -2071, -1662, 12955, 12998, 1252, -94, +802, 2573, -2557, -66, -832, 106, -728, 1050, +-811, -2684, 629, -16524, 1531, -1617, 1348, 204, +1722, 368, 554, -1752, 114, 1349, 1952, -1007, +2626, 2035, 8148, -2539, -4296, -4460, -8542, -3089, +-1543, -857, -2617, -1765, 6642, 2167, -1531, -6881, +86, -414, -5896, -5152, 17445, 1129, -5006, 2936, +-3432, -2226, 1176, 972, 1170, 530, 3390, 260, +-2909, -3550, -5255, 1771, -382, -1690, 17070, 2688, +566, 2430, -1768, 3373, 1460, -3464, -629, 3119, +430, -3554, 8357, 7075, 293, 2955, -61, -6919, +-4939, 3678, -6852, 652, 2206, 5918, -2768, -3022, +5721, -770, -1102, -1057, -2760, 3086, 5611, -160, +2714, -1042, 2569, -14248, 3846, 8212, 5392, 144, +-11896, 618, 1212, 3283, -3777, -715, -3870, 2528, +-2900, 1645, -1786, -1852, 2776, -1348, -586, 234, +-4, -1666, 46, 2095, -1987, -18728, -2980, 2501, +4042, 79, -1849, -2013, 8047, -1898, -108, 340, +-4760, 2134, 9000, 347, 10365, 4779, 6660, 1694, +-3253, -2282, -1488, 10406, -8054, -3414, -2934, -1611, +3172, -2195, 4973, 1249, 2888, -4054, -5738, -2995, +-2282, 1977, -353, -516, 5322, 3225, -4907, 1303, +-4656, 9947, -236, 9382, 2332, 2076, 1470, 3173, +4712, 2645, 559, 4904, 1511, -1715, -4856, 5750, +-1276, -306, -5980, 14393, 1443, 85, 156, 7718, +793, 4199, 2122, 1098, 128, -1996, -1397, -20, +-534, -13296, -1518, -2970, -1001, -6474, -6146, 8337, +5476, 3058, -526, -1295, 1623, -8791, 1257, 2006, +-5725, 3035, -2917, 1280, -8479, 5934, 9870, -13131, +14, 1088, -9, 1969, 366, -3214, 192, 2764, +1499, 346, -2031, -2900, -2529, 1072, 11717, 5206, +-44, -2514, -8900, 2892, 2132, 3635, 3735, 2726, +1398, 6035, -2830, -4568, 424, -8696, 1368, -3860, +1823, -2620, 4546, -2210, 1660, -1672, -10524, -484, +950, 11, -4494, -6220, -5653, -13332, 2868, 460, +-4120, -4030, -3277, 522, -3403, 1126, -170, -1892, +-4366, 1304, 3477, -1507, 1111, -594, 1670, -8416, +-1690, 2492, -7109, 2531, 4131, -8123, -4884, 16505, +-240, -63, 32099, 974, -1360, -2395, -2005, -1156, +-877, -416, -922, 1857, 766, 71, 1380, -259, +-272, -1924, 2498, -3290, -16045, -2064, 2966, 2936, +-1265, 2121, 488, 3781, 1484, -1193, 4776, -1001, +-669, 1569, -379, -604, -5, -1943, 757, 359, +-560, 118, 17941, 2323, 215, 7621, -3582, -8130, +-698, 9893, -2752, -417, -1262, -1504, 3319, 1186, +-2192, 3014, 781, -3602, -6190, -7725, 3169, 2038, +1175, 612, 2477, -4136, -12152, 4538, 567, -116, +-3222, -470, -118, -9257, -635, 3078, -11596, 93, +-4178, 4150, 5985, 4414, -2110, 542, -1125, -1242, +-234, 807, -1385, -2448, 824, 109, -1826, 3032, +269, 14188, 3468, 908, -12, 2290, 5758, 1685, +680, 5963, -2763, -173, -34, 3135, 1230, 2226, +2471, -9546, 2266, -1583, 729, 3506, -10664, -652, +2212, -620, 2762, -751, -6337, -4339, 4131, -1234, +5423, -2279, -2884, -929, -12582, 416, 2046, -3854, +11130, -2738, -670, -202, 6216, -7266, 9726, 1308, +-1761, 4696, -1061, -144, 482, -1586, 4377, -5016, +-3894, 2296, 4340, -555, -3003, -2117, -962, 100, +4548, -1870, -13885, 1351, -3226, -8114, 377, -391, +-1344, -2148, 4756, -3518, -14429, -670, -238, 400, +1234, 4389, 1181, 1046, 425, -32, 840, -29846, +1580, -992, 1844, 1961, -1305, 1055, 418, 52, +-641, 2430, -1773, -5323, 3341, -5367, 14027, 3051, +3864, 404, 4186, -1875, -5822, -4321, 112, 395, +-177, 1080, -3008, 520, 8, 226, 1430, -1635, +8, -2632, -3249, -3595, 622, 564, 8404, 14463, +160, -7828, -4113, -16547, 848, 6320, 2311, 4074, +-2050, 668, 1463, -2322, 1790, 864, 317, -594 diff --git a/src/main/resources/vavi/sound/twinvq/cb2232l0.txt b/src/main/resources/vavi/sound/twinvq/cb2232l0.txt new file mode 100644 index 0000000..325d499 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2232l0.txt @@ -0,0 +1,96 @@ +-9947, -673, 522, -36, 396, -433, 949, -442, +-12495, -2186, 4280, -997, -1715, -7385, -379, 3498, +-572, -9897, 6686, -4736, 577, 1866, 659, -123, +-1682, 420, -866, 4458, 5821, 3155, 7929, -5562, +-1798, 3086, 8556, -65, -8943, 2354, -4187, -3798, +627, -1859, -9760, -1811, -1724, -45, -1838, 1638, +499, 148, -335, 20916, -264, -556, -269, -1014, +-1531, 711, -519, 462, -5117, 3944, -950, 8277, +878, -4803, -5003, -4402, -4722, 2988, -144, -6887, +10661, -909, 700, -2287, 12126, -101, -761, 1836, +827, -609, 538, 442, -4504, 1812, 3818, 7359, +96, -555, 1598, 10040, -554, 924, 3426, -1786, +2620, -2132, 867, -519, -2299, -672, -508, 201, +-2457, 10872, -5003, 5422, -8890, -104, 2579, 940, +401, 871, 11167, 1216, 1054, -2876, -1523, -3950, +-1229, -3410, -428, 3648, -9389, -3025, -1752, 7583, +3953, 1938, 3899, 1435, 8170, 1019, -2320, 1299, +-1152, 226, 394, 11328, -1471, 604, -184, 567, +-3704, -5723, -5938, 423, 9362, 4546, -3318, -3395, +5084, -4341, -1781, -2619, 1078, -365, 151, -413, +-21591, -968, -202, -183, 849, -481, 407, -11, +-2708, 2472, 2689, -9232, -9482, -1776, 645, -1510, +-1410, -6115, -114, -2550, 1922, 1668, 288, -1302, +948, 1967, 52, 2393, -1975, 374, 17358, -1332, +5303, 3195, -2674, 4784, -1418, -1359, -57, -2126, +4618, 8890, 6455, 1181, 76, 374, 9585, 8762, +672, -642, 666, -6485, 1751, 3255, -934, 6196, +892, 171, -102, -44, -326, 1330, -320, -480, +-842, -22376, -561, -141, 635, -6528, 5711, 2400, +838, 2846, -3212, -5341, -5479, 4961, 2110, -7480, +-4215, 7964, -1308, 1219, 1541, -4418, 6293, -4522, +-4887, -5760, 2790, 1441, 6135, -1133, -1627, 1235, +914, 572, -1043, -1473, -519, -4618, -1228, -12212, +1101, -10794, -4292, -4355, 6431, -588, -992, 612, +-1771, 6751, 4871, 581, 620, -352, 277, 727, +2226, 8552, -43, 2295, 9409, 1122, 7618, 1885, +1192, -1432, -1103, 8666, -2078, -403, -1787, 1572, +-2200, -7705, -6743, -1277, -1228, 955, 7613, -1536, +8530, 5703, 5446, 4251, -853, 4910, 1578, 2832, +1274, -2610, 243, 2820, 951, 9240, 1617, 605, +-6755, -2728, -5658, 3866, -157, 1215, -8470, -2038, +-189, 10411, 7444, -376, 407, -1128, 770, -410, +503, 1707, 786, -529, 82, -27, 21512, -282, +81, -1129, -686, -555, 2674, -99, 1284, 2216, +1238, 404, -3398, 1010, 3966, -1134, -2682, 14222, +-1581, 9779, -1114, 848, 1905, 2129, -3937, -4742, +1229, 8051, -4344, 3914, 4273, -659, 159, -1188, +-1844, 912, -1256, -478, -16158, -2869, 959, -2096, +-2166, 2360, 7861, -2718, -6358, 7653, 6639, -3239, +-1690, -1242, 3439, 1254, -954, 604, 17512, -288, +2412, 211, -298, 2656, -5217, -1770, 892, 1979, +-1482, 3498, -40, 10424, -1038, -1862, 9905, 298, +77, 2179, -4444, 2580, -2069, -6473, 61, 84, +1035, -645, -662, -824, -743, -104, -1962, -124, +4976, -5378, -1254, -7055, -3474, -10695, -1254, 2547, +-694, 3194, -82, -2634, 230, 358, -12, 1594, +-90, 598, -76, -21136, -1278, 846, -84, 259, +-2536, -4442, 2337, -1606, -3264, -3126, -591, -1295, +-2440, -2592, 10888, 5821, -862, -5070, 10402, -10633, +159, -2660, 894, -2112, -1774, 3732, -1020, 422, +9487, 1608, -992, 2046, 275, -10676, 2606, -999, +477, -1868, -1690, 4764, -6419, -7550, 8159, 529, +2308, -394, -2394, 2826, 6680, 496, 3628, -646, +3186, -657, -2260, -1416, -9202, 496, 6624, 2441, +1554, -2195, -8458, -3459, 466, 6706, 1056, -8777, +5436, -4000, -3130, 4794, -6127, 2008, 1602, 195, +558, -1362, -880, -2662, 9726, -9793, 2989, -3182, +-2378, -1338, 1086, -4682, 372, -399, 11129, -601, +-666, 5206, -1106, 362, 3155, 328, -9862, 719, +1602, 998, -2342, 857, 1510, 476, 7256, 4652, +-5750, -4991, 4611, 8718, -4434, -4119, -351, -1606, +-1033, -3717, 3585, 9381, -1594, 5052, -7414, -205, +2356, -5949, -8738, 1526, -1838, 4760, -5444, 623, +112, -2863, 5710, 4920, 9497, 3759, 10748, -201, +716, 747, -2559, -4077, -449, -741, -136, -1303, +-572, 1886, -986, -10529, -51, 1360, 2418, 116, +-1490, 1928, -9977, 4720, 227, -11212, 3730, -2996, +1300, 9935, 356, -4618, -384, 972, 3174, 3732, +-803, 2666, 790, 2067, 2343, -1209, -10147, 21, +9066, -4564, 2508, -176, 264, 9834, 3360, 7278, +9386, -1274, 522, -50, 4150, -884, 592, -688, +309, 20750, 672, -1326, -346, 366, 2058, -607, +633, 620, -677, 330, 69, 432, 319, 436, +-300, 21845, -318, -676, 320, -386, 889, -724, +-1394, -2664, -431, 2046, -136, 5520, 6700, 1192, +5779, 9386, -3541, -5638, -16125, -259, 545, -267, +1972, -2366, -43, 615, 251, 1003, -980, 2262, +-10519, 12166, 2007, -884, -1560, -1250, -491, -438, +820, 1212, 3512, 354, -1066, -46, 98, 315, +8532, 944, -1297, 8011, 1029, -383, -1606, -8381, +-1650, 2852, -958, 1757, -4270, 2160, -9283, 2918, +-3718, -224, 6154, -5671, 3764, -554, 5214, -2526, +-31, 547, 6, 1633, -4562, 1424, 1177, -866, +1648, 653, 6056, -1845, -1271, -350, 596, -2286, +9893, -6594, 1099, 630, -537, 230, 972, -134, +-491, 79, 306, -74, 253, 208, -1804, 73 diff --git a/src/main/resources/vavi/sound/twinvq/cb2232l1.txt b/src/main/resources/vavi/sound/twinvq/cb2232l1.txt new file mode 100644 index 0000000..cc48ec7 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2232l1.txt @@ -0,0 +1,96 @@ +-11397, 378, 12845, -1813, 342, 329, 1165, 550, +556, -115, 755, 117, 2511, 260, -1189, -1406, +-1528, 1866, 3300, -9678, 1025, 10413, 199, 2878, +-3572, 8701, -1895, -1189, -576, -3384, -162, -10866, +3253, -1267, 91, 2277, -86, -3394, 6576, -2475, +-1136, -4295, -1610, -8064, 297, -8908, -4433, -2954, +-82, -11426, -4610, 2063, 1522, -7972, -495, 1799, +2922, -5179, -865, 4739, 11072, 3927, -483, -11111, +-2375, -1432, 1210, -1342, 2418, 1688, 852, -64, +133, -4582, -7136, 10558, -3417, -3162, 2033, 3149, +-3050, 2532, 568, -2444, 4082, -2859, -10350, -4983, +6633, 230, 5954, -1140, -657, -998, 1156, 736, +-8894, 64, 939, -260, -1704, -526, -1330, -869, +-2427, 12377, 1296, -120, -10560, 1794, -9090, 1487, +7162, 519, -382, -3234, -66, 1294, 2363, 1482, +498, -4053, -752, -154, -587, -293, 16533, 65, +-1211, 1666, 291, 2820, 2222, 2, 865, 344, +-1206, -1214, -2162, 8842, 11063, -2093, 1896, -857, +-144, 321, -9548, 4464, 5038, -282, 1160, -194, +823, 3479, -8234, 5834, -320, 7114, -184, -2663, +-11670, 472, -2013, -1282, 4390, 4453, -2126, -2483, +-900, -6262, -2237, -539, -1134, 164, 426, -8969, +-1746, -1960, 8172, -2127, -19948, 657, -712, 344, +-443, 458, -564, 56, 756, -157, 274, -1324, +-3372, 2981, 635, -9454, -4916, 2884, 2316, 8200, +-1452, 2135, 1785, -1054, 82, 5007, -4164, 642, +9241, 5091, 1002, 2467, -8409, -854, -861, -2317, +405, -1810, -793, -7907, 496, -1005, 3373, -1016, +9527, -542, 1672, -9105, 280, 11170, 273, 908, +89, -233, 10850, 870, 436, 1630, 3328, -499, +5091, 1224, 9135, -480, -1134, 2428, -2904, 5077, +2014, 2859, 4277, 7763, 8719, -11474, 1619, 1167, +-3188, -1063, -433, -4291, 2646, 1024, 2008, 317, +746, 327, 6824, 1174, 8978, 5254, -8948, -136, +-2602, -1442, -698, -950, 1800, 296, -1016, 1653, +3771, -9326, 4536, 7033, 4729, 6630, 1042, 167, +11485, 12338, -147, 2834, 611, 1844, -313, 486, +-916, -887, -1423, 642, 242, 75, -1875, -645, +-1239, -2118, 1458, -272, -1703, 949, 778, 21826, +214, -1320, 310, 2680, -1542, -2202, 1072, -132, +-2067, -3593, -8293, -10331, 9030, 402, -2702, 2984, +-12068, 3170, -1098, -1175, -1188, 2998, 1159, -1712, +-904, 236, 42, 823, 548, -546, -1954, 15989, +-2212, 1886, 2300, 2293, 2606, 2905, 2365, -1214, +1592, 1362, -2210, 1674, -1892, 15049, -1012, -2824, +-792, -11447, 11144, 4853, -357, -1230, 748, 1212, +-294, -424, -2720, 78, -2149, 966, 7794, 1645, +138, -709, 464, 3614, -10308, 310, -4726, -3694, +1088, -576, 690, 68, -145, -3282, -9280, -9537, +-1274, 3202, 588, 1790, 1437, 3880, -1803, -1154, +15082, -2388, -1746, -885, 2267, 1813, 1688, -1039, +9775, 350, 3218, 10550, 1048, -3731, -3748, 3517, +-910, -663, -413, -1045, -1236, -248, -132, -1196, +12, 15815, 653, 1429, -371, 4094, -3050, 567, +-5524, -11128, -4261, 1929, -1719, 8236, 686, 1309, +-1057, -715, -2586, 1327, -38, -6180, 3499, -2080, +8980, -1890, 62, -1004, 3308, 5809, -5778, -3865, +-610, 180, -519, 3129, 9000, 1607, 8484, -4056, +4741, -4491, -355, -1324, 1203, -1864, -811, -15995, +-121, 1325, -817, -2170, -5753, 731, -1875, -2286, +-9193, -307, 247, 2469, -1738, -12290, 31, 1028, +670, -66, -1856, 570, -3542, -3401, 144, -320, +-524, 184, -928, -1606, 10978, -3114, -8861, 1467, +1156, 872, 8276, 5655, -695, 2788, 3733, 2155, +-2044, -10260, 1683, 1859, -263, 17966, -19, 1621, +50, -261, -4143, 1245, -22, -1564, 809, 2462, +-8005, 1247, -1471, -763, -1686, -698, 2868, 796, +4036, -3672, 11209, 1102, -9369, -1008, 1273, -906, +-4458, 1642, -3254, 3563, -94, -6267, -604, 8687, +2388, 2214, 1759, -7788, 4296, -7467, 3547, 3248, +845, -7784, -2195, -42, 5327, -1002, -3915, -4581, +-1215, -919, -3444, 5142, -1874, -3020, -2627, 1129, +-4456, 1840, -11472, -914, -6366, 3495, -2775, 484, +-5859, 980, -1967, 1350, 929, 6856, -3952, -3365, +1514, 7423, -675, -2260, 6027, -3072, -6388, -3716, +-2398, 5564, 1447, -86, 1180, -1239, -1372, -435, +-1314, -1978, 942, -2018, 1027, 704, 20417, -94, +-1239, 252, -171, -1100, 1684, 1401, 623, -354, +-2674, -5042, -734, -6631, 7587, 4901, -1596, 6806, +4230, -859, -867, 1266, -3869, -3972, 1548, -4889, +2811, 2263, 2468, 354, -6197, -1278, 1947, 5675, +10612, -1730, 2056, -70, 3034, -583, 879, -3719, +-8623, -1241, 822, 5832, 163, -1075, -784, 398, +1170, -717, -374, 856, -21602, 89, -513, 260, +854, 1152, 762, -601, 523, -107, 1033, 1877, +-1456, 226, -20758, 365, -8943, 1305, 193, 948, +295, 2696, -3165, -1982, -2439, 1067, -12266, -1018, +3400, -178, 1995, 11745, 1833, 9785, 1171, 582, +-1844, 157, -1242, -4080, 864, -1771, -4257, 721, +-4010, 7990, 142, 730, 1976, -6623, 4637, -7394, +-1143, -835, 3341, 1732, -7266, -448, 5379, 290, +1855, 6977, 6637, -6561, -1370, -1767, -2769, -1189, +3872, -4895, -4679, 3906, -1664, 1514, 7908, -7960, +-4147, -1235, -1706, 3314, 144, 1668, -9505, 2268, +4147, 2515, -1451, 6475, 1675, 106, 981, 201, +309, 60, -133, -472, 561, -380, 1130, 91 diff --git a/src/main/resources/vavi/sound/twinvq/cb2232m0.txt b/src/main/resources/vavi/sound/twinvq/cb2232m0.txt new file mode 100644 index 0000000..16f2a3d --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2232m0.txt @@ -0,0 +1,88 @@ +-13394, 14382, -488, -1088, -817, 100, 305, 2267, +2527, -1584, 995, -5781, -3585, -1826, 803, -4108, +-3137, 12111, -211, 838, 4879, -1964, -1728, 13830, +2084, -11535, 664, -2499, -3421, -703, 4528, 968, +1008, -12010, 984, 2658, 422, 1412, 10772, 2216, +-4291, 1329, -2324, 2392, -2029, 12322, 1053, 169, +12635, -902, -62, -670, -3007, -3322, -2948, 1817, +-10688, -1264, 1949, 2734, 1072, -1429, 2085, 10312, +-1685, -4433, -1287, -9620, -1132, 20, 614, 2470, +2821, 5934, 3526, 11292, 50, -12970, -11948, 1114, +1980, -945, -713, -5357, 3766, -447, 969, 2247, +11854, 2148, -12393, 1518, 610, 4527, 1164, 1347, +-1422, 649, 653, 855, -24, 30152, 20, -564, +-2825, -11, -1408, -80, 239, 305, -3163, -854, +568, -18, -4212, -403, 288, -3009, 229, -1152, +16390, -877, -458, 316, -128, -12165, 1088, -828, +-10886, -269, 747, -1026, 1716, -10920, -9204, -3123, +958, -6128, -260, -851, -1524, -2386, -6472, 228, +2667, 3158, -140, 1719, 2330, -2730, 3080, 44, +15743, -2167, -11637, -607, 476, 408, -12505, -1862, +-1892, -440, -3785, -2348, 1229, -338, -438, -797, +29933, -715, 366, -197, 576, -188, 484, 240, +-4844, 1168, -1054, 863, 875, -295, -16091, -1972, +3976, 3833, 3056, -770, 1011, -3098, 165, 3973, +-9367, -18, -299, -11254, 1005, 8644, -14788, -2268, +2644, -8410, 578, 2169, -766, 2764, 2378, 3282, +-2710, 7612, -542, -12062, -2437, -414, -506, -10332, +2732, 839, -2593, 923, 1159, -1057, -7333, -86, +2832, 11328, -1616, -302, 4399, -547, 6107, 9983, +-6901, -85, -544, -4916, 366, 4878, -8662, 7313, +-3056, -1027, 2381, 8906, -7270, 509, -1124, -2512, +-1636, 5830, -5868, 2369, -3236, 12557, -2713, 12793, +-2957, 1688, -852, 4723, -122, -2336, -4698, -1306, +-7399, -2090, -1953, -1505, 3335, -10906, -2598, 1322, +2556, 7210, -1553, 1262, 1878, -10719, 1746, -2736, +1448, 8734, -9602, 828, 1752, -1632, 8037, 2728, +562, -1879, -10572, -544, -2254, -1997, -6384, -87, +-5878, -473, 498, -2960, -5698, -11500, 1815, 2050, +7388, 5230, 2782, 5602, 514, -306, 13022, 523, +-10776, -846, 716, 270, 3350, -6021, 1420, -6175, +-1978, 3967, 11612, 3320, -4100, -2468, 4595, -5338, +65, 3478, 19, 3501, -15896, -1335, -1861, -1944, +3935, 3630, 4627, -5892, -458, 383, -211, -594, +-165, 24865, -656, 2300, -404, 257, 214, -643, +2298, -180, 35, 4974, 834, -998, -1738, 5449, +-9222, -10858, 4188, 9147, -5639, -1691, 990, -1945, +3421, -3527, 9005, -2038, -2369, 5098, 967, 15840, +196, -3204, -1079, -776, 11806, -1352, -2053, 2011, +309, 642, 1541, -1466, -4465, 6679, 5756, 7474, +-58, -1864, 5908, -1576, -30374, -904, -571, -1136, +425, -22, 666, 1150, -734, 82, 1254, -226, +-437, -890, 1464, -3368, 987, -11885, 1127, -7224, +1872, -8198, 8775, -2695, 1457, 15102, -899, -1384, +-1975, 1891, 3128, 1465, -1649, -1363, 1483, 303, +-534, -7, -1710, -1377, 769, 12698, -8987, -802, +4636, 572, 2004, -3513, 442, -9863, 3215, -4550, +2138, -4346, 5682, 11053, 7220, 9842, 797, -1399, +-2679, -5857, -2143, 3241, 2330, 248, -630, 1044, +639, -3432, 125, 22083, 1976, -1003, 813, 552, +-571, 4358, -6200, 3635, 5439, -636, 233, -4856, +-3519, -460, 6956, -4215, 1537, 7895, 13910, -7637, +1392, 1572, 648, 3690, -1988, -2463, -3302, 677, +-924, -535, -6025, 4126, 7178, -4145, 4960, -1860, +-10926, -1470, -9506, -226, -258, 32, -479, 2222, +94, 11358, 3984, -2732, 2111, -590, -2444, -344, +-425, 598, -1382, -1213, -17632, 1566, 1387, -3521, +-57, -1829, 4788, 574, -206, 7962, 9157, 6459, +-1594, -1355, 4874, 1066, 2006, 1793, -7569, 2369, +1108, 1305, -3046, -14052, -1736, -4045, -4328, 7497, +3304, 1518, -5666, -529, 4256, 4667, 932, -1495, +-10414, -414, -2110, -3150, -1250, -8799, -419, 5162, +8497, -8720, -746, -3015, 6403, 3855, 7350, 165, +-59, -958, 5780, 6044, 1736, 3016, 31, 1012, +3422, 7598, -6837, -2092, 2262, 6171, -10362, -2108, +-1352, 1798, -4872, -6369, 2507, 2640, 6074, 1835, +2948, 388, 398, -9295, -5384, -2088, 2096, 742, +3286, 441, 7135, -2112, -9958, -5612, 2479, 5427, +-10114, -674, 308, -1037, 770, 514, 1868, -252, +-11901, -984, 670, 2506, 5396, -1047, 9113, -10865, +4872, 1720, 2226, 947, -2336, 2649, 173, -1464, +-2874, 4463, -1270, 3429, 6242, -5380, -7772, -4550, +-8451, 2045, -2855, 5336, -15066, -418, -4886, -648, +3736, 945, -956, -4825, -116, 130, 1889, 9642, +3790, -4371, 7180, -1556, 6562, -2207, -7910, 506, +-21594, 662, -338, -943, -1022, 6453, 301, -464, +-457, 840, 3313, 10946, -294, 8156, 138, -1425, +2397, -792, 6468, 4615, -511, 15938, 494, 274, +-5976, -660, 3894, -2140, 1424, 2003, 4101, 2823 diff --git a/src/main/resources/vavi/sound/twinvq/cb2232m1.txt b/src/main/resources/vavi/sound/twinvq/cb2232m1.txt new file mode 100644 index 0000000..6ab251e --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2232m1.txt @@ -0,0 +1,88 @@ +20456, -1952, -1581, 869, 628, 76, 1404, 4060, +508, -3177, -946, -2992, 2422, 1139, -1931, -240, +1011, 365, -1106, 20973, -1438, 372, 137, -1058, +1171, -1252, 2794, 1434, 1814, 482, 3948, -2704, +20422, -241, 441, -1121, 499, 1036, -918, 9708, +-3166, -488, -10379, -3201, -5254, -1871, 5665, -12622, +-7591, 127, 1469, -2267, 1813, -4197, 2065, -602, +-395, -652, 333, -19114, -1092, 4310, 1590, 1688, +-1453, 177, 4402, 1168, 5972, -1295, -3258, 1542, +-4832, 3377, -5545, -3622, -4944, 2064, -2846, 8118, +-845, -6778, -3640, 5729, -907, -11007, -5, 2634, +-11118, 2108, 144, 13299, 251, 336, 563, -75, +3004, 169, -3892, 1477, 1066, -1571, -1113, -1088, +517, 465, -21841, -1541, -1094, 1841, -9213, -17478, +1662, 8, 1192, 1174, 1014, -5659, -695, 316, +-5161, 1803, -1056, -2369, -2919, 2941, -9712, 1975, +426, 11214, 2288, 6186, -7348, -3062, 3341, 3252, +-4102, -346, -876, -7088, -3330, 4507, 310, -1632, +299, -2636, -2740, -752, 10159, -7201, -9568, 3134, +-4002, -41, 2479, -1816, -14099, 3575, 1161, 6427, +-2466, 390, -1883, -6265, -1266, -263, 1474, -592, +-21234, 94, 4187, 1, 3227, -3273, 1950, 406, +543, 1661, -2648, -9252, -2048, -5987, -722, 4932, +-4410, 12504, -1572, 2244, 5610, 307, -9710, -3642, +-6436, 4368, 2956, -2269, -6196, 4069, -766, -3695, +3416, -5786, -9668, 11677, 1208, -965, 1516, 1132, +1018, -6168, 1970, -10357, 1379, -725, -8789, 3730, +-65, -4758, -1818, -1050, 9641, 4519, 2886, 2667, +6348, 2436, -438, 1978, -9374, -1286, 3893, -2073, +-11199, -2081, 3345, -3444, -9480, 2410, 1986, -1869, +3252, 5949, -2119, -401, -214, 3416, -1067, 18510, +-2986, 3510, 508, -357, -837, -1205, 2884, 11587, +11565, -555, -2664, -873, 3642, -2068, 1734, -4408, +330, -181, -1358, 1407, -9739, 809, -10203, -2066, +3440, -2063, 3238, 3734, 1671, 750, 6890, 4068, +1238, 493, -1330, 76, 8918, 10855, 85, 12236, +3570, -1074, 3008, -9424, -3186, 1271, -380, -157, +-4974, 10575, -1378, -219, 1354, -1589, 10936, 2268, +-3787, -1040, 7567, 924, 10490, -806, -1318, -1576, +-209, 93, -3745, -3820, 439, -9828, -6265, -864, +31342, 35, 1332, 443, -590, 846, 104, 868, +-863, 1526, -1088, 11494, -7055, 3564, 109, -3072, +-2234, -4530, 1866, -3425, 9940, 3158, -1821, -680, +-1124, 2884, 1191, -61, -9698, 7596, -558, -9019, +-1181, 208, -1342, -68, -312, 294, -1468, 1410, +39, -21081, 724, -2137, 935, -8, -10297, 3509, +-6510, -6558, -6906, -1905, 1915, 5920, -8983, 3416, +7300, -1372, -1422, 1822, -10433, -2530, 1669, 554, +-3008, -3351, -922, 8279, -5184, 5520, 4785, 683, +-506, -4558, 1938, 8442, -12639, -54, -2907, -820, +10004, 1780, 485, 1401, -3786, 786, -5937, 2632, +-1540, 972, -3342, 2294, 8076, -1006, 11731, -1825, +3036, 1085, 1160, -9680, 11111, 7838, -2504, -2112, +2376, 2534, 3624, 555, 3610, -520, -831, -15, +-498, 167, 711, -22685, -999, -1466, -1643, -394, +5404, -4247, -2307, 4052, -1156, -1240, -490, -1598, +-4365, -8382, 10493, 464, -16592, 3723, -7709, -821, +-4218, -922, 398, 5635, 2184, 5090, -7144, 2420, +792, -324, -1278, 3172, 13101, 1608, -3996, -2219, +2995, -6924, 816, -2482, -406, 3458, 503, -8154, +3460, 2542, -3703, 8524, -61, -430, 23212, 1203, +2335, 5556, -476, 923, -565, 593, -1611, 1814, +-1614, -7067, -1957, 10166, -4306, -421, -4026, 1854, +-9881, 667, 7720, -2906, 7003, -1823, 6344, -8614, +-2965, -2720, -62, -802, 1945, 4574, -4604, -8341, +518, -3543, 95, -4262, -5220, -133, 10270, 1999, +3234, 8900, -4866, -3708, -4465, 4542, 2545, 1770, +6995, 3559, 1133, -1152, 14680, 1002, 634, -12913, +1686, -1645, -1796, -50, 112, -1108, 1070, 686, +1068, 1555, 896, 3498, 10458, -32, 12017, -737, +650, -432, 404, 170, 10873, 1864, -1718, 11061, +-1556, -3766, 225, 6999, 1730, -6919, -1895, -2919, +8250, 10050, -4631, -1488, -4801, -1504, -2736, -110, +-3630, -2752, -11162, 1128, -2580, 11692, -678, 1338, +2175, -6030, 616, 1651, -7034, -3057, 2420, 1998, +4383, -1721, -10762, -428, 2902, -906, -4298, 2141, +-1242, 5464, -607, 5389, -8946, -3890, 10884, 1544, +628, -1969, 13902, -1570, -1080, -689, -4676, -3642, +753, -11351, -110, -744, 4286, 1163, 3105, 9752, +11143, 4296, -1698, 1012, 2284, -989, -958, -9481, +738, 24, 426, 1638, 3898, 8885, 2938, -8826, +2982, -1679, 8466, -651, 5144, 2736, 751, -84, +7710, 3077, 2885, 146, -1102, -2569, -2039, 11059, +-9950, -1048, -1031, -33, -5118, -1096, -1986, 2306, +2400, 9320, 6188, 500, 2090, 61, -11357, 118, +1505, 1032, -1920, -164, -9744, -4670, -11029, -102, +-960, -1023, -2570, 4102, -3989, -11478, 772, -1515, +-1102, -2194, 1722, -1195, -8144, 746, -9534, 3250 diff --git a/src/main/resources/vavi/sound/twinvq/cb2232s0.txt b/src/main/resources/vavi/sound/twinvq/cb2232s0.txt new file mode 100644 index 0000000..ffa3d29 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2232s0.txt @@ -0,0 +1,88 @@ +-26218, 1606, -390, -696, 266, -947, 561, -1526, +-8, 1080, -187, 5671, 2249, -30, -4129, -768, +-10908, 3826, -10422, -144, -1259, -1372, -3553, 1287, +-5151, 6442, -5101, 1386, 791, -1593, 12942, -764, +424, -6212, 9733, 702, -9721, 524, -4818, -1232, +6, -484, -818, 955, 6425, 3594, 5156, -286, +1514, 4466, -1756, 11321, -679, -1481, -477, -8015, +-3059, 4476, 679, -1143, 2877, 2581, 3230, 239, +12018, -1597, 13431, 11852, 260, 3306, -714, 1299, +-4375, -778, 170, -565, -3510, -6632, 3354, 5901, +-1070, -5912, -3430, -4970, -4712, 2648, -9113, 1561, +1002, -5659, -3177, 638, 2289, -1050, 12310, -10364, +2830, -961, -194, -6442, 2206, 3454, -2087, 4327, +1080, 10257, 8107, 4904, -3141, -2339, 7568, -363, +3765, 7960, 7067, 1496, -3842, 1805, 2415, 913, +-1641, -5411, -7583, 4597, -1324, 2882, 11310, -2570, +-2877, 3544, 4642, -2249, 7110, -307, -3413, -2871, +-8974, -6358, -5703, 4046, 83, 1887, -3476, -4346, +-2995, -346, -46, 22143, -576, 2597, 696, 1520, +140, 2937, -3356, -988, 4090, -1246, -3347, 1387, +2264, 1282, 7040, -806, -12810, -1105, 32767, -4266, +108, -1998, -680, -1279, -467, -110, 462, 768, +1678, 1408, -1888, -1115, 9430, 5852, -3578, 5367, +-1096, -4310, -9588, 4350, 6048, 2516, 3214, 4468, +-276, 15175, -848, -2875, -314, -6002, -11743, 448, +9238, -3026, -3934, 2840, -2070, 1850, 444, 511, +-542, -7382, 6002, -14447, -1498, 176, 812, -2632, +-2291, -3312, 3953, 370, -2154, 1678, -1186, -6382, +1544, 3534, -3767, -7459, 7265, -3272, 10669, -1677, +-7046, -1679, -132, 2108, -1948, -2938, -5393, -6222, +-11293, 2066, 981, -731, 1869, -2211, 3558, -21513, +-678, -493, -2087, 245, 635, -2011, -3316, 13445, +2089, -10186, 1114, -1241, 2121, -2305, 3316, -1282, +2733, 318, 3534, 4844, -1439, 8932, -7649, -556, +-7519, -3442, 5068, -3546, 8586, -8425, 7146, -683, +665, 3052, -2581, 248, -8320, 2270, 7045, -800, +5890, 2187, -251, -2552, -3867, 3665, -1643, -11757, +-5542, 1806, 3669, -508, -3436, 600, 10412, -5426, +1680, -4545, 11536, -1859, -5446, -4594, -4300, -1173, +282, 2100, -2556, 9486, -7325, -7252, -3155, -775, +-13674, 4272, 3066, 9352, 1647, 1136, 794, -520, +-654, 1539, -2244, 3155, -12039, 731, 3379, -1904, +6866, 9669, -2384, 2099, -2426, 1633, -3358, -5662, +2164, 10679, -5330, 7066, 5826, -187, -4840, -1174, +-3694, 976, -2548, 2292, -3517, -1007, -4041, 684, +-14986, -4789, -4135, -4376, -10678, -1482, -10466, 3575, +-1960, 3185, 1198, -196, -892, -5424, 4802, 13608, +-7772, 3952, 4404, -52, 1097, 3182, -2699, 900, +-1258, -8055, -3102, 784, -2574, 1556, 1060, -5417, +537, 11991, -650, -487, -10250, 6766, -3716, 1062, +2525, 1039, -3002, 5742, -502, -4583, -144, -144, +-5896, -978, 1786, -1420, 1944, -130, -5202, -1578, +7821, -11675, 9980, 5065, 5942, -362, 16344, -801, +1932, 1242, -10, 791, -170, -2468, -479, 3297, +4328, 11473, -1549, -12316, 209, 1739, 1875, 1305, +-4310, -13049, -4913, 9208, -966, 2570, -138, 890, +1373, -1324, -965, 8563, -7560, 490, -1392, 5695, +-5656, 5431, 3974, -1131, -1246, -1334, -3859, -3150, +-12976, -6929, 665, 9393, 490, 2212, 18, 542, +229, -3925, 1836, 4223, 5268, 1200, 471, 20, +-9914, -5774, 8362, 5929, -7087, 2005, 15624, 1626, +5419, -1492, -1536, -417, 1957, 2585, -404, -1125, +2296, 596, 836, -356, 745, -2810, 2879, -2354, +-21682, -108, 726, -862, 593, -42, 266, -1356, +-2119, 19613, 814, 2462, -2940, 222, 3595, 5634, +-807, 1219, 2446, 5666, -1839, 7092, -10581, -5136, +-2408, 5726, -1116, -2348, -6318, 8991, 6750, -5321, +-7344, -2194, -5544, 1705, 12500, 9069, -1966, -4914, +2225, 3537, -1485, -5141, 434, -1620, -5383, -710, +-5443, 3930, 7082, 667, -3289, -3202, -2097, 1970, +-11647, -2927, -2098, -1345, 3449, -2075, 262, -756, +1829, -271, -1292, 1079, -5746, -344, 3660, -4456, +3593, -7652, -1367, -828, -2290, 1063, 4234, -17596, +-911, -6068, 1040, -2956, 2704, 1763, 974, 3132, +697, 1267, 240, -5520, -12368, 10830, -633, -5939, +2307, 1868, -2216, -1261, 597, -6302, -5145, 3550, +7519, -6963, 3752, 876, -1912, 30, -9192, 1075, +-4632, 9108, 1139, 911, 9290, 1268, -1006, -1718, +-6668, 3294, -1510, 6527, 456, -1400, 11424, -4168, +-3940, 4738, -4863, 2990, 3202, -441, -4744, 4623, +-4351, 3997, -11016, -737, 136, 7978, -3801, 4170, +3602, -2217, 849, -2552, -22232, 323, 193, -4, +-1030, 590, 1625, 3208, -10595, 2624, -741, 13121, +-1044, 1601, 5175, 2199, -3833, 1804, -2314, 793, +-11486, -655, -3320, -2975, 4065, -3124, -706, -7264, +-1038, -3082, -5503, -7147, 8367, 1205, -1092, -1694, +-1078, 11584, 8, -1237, -2077, 9732, 4963, 2780, +674, 581, 8226, -1231, -9252, 644, -3284, -744 diff --git a/src/main/resources/vavi/sound/twinvq/cb2232s1.txt b/src/main/resources/vavi/sound/twinvq/cb2232s1.txt new file mode 100644 index 0000000..9bf8dfd --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb2232s1.txt @@ -0,0 +1,88 @@ +32767, -45, 422, -1139, -1052, -2085, -695, -612, +1451, -288, 58, -878, 53, 2912, -1891, -7148, +1893, 3028, 165, 963, 2260, -7904, 5857, -18824, +-2617, -1030, -872, 1500, 1118, -745, 143, -436, +1239, -3840, 1785, -2506, 20237, -1026, -1556, -1371, +-660, -1185, 939, 1315, -3658, -5428, 587, -4105, +1596, 12612, 5781, 1172, -3490, -1182, -333, 6258, +-2594, 2144, -4830, -190, 1972, 2687, 1327, -987, +-15046, 4659, -71, 6890, 1588, -4787, 4318, -3704, +496, -5601, 1954, -1250, -3389, -5156, 9238, 2298, +-4945, 183, -2036, 114, 12250, -2330, 71, -3395, +-1402, 3668, 531, 10915, 1162, 7738, 9089, -1250, +1500, 6357, 1155, -5094, -2641, 1657, 470, 2022, +535, -306, -18031, -903, 2913, -5486, 1769, -1419, +9082, 2149, 3516, 6960, 833, 1123, 1266, 1672, +-690, 9634, -2986, -4675, 1006, -2205, -2919, -3205, +-2759, 107, -931, -9694, 2340, -862, -2782, -3636, +-9414, 9564, 1057, 8664, 1326, 3928, 1452, -4692, +-3437, 8610, -10466, -6638, -2879, 3408, 861, -3057, +-823, 164, 3153, -3698, -15693, -886, 1456, 3278, +-6160, -57, 1110, 22, -2985, 7299, -1082, -7921, +-12212, 480, -7645, -211, 1586, 3874, 3242, -883, +6730, -1597, -506, 3744, 7552, -7607, -65, -1442, +266, 10012, 1594, -2628, 6988, -1049, -516, -691, +672, 4913, 1788, 14973, 342, 962, 7212, 1124, +500, 1135, -311, 3886, 12548, 5432, 6219, 3341, +-122, 5636, 6871, -10831, 4010, -10084, 1456, 5216, +-1013, 1102, 4164, -1490, -5186, -242, -4498, 3322, +3584, -2176, 5704, 515, -11556, 1446, 4303, -3928, +-4227, -7268, 6069, -11330, 822, -2054, -3035, -2516, +-1816, -3796, 8408, 8849, -3030, -8201, 1149, 7388, +1036, 2586, 5618, -2274, -5037, -1497, 384, 1454, +8154, 1672, -2409, 3347, 13258, -979, 513, 7826, +2662, 1818, 5537, -1104, 2645, -10632, -8767, -5667, +-1029, 806, -9040, -4684, 792, -5008, -5807, -3924, +964, 313, -2521, 1106, -5728, 13534, -8078, 4216, +-1388, -2588, 986, -14536, -1410, 3461, 1360, -1348, +-104, 1493, -2858, -2860, 2045, 18330, 4814, -3628, +-705, -3228, -660, -2664, 2616, 4548, 3753, 1574, +-1319, -1110, 556, 3304, -2803, 13052, 4592, 2922, +13667, -2322, -3056, -2717, 174, -4222, -4296, -7695, +1366, 1786, 1041, -110, -1997, 4102, -1855, -900, +203, 1311, 3412, 4107, 22609, -4112, 427, -2488, +257, -1267, -1277, -6430, -7193, 10667, 4495, -4317, +6846, 13213, 7335, -972, -3137, 335, -609, 3131, +2406, -3762, 2151, -5188, -7675, 2068, -2027, 3722, +-773, -3276, 1539, -7886, 1005, 13693, 4601, -8386, +-508, 5662, -4889, 93, -10603, 4051, -2, 1094, +-4897, -2274, -2377, 2228, -5507, -464, -3455, -227, +9433, 8093, -2245, 3701, -1047, -6827, 2037, 1926, +-3610, -15420, -581, -6127, -2075, 2501, -2216, 5385, +-2297, -2660, 1563, 3244, 1418, -2012, 2964, 12235, +-8595, 2728, -3541, -6511, 11038, 11326, -183, -1102, +1038, 1224, 20, 1441, -349, 1240, -7737, -930, +1411, 6945, 4130, -13544, -2625, 3550, 3149, -730, +7658, 3098, 673, -2259, 2556, 1543, 1478, -951, +-8128, 4951, 11919, 4588, -8448, 784, -11498, -1908, +2578, 2936, -7496, -5834, 1987, 3407, -4133, -4924, +-1348, -1300, 916, 899, 20257, 2027, 1450, 4388, +-3748, 3846, 2187, -1158, 4720, -3613, 5312, 4055, +448, -6383, -8794, -2232, 1920, 834, 27087, -754, +90, 1410, -985, -1381, -61, 650, 1080, 7035, +-2772, -1233, 13410, 4494, -472, -2896, -5083, -2217, +-5778, 437, -6853, 4996, 3442, 6092, -6497, -3871, +4024, -898, -73, -3067, -2793, 5640, 6076, -2454, +3598, -277, 1672, -6858, 2419, 9753, 6292, 8835, +-9909, -4724, -618, 7266, -416, 1965, -4968, 2421, +1155, 3815, -116, -3725, 7872, -4901, 2383, 1612, +-2186, -2302, 2791, -2226, 1144, -13379, -6602, -806, +7099, -2098, 4194, -2128, 8663, -4275, 452, -135, +-6053, 1280, 12815, 3278, 8452, 4479, -1648, 1453, +1407, -966, -1016, 3173, -7333, -4552, -13176, -1744, +577, -1572, 611, 1202, -146, -5773, 3012, -3016, +-1581, 3162, 3818, -1970, 6195, 1946, -9656, 2861, +-7875, 3133, -7840, 10951, -1684, -306, -227, 9776, +-82, 1736, 1180, 3457, -2874, 5365, -7428, 7604, +2623, -2998, -2270, 10410, 1252, -2725, -4433, 1758, +-5225, 6522, 6698, 712, 4694, -2392, 240, 423, +-3030, -12708, -3136, -5176, 480, -1624, -12900, 7537, +4371, 1186, -1828, -757, -1850, -974, -3755, 1415, +-6302, 2642, -3823, -1570, -8090, 8251, 1945, -9213, +1147, 4128, -4301, 806, -1745, 704, -2496, 1375, +-802, 9, -808, -252, -5453, 3857, 10353, -536, +1875, -2896, -10792, 3358, 1063, -890, 7200, 3660, +406, 2840, -6973, -4469, 4638, -8091, 2772, -8035, +1728, -5315, 7234, -2718, 3707, -1226, -11858, -2397, +772, 3285, -4089, -1400, 1113, -16680, 1885, -435, +-959, 242, -817, 259, -2010, -1857, -557, -914 diff --git a/src/main/resources/vavi/sound/twinvq/cb4440l0.txt b/src/main/resources/vavi/sound/twinvq/cb4440l0.txt new file mode 100644 index 0000000..564e0b8 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4440l0.txt @@ -0,0 +1,136 @@ +-14497, -1982, 631, -984, -2115, -3252, 2755, 2017, +-2110, -8864, -792, -1291, -2761, -2365, 698, 1047, +972, -14703, 10590, -3945, 663, 972, 1204, -2801, +1295, -1296, 50, 1448, 888, -1879, 122, 78, +-183, -588, 16202, -388, -2240, 1136, 1266, -6445, +2619, -1664, -6329, -2700, 1557, -497, 598, -110, +1298, -334, 191, 29897, 387, 419, 76, 152, +533, 78, 112, 101, 158, 136, -236, 88, +43, 107, 84, 21, -6385, -1711, 1757, 1411, +9152, -72, 1428, -1098, 10328, -506, -360, 285, +-36, -2816, 819, 88, 176, -481, -172, 2067, +3268, 5479, 8605, 11272, -1880, 361, 1582, -4973, +-1379, 3835, 74, -3, 493, -431, 1390, 101, +-550, 59, 476, -469, -583, 568, 732, -1015, +-1104, -698, 23922, 1130, -1268, 280, 204, -59, +-9789, -317, 935, 2944, -10402, -2564, -4648, 1506, +3834, -1002, 2805, -158, -409, 814, -150, -97, +-3573, -1550, 1356, 5350, -365, -2622, -3454, 310, +1194, 911, -10928, 937, 7980, -5286, -554, 1999, +-1263, -562, 10, -321, 744, 44, 64, -274, +-30136, 340, -1051, 756, -30, -6, -269, -273, +12, 95, 1565, -13194, -11810, -485, -1574, 414, +-240, -452, 564, 740, -476, 959, 1079, -1568, +-422, 37, -154, 10117, -68, 1412, 11862, -3420, +4169, 5178, 527, -1027, -1030, -1985, 448, -716, +1696, 1942, -254, 308, 1100, -790, 8102, 6630, +3653, -1018, -587, -6990, -19, 1671, 1425, 8089, +3708, -1182, 774, 659, 113, 437, 50, 835, +-532, -11209, 1682, -7490, -2592, 1234, -4689, -7301, +-143, 3361, 1121, 177, -473, 513, 136, 965, +-4020, 4639, -1212, 1271, 2905, -6865, 10499, -3800, +-3354, -5029, -3606, -950, 4490, 526, 1006, 2, +1760, 5819, -55, -1098, -1843, 348, -2062, -9196, +3712, -11466, -3218, -858, 2720, 589, 320, 861, +59, 5357, 564, -380, 538, -142, 490, 212, +1716, 670, 1904, -181, 2979, 943, 16916, 1271, +988, -802, -1490, 9154, 643, 1725, 1347, -2827, +-4096, 485, -7091, -3180, -4747, -1604, 1576, -5724, +6104, -139, 1726, 11715, 360, 7519, 2513, 5192, +-2208, -1993, 829, -387, -5724, 4418, 116, -2955, +-226, 249, 377, 2149, -2929, 5021, -3064, 800, +-1459, 11384, 8556, 1740, 368, -2839, -2049, 1438, +-1357, 4084, 1896, -528, 1621, -1760, 13741, 302, +-1018, -9774, -3521, 1302, 1374, 1139, 918, -1724, +-764, 858, 804, -1772, 372, -322, -526, 11924, +-11944, 4012, 1749, 1737, -1545, 68, 889, 280, +690, -2200, 1068, -484, -171, 455, -44, -3178, +2243, -590, 749, -792, -19876, 198, 236, 2695, +-3413, 652, 284, -820, -1134, -199, -112, -5650, +-418, 1047, 1090, 2260, -3297, -2164, 13524, 1720, +-326, 910, -1706, 3912, -1175, 1687, -2152, 50, +35, 1718, 721, 9316, -2256, -4330, 6961, 4432, +-8043, 45, 1370, 3472, 2892, -3224, 1368, 1355, +-562, -694, 746, 198, 1188, 2819, 3131, -2371, +6438, 847, 2111, -10187, -3451, -9826, -3502, 655, +649, 1460, 270, 118, 45, 192, 188, -1139, +-258, 663, -84, -27519, -765, -905, 357, -4, +89, -372, -24, 178, 1127, 209, 1177, -2762, +-587, 1488, 8989, 3217, -2550, 215, 9540, -7196, +1259, -3716, 2767, -261, -216, 872, -3008, -2076, +8682, 709, 3629, 87, -3114, -10624, 246, -1670, +-1738, 1229, 7624, -1120, 784, 305, 233, -185, +280, -1466, -268, 198, 499, 308, -2187, -1149, +-388, -38, -338, -1084, -19424, 40, 1958, -2240, +-86, 264, -9876, -1287, 4086, 3742, 2502, -10078, +4574, -1493, 1078, 3218, 2410, -364, 1049, 2638, +35, -1295, 200, -2847, 10818, -12064, 2375, 348, +-353, 2788, -821, -3196, -511, 146, 2015, 235, +-1094, 2622, 2688, -79, 5176, -884, -11814, 794, +2696, -6704, 3452, 1295, 3872, 2924, 4498, -166, +-598, -1213, 891, 5478, -266, -777, -5, -776, +1003, -1837, -156, 17910, 453, -297, -1545, 857, +-288, -308, -6373, 2045, -1846, 3007, -2236, -1904, +815, -2889, 4200, 8320, 9872, -614, -834, 3856, +414, -234, 1559, -7451, 3641, -1230, 837, -127, +2652, 411, -532, -12548, -1692, 1034, -2418, -968, +558, -1564, -1952, 307, -1064, -6776, 1588, -2636, +949, 8272, -12, -3468, 3481, 6588, 2580, 7393, +272, 1528, 1818, -2206, -349, -396, -11704, 1487, +9753, -4665, -24, 2084, -780, 5036, -647, 3668, +561, 1099, -1094, 534, 1270, -99, 1006, -476, +-528, 12481, 1589, 1593, -1682, 7022, 2664, 8702, +-563, 1082, -206, 87, -1978, -144, 228, 1232, +889, 14340, 65, -1061, 10510, -95, 649, 53, +-962, -383, 2479, 1322, -1798, 2840, -492, -419, +90, -680, 79, 1026, -20912, 1593, -742, 1086, +516, 699, 2393, -64, -2010, 46, -859, 111, +-440, 14281, 272, 797, -10141, -3734, 3126, -3050, +1300, 73, -1754, -1278, 1890, -2710, 704, 1160, +1, 269, -24, -622, 124, 138, -522, -510, +95, -402, -27306, -470, -214, -159, 396, -201, +-372, 122, 136, -1005, 744, 1949, -810, -2648, +-726, -384, 955, 1232, 1354, -345, -19485, 1056, +-193, 1257, -263, 398, -752, 602, 98, 793, +17, 20186, -189, -2615, -174, 166, 436, 411, +-1046, 374, -471, -253, 233, 8352, 1342, -1279, +9305, 2190, -3239, -5262, -3454, 1844, 684, 303, +-4434, -6041, -3495, -2482, 389, 353, 159, -14, +-29179, -511, -158, 92, -401, -36, -297, 447, +-605, 269, 85, 212, 8, -118, -130, 207, +13150, -8712, 2504, 1355, -3268, 1396, -4748, -2200, +-1560, 228, -162, 1179, 3024, 742, -860, 69, +10, 30006, -538, -489, -125, -214, 364, -682, +-283, 532, -134, 227, -448, -20, -266, 70, +2, 9310, 14858, 856, -493, -3357, 36, -248, +214, 281, -73, 3268, 745, -245, -1007, 146, +392, 36, 8042, 2953, -6603, -7697, 4425, -2498, +571, -2194, 3388, -794, -561, -2763, 1912, -3030, +225, 214, -27, 834, -10661, 437, -506, -535, +8397, 1332, -2406, -8868, -2972, 1385, 296, 865, +2318, 890, 244, -121, 226, 375, 896, -10381, +-2266, -3404, 983, 1255, 259, 11427, 455, -3041, +307, -2446, 476, 723, 18, -10224, 510, 552, +-654, -876, -465, 628, -12572, 786, -393, -4162, +938, -1327, -1695, -608, -1352, -131, -880, 830, +1016, 21875, -408, -1560, -500, -1682, 453, -930, +1316, -136, 434, -683, 412, 202, 233, 382, +-2002, -9267, -1034, 8710, 434, -8121, 3035, -3121, +1792, 2712, -1537, -1082, 854, 1337, -1084, 91, +-4485, 2545, -4412, -1930, -12234, -4802, 4641, 437, +-928, 2163, -3154, 521, -665, -1200, 2654, 931, +-388, -118, -1144, 133, 5089, -1194, -1528, -967, +-795, 188, 1918, 897, -7046, -7617, 7118, 5755, +-2724, -7894, -472, -360, -591, 990, -3032, 7742, +726, 5490, 9383, 479, -3032, -1904, 7158, 4706, +2442, -1576, -58, -156, -3977, -2696, 4195, -166, +3342, -1566, 3767, -4159, -5750, 5505, -7663, 4516, +-4073, -2612, 5136, -290, -666, 1282, 776, -566, +-602, -310, 1003, -648, 2928, -3159, 427, -1168, +-2702, -16990, -205, -343, -1196, -1980, 1653, -512, +-1820, -418, -3368, 3522, -1966, 4964, -5728, -5185, +-210, -1721, 10131, -7060, 3351, 334, -96, -3193, +-1713, -614, -2633, 147, -1552, -2363, -3724, -1731, +-7350, 5453, -2732, -2867, 12458, 416, 0, 4414, +833, 590, 1617, 405, 73, 868, 232, 195, +15, -196, -782, 749, -955, -84, 1176, -553 diff --git a/src/main/resources/vavi/sound/twinvq/cb4440l1.txt b/src/main/resources/vavi/sound/twinvq/cb4440l1.txt new file mode 100644 index 0000000..c116885 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4440l1.txt @@ -0,0 +1,136 @@ +-12227, -3413, 12848, -1336, 20, 894, 254, -1001, +-1381, -406, -1157, -458, 300, -395, 825, -34, +74, 382, -1018, -10266, 1338, 11091, 544, 797, +-4304, 1389, -747, 1924, -257, 2615, -37, -4375, +782, 158, -378, 19, 652, -539, 1012, -4211, +1263, -925, 96, -9226, 5921, -8209, -71, -1838, +-2201, -7441, -60, 393, -5626, -264, -1002, 85, +1989, -1616, -216, -914, 9907, 8044, -578, -7830, +-1705, -3624, 2430, 59, 5813, 870, -317, -2545, +-4020, -1330, 1215, 9352, 5425, 324, -4803, -681, +-506, -4710, -6574, -4184, 65, 729, -1310, -1387, +1385, 2364, 1672, 2493, -438, -1367, -907, 38, +-20220, -1644, 512, -413, 348, -112, -532, 785, +1332, 7140, -1916, -1766, -11570, 1811, -9167, -76, +-1531, -175, -1739, -771, 2014, 519, 15, 576, +8736, -979, -28, 1830, 329, -302, 12206, -1501, +5195, -305, 1456, -581, 1488, 142, 235, -157, +192, 1540, -922, 11056, 11823, -2964, -1488, 1712, +-2018, -880, -3282, -190, -198, 2436, -248, 222, +22, 863, 1504, 2078, -2047, 216, -1270, -732, +-18252, 1186, 3178, -730, 432, 934, 1617, 873, +-491, -70, -768, 679, 1398, 537, -364, 172, +-541, -94, -24, -129, -26725, 201, -554, -357, +-71, 60, 96, -1665, 1425, 1244, 332, -1068, +326, 834, -620, -1473, 1585, 1432, 928, 18782, +-1388, 2897, 448, 40, 1323, 1433, 787, 215, +3297, 2586, -856, 451, -17700, 735, -43, 405, +-1252, 744, 1012, 677, 312, 206, -279, -432, +6677, -87, -72, -10400, -106, 11224, 1152, -422, +2024, 704, 2462, -1197, 232, -119, 4, -879, +1600, -708, 3496, 279, -143, -1096, -555, 4594, +1486, 161, 942, 2018, 2474, -16010, -380, -193, +-11415, 457, -276, -11220, -1604, -38, 813, -4044, +1888, -4265, 1647, -882, 981, -734, -110, 140, +-3050, 1248, -549, -1167, -967, 3586, 688, -1380, +424, -17959, 2022, 2274, -44, -1406, -432, 1335, +-659, 9555, -3581, 11045, 1870, 806, 599, -2065, +156, -4420, 16, 2349, -609, -3058, -738, -60, +-548, -119, -49, 26, 1528, -1842, 6306, 14078, +-692, 5480, 321, 1996, 1376, -3086, 490, -54, +1151, 932, 445, -9887, 15808, 3085, 866, -2020, +-1785, 2126, -920, 414, -290, 138, 244, 994, +-702, 1410, 330, 202, 675, -389, -241, 31306, +380, 300, -53, 804, -109, 413, -44, 6, +14, 486, -293, -112, 26, 11632, -836, -3948, +-518, -1364, 11360, 3558, -588, -2084, 490, 381, +-955, 2207, -2953, 1115, -265, 2, 65, 464, +-180, -111, -174, -152, -30508, 121, -207, -835, +1126, -185, 91, -96, 222, -99, -93, -10138, +-430, -184, -372, -194, 953, -100, 382, -1422, +13931, -1835, -1657, 821, 408, 808, -601, -463, +7142, 5596, 3171, 2174, 2740, -11350, 1019, 1449, +-386, 1642, 3703, 4271, 1664, 2232, -674, 983, +551, 8543, 154, -383, -2419, 1117, -520, -10966, +-4406, -3742, -79, -909, 1813, 5043, 412, 1099, +1434, 173, 788, -92, -1004, 1288, -87, 931, +10241, -855, 6, -405, 2580, 11455, 1150, -1916, +3614, -262, 292, 897, 9673, -381, 1711, -2713, +-1111, 282, -2180, -2282, -2266, -724, -849, -11787, +888, 3120, -1459, 495, -10812, -792, -274, -984, +-12223, -737, -2394, -299, -578, -2758, 1521, 774, +1938, 857, -1935, 217, 654, 1452, -3695, 6734, +804, 134, 946, -2156, 9495, -600, -1962, -5252, +-246, 1269, 8492, 1261, -2205, -106, -1314, 828, +1013, -12059, 663, 436, -2648, 9863, -630, -2961, +3004, 1015, -3153, -1475, -25, 399, -846, 430, +-1237, -156, -187, 1115, -502, -363, 386, -2820, +942, -926, 727, 1130, -20388, -274, 1140, 198, +199, 2548, 442, 157, -1546, 3693, 892, 460, +6552, 4858, -2560, -8673, 1930, -8913, 3427, 686, +61, -8830, -358, 1338, -74, 1180, 2871, -3822, +104, 2414, -1742, 11425, -4522, 393, -3016, 972, +34, 117, -16113, -6900, -6964, 1726, -843, -242, +-2141, 803, -1093, 442, 1776, 2429, -1000, 489, +393, 635, 389, 1126, 12285, -1648, -11396, -2885, +-56, 3840, -174, 3177, -1708, 1189, 1914, 1514, +-189, -88, 276, -240, -120, -2929, 9823, 678, +568, 26, 10080, -2575, -806, -64, 6406, -82, +-1171, 2169, -1804, -667, -37, 54, 4208, 10829, +11920, -468, 1916, -809, -370, 144, 3616, -263, +-4352, -124, 300, -246, -440, -115, 447, -407, +20869, -340, 54, -764, -807, -699, -283, 727, +-922, 1098, 577, -6, -809, -50, -115, -75, +280, 156, 182, 225, -30432, -212, -417, -245, +177, 94, 4, -627, 167, 47, 152, 148, +1325, -2436, -10063, -696, -9966, 1032, -1024, -3702, +3933, 400, 333, 692, -3858, 2599, -1215, -389, +393, -666, 2135, 10280, -2443, 1972, 410, -392, +590, 12322, -523, 1141, 52, -1468, 819, -213, +162, 116, -614, -10630, -204, -1247, 535, 199, +-6058, 2538, 1644, -11539, -1562, 1462, -1493, -218, +-296, -605, 321, 607, -366, -257, -837, 4536, +-11683, 1266, -3805, 4496, 2854, 8, -8848, 124, +656, -1041, 411, 144, 916, 445, -91, -260, +-149, -882, -433, -121, 345, 68, 349, 821, +652, 251, -23053, 1015, 712, -73, 7038, -1520, +5810, -12604, 2841, 425, 265, 1546, 938, 1851, +-1180, 2751, -498, 1289, -774, 327, 4047, -8132, +-2622, 5449, 3221, -2990, 10107, 1880, 173, -4006, +399, -332, 642, 297, -4513, -1230, -330, -788, +-21881, 903, -1308, 547, -522, 1885, -1730, -63, +973, 897, 670, -657, -232, 498, 92, -8, +-11010, 1072, -368, -1864, 11505, 3497, 730, 2158, +-1629, -1351, -1583, 2247, -1506, 2144, -902, 639, +175, -6006, -986, -4246, -1510, 1785, -9792, -495, +1995, -9189, -1414, -2550, 1578, 2390, -2989, 1673, +-1980, 21, -4054, 8552, 1155, -301, 1204, 3776, +262, -1828, -1837, -1014, -9, 2711, 1467, 463, +-11605, 1743, -956, -1213, -3892, 1534, -10298, 22, +-902, -658, -1759, 2507, 1552, -12298, -1050, 623, +-3221, 1522, -36, -446, -5925, 2144, -2844, 15080, +-1984, 3631, 1931, 1894, 1193, -1694, -3172, -813, +-1336, 534, -365, 833, -293, 21759, -1266, -1216, +996, -2, -393, -858, 759, 969, -230, -151, +977, -874, 119, -896, 262, -118, 89, 95, +94, -437, -30375, -462, 360, -588, -334, 86, +-1027, -208, 536, -196, 367, -467, 119, -32, +-2544, 6204, 8830, -264, -7847, 848, 2267, 3877, +-6378, -2249, 1420, -1868, -3443, 3747, -590, 58, +-274, -6065, -8472, 5906, 3109, 5834, 3905, 2086, +1300, 3828, -518, -528, -3672, 1794, 4353, 408, +566, -2577, -1137, 2749, -2662, -528, -7479, 5550, +2932, -336, 3681, -2034, 212, -8733, 1017, 2258, +8225, 387, 227, 877, 2752, -1375, 2636, 8131, +3850, -6870, -1158, -3736, -8478, 228, -5809, 97, +-2555, -2956, -928, 678, 112, 1434, -1250, 1240, +-412, -4267, -3811, 4322, -3430, 7705, 5456, -6876, +-3452, 7329, 3142, 220, 662, 1531, -5492, -1388, +6842, -3631, 362, 5029, 8052, -2367, -5346, 5724, +-358, 2469, 2196, -1426, -272, 534, -192, -531, +-705, -70, -259, 93, 335, -94, -145, -17, +920, 1186, -818, -599, 343, -19859, 2968, 161, +128, -4282, 598, 152, 1210, -1317, -1545, -229, +181, -6488, 5699, 7270, 6271, 8809, 27, -4770, +-804, -168, -247, -680, -129, -470, -152, 915, +176, -904, 622, 280, 2986, 1034, -1046, -482 diff --git a/src/main/resources/vavi/sound/twinvq/cb4440m0.txt b/src/main/resources/vavi/sound/twinvq/cb4440m0.txt new file mode 100644 index 0000000..daea4f3 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4440m0.txt @@ -0,0 +1,136 @@ +-25793, -238, 1193, -2635, -238, 1315, -2277, 1588, +-896, 512, -864, 611, -398, 1277, -212, -358, +202, 13250, 16, -860, 1618, -1024, 310, 11560, +-746, -3876, 780, -4087, -475, 857, 1017, -1439, +-890, 155, 8556, 362, -1158, 2116, -291, -66, +-1272, 510, -1394, 2259, -4761, 808, -740, -937, +13993, 191, 273, -7670, 6776, 846, -1907, 955, +-13206, -1956, 1697, 1670, -329, -244, 2395, 6119, +-802, -1007, 649, -974, 170, -2136, -10780, 1020, +1270, 1954, 1118, 13348, 983, -1394, -594, -514, +-586, 1026, -1821, 548, -298, 3342, 837, -1395, +13977, 1021, -7792, -2930, 1466, 5494, -843, 2432, +1378, -68, 174, 407, 76, -877, 691, -9445, +522, -3448, 2549, -412, -2358, 875, -5044, -952, +-10113, 6574, -6347, -2760, -662, 29, -227, 4884, +1304, 411, -3320, 2434, 785, -14822, 4412, 2272, +-6407, 2172, -613, -1665, 296, 742, 624, 135, +5316, -3191, -855, -2061, 485, -3188, 2998, 1382, +2516, -2438, -3506, -238, 737, -629, 1001, 773, +17540, 1478, -724, -764, -1231, -1254, -1582, -692, +-351, -1551, -171, 183, 38, -668, 756, -770, +24344, -905, -7182, 502, -3766, -1690, 1588, 1522, +1844, 1276, 1458, -777, 1731, 4856, -14860, -1097, +36, -1310, 846, -1500, 521, -3669, -252, 4480, +-2602, -845, 597, -4512, 1062, -292, -18518, 1972, +-334, -80, -1256, -366, 3640, -436, -12, -1670, +-435, 1496, 1429, -11092, 1012, -936, -1224, -12240, +-3048, 210, 1905, -1197, -357, -9759, -2632, -332, +-3417, 15078, 1496, 2206, 1800, 205, 1384, 3546, +-1853, 755, 1016, 726, 58, -150, -13053, 10375, +-2589, -330, 1616, 3081, 2763, -2617, -1204, 324, +-53, 2968, 1485, 214, 124, -334, -237, 16784, +2612, 1023, -4298, -2156, 4336, -4307, 4952, 1036, +81, -762, 3416, 714, -187, -4100, -757, 1124, +10224, 7059, 424, -316, 1281, -12262, 912, -1999, +2, -731, -184, 879, -934, -202, -391, -1046, +-338, -101, -17511, -1712, -5580, -2327, -2478, 1770, +-5825, 1499, 578, -130, 1424, -1818, 110, 542, +22, 988, -4227, 2836, -1447, 1170, 12335, 2179, +-11216, -2500, 64, -912, -954, 654, -802, -455, +-597, 234, -296, 811, 1083, 1848, 4148, 637, +-6608, -2362, -3382, -664, -13088, 2839, 3090, 3294, +-4554, 2518, -55, 837, 1392, 5905, 1287, -1484, +965, 16533, -3507, -1903, -1562, 2408, 5037, -4816, +1409, 361, -1890, 170, -610, -1755, -524, -867, +-6238, -20117, -745, -956, -176, 2998, 130, -668, +-843, -267, -364, -573, 495, 127, -66, 32767, +271, -408, 654, -123, 1831, 151, 996, 82, +628, -251, 144, 198, -88, 357, 37, 612, +184, 238, -584, -52, -30025, -415, 404, -566, +100, 659, -336, 877, 211, -730, -377, 184, +-5256, -1484, -1191, -2108, 24, -7821, 209, -2856, +-1844, 697, 5798, -1191, 427, 11858, 1000, -261, +184, -686, 1182, -3142, -3138, 139, 144, 117, +3658, -3566, -1562, 672, 2036, 15051, -5069, -551, +529, 1696, -214, -2678, -5966, -3707, 2847, -2554, +-1760, -1196, 2088, 6372, 1778, 12935, 2189, 1992, +1761, 578, -542, -753, -1182, 4321, 1871, 309, +704, -1259, 884, 19136, -2665, 1096, 3048, -167, +872, -344, -1092, 464, 3255, -86, 1608, -1062, +-1569, -1699, 4504, -274, 568, 1428, 20571, 1452, +-894, -791, 459, -882, -1048, -2944, -11095, -783, +-832, -2450, 650, 2784, 3156, 529, 457, 483, +-12553, 655, 686, -757, 929, 212, 1242, -201, +-1627, 4826, -1895, 997, -3225, 84, 80, 287, +-2136, 405, -188, -890, -18272, -511, -118, -3642, +-1018, 420, 12650, -474, -540, 6978, 6977, 4418, +1162, -1332, -1112, -1765, 2640, 562, -1164, 1256, +595, 567, -483, -31511, -960, -816, 756, 1505, +12, -518, 234, 184, 679, 328, -600, -137, +267, -440, 2540, 593, 1023, -11756, 626, -2034, +5756, -9882, 3175, -1190, 1628, 3920, 3219, 1394, +834, -140, 4036, 4722, -455, 3105, -1355, -3106, +1000, 7806, -2227, 687, -1580, 3180, -12302, -1394, +-425, 488, -187, -36, 219, 158, 12006, 1683, +2151, -2, -1110, -12250, -59, 672, 1844, 2084, +-2101, 1652, -783, 634, -13257, -339, 3932, 2260, +-12452, 152, 316, -688, 79, -912, -2081, 1384, +188, 1942, -706, 204, 700, 1776, 13901, -13666, +-324, 472, 1055, -646, 82, -769, -877, -443, +-227, -900, 636, -870, 470, -112, -598, -4402, +-2726, 1775, -216, -43, -18675, -863, -4604, 3433, +674, -155, 208, 1546, 294, -157, -616, 11070, +1229, -528, 2124, 699, 3624, 54, -516, 194, +-13556, 1902, -506, -1317, 1916, 471, -342, 836, +18, 906, 614, -8, -951, 1052, -97, 2212, +-924, 310, 6, -733, 122, 23731, 468, 345, +1545, 1434, 611, 403, -3136, -2214, -54, 1023, +-1390, -5243, -3744, -258, 6871, -1778, 673, -2362, +-13007, -776, -974, -1077, 8386, -3978, -4325, 1236, +4011, 1161, -263, 1224, -12957, -100, 2801, 1458, +-3081, 578, 17, 1037, -742, 5972, -632, 2904, +-12721, -6733, -478, 182, -1973, -820, -6911, -4904, +-942, -348, -353, -350, 7864, 34, 568, 1985, +956, 3310, 118, -2067, 12600, 9063, 1609, -1261, +296, -1248, -1656, -65, 1832, 1525, 1503, 5149, +4370, -1638, -3868, 320, 1527, -424, 17676, 1780, +1172, -1132, 1128, 1294, -322, -101, 462, -6668, +-3024, 7573, -11088, 1581, 13, -1398, 550, 4376, +1623, 1727, 857, -5310, 2528, -529, -401, 539, +6508, 4246, 4105, -5363, 96, -13407, -694, 5061, +3445, -3283, -348, -1470, 1114, 602, -404, -129, +642, 1547, 23110, -2255, 1969, 333, 1297, 116, +-1691, 364, -528, 758, -1239, -1826, -249, -395, +684, -856, -638, -10000, -2773, -6151, -1244, -3138, +-9688, -1994, 7124, 1368, -1870, -312, 1863, -1006, +963, 789, 743, -4158, -760, 1384, -7525, -959, +-262, 5752, 4005, -12037, -210, 886, -1961, 4895, +-251, -158, 212, 677, 518, 342, -226, -360, +466, 17, 28392, -20, 246, -686, -258, 640, +-378, -120, -443, 1078, -2612, 2084, -1706, 4334, +-4675, -4634, 2336, -9998, 9975, -1285, 2778, 3292, +-1717, 138, 2114, -1120, -180, -1146, 11988, 829, +-2530, -8827, 6833, -1191, -1653, 2691, -4067, 1166, +1971, 303, -544, -1459, -261, 1065, 3410, 2050, +3163, -515, 5456, -4261, 5483, 1531, -2098, 2020, +3773, 588, 915, 158, -11876, 282, -1180, 265, +11036, -66, -1741, -1894, -4234, 3048, 218, -1030, +2240, -12666, -2290, -1673, -1911, 1480, 287, -81, +1182, 216, -10734, 2201, -58, -619, 8585, -574, +-4576, 1852, -468, -6759, -7667, 167, 995, -1114, +-1276, -2053, 2178, -8133, -1270, -7822, -10582, 5380, +3037, 1071, 827, 4972, 1024, -129, -180, -3002, +-846, -736, 9587, 1890, 10287, -1954, 1042, 1558, +-950, 2406, -1852, 2275, 6694, -703, -910, 3854, +812, 521, -1075, -761, 5357, -3911, 3892, 7944, +4580, 5031, 1088, 7116, -1746, -5223, 2607, 3227, +2296, 5603, 211, -731, 6450, -3312, -12378, -326, +4245, 4168, -799, -3563, -505, 725, -5297, 2196, +2221, -16, -3472, 315, 626, -6131, 71, 920, +-4383, -1340, -2675, -664, 7412, -1240, -1361, 997, +-3817, -2377, -11717, 1661, 22, 540, -5261, -950, +7472, 3148, 7647, -4400, 4558, -4412, -869, -1528, +-2618, 8311, 2110, 534, -460, -223, -162, -828, +274, 1844, 1861, -1583, 6899, 5222, -1772, -2880, +-6400, 4703, 2606, -3990, -1224, -4160, 9032, -299 diff --git a/src/main/resources/vavi/sound/twinvq/cb4440m1.txt b/src/main/resources/vavi/sound/twinvq/cb4440m1.txt new file mode 100644 index 0000000..b121083 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4440m1.txt @@ -0,0 +1,136 @@ +32767, 383, 857, -1579, -423, 1164, -1606, 1218, +-410, 777, -292, 122, 282, -74, -1394, 259, +-734, 102, -82, 32616, 427, -545, -146, -141, +340, 506, -808, 171, -778, 900, -204, -277, +-228, -426, 566, -481, -1138, -907, 112, 2722, +871, 115, -7202, 1953, -826, -1812, -396, -14722, +-840, 155, 1114, 5624, 1112, -147, -6383, 926, +1505, 360, 937, -13391, 969, 7062, 2218, -3531, +471, 458, 191, -465, 8664, -1168, 546, 2109, +-944, -74, 1644, -81, -760, -1920, 2659, 13330, +1511, -1148, 1346, 796, -20, -15616, 1246, -1190, +-10882, -774, -70, 3643, -896, 1830, -192, 1018, +1085, -95, -309, 659, 91, 727, -4486, 486, +-2078, 1235, -14415, -4053, -1619, -2589, -582, -4650, +4076, -762, -1111, 277, 1448, -742, -314, -979, +1889, 2679, -1972, 2480, 302, 2869, -9183, -445, +-1817, 12894, 106, 187, -1406, -615, -1174, 746, +-371, 382, 350, -1811, -527, 36, 500, -835, +-106, 1134, -2207, 1021, 348, 908, -21780, 448, +688, -60, -1790, 1901, -22990, 1467, 596, -912, +-3190, 1484, 269, -409, -474, -1670, 1328, 152, +-402, 359, -734, -13208, 62, -4197, -6242, 5195, +-2841, 5030, 2794, 1264, -1130, 3821, 961, 729, +1075, 49, -148, 7267, 2596, -5093, -8284, -6875, +-3059, 3909, -4635, 1402, -6334, -342, -3083, -861, +490, 1257, -630, 128, 2240, 832, 1060, -1802, +-1652, 128, 7816, -14391, -6722, -3328, -2586, 3044, +1088, 1577, 852, -142, -176, 1371, 1236, 976, +12165, -1596, -199, -504, -11020, -582, 972, -1468, +-2402, -666, -3327, -2148, 1078, -194, 9675, -2102, +-1236, -70, -942, 291, 1364, 1403, -3362, 12963, +-375, -1728, 1615, -2354, 633, -506, -194, 13037, +14172, 534, -1026, -425, 2488, -180, -678, -436, +272, 1507, -334, 840, -1000, -1068, 1029, -306, +24, -4435, -5994, -1307, 4251, 3968, 2527, -981, +-2626, -4400, -242, -1823, -679, 12831, -22, 51, +-381, 2422, -2376, -8156, -1477, -6974, 1102, -373, +467, 11314, -554, -432, 824, 7277, 393, -178, +179, -653, 11848, -1593, 14143, -731, -1036, -2322, +261, -1992, -1152, -1430, -1354, -51, -285, -1637, +144, -59, -2182, 5731, 538, -880, 397, 3010, +707, -1822, -1006, 4686, -5096, 4246, -3096, -3997, +-254, -11025, 394, -345, 18780, -686, -517, -3422, +104, -2173, 2439, -5400, -10, 1084, 1821, -602, +1431, 405, 2143, 499, 405, 351, -62, -47, +1954, -29915, 440, 1054, 559, -1210, 442, 928, +-1, 59, 279, -112, -110, -440, -396, 805, +311, 858, -431, -1070, -30192, 135, 1246, -345, +790, 498, 319, -302, -469, -10, 512, -829, +-526, -2052, 2456, 134, -19375, -1210, -1292, 640, +3232, 2580, 973, -2412, 271, -282, 632, -523, +-847, -138, -990, 2501, 536, -166, 2100, -357, +122, 466, -4, 2034, 20083, 1578, 444, -344, +-689, 5733, -456, -503, -592, -1350, -1038, 932, +-1916, 1098, -990, -22687, 1544, -442, -396, -570, +-683, -616, -1431, 118, 4113, -312, 2300, 2093, +-2344, -2955, 6343, 4306, -10078, 6286, -5794, -806, +664, -217, 548, 5072, 4626, -1643, -11619, 779, +1956, -2960, 614, 2087, 9104, -2418, 775, -4447, +768, 1599, -1084, 999, 1652, 1090, 630, -1197, +-3495, -912, -9817, 648, 3278, 1828, 13605, 2757, +-831, -1191, -1846, -1441, -278, -8530, -455, -495, +323, -911, 2500, 14100, 3635, 1016, -936, 5265, +-3092, 2125, -121, -64, -656, -337, 9438, -7600, +1403, -11917, 2180, 2612, 1664, 1091, -318, -3300, +-427, 282, 1979, 894, -703, 514, 160, 1697, +6508, 828, 187, -34, -1094, -2861, 240, -5013, +6004, -4796, -991, 158, 11437, -1730, 354, 1195, +3790, -10432, -3584, 13872, 336, 2043, 221, 604, +2930, 1080, -1417, 1878, -878, -459, -419, 364, +-1037, 7764, 3100, 48, 11057, 1936, 2229, 9150, +-472, 1178, -129, 2876, -249, -258, -1181, -329, +-581, -1140, -1967, 347, -539, -394, 775, -1151, +-31, 1052, -1900, -213, -1552, 22484, 164, -113, +135, -1294, 550, 7738, -7223, -739, 1362, 5518, +193, -2170, -11861, -1357, 351, 2215, 165, 16, +-606, 727, -158, -772, -13420, -1248, 12422, -812, +1768, -442, 1269, -1076, 899, 124, -249, -1110, +653, -3064, -1632, 839, -230, 512, 642, 13230, +13285, -552, -1113, -595, 864, 537, -1012, -539, +-615, -491, 1014, 800, -10, 534, -1227, -25011, +1239, -26, 3834, 104, 762, 1259, 2112, -300, +-920, -812, 612, -1061, -378, -246, -7, 11042, +-18492, -1411, -77, 407, -556, 218, 1751, 1069, +-294, 1789, 904, 285, -76, 300, -160, -128, +-3398, -2001, 1689, 4946, -2750, 1427, -12632, -1873, +-1802, -1115, -2777, -4436, 2937, -6408, -467, 487, +1043, 3914, -81, 1540, -11718, 1368, -12656, -583, +1009, -416, 249, 1874, 1157, 994, -858, -154, +294, 333, -26, 73, -1576, -20, -560, -1068, +1325, -588, 26161, 1580, -411, -587, -1083, -79, +762, 292, -622, 788, 284, 2014, 78, 554, +-516, 1340, 835, 300, -24827, 558, -705, -22, +139, -159, -246, -585, 4318, 234, 1308, -198, +-3370, 5724, 2381, 13843, 4, 569, 8002, 1188, +-63, -1698, 4624, -405, -218, 4238, -888, -1180, +3750, -4848, -9497, 293, -1087, -13274, -33, -2870, +457, -618, 338, -34, 286, 345, -5321, 904, +-5656, -2082, 12644, -7423, 532, 958, -1997, -1483, +-2982, 3115, -1851, -2025, 1853, -918, -903, 1554, +540, -16549, 1441, 2939, -1272, 3106, 2374, 3906, +-697, 1144, 750, -379, -6502, 980, 386, 36, +1109, 1195, 6272, 4264, 1501, 5369, -1560, 3535, +1084, 739, -1031, -4400, 8452, -430, -1787, -7669, +-231, -115, 4324, -1820, -2098, -786, 7478, -2709, +-14255, 5771, 115, -1700, -111, -1482, -1369, -112, +122, -472, 233, 2427, 1816, 180, -481, 928, +82, 84, -700, -448, -946, 1968, 1644, 168, +-167, 16164, 155, -10316, 941, -584, 488, 96, +5205, 491, -1844, -13055, 1266, -352, -836, 558, +1546, -1720, 313, 2033, 597, -14351, 4426, 3281, +-559, 2614, 3248, -2265, -10312, -1614, -288, 480, +1419, -546, -485, 835, 960, 462, 923, 6518, +834, -711, -12639, 8811, -207, 1806, 337, -1240, +-4796, 2383, 277, 1141, 969, 59, 197, 1365, +-614, -9144, 4824, -436, 4191, -2588, 4509, 391, +-5055, -3231, 6978, -6388, 51, 105, -863, 1050, +13103, 12769, -420, -1562, -123, 2702, 292, 1061, +123, 405, 1917, -275, 493, -95, -195, 130, +-2613, 9010, 196, -1382, 5903, 7281, 1585, 2557, +-876, 3166, 6910, 590, -3060, -559, 4722, 393, +613, -392, -3022, 9892, 1808, 923, 8123, 9873, +-1665, 2349, 2894, 591, 2000, -3734, -917, 220, +408, 296, -656, 2608, -1700, 400, -10734, 5434, +6504, -1399, 2175, -1203, -6358, -1221, -5062, 45, +970, -500, -1322, 1176, 5882, -11687, 6324, -2183, +2327, 922, -5628, -3507, 2406, 874, 1399, 4518, +-343, 857, -224, 802, -725, -8561, 4432, 1974, +1825, -2168, -451, -3408, 6587, 7589, 3361, -4711, +-1474, 3151, 1950, 1022, 1466, 9192, 4666, -822, +1024, 2342, -2220, 1169, 10460, 2993, -988, -4407, +-6727, 902, 1659, 80, 106, 400, 34, 1746, +-6982, 10484, 6333, -845, -3333, 1764, 217, -4730, +-3306, -3664, -2830, 2254, -927, -55, 587, 1812, +281, 4375, -3614, -1349, 1802, -6184, -2648, -4189, +-9381, -3243, -4147, 384, 2241, 5524, -478, -1534 diff --git a/src/main/resources/vavi/sound/twinvq/cb4440s0.txt b/src/main/resources/vavi/sound/twinvq/cb4440s0.txt new file mode 100644 index 0000000..fa87e14 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4440s0.txt @@ -0,0 +1,144 @@ +-12085, 8192, -1802, 4587, 5947, -3183, -2629, 1837, +2434, 252, -612, -4697, -576, 150, -704, -640, +174, -126, -10309, 350, -3187, 4714, -2829, 12618, +-2172, 3502, 465, -159, -601, 1306, 1174, -448, +-292, -136, 242, 31, -9005, -6203, -10027, 25, +-209, -20, -1292, -1252, 4304, 3681, 4462, -4401, +4412, 1240, -576, 3618, 595, -237, 2544, -6032, +-1511, 1523, -3668, -3472, 5552, -4901, -272, 5963, +2740, -878, 13010, 191, -2017, 768, 455, -45, +-6873, -3664, 2639, -961, 3068, -4242, 1327, 2362, +-1909, -1114, 100, -5940, 220, 865, -12952, -76, +-1279, -591, 1092, -3502, 88, -2118, 13053, -10141, +-3024, -533, -1923, -4097, 135, 1672, -1661, 1646, +-370, -361, 644, -197, -6796, -10948, 11692, -974, +488, 349, 3936, -1506, -149, 513, 1401, -1776, +-391, -210, 57, -56, -344, 1018, 7989, -4957, +167, 987, -60, 62, 1622, 1207, -69, 338, +-16133, -46, 1018, -1460, -821, -646, 1316, 126, +-4631, -842, -1505, 15833, -6404, -4514, 2946, 2923, +1198, -3141, -3109, -1613, 1853, -906, -436, -1110, +-282, -214, -3424, -3141, -3988, 284, 22262, 1269, +1787, -1116, -1429, 1017, 371, -187, -825, 534, +350, 1088, 26, 176, 8914, 6662, 935, 2074, +-7986, -4780, 2194, 1796, 697, -4040, 2486, 1700, +9150, -37, -1560, 2449, -162, 128, -7469, -2690, +-281, -4698, 424, 535, 1416, 243, -575, -1160, +326, -2417, 808, -15816, 994, -302, 26, 894, +-7376, 395, -586, 823, -1341, 972, 100, 241, +743, 470, 267, -550, 474, 182, 18252, 178, +-182, -7, 3496, 2132, 863, -151, 741, -2158, +-763, -652, -503, -434, -736, 770, -156, -19071, +443, -354, -243, 66, 4258, 6714, 3577, 17338, +556, -3570, 1269, -1406, 1668, -349, -90, 781, +82, 558, 936, -788, -1072, -21, -6472, -3022, +-475, -6997, -2816, -3774, 1683, -13950, 3482, -1872, +2624, 1064, -318, 1300, -1214, 179, -11, -124, +4560, -2827, -6314, -5736, 1159, 1309, -5462, -11652, +4192, 151, -543, -3484, -2288, -119, 745, 1373, +-121, -629, 5204, 7650, -2062, -3370, -2894, -338, +-1361, 1080, -3674, 12852, -6119, -1578, -736, -241, +-1564, -109, -441, 335, 416, 1678, 4802, -3239, +6182, 154, -3656, -1337, -17027, 1707, -381, -1704, +-377, 1022, -592, 983, -321, 37, -1846, -4500, +2575, 14162, -560, 9385, 4179, -1340, -3466, 3235, +1727, 1545, -23, 636, 280, -39, 871, 173, +-8915, -2427, 2146, -3698, -12153, -3773, -3873, 5042, +112, 788, -1139, 245, 546, 278, -8, -1005, +443, -76, -1256, 8255, 3841, 6116, 4226, 3705, +-1278, -6470, 5220, 5892, -3468, 2736, 5427, -3336, +-264, 1906, 294, -60, -7078, 7699, -9792, -7108, +-2030, 1055, -6962, 702, -2074, -232, 127, -430, +658, -272, 757, 138, 159, -340, -4606, 1021, +146, -7690, 6001, 5660, 3363, -367, 13222, -441, +13, -874, 668, 2293, 875, 1238, 110, 778, +1434, -976, 2151, -8169, 1421, 2622, 206, -795, +-816, -14443, -1583, 3356, 2971, -964, -321, -841, +-404, 111, -5595, 4248, -3819, 214, -2520, -712, +-1505, 849, 947, -876, 188, 3221, 863, 105, +-17336, 1818, 14, 17, -6349, 379, 4746, -12405, +-560, -3448, 3664, 8251, 845, 383, 1348, -739, +-780, 1695, 4828, -123, -647, 823, 9940, -183, +-1804, -7112, -161, 578, -619, 11534, 3214, 1586, +4784, -2540, 1188, -304, -485, -648, -824, -595, +-8817, 4138, 927, -3259, -198, 4022, 2213, -1627, +645, 14602, -1058, 1481, -1670, -113, 564, -710, +-451, -360, -1261, 2504, 247, 5566, -7262, 1344, +-5106, -1608, 1946, -4240, -7393, 10440, 3306, 1940, +-999, 155, 832, 55, 10218, 11475, -3252, -8295, +1347, 2405, 3421, -2619, 2262, -2829, 754, -307, +548, -2040, -1130, 317, 170, 292, 248, 2601, +-18930, -1942, 1417, 1678, 3310, -2578, -1969, 1550, +3010, 70, 8, 3064, -848, 504, -172, 180, +1787, -1133, 2427, 1002, -664, -40, 192, -23400, +-1004, 513, -818, -382, 360, 360, 268, 98, +-202, -192, -668, -12924, -11702, 7325, 797, 1937, +674, -2458, -541, -1497, -1673, -955, -356, -486, +182, 299, -46, 65, -4232, 1418, 6532, 2356, +-4894, 4870, 3369, -4585, 8743, 1497, -1451, 862, +-8612, -1718, 1716, -2389, 371, 592, 7397, -3188, +-649, 126, -1300, 1374, -1292, 645, -1494, 2736, +-1468, -1808, -17223, -352, 111, -222, -236, 171, +-198, -7994, -3822, 5324, -16856, -517, 119, 314, +-360, -515, 435, 520, -638, 1635, 420, 1191, +830, 710, 6897, 2925, 3091, 510, 3268, -1702, +-16186, 718, -3127, -463, 763, -1035, 725, -122, +646, 172, -164, -277, 5853, -7074, -10, -1770, +-2544, 5978, -874, -494, -232, 14465, 1815, -1902, +987, -1533, 1216, 741, 620, 161, 4414, 4184, +-32, -2944, -4619, -462, 15701, -1026, -140, -2396, +-1747, -538, -1024, 219, 854, -351, 860, -226, +-4390, 732, -2003, -2430, -540, 592, 1622, 1180, +385, -2052, 4050, 17401, -650, -243, 1709, 1261, +95, -307, -5110, -666, -7094, -533, -1293, -17357, +2929, 2389, -119, -413, 317, -962, 709, -1552, +26, 175, 700, -570, 20120, 1107, 232, 169, +-889, -533, -1276, 22, 959, 866, -954, -792, +873, -172, 1757, 195, 148, 423, 4490, 8782, +631, 682, 1832, -3728, -1742, -11130, -1201, 1776, +9268, -586, -1358, -646, 626, -866, 5, 263, +3950, -760, -2914, -12751, -12669, 1513, -4, 631, +1835, 312, -167, 1546, -532, 619, 1176, 1436, +-116, 312, 7054, 3120, 4075, -1320, 715, -206, +-1572, 1350, 17688, -1182, -1568, 680, 6, 207, +1010, 600, -766, 554, -1483, 644, -8810, 624, +148, -4015, -1536, -1863, 92, 730, -14806, 386, +-5174, -1420, -331, -254, -104, 275, -7268, 2563, +11983, -65, 8043, -1623, -2589, -2610, 1328, 3154, +1935, 3672, -1761, 4984, 661, 209, -1038, 122, +-1019, -28948, 55, 358, -539, 488, 55, 618, +20, -314, 446, -1016, 618, -93, -94, -331, +-36, 194, -1706, 6628, 396, -146, -765, 10500, +2619, -82, -10894, -3908, -888, -192, 620, 163, +78, 774, -293, -104, -4826, -14066, -1883, -3258, +-4577, -1484, 5412, -4274, -4951, 3316, -907, 1948, +-1187, -404, 3654, 400, -70, 459, -3224, -3194, +2338, 4390, -5, -3167, 3273, 116, -1026, -1668, +3767, 272, -16662, 137, -1634, -1007, 220, -310, +982, 8220, -16, -1251, -2644, -3344, 2236, -1573, +8174, 612, 1142, -10799, 393, -707, 4804, 397, +1232, -292, 5762, -15608, 2921, -6440, 3544, -2395, +-504, 1890, 172, -1010, 178, 380, -1163, 404, +-1230, 1034, -596, 105, -2038, 1991, 5613, -312, +-4156, -10205, 3092, -4704, -6101, -1620, -1037, -1130, +1590, 8321, -797, 247, 954, -103, 3838, 2330, +10064, 3197, -8508, 1300, -1012, -6607, -3861, 5651, +31, -475, 1582, -1370, 1107, 2164, 743, -567, +4842, -2930, 3191, -190, -2230, -47, 254, 2147, +591, -512, 1312, 1159, 811, 1444, -1312, -257, +16016, 789, -2562, 3983, -373, -9255, 302, -3655, +5750, -3856, -6941, 3934, -2314, 5556, -4099, -265, +-479, -4843, -130, 20, -4859, 3083, 6482, -3738, +-3936, 590, -6368, -1784, 75, -3903, -6834, -4452, +-871, 764, -1118, 8731, 38, -148, -3368, -6330, +-370, 2234, 907, -2809, -1458, -2306, -402, 2679, +-1222, 1138, 192, -1317, 1012, 15514, 624, 279, +-4032, 2565, 6162, -938, 5760, 1685, 4350, 2939, +-825, -331, 1840, -556, 427, -4642, -23, 8346, +7577, -467, 3848, 454, -3962, 373, -116, 2314, +4868, -208, -1367, -1803, 2681, 806, -4279, 3348, +-528, 14027, -238, -457, -2764, 832, -4680, 4354, +1219, -801, 2414, -5204, -3768, -6524, 5163, -10909, +1656, 321, 3260, -1773, 214, -135, -4563, 5206, +-4794, 1486, 406, -1026, 281, 1799, -218, 320, +-908, 872, 1056, 2955, -208, -799, 15492, 334 diff --git a/src/main/resources/vavi/sound/twinvq/cb4440s1.txt b/src/main/resources/vavi/sound/twinvq/cb4440s1.txt new file mode 100644 index 0000000..bb1907d --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4440s1.txt @@ -0,0 +1,144 @@ +27498, -414, -266, 646, 229, 94, -15, 302, +-489, -401, 125, 752, -476, -200, -976, 195, +4, -402, 2220, 1012, 1731, 2530, -652, -21380, +-679, -867, -195, -114, 1326, 2531, -348, -185, +-114, 178, -694, -298, 8752, 1735, 2640, -2374, +6191, 1516, 5771, 6705, -253, -8502, 986, 2134, +-1854, 3490, -678, -48, 133, 844, -1635, 1630, +6056, -756, -1109, 1563, -1445, -139, 580, -1448, +-18675, 846, -390, -259, 1548, -324, 281, 142, +1792, 1211, 1328, -4308, -1032, -5412, 4742, -201, +-47, -297, -8403, 9715, 7268, -3756, 1573, 677, +-88, -145, 4877, 12946, 3264, 1809, 7230, -2583, +1627, -1786, -7113, -1480, -2111, -508, 415, 1664, +-483, -538, -249, 80, 7005, -2562, -887, 3801, +6411, 2222, 36, 875, -5089, 10897, 4014, 4948, +-1580, 1425, -1814, -391, -96, 322, -6484, 1896, +-7790, -950, -4235, -8362, 3118, 4843, 3754, 1070, +-1648, 7692, -1675, 3405, 918, 2270, 573, 193, +6024, 8912, -4905, -1810, 985, 1877, 2158, -2150, +-386, 3908, 2030, 419, -12599, -570, -150, 1580, +36, -152, 2, -538, -1565, 6809, -715, -6266, +-12725, -6718, 810, -603, 1547, 1001, 2250, 810, +1773, -672, 327, 246, 6414, -7511, 916, -327, +830, 11862, 4373, 1003, 6370, -1730, -2127, 613, +1627, 626, 763, -864, 207, -233, 3738, -8644, +-1634, -2050, 3906, -451, 12986, -4828, -2973, -4714, +545, 822, 735, -3539, -256, 65, -93, -94, +2923, 7075, -3763, 6172, -9544, -2675, -3833, 930, +418, -4496, 3790, 386, -7797, 234, -609, -259, +454, 330, 1546, -7634, -1966, 515, -2496, 374, +2633, -3014, 4126, 9920, -7103, 1441, -150, 7695, +670, -48, -41, -512, -6849, -1785, 3755, 1860, +2418, -2346, -1194, -1574, 15510, 444, -1515, 585, +742, -199, -1115, -122, -11, 140, -7763, 1438, +-317, -444, -17149, -24, 2685, -856, -3166, 1109, +308, 233, 30, 63, 530, 645, 84, 133, +6139, -1183, -10673, -12790, -112, -1544, 4623, 576, +-804, 1023, -1646, 1192, 269, 2681, 44, -909, +-14, -414, 48, -4002, 4768, 3440, 3252, 1441, +101, 372, 3166, -1398, 325, 16184, -711, 486, +1328, 114, -450, -31, 1152, 2154, -69, -252, +32, 922, 219, -2055, 421, -1377, 1006, -614, +234, -40, -84, 204, 27171, 182, 1034, 1536, +834, -8038, 1243, -3074, -7829, 11165, -1854, -1173, +-871, 4105, 3588, -3191, 188, -2102, 124, -166, +8070, -11066, 6632, 2739, -7787, 184, -5872, 1360, +-1089, 1273, 84, -1683, -1584, 975, -206, 1160, +180, 12, -6121, 5436, -14726, 5949, -6756, 834, +1750, -3142, -878, 7, -220, -1933, -141, 160, +26, 756, -800, 6, -8104, -6989, 3353, -3518, +4510, -12430, 736, -2685, -1042, 32, 1184, -519, +-312, -1073, -402, 71, -422, -35, 1791, 12735, +-2281, 2623, -1502, -3878, 6727, 10541, -1110, 2308, +870, 1124, 874, -1406, 123, 254, 405, 328, +3828, -7541, 3096, -14145, -672, -1725, -423, -1918, +4164, -411, 3094, -568, 3575, -2895, -378, -3065, +-232, 449, 8110, 2264, -1383, -557, -10683, -7628, +4155, 754, -134, 6759, 1051, -2054, -900, -948, +579, -1277, 151, 462, 11562, -310, -8260, 10238, +-1309, -3052, 345, -689, -1133, -588, 548, 980, +-1332, 881, 368, 776, -704, 422, 12433, 1314, +-1487, -4753, 2679, 3092, -939, 136, -586, 3504, +-1034, -6318, 3506, 420, 2326, 1034, -252, -398, +-6232, 4488, -6166, -1754, 908, 4884, -5188, -2985, +10793, -116, 4674, 3980, -9, 805, 1568, -1620, +-88, -146, 3027, -16154, 2899, 7839, 5912, -427, +270, -1467, -387, -351, 615, -322, -2, -1061, +-654, 56, -438, 132, 2388, 460, 2172, 1874, +-3028, 3302, 2035, -704, -1222, -19835, -472, -1858, +-1686, -286, 5, -748, 491, -350, -4344, 103, +1473, 2440, 13575, -1350, 1456, 10377, 1962, 3036, +-1238, 1580, 607, 1352, 997, 1212, -489, 251, +4075, -3457, 6186, 786, 300, -2532, -373, -2522, +3108, -294, 4938, -2980, 1509, 12450, -695, -1128, +-96, 354, -3678, 8494, 2480, 2264, 5162, 11907, +4721, 1111, 752, 2999, 3924, -1429, 321, 276, +309, -603, 601, -62, 3337, -3570, 3273, 6618, +-2001, 950, 532, 972, 1619, 956, 65, -609, +-281, -14769, -438, 580, 230, -228, -10108, 12289, +8904, 872, -3296, 1535, -384, 477, -913, -777, +546, 445, -1004, -435, -716, -138, 572, 435, +4626, -864, -5716, -2810, 1291, -4796, -241, 2527, +-2342, -1360, 4161, 1886, -128, -1521, 13726, 1818, +-554, -157, -9665, 2607, -1013, 579, 1122, 1571, +-2684, 11364, -6464, -184, -1542, -5670, -1091, -670, +1273, -1051, -7, -278, -2551, -548, -10673, -1434, +-343, 317, -3108, -1615, -2239, -14132, 490, -454, +2467, 1990, 470, -1072, 440, 290, 3006, -4420, +-2083, 3050, 2779, -2349, -590, -4941, 7464, -9000, +-2686, -2045, -8712, -3281, -2476, 648, -148, 408, +-1367, -1113, 27347, -1113, 739, 39, 1443, -208, +-686, 986, 735, -702, 76, 665, -194, -165, +366, -606, -4908, -3932, -15941, -2810, 4572, 816, +-2092, 4213, -2492, 4006, 926, 210, -1110, -1635, +-270, -226, -362, -187, 1790, 3016, 2216, 3890, +2018, -1325, 19784, -771, 356, 2118, -98, -688, +1016, 978, 559, -39, 160, -310, 6622, -1754, +-11104, 204, -2212, 2370, -11610, 1119, 3216, 3102, +524, 278, -829, 524, 28, 838, 374, -76, +-4593, -2933, 10697, -6510, -4970, -2025, -9383, -3428, +-4112, 2665, 1459, -1411, 421, 481, 842, -341, +147, -158, 4108, 45, 4935, -21, -7905, 2058, +1158, 15260, -567, -752, -992, -1094, -1059, 2370, +820, 655, -261, 280, -3969, 6342, 8521, 3114, +369, -12269, 1684, 4, 4686, 1985, -3668, -3040, +677, -254, 57, -161, -989, -379, 7075, -580, +2846, -3177, -2285, 958, -7096, -154, -515, -3345, +13487, 3548, -1804, 290, -430, 726, 399, 54, +-2814, 10235, 1958, -3356, -1330, 536, 3218, -14194, +200, -796, -862, -1480, 1811, -346, 604, -391, +-231, 513, -10495, -6029, -6492, -8746, -357, -221, +-1890, -2669, 8, -1756, -5812, -1048, 2258, 223, +-474, 1154, -226, 348, -1590, 2915, 158, -24059, +875, -846, 1150, -1000, -844, -116, -246, -219, +-482, -367, 120, 517, -489, 442, 8148, 5040, +3770, -1006, -51, -3175, -10278, -4468, 1188, 1497, +-6515, -5, -1628, -2387, -1297, -717, 1630, 232, +-3608, -6688, 2444, -792, -246, 411, 1464, 3661, +3244, -1121, -1602, -15398, -443, 882, 1412, 926, +16, -73, 2693, 7168, -9399, 528, 7916, -9270, +-1669, -2756, 1304, 3074, -1510, -2089, 1491, -1556, +-422, -414, 132, -192, 5988, 4500, 7572, -10978, +-4875, 3685, 1888, -660, -1750, -515, -2728, -3133, +-2742, 666, -2861, 626, 256, 243, 4587, -3567, +-288, 2314, 4765, -11036, 7322, 7581, 2651, 3264, +-394, -246, -891, -1464, -1717, 123, -517, -486, +-1019, 7215, 554, 722, -4253, 2393, 3053, 2881, +1538, -2104, 573, 321, 673, 3902, -2855, 944, +-12816, 370, 3496, 952, -1435, 6379, 766, 2273, +-729, 80, -2432, -1150, 2408, -895, 15497, -1231, +-282, -3306, -435, -167, -3528, -5683, -6413, 2501, +-4825, 124, 3128, -425, -2800, -986, -2283, -495, +-3392, -1560, -2093, -11613, -37, 157, -438, -794, +1988, -45, 1508, 20, 98, -458, -245, 1130, +110, -525, -771, 1120, 710, -21758, 174, -210, +-4839, -2468, -648, -4388, -11, 2990, -181, -4790, +-4232, 3634, 6427, 2772, 166, -2996, -12005, 1630, +-249, 179, 856, -1250, -4216, 1993, 5164, 4757, +-5071, 4331, -3029, -1276, -11184, -2864, 1238, 6332, +-2431, 1276, -338, -476, -5659, -2410, 2510, 1853, +-4853, -3175, -1896, 10728, 3724, 960, 9963, 305, +-938, -646, -2760, 1436, 113, -74, -3098, -4090, +2950, 2701, 992, 206, -1393, -2179, -10862, -2396, +-1008, 2639, -1547, -416, 9264, 1824, -360, 401 diff --git a/src/main/resources/vavi/sound/twinvq/cb4448l0.txt b/src/main/resources/vavi/sound/twinvq/cb4448l0.txt new file mode 100644 index 0000000..33d4085 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4448l0.txt @@ -0,0 +1,112 @@ +-15402, -5156, -1798, -144, -4711, -4700, 2819, -389, +148, -2600, 1706, -1906, -578, 495, 24, 829, +-383, -12581, 11667, -1039, 1395, 2670, -288, 23, +628, -248, -512, 79, -326, -5428, -2830, -2476, +-1253, -915, 12042, -674, -110, 2950, 3885, -5799, +983, 616, -652, -60, -372, 22, -141, -167, +98, 125, -100, 27211, 133, -127, -271, -272, +-176, 1268, 173, -422, 2431, -3998, -2797, 2328, +182, 6526, 3318, -6282, -10580, 3966, 8504, 527, +9507, 6203, 990, -989, 6030, -136, 647, -1100, +-324, -2618, -2499, 500, -132, -842, 1237, 3599, +2285, 2906, 10766, 11284, -2794, 242, 184, -1934, +55, -839, -1181, 406, 855, 902, 10490, -327, +-1561, 5742, 428, 2218, 1523, 5229, 9130, -760, +108, -140, 22229, 1132, 411, 720, 414, -356, +-745, -1276, -899, -562, 369, 5, -7770, 4101, +3626, 126, -13, -4356, 728, -3197, 1930, -1470, +-6936, -410, 6720, 1897, -530, -4267, -2181, -876, +-472, -2540, -10234, 4008, 10217, -2561, -2021, 716, +-1378, -325, 427, -245, 314, -48, -118, -150, +-30295, -368, 256, 369, -656, -78, -246, -140, +-1250, -635, 1332, -13604, -10383, -1375, 353, 2417, +2140, -349, 1460, -51, -309, 523, 509, 2352, +1208, -377, -2023, 9708, 397, 1216, 10610, -4416, +5520, 3902, -2119, -480, -420, 1170, 36, -3304, +1550, -266, 1682, -808, 2420, 2700, 16239, 3910, +572, -375, 85, -9775, -120, 2214, 2779, 11510, +2628, -416, -1740, -1305, 1226, 78, 78, 635, +422, -13892, 1302, -4117, -1218, 2681, -8436, -1723, +2290, 2815, 1172, -181, -675, -475, -763, 2394, +-3639, 7903, -659, 2323, 4837, -6758, 9460, -1480, +-2403, -2783, 1496, 806, -458, -246, 12, -254, +121, 1477, -633, -513, 791, 208, -390, -177, +-1292, -20471, -4401, -2678, 9026, 128, -265, 822, +260, 11202, 3132, -1879, -3891, 1884, -842, -107, +7516, 1208, -1552, -995, 1203, 2150, 11044, 1285, +2282, 80, 1348, 5342, 2089, 924, 1472, -1454, +-8259, -226, -10259, -2335, -2442, 224, 3257, -1528, +6685, 1630, 1969, 48, 4802, 6051, 987, 8662, +-2368, -4984, -1974, -4049, -5320, 5003, 299, -400, +727, 208, -187, 2838, -4547, 9682, -2238, 1065, +-3206, 10091, 4915, 2945, -1635, -198, 1074, -698, +-716, -96, 1390, -2644, 1006, -4154, 10587, 1132, +2912, -7399, -8350, 785, 156, -290, -142, -374, +-2161, 1066, 1358, -1798, 3050, -19, 452, 10470, +-10948, 4190, -984, -2089, -728, 1503, 4273, 812, +4950, -3750, 844, -1231, -1582, -2517, 2385, -10537, +5807, -4621, 332, -357, -12484, 1676, 160, 10762, +-1225, -1374, 14, -1389, -2900, -467, -1260, 459, +-861, 102, 1715, 4295, -7324, -7400, 10435, 287, +1866, 765, 1730, 3430, -744, -2, -1773, -96, +2001, 2165, 118, 9296, -4640, -4612, 7134, 5128, +-7967, 404, -433, -433, 2222, -8050, 2023, 2766, +-260, -2440, 1607, 2442, 7763, -486, 3766, 2355, +7515, 230, 1248, -8873, -8224, -9135, -1402, -1812, +1223, 152, -2316, -739, -405, -784, -598, 625, +503, -175, -573, -31693, 502, -478, -554, -934, +387, -80, -484, -701, -34, -51, -494, -1461, +1005, 2920, 11532, 2667, -1674, -832, 8680, -5767, +786, -1558, -2062, 1009, -392, 2099, -7277, -2587, +6302, 3070, 4496, -1713, -4042, -8109, 1642, -1894, +3450, 840, 3632, 160, 578, 149, 767, 754, +208, -870, -672, 252, -30, -213, -482, 50, +-578, -2, -148, 246, -31918, -568, 130, 472, +761, -27, -51, 454, 144, 124, 5844, -8354, +9562, -3755, -262, 3286, 1120, 983, -628, -734, +-1732, -1424, 353, -403, 15877, -13552, -335, 337, +519, 140, 297, 150, 725, -780, 876, -116, +-91, -128, 275, 2499, 9313, -768, -10469, 1148, +2172, -6417, 3292, -2187, -1108, 3055, 1105, 625, +794, 68, 337, 1384, -106, -516, 574, 868, +849, -997, 81, 25796, 28, 206, -3556, -351, +1058, 1126, -7826, 5310, -4102, 5352, -6835, -4032, +1487, 230, 5617, 937, 10484, -71, 2653, 1203, +-1, 667, -1489, -10136, 7782, -763, 792, 1434, +-170, 367, 96, -21992, -252, 756, 145, -1476, +1408, 1523, -819, -576, -476, -1068, -241, -39, +1547, 9553, -622, -1799, 1861, 6115, -864, 10690, +-586, 470, 200, 1162, 586, 44, -11650, 3453, +8734, -2754, -178, 236, -2650, 2654, 2699, 1180, +5325, -458, -40, -218, -6, 126, 6794, 506, +860, 11863, 652, 1665, -4213, 4863, 1424, 5712, +-663, -688, -10, -1421, -676, -1325, -378, -311, +-490, 19501, 1242, 268, 4581, 1587, -1153, 848, +-1378, -1159, 505, 63, 704, 1942, 2204, -2106, +44, 479, -1098, 333, -21595, -617, -6444, 3547, +1282, -1784, 4664, -1330, 2607, 1241, -3579, 247, +-875, 11359, -3013, -136, -12813, -14400, 1857, -998, +1342, 1187, -338, 1263, 575, 1226, -995, 596, +446, 293, 767, -356, 70, 786, 466, 202, +149, 849, -28991, 652, 124, -209, -124, -406, +-5463, -1413, -1300, -5339, -1761, 4770, 2680, -10542, +3486, 5601, 2932, 1581, 489, 521, -16583, 1, +-1529, 5942, 1234, 4714, -1647, 1150, 2802, 642, +586, 3836, 240, 307, -490, 67, 771, 816, +-906, 1554, 1090, -2353, -629, 11291, 2941, -2982, +9473, 1434, -4351, -8017, -5173, 8071, 1931, 1281, +-4055, -3224, -1918, -271, -204, 670, 3491, 107, +-31624, 227, 75, -91, 108, 171, -53, -201, +373, 63, 118, 126, -104, 127, -88, 1810, +11688, -10240, 550, 3692, -4978, -1619, 40, 911, +-1080, 580, -767, 333, 192, 403, 308, -904, +142, 31169, 503, -1101, -146, -144, 35, 181, +-355, 54, 590, 499, 95, -1767, 444, -49, +2160, 7176, 12032, 6478, -741, -5576, -644, -101, +-1251, -1268, 2365, 10029, 537, -1476, 307, 2108, +-2478, -944, 10725, 349, -4242, -135, 7577, -4492, +1492, -2512, 7736, -5118, -6756, -2436, -1890, -2390, +1620, 914, 1658, 47, -11692, -134, -1740, -196, +9521, -136, -1376, -8682, -1136, 1096, 903, -1148, +-334, -228, -4, -675, -199, 1914, 2827, -11098, +-2129, -2559, -978, 175, 1832, 10075, -2358, -1888 diff --git a/src/main/resources/vavi/sound/twinvq/cb4448l1.txt b/src/main/resources/vavi/sound/twinvq/cb4448l1.txt new file mode 100644 index 0000000..87b2acc --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4448l1.txt @@ -0,0 +1,112 @@ +-11514, -2858, 12392, -305, -206, 929, 473, -3120, +-2766, -1068, -1237, 420, -718, -21, -336, -45, +-478, -1517, 1830, -12644, 259, 11978, 257, 1494, +-1759, 247, -733, 112, -2242, 290, 234, -10260, +1781, -1806, -4104, 1747, 38, -692, 4971, -9113, +-1925, -1580, -615, -9608, 3779, -11158, 469, -4736, +299, -2815, 2108, 1910, -2356, 66, 523, -440, +2298, -4219, -2512, -1110, 11192, 5932, -2629, -7985, +-992, 775, -1134, 3287, 900, -681, -39, -1206, +-1708, -6800, -361, 11024, 8496, -198, -3855, 1486, +-2547, 1773, 50, -276, -286, 785, -7884, 438, +4590, 2794, 5333, 5476, 2108, 660, 3610, 2308, +-8538, 224, -132, 134, 731, 988, -1368, 3894, +4318, 9911, -104, 320, -9506, 1721, -5690, 1712, +-8747, -1876, -5122, -1304, -162, 752, 3646, 1621, +11089, 1117, -1971, 1058, 3070, 180, 23112, 175, +483, -1028, -538, 497, 1053, 61, 788, -455, +22, -55, -32, -326, 15956, -2045, 788, 9784, +-1170, -819, -3677, 647, -484, 578, -160, 286, +-421, 289, 8140, 3838, -578, -1866, -2074, 667, +-11951, 1684, 3439, 1280, 158, -1784, 1276, 638, +562, 2045, -220, 852, -594, -2109, -2665, 2748, +38, 91, 1377, -624, -18586, -498, -882, 36, +536, -99, 62, -5275, 3051, 231, -6343, -1751, +1206, -1646, -1347, -13590, 1431, -271, -442, 21934, +-143, -1824, -378, -463, 816, 379, 336, -291, +-652, 275, -758, 257, -14866, -1304, 7260, -3373, +1249, -1992, 2734, -2565, -3064, -416, 2424, 279, +10518, 206, -681, -14338, 666, 1843, -648, 526, +1982, 366, 684, 1019, 192, 8, -482, -4785, +2134, -1722, 10674, -1613, 33, 1148, -1566, 10226, +3397, 667, -1100, -738, 2420, -14282, 451, 90, +-10346, 2673, 1175, -3639, 266, -566, 0, 1672, +1082, 298, 359, -497, 1784, -570, -2538, 2522, +-3825, 6265, 99, -7927, 3160, 11079, 131, -2080, +92, -29951, 268, -293, 240, 254, -182, -145, +303, 12, 86, 596, 246, 136, 1020, -1521, +-1134, -10125, -5691, 6028, -3703, -4295, -3718, -5719, +-564, 660, -321, -1073, 83, -3068, 6167, 12788, +-762, 8057, -1215, 2379, 2142, -3625, -503, -1418, +-304, -649, -501, -12558, 12787, 3737, 1465, -3692, +-1321, 1106, -1136, -651, -50, 1608, 59, -583, +82, 331, 443, 782, 93, 285, 310, 29149, +-698, -52, -909, -238, -222, -114, 4, 650, +-200, 235, 2541, 598, 378, 11000, 3101, -8228, +1690, -4313, 6996, -11, -2620, -1458, -1428, 579, +-304, 20, -372, 897, 602, 432, -138, 690, +593, -1485, 136, 191, -32147, 260, 199, 412, +-168, -41, -384, -362, -14, 242, 366, -318, +-304, 1544, 458, -7790, 3332, -5117, -1937, 868, +12622, 906, 1941, 4763, 1698, 351, -234, -973, +9166, 6726, 2686, 248, 3597, -9812, -400, 4155, +2852, -415, 2218, 876, 1423, 3852, 2965, -410, +1820, 8268, -1296, 686, 114, 3087, 3007, -9402, +-5751, -3459, -6674, 418, 4137, 4778, 56, -1399, +-1698, -2590, 8343, -2130, 2535, 6148, -134, -2393, +11551, -338, 735, 630, -658, 13358, 949, -1136, +-217, -985, 182, -1014, 1459, 221, 7713, -1386, +-1427, 1326, 555, 66, 2694, -1535, -268, -13596, +658, 305, 858, 548, -12748, -582, -1055, -659, +-12155, 940, -2164, -2518, -126, -132, -842, 641, +-483, -446, -5184, -186, -511, 1169, -6092, 6161, +3082, -664, -2037, 847, 11032, -1306, -1673, -1219, +-36, 1862, 10053, 780, -282, -837, -263, 509, +-588, -12646, -769, -2164, -2219, 524, -3433, -6437, +3890, -623, -7509, 241, 4042, 264, -1394, 3646, +-6925, -5184, 1218, -1476, -2240, 1882, 182, -3450, +-497, -148, 160, -1579, -19545, -80, 886, 913, +708, 728, 393, -603, -778, 3414, -778, -1495, +1205, 2342, 232, -3634, -76, -16792, -684, 1322, +192, -13248, -658, 7650, 4731, -169, 5148, -1413, +3026, 2480, -2190, 1004, -2082, 237, 171, -717, +-766, -525, -11802, -3776, -9914, 1374, -3250, 415, +-2787, -175, -1081, 792, 980, 11464, 834, 714, +-993, 150, 77, 2306, 11249, -3058, -3418, -1758, +-239, -119, -1408, 6083, -4276, 1827, 1660, 2287, +-2997, -576, 400, 2062, -3174, -6215, 10026, -1082, +41, 249, 10026, -6199, -301, 280, 10120, 2249, +527, -564, 1002, 622, 3341, 408, 2870, 12902, +13307, 689, 336, -819, -43, 832, -1242, 657, +-106, 42, 1123, 149, -2072, 78, -303, 329, +21745, -2172, -1204, 448, 1437, -560, -376, 311, +-73, 153, -785, -368, 54, -445, -92, 120, +-59, -377, 402, 567, -25820, 1284, 1288, 200, +-865, -1286, -41, -1862, 402, 179, -2338, -3876, +4992, -1824, -10092, -3407, -8516, -3556, 130, -5695, +5846, 2333, 2995, 2110, -6946, 5049, -2377, 1655, +-859, -4737, 1648, 7031, -7344, 4992, 1760, -711, +3134, 14363, -907, 171, -1971, -3062, -1079, 600, +603, -224, -440, -11328, -291, -663, 1878, -715, +-2724, 284, -456, -10970, -3225, -2240, 252, -977, +-360, 729, -572, 3981, 1615, -52, -5372, 6095, +-9888, 6873, -3830, 4916, 1834, -1581, -11268, -2316, +-398, 1361, 6151, 2736, -1968, 4624, -180, -260, +-1221, -5633, -1300, -1081, -1433, -509, 366, -388, +1660, 340, -18997, 694, -1184, -813, 1324, 1261, +735, -186, 5258, -583, -221, 1707, 149, 1022, +-835, 1089, 2939, 2025, 421, 411, 3609, -13797, +464, 9214, 2462, -6257, 6032, 1911, 1282, -9673, +974, -703, -128, 950, 369, 1160, -674, -312, +-13858, 1078, -7606, 8, 2786, 367, -6441, -824, +-195, 714, 484, 108, 475, 289, -1012, -1591, +-10880, -324, -647, -2199, 10378, 5781, 995, -416, +871, -1240, -380, 70, -1893, 7632, 1727, -908, +-672, -10901, -962, -7322, 794, 1748, -5568, 1215, +5845, -9575, -2413, -2159, 3077, 1359, -416, 6277, +-85, 1352, -3498, 6130, 1125, -236, 1950, 8481, +716, -560, -1311, -228, 250, -440, -5320, -1941, +-9710, 4637, 1420, -102, -8222, 616, -2254, -528, +196, -1315, -749, -97, -285, -15880, 1105, 630, +368, -809, 29, -1688, -2314, 745, -1627, 19840, +-2380, 4108, 1670, 2763, 275, 530, 492, -589 diff --git a/src/main/resources/vavi/sound/twinvq/cb4448m0.txt b/src/main/resources/vavi/sound/twinvq/cb4448m0.txt new file mode 100644 index 0000000..97f74f1 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4448m0.txt @@ -0,0 +1,112 @@ +-20455, 663, -3140, 2540, -2110, -406, 1078, 1968, +-741, -2458, 490, -496, 338, 581, 1079, -616, +154, 10097, 231, -228, 477, 20, 1372, 11492, +-1112, -3148, 547, 248, -676, 8197, 5902, -1299, +519, -2808, 11529, -76, 1239, -1032, -542, 353, +-1071, 278, 274, 2781, -7741, 3260, 2711, 175, +12340, 1110, -2348, -5303, 1440, 581, -70, 262, +-9902, -2375, 530, 1433, 1624, -1475, -947, 13450, +1318, -1696, 207, 198, 1162, -944, -9329, -1046, +195, -106, 682, 14624, -854, -2410, 1054, 242, +-348, 581, 463, 716, 760, 2714, 1356, -1359, +13089, 2565, -10523, 1934, 637, 1218, 1160, 830, +905, 272, 408, -581, -1426, 613, 2586, -8186, +3748, -6663, 4372, -114, -4644, 2998, -9440, 685, +-8741, 3363, -5623, -4229, -7058, -1201, -822, 1806, +8671, -856, -612, 1165, -426, 317, 6867, -80, +-7084, 1143, -1862, 2742, 669, 550, 22, 173, +4301, -10406, 1042, -346, -1334, -2897, 647, 744, +14, -1338, -1648, -1235, 3550, -455, 2125, 1188, +17136, 1188, -6782, -849, 298, -1054, -9254, 409, +-1736, 1410, -7254, -1889, 457, -740, 22, 262, +32242, 1657, -2308, 2688, -607, 609, 4, 150, +-264, 192, -140, 246, -393, -76, -15050, 390, +969, 457, 1436, -649, 460, -12150, 1359, 1014, +-2103, -576, 55, -590, 113, -1410, -23431, 182, +-2386, -1568, 904, -218, -281, -188, -178, 63, +211, 549, 687, -12069, -88, -654, -1070, -13155, +-124, -697, 438, 3174, 1700, 270, 234, -289, +-625, 15749, -2340, 8466, 397, -4460, -1030, 3206, +1081, -1317, -1030, -72, 487, -1477, -8782, 6984, +-1221, 2395, 3198, 2995, 5862, -1195, -6075, -1020, +-934, 868, -470, -1024, 1202, -998, -1306, 22118, +344, 540, -3137, -547, 2440, -28, 222, 372, +-424, -199, 1068, -917, -105, -4278, 52, -299, +6933, 11715, -520, -2853, 58, -8575, 416, -1272, +1128, -32, -1140, -1873, -495, 235, 2079, -314, +-1328, -2615, -20194, 848, -1553, 387, -6091, 906, +-10180, 8634, -506, 4078, 318, -2657, 1612, -126, +-1424, -4, -1745, -343, 302, 2439, 12190, 941, +-12534, -4756, -176, -90, -1295, 1041, 1875, -450, +89, 212, 2098, 1708, 1876, 4065, 1682, 1972, +-4916, -951, -10683, 1443, -10978, 772, -1013, -235, +59, 213, -230, 142, -576, 506, 101, 44, +-137, 26238, -47, -322, -289, 281, 2614, -4538, +634, 1116, 1191, 2985, -759, -5527, 550, 2107, +-6018, -11013, -425, -221, 901, 217, 546, 213, +2026, 695, 1074, -2132, -173, -1664, -783, 25065, +-326, 86, -632, 1398, 4708, -2911, 2376, 135, +-1471, -904, -2338, 987, 3216, -4564, 314, 15692, +-214, 1238, 230, -181, -30537, -294, 155, -607, +218, -309, -180, -246, -102, -988, -644, 111, +-10517, -1604, -1180, -2748, 1191, -12959, -2, -1004, +28, -196, 1974, -790, 809, 8802, -1204, 332, +180, -3857, 1025, -5998, -9578, 94, -1069, -2398, +185, 643, -1479, 322, 2544, 12584, -8308, -3856, +1286, 1600, -2539, -2752, -2520, -367, -942, 417, +-309, -2162, 2044, 10886, 1764, 11028, 3810, 2955, +-1028, -1017, -1752, -487, -605, 48, 2312, -368, +-1758, -252, 371, 19882, -1994, 1675, 5494, -660, +-1669, 256, -54, -941, 4318, -306, 2143, 273, +-3367, -3088, 6509, -1884, -5400, -576, 11394, 875, +455, 271, -218, 1401, -44, -5336, -12170, 4664, +-589, -3562, -1934, 5842, 1357, 3232, 1449, -402, +-11228, -96, -1509, 2073, -1751, 776, -439, 775, +-3302, 13521, -325, -118, -172, 411, -396, 6154, +-2455, -52, -4616, 783, -12488, -2085, 5817, -1278, +635, -1713, 2888, -830, 649, 7482, 10134, 9147, +3784, 1046, -1934, -2580, 102, -679, -124, 68, +657, 417, -175, -32768, -80, 375, -941, 224, +271, -232, 1519, -99, -680, 67, 66, -618, +252, 1907, 5121, 2456, -2117, -9388, -1441, 636, +7868, -8340, 1939, 1340, 1511, 711, 6530, -1748, +-183, 90, 2561, 5860, -364, 5117, -4101, -4028, +-944, 10526, -1028, 1047, 707, 12116, -12596, -4006, +922, -1047, 348, -971, -272, -2388, 435, 246, +-1055, 148, -1852, -12418, -2531, 3524, 4103, -344, +1667, 2818, -4576, -273, -8337, 183, 497, -144, +-9845, -292, -503, -1212, 4316, -1434, -11058, -3043, +-5817, -981, 813, 0, -718, -467, 10285, -19005, +-82, 776, 1192, 1030, 1560, 1080, -144, 729, +606, -225, -389, -187, 552, -930, -444, -5959, +-1960, -1315, 2650, -1282, -18790, 1772, 263, 1410, +812, -458, -476, 744, 2595, -426, -19, 9119, +4529, -1502, 4673, 3675, 7430, 1084, -6966, -518, +-13552, 1054, 2474, -9499, 1041, 5114, 442, 2927, +511, -1492, 217, -726, 398, -522, 35, 119, +-332, 106, 816, 437, -1223, 27612, 521, -29, +-462, 367, -966, 476, -2559, -3485, -160, 1487, +-272, -586, -6014, -232, 3679, -1864, 1244, 575, +-14591, -483, -1428, 20, 7874, -2948, -5965, 2383, +3270, 490, 2750, -547, -9658, -1473, 943, 285, +-2388, -772, -1582, 3181, 3419, 2628, -197, 3376, +-13282, -7684, 3383, 70, -1174, -70, -6703, -7305, +-553, 3588, -826, -12, 7350, -3604, 345, 1098, +3856, 918, 2038, -39, 11514, 15798, 1327, 1158, +436, -918, 71, 953, 975, 1147, 174, 411, +1467, 83, -4536, -1511, 5350, -3314, 13999, 18, +4107, 1901, 834, 2614, 2356, -369, 943, -341, +-460, 4380, -10014, 3308, -3541, -3225, -621, 8449, +-1383, 4481, -1399, -3646, -936, 923, 221, 346, +7828, 2406, 3021, -4993, 3012, -10903, -1925, 8153, +382, -1453, 1238, 601, 1195, -2245, -2792, -4118, +473, 4898, 12961, -6094, 5905, 1368, -2754, -303, +768, -31, -1275, 1400, 596, -1326, 619, -1744, +1145, -3977, 639, -10785, -1693, -11192, -541, -434, +-11384, -1017, 14361, 1398, 521, -3239, 1851, -491, +237, -1024, 1002, -3002, -303, -33, -6532, 601, +-3726, 7832, 6090, -10107, 957, -1149, 689, 1327, +-51, 1945, 990, -106, 595, 234, 518, 1060, +77, 837, 28880, -91, -395, -275, -265, -279, +-217, -300, 240, -1055, -406, 4314, -2139, 6349, +-2227, -5996, 963, -10386, 4629, -560, 1080, 134 diff --git a/src/main/resources/vavi/sound/twinvq/cb4448m1.txt b/src/main/resources/vavi/sound/twinvq/cb4448m1.txt new file mode 100644 index 0000000..271750d --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4448m1.txt @@ -0,0 +1,112 @@ +31577, -1322, 1533, -2224, 253, -1485, -92, 294, +183, -580, 420, 172, -794, -206, -342, -338, +53, -85, -920, 29517, 1073, -972, -1839, 1004, +290, 46, 460, -71, -988, 1731, -362, -2070, +3848, -2, -3842, 734, -1221, -8012, 1104, 6782, +9673, 1082, -8561, -860, -2135, -1557, -1613, -13999, +1664, 2268, -1570, -732, 1010, -402, -1139, -428, +400, 1123, -2108, -11776, -345, 10608, 1245, -3142, +-3244, -1132, 1700, -308, 1573, 543, 678, 5160, +-3062, 433, 2703, -852, -4903, -1880, 1706, 13995, +2465, -4844, -904, -148, 350, -11168, 1406, 312, +-11900, 397, 769, 5558, -1354, 187, -30, 231, +-1020, 202, 884, -198, -3151, -830, -8490, -670, +-2767, 1517, -12957, -3861, -2794, -1854, -180, 135, +7140, 4103, -4427, 450, 494, -1033, -1110, -2857, +11056, -711, -800, 3628, -180, -852, -10300, -2120, +-450, 14464, -511, 303, -1464, -542, -89, -204, +500, -400, -318, 569, 216, 428, 350, 1973, +-137, -885, -1794, -974, 3977, 3382, -18624, -420, +-1947, 165, -449, 1395, -17313, -286, 2054, -447, +-2740, -1881, -550, -2166, 1360, -6021, -94, 148, +676, -1619, -1737, -11977, -169, -1664, -7709, 6202, +-5954, 1681, 715, -263, 56, 369, 589, 564, +1989, 1617, -1648, 9205, 1343, -11508, -7379, -3791, +-3136, 1049, -844, 24, -6714, -1736, -5734, -2907, +5016, 2167, -5722, -1210, 6232, 428, 2467, -3334, +-1477, -711, 6728, -10274, -4930, -6224, -349, -710, +1598, -713, -1708, -497, -254, 567, -884, 131, +11520, -908, -1425, -1862, -13449, -1590, -669, 657, +505, 236, -4, 21, 846, 100, 8248, -1847, +-131, -186, 181, -806, 3293, -1072, -1208, 14492, +1555, 1527, 544, -120, -258, 6, -2401, 12455, +10880, 1091, -2350, -939, -1252, -564, 150, -114, +1419, 737, -1732, -440, -2303, -226, 536, -2492, +-1085, -10117, -11013, 3786, 5275, -10, 2479, 143, +-1647, -7945, 884, -1618, 2056, 12890, -424, 5986, +-1471, -666, -570, -1466, -499, 64, 566, -1738, +-639, 11380, -612, 1879, 1550, 12469, -299, -1501, +2634, 1036, 3020, -13, 14974, -2066, -5786, -2667, +5487, -6768, 468, -385, 778, -805, -536, -304, +718, 386, 285, 7546, 643, 1462, 913, 4707, +941, -3338, -194, 6669, -4493, 8869, -837, 400, +-877, -11113, 326, -2318, 13683, -1304, -1966, -933, +312, 128, 470, -296, -322, 340, -1126, 1811, +1999, 2885, 3201, 331, -2494, 3999, 660, -80, +-2063, -16771, -1337, 426, 4884, -6026, -40, 2093, +342, -176, 83, 134, 796, -425, -8934, 2100, +8550, 160, -221, -252, -32714, 1306, 1332, -609, +-109, 547, 848, 518, -40, 303, -246, -451, +-2177, -716, -750, 1, -21232, 1287, -1303, 2051, +1659, 1501, -369, -1415, 274, 308, 260, 371, +-1409, -662, -7347, 7161, 3656, -1104, 8862, -5671, +1370, 1122, 16, 1132, 17593, 6778, -993, 613, +-665, 3004, 3288, -1625, -1823, -1003, 740, -1002, +-888, -677, -1065, -25294, 997, -160, -180, -811, +188, -333, -2483, -696, 1309, 120, 456, -116, +-2020, -896, 7216, 6328, -9170, 8407, -2986, -1684, +680, 1752, -684, 613, 337, -629, -11750, -493, +-324, -907, -391, 1053, 14125, 142, 420, -1917, +-378, -1428, -90, -497, 1116, -464, 2170, 805, +-1572, -904, -9020, -534, 6450, -490, 10750, 279, +765, 961, -3985, -2702, 2423, -4981, -1222, 1654, +-1089, -2157, 1940, 14331, -895, 1726, 1555, 122, +-3552, 1274, -598, -910, 3056, -1704, 6430, -10626, +1014, -8773, 1009, 1936, -360, -468, -1029, -8841, +-625, 2212, 2234, 2720, 1190, -64, -2078, 4688, +8690, 5150, -450, 744, -796, -5661, -332, -7938, +2670, -4054, 1377, -1594, 11554, -4702, -3631, 745, +742, -90, -1311, 12528, -4664, 834, -853, 1542, +8560, 2209, 4091, 2876, 2117, -678, 1684, 785, +304, 7980, 2126, -302, 8239, -2105, 1584, 11894, +-1055, -1391, 596, 2343, 86, 388, -1348, -1007, +1428, 413, -9231, -10312, -7346, -1108, 1385, -1255, +-3954, 738, -1258, 410, 226, 15115, -1059, -4117, +-50, -504, -1726, 1425, -9974, -346, 688, 464, +244, -586, -8880, 845, -659, 932, -1309, 290, +-29, -417, -2184, 1011, -9622, 1443, 9009, 1945, +2698, -708, 10572, 2410, 1200, 4492, -2569, 1444, +2735, -8604, 2274, -4057, 478, -199, 1285, 12695, +12321, -2933, -1708, 1198, 675, -492, -560, -52, +-1261, 85, -480, -96, 696, -764, -1402, -31368, +-580, -675, -1678, -58, 600, -522, -292, 647, +-36, 154, -1148, 437, 1561, 588, 603, 7629, +-16973, 29, -828, -589, -919, -1372, -470, -445, +428, 528, 5828, -353, -32, -1781, -702, -690, +-7196, -3253, 1942, 4600, -12102, -674, -10480, -2336, +711, -2174, -7474, -1436, -451, -7133, 856, -2652, +1892, 3464, -546, 676, -13296, -516, -13618, -997, +938, 1686, 1006, 1358, -1371, 922, 534, -170, +126, 255, -835, 50, 945, -1066, -1676, 3, +1038, -437, 26030, 418, 27, -1092, -493, -428, +-606, -1097, -628, 298, 295, -806, 183, 146, +1352, -84, -722, 833, -25667, 3176, 1001, -322, +-2339, 15, -475, -1257, 2116, 876, 637, -529, +-1108, 302, -2452, 19734, 58, 851, 9845, 1142, +2168, 706, 11070, 1556, 544, 3002, 2238, -3974, +2738, -48, -8324, -2186, -355, -14933, 2192, -2481, +2700, 473, -486, 761, -208, 76, -78, 102, +-4896, 1378, 12377, -8269, 28, 1092, -5071, -1500, +-1190, -804, 1085, -766, 493, 22, -1041, 9136, +-1234, -12247, 967, 2672, -883, 4582, 4871, 1891, +-532, 329, 226, 446, -6710, 312, -914, 1416, +-1852, 3052, 6512, 8971, 5544, 6519, -579, 1021, +-241, 911, 782, -3456, 10158, -1865, 3941, -12300, +8, 472, 882, -1580, -1799, -1025, -631, -127, +-15316, 8047, -200, -1860, 582, -4363, -1274, 1085, +-48, 2383, 638, 480, 369, -838, -1341, 414, +-114, 2757, 1222, -2194, -3394, 6469, 2418, 738, +-1656, 15594, -1090, 202, 727, -769, 484, 2462, +4875, 1656, -3835, -16877, 5276, 239, 982, -1872, +-130, 901, 1352, -155, 4939, -8317, 9000, 2503, +485, 1184, -548, -1356, -7482, -188, -1587, 496 diff --git a/src/main/resources/vavi/sound/twinvq/cb4448s0.txt b/src/main/resources/vavi/sound/twinvq/cb4448s0.txt new file mode 100644 index 0000000..e900cec --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4448s0.txt @@ -0,0 +1,120 @@ +-10720, 9997, -1313, 8849, 5152, -226, -2908, 303, +-842, -870, 165, -1372, -105, -154, 170, 2424, +-2476, -2126, -8329, 349, -4509, 5128, -92, 9086, +-7263, 416, -124, 341, -88, 239, 5172, 553, +1526, 1728, 1955, -1489, -6595, -11237, -10224, -394, +-927, -932, 674, 743, 317, 4628, 8453, -3768, +2545, 3506, -2406, 9108, 5643, 4660, 4116, -2452, +-1391, -154, -74, 180, 5270, -7922, 46, 11046, +6076, 735, 7922, -196, -1080, 1445, -687, -2403, +-784, 742, -269, -498, 6010, -4045, 1053, 891, +-1538, 613, -84, -4254, -957, 4682, -14004, 2050, +-647, -718, 557, -2720, 2437, -7675, 11874, -9284, +-734, 775, -2231, 105, 366, 1360, -98, -126, +508, 2647, 729, 762, -8806, -10413, 9008, -2093, +1107, 201, 1421, 1181, -259, 1420, 828, 327, +-1956, -573, -874, 354, 2662, -1437, 10864, -9240, +-7648, 1670, 1598, 173, 438, -373, -566, 246, +-11999, 1817, -611, 1, -1652, 1876, 1354, 1270, +-789, 300, -321, 11577, -516, 329, 5723, 4732, +1717, -6224, -5356, -6292, -370, -3644, -922, -50, +-14, -581, -1554, -1675, -20, -965, 28479, 658, +-498, -488, 504, -601, 437, -585, -245, -196, +186, 281, -174, 159, 7469, 5890, -5112, 4918, +-9023, -360, 40, -2975, 4784, -437, 1609, 1032, +2759, -297, 106, 5176, -4315, 568, -9536, -1297, +-6783, -10965, 1285, 264, 330, -508, -522, 624, +662, 539, 7248, -13780, 40, 2140, -2188, 1925, +-8972, 1147, -1340, 870, 779, -4, -101, -374, +781, 5733, -5712, -5777, 2080, 875, 13450, -1551, +-3229, -1818, -114, 1265, 501, 636, -576, -623, +-1269, 3006, 1023, 862, 1359, 1950, 588, -22648, +218, -438, 1547, -408, -844, -263, -106, 14754, +-689, -9466, -978, -21, 1412, 43, 2012, 352, +908, 277, -960, -747, -230, -1557, -7132, -5707, +79, -2474, 2177, -5349, 2510, -12720, 2833, -2152, +-1693, 458, 197, -643, 735, -2728, -893, 2758, +5196, -3566, -4294, -4914, -1222, 188, -8884, -6234, +2391, -1518, 663, 572, -1465, 1147, 8486, 2037, +2516, 941, 6092, 11602, -2559, -1702, -1848, -924, +-210, -108, -1052, 8360, -7567, -4588, -169, 3464, +-9206, 1842, -4329, -2499, -341, 592, 918, -102, +340, 214, 1037, -324, -16289, 10308, -47, -29, +1340, -603, -2763, -548, 392, 1489, -149, -769, +-67, 13270, -2233, 8257, 1582, 1034, -4270, 916, +4486, 1191, -102, 159, 109, -536, -664, -987, +-8041, -1759, 4264, -5600, -13815, -1158, 1712, 2516, +-634, 504, 515, 732, -46, -685, -481, 1685, +-1782, 262, -3600, 14721, 6334, 7941, 101, 914, +-2141, -2, 182, 829, -215, -122, 6325, -3752, +-2812, 1618, 3512, -1591, -4276, 6994, -10349, -5675, +-1501, -1766, -1949, 436, 82, -5596, 2592, -1086, +-2804, 2540, 458, -550, -1834, -2401, -7563, 2340, +1678, -7666, 4538, 27, 6337, 3642, 17068, 5310, +1115, 1579, -142, -397, -670, 2010, 863, -504, +845, 848, 770, -8821, 1963, 2782, 162, 1130, +2597, -13699, -3996, 800, 2499, -1045, -1512, -186, +-59, -119, -5048, 6800, -8766, 784, -7091, -1002, +335, 1993, -1045, 601, 1804, 166, 1343, 110, +-224, 2247, -344, -5, -4292, 5846, 8591, -11846, +-1303, -1027, 1759, -168, -194, -1281, 489, 378, +-5069, -3321, 11238, -375, -806, 3962, 9660, -2960, +-664, -1067, -627, 271, 1205, 1160, 261, 3725, +7877, -679, 22, 598, -1086, -420, 2168, -46, +-15552, 420, 1220, 1332, -58, -156, 7777, -4657, +352, 15316, -4760, -2140, -2577, -1321, 2037, -371, +-1254, -912, -1177, -1367, -103, 4572, -9482, -1599, +294, 403, -272, -2331, -4365, 13467, 4585, -2554, +-1743, 545, 162, -369, 6074, 11273, -8856, -8175, +2543, -7, 314, -2033, 2704, -1755, -1431, -791, +-276, 1085, 236, 6553, 1872, 387, 1056, -31, +-20610, -609, 608, 1007, 1604, -1501, -68, -527, +204, 252, 2533, -721, 1468, 444, -72, 61, +-209, 512, -216, 42, 385, -490, -104, -29030, +-166, -4883, -2754, 788, -430, -867, 565, -1155, +562, 1076, 1757, -2990, -14971, 8392, 902, 550, +102, -6579, -6939, -319, 172, -863, 979, 2178, +630, 160, 952, 946, -3955, 1515, 352, 2557, +-5339, 6166, 4588, -2040, 4031, -535, -2504, 2782, +-12136, 1338, -2758, 458, -671, 155, 6998, -2598, +-931, -396, -922, 2060, 447, -42, -649, -532, +-552, -1945, -16548, 815, -408, 3469, -4118, 875, +-1017, -11150, -511, 3846, -11349, -1928, -781, 2765, +-681, -713, 655, -218, -8032, -465, 295, 1591, +-383, -1889, 1627, 108, 1149, 2513, 388, -5702, +-15693, 24, 470, -4322, 3721, 1584, 1808, 350, +-1765, -620, -2953, 4354, 8512, -12533, -86, -2490, +-192, -507, 2024, 3942, -801, 13444, 738, -2086, +162, 2013, 837, 56, -384, 3164, 5052, 1158, +-403, -6913, -4290, -2068, 16622, -2738, 856, -2884, +-2432, -410, -1179, -456, 504, -1359, 436, 352, +-6351, 327, -2196, -1502, 302, 338, -839, 235, +-520, 1283, 2710, 18814, 2256, -2, 400, 1300, +-1185, 1024, -3744, -3542, -4350, -763, 1902, -14737, +5437, 48, -1589, -280, -67, 232, 2276, 1413, +3284, -308, 1013, 610, 22787, -685, 724, 12, +-359, -1651, -1060, 569, 248, 3836, 605, -413, +3380, -1360, -1120, -2933, -2368, -977, 10135, 12356, +3739, -1571, -418, 580, -2662, -11460, -6128, 2867, +11468, 825, -3201, -501, -138, -755, -554, 168, +757, -564, 428, -12118, -15179, -1978, 432, -597, +1528, 3038, -568, 1349, -3377, 914, 498, 928, +-91, -5, 9192, 3000, 2542, -1411, 626, 2705, +-763, 3247, 13736, 3034, 2170, -67, -852, -378, +1264, -2771, -2415, -4236, 126, -1984, -13336, -1088, +-416, -1979, -520, 2506, -1505, 294, -2398, 218, +-8740, -3873, 2069, -1374, 86, -998, -3851, 1070, +13357, 955, 3085, -536, 166, 926, 299, 6532, +1324, -502, -1658, 1829, -1263, 445, -1902, 1452, +-2747, -16422, 1875, 1773, 452, 288, 5992, 1626, +3659, -917, 2255, -1508, 356, 547, 158, 9, +-117, -1665, -595, 14392, -1013, 49, -4060, 12064, +3666, -2903, -9145, -396, -4341, -953, 2758, -178, +-204, -462, 98, 222, -3622, -12200, -4484, -94, +-8642, -5694, 4034, -720, -1695, 751, -1668, -266, +-343, 296, -112, -900, -3750, -360, 1002, -7402, +7758, 7370, 3332, -7517, -769, -1272, 412, -1451, +-89, -227, -11332, -472, -1108, -394, -339, -1981, +-3494, 12110, -564, -5958, -690, -1066, -130, 762, +-50, -1456, -1521, -8428, 994, -867, 2650, -2335, +354, -2253, 4612, -12364, -2626, 1853, 577, -103 diff --git a/src/main/resources/vavi/sound/twinvq/cb4448s1.txt b/src/main/resources/vavi/sound/twinvq/cb4448s1.txt new file mode 100644 index 0000000..7df42c8 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/cb4448s1.txt @@ -0,0 +1,120 @@ +25901, -239, 648, 167, -284, 198, -340, -1112, +-55, -242, -214, 528, 112, -259, -284, -250, +23, 475, 780, -558, 111, 148, -2411, -19826, +-1158, 2799, -964, 44, -1204, 1187, -4036, 1872, +3541, 768, 159, 1979, 3382, -113, 804, -1021, +3708, -2577, 9697, 11527, -326, -7058, 4306, 1260, +3782, 3370, 1595, 705, 2268, 2182, 1509, 1131, +9877, -7260, -258, 49, 1686, -1472, -2556, -1973, +-22425, 338, 486, 963, 1069, -34, -1027, -90, +-881, -473, 554, -6326, -873, -9744, 10157, -1079, +584, -1047, -1954, 6204, 2416, -899, 1452, 938, +-439, -664, 4231, 9370, 7800, 170, 9448, -4756, +1967, 686, -1186, 636, -1719, -1244, -540, -728, +306, -1778, -7980, -3418, 8318, -1828, 1556, 3487, +10195, 3741, -510, 2077, -1496, 1241, 384, 477, +-1051, 7922, -4077, -2513, 849, -693, -9170, 4264, +-7940, -1703, 460, -2986, 586, 13, 377, 781, +-7047, 6852, -1350, 7537, -493, -1919, 379, 3108, +4293, 8467, -3875, 63, 44, 493, 1496, -1577, +-5676, 3318, 6628, 5177, -11082, 1146, 3251, -1159, +-461, 442, 1250, 212, 176, 3586, 137, -9153, +-13772, -8211, 393, 1170, 1717, -671, 298, -233, +883, -1533, 401, 254, 7700, -4827, 794, 377, +-376, 12240, 7298, 2445, 1168, -562, 1528, 563, +421, -606, 0, 5792, -1069, 824, 3728, -2729, +1005, -730, 4318, 644, 17336, -1588, 2100, -365, +509, -415, 3684, -9128, -1096, -4278, 1549, -1247, +5519, 11075, -2216, 6004, -3683, 409, -730, -414, +-263, -6623, 8194, 489, -9085, 334, -1104, -814, +1412, 1522, -1657, -7029, -4142, -1274, -520, -40, +650, -1886, 9701, 11456, -7567, 1176, 3268, 3016, +1109, -117, -858, -155, -1249, -230, -216, 3945, +9142, -2297, 134, -2563, 15131, 857, -1597, -618, +150, -590, -166, -357, 388, -69, -8767, 2914, +1087, 4673, -14373, 600, 382, -1893, 844, -242, +544, -106, 568, -1141, 371, 2663, -1860, -725, +8066, -1353, -8743, -10433, -1796, 427, -73, 178, +96, 980, -478, 978, 1767, 6034, 633, 966, +677, -65, -884, 417, 461, 62, -868, 93, +-100, 519, 16304, 2646, -1260, 12271, -140, 142, +11138, -892, -2114, -629, 172, 744, -2056, -960, +61, -980, 2082, -439, -3126, -2564, 1174, -78, +254, -178, 1599, -436, 19023, 5335, -1686, -782, +520, -8727, 256, -3588, -5694, 12323, -2091, 1511, +-656, 3872, 2370, -770, 282, 455, -573, -39, +7845, -12566, 12690, -156, -442, -227, 575, -274, +-1717, 120, -40, 1866, 635, 161, 270, 1039, +3256, -673, -3343, 4292, -14247, 7142, -4821, -591, +-418, 376, 21, 572, 551, 70, -5536, 79, +2540, -505, -283, -350, -1279, -1630, 2234, -604, +5246, -17580, -3022, -1052, -307, 6626, 2794, 1702, +1875, -1876, 1011, -320, 1268, -282, 1072, 14370, +-8206, 1218, 630, 173, 7486, 15176, -6146, 4903, +-636, -1341, 1360, -1541, -1012, -778, 84, 426, +-124, -746, -252, -11085, 1783, -2833, 809, -744, +2194, 3328, 7029, -5097, 4934, -3025, -641, 303, +-328, 258, 8674, 53, -3395, 975, -9944, -8550, +3376, -714, 1078, 1186, 598, 808, -166, -752, +484, -5088, 1484, -1278, 11394, -1876, -8236, 5159, +-1830, -1520, 2761, 592, -204, -1360, 454, 230, +-5038, -1582, -5617, 1346, -2045, 2306, 17764, 494, +572, -1930, 339, 550, 784, 151, -753, 4708, +-3058, -8267, 3281, -1054, 870, -1201, -2005, -920, +-10115, 5395, -6423, -798, 367, -221, -5296, -2808, +8313, -5077, 1655, -200, 114, 46, 350, -2374, +868, -327, 377, -9570, 1231, 9258, 8752, 3074, +-4411, -308, 2315, 6824, -3303, -896, -1186, 579, +-2561, 2280, 586, -798, 4747, -3487, 1306, -1241, +-487, -90, -52, 3231, -555, -17702, -2681, 1649, +-17, -278, -647, -4225, 2740, -1248, -3826, 1356, +3572, -1010, 16160, -422, 304, 3970, 1124, -317, +-554, 673, -1191, 3180, -4429, 1581, 1543, -2097, +4208, -9363, 10146, 1896, 2904, -4112, -1428, -207, +459, -35, 5395, -8960, 3141, 11004, 308, 3687, +1540, -2156, -592, 1640, 1003, -280, 797, 204, +6910, -824, 4724, 4729, 5553, -3165, 483, -12, +33, -588, -379, 402, 3543, -9646, 74, 9603, +-465, 2872, -2367, -885, 2894, -133, 2758, -721, +3473, -13322, 1506, -1344, 512, 1066, -8300, 11391, +11976, -1201, 13, -612, 165, -1823, 154, -123, +1234, -423, -367, -58, 384, 2687, 2536, 826, +6223, 1750, -8589, 1126, 9772, -6646, 2043, 1826, +-1037, -2018, 692, -818, -3431, -467, 11006, 3407, +880, -2047, -10303, 6168, 1428, -307, -18, 661, +-252, 754, 1207, -2797, -3057, -6235, 99, -931, +1618, 692, 2790, -294, -1200, -5768, -11691, -5305, +-100, 390, -783, -11660, -4675, -13570, 2764, 1414, +-786, 385, 163, 718, 794, 1118, 827, -634, +-75, 6224, 3965, -2092, -1120, -6395, 5474, -12986, +-3985, 635, -544, -1877, -191, 0, 121, 379, +-3059, 132, 26320, -721, 1262, -706, 421, -85, +-38, 665, 590, -208, -196, 168, 10, 1271, +-218, -365, -5843, -5897, -12346, -3026, 5916, -115, +-2671, -1022, -203, 962, 995, -850, 527, -516, +-1641, 452, 68, 1204, 740, 385, 38, 752, +150, -3088, 20608, -54, -39, 6109, 3224, -92, +-315, 4407, -306, 1317, -395, -1617, 9104, -3493, +-10724, -3059, 283, 81, -9791, -3210, 7307, 4459, +-639, -61, 1152, -184, 2290, 398, -2902, -2776, +-1624, 1153, 242, -8865, -3617, 309, -11933, -3847, +-5750, 3235, -153, -315, 382, 209, -923, 2072, +458, 164, 3631, 3121, 3220, -828, -8644, 2215, +3873, 12445, 533, -631, -53, -136, -728, -240, +420, 2870, -4981, 906, -3272, 4735, 3613, 2412, +-3951, -10587, 7389, 564, 3266, -1348, 524, 1570, +6611, 3354, -1042, 1862, 1860, -1187, 5761, -1722, +8231, -7428, -5662, 1239, -2887, -218, 810, -1063, +15078, 686, -2374, -293, -2031, -245, 4441, 5045, +1100, 6722, 1787, -587, -380, 132, 5124, -12478, +95, -1230, 1464, -1871, 929, 1430, 2666, -3768, +2784, -3697, -8238, -247, 603, -8406, 1330, 1033, +-743, -2546, 2739, 856, -12698, -4970, 2290, -1104, +34, -1048, -80, 634, -695, -84, 2374, -24793, +-1064, -1080, -254, -812, 252, -1582, -401, 765, +847, 340, 479, -3163, 150, -187, 8432, 2607, +2075, 1384, 423, -7361, -10262, -2254, 54, 1065, +40, 857, 2014, -5076, 198, 657, 482, -422, +-2185, -850, -318, 164, -684, 2698, -1008, 17493, +-64, -6788, -5966, -14352, -2349, 2492, 266, 1077, +1935, -99, 4270, 2319, -2391, 779, 187, -70 diff --git a/src/main/resources/vavi/sound/twinvq/fcb08l.txt b/src/main/resources/vavi/sound/twinvq/fcb08l.txt new file mode 100644 index 0000000..2b10b11 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb08l.txt @@ -0,0 +1,80 @@ +-2539, -3275, -2699, -3345, -2843, 5501, 426, 7127, +-149, 3111, -2991, -2297, -2345, 2702, -969, -946, +2837, 1114, 1800, 1271, 12249, -2282, -2309, 1566, +-2889, -3020, -2083, 3586, 8919, 2651, 4111, -1842, +-1588, -1428, 3251, -102, 156, -320, 722, 1711, +20565, -3068, -2211, -3164, -3410, -3396, -2882, -2002, +1730, 4077, -2696, -1694, -2839, 2948, -2739, -2380, +-2252, -1311, -269, 1900, -2796, -444, -2996, -2525, +5194, 1459, 5042, -1089, 914, 4116, 7644, -3137, +-3156, 4028, -3435, -3240, -2585, 5542, 5119, 9885, +-2995, -3153, -3449, -3101, -3551, -3469, -2196, -1271, +3869, 5413, -2800, -1990, 3371, -2286, -1022, 3190, +-550, 1723, 968, 1916, -2749, -1530, -2211, -2987, +-3357, -3262, -1042, 10277, 107, 2662, 9819, -2753, +4269, -3277, 3125, -3131, -2974, -3251, 6466, 9484, +-2034, -2707, -2424, -3170, -2619, -2278, -143, -1641, +11856, 5975, -1282, -2629, -2396, -2364, -2012, -1085, +-2576, -2422, -2206, 13731, -2261, 2751, -1768, 2482, +-1065, -347, -137, 31, 619, 385, -2257, -2215, +-1698, -2686, 4468, -2563, -1071, -1359, 7757, 3732, +-2856, 9018, -2046, -1494, -2234, -2209, -67, 1340, +2433, 2965, -2722, -2151, -2966, -2780, -2732, -1509, +-2085, -1532, 6934, -1248, -1936, -2203, -787, -1781, +-895, -1990, 4693, -1818, -1569, 1954, -2283, -2403, +10514, -3105, -1074, -2838, -1, 1192, 1113, 3309, +-2249, -2451, -1660, 2535, -1439, 3582, -1093, -594, +1956, 758, 5349, -2524, -2320, -1903, -2055, 5075, +-941, -721, -536, 2197, -2309, -3027, -1460, -2911, +11344, -2474, -1601, -1749, 3260, 2547, 3819, -1247, +-1449, 2835, -1118, -652, -516, -379, 531, 440, +-569, -2606, -2545, -2447, -1685, 8678, -1868, -2003, +-992, 5888, 8591, -1848, -2010, -2196, -2049, -658, +3473, 214, 905, 317, -2050, -1083, -2593, 8754, +-2234, -2449, -1688, 2194, 2244, 2502, -1659, -2748, +4584, -3011, 3702, -2307, -1887, -1960, -1068, 2889, +-3022, -2989, -2295, -2794, 3071, -1588, -43, 2627, +1278, 2031, -2145, -2551, -2333, -3205, -3237, -2760, +9082, -454, 4339, 1776, -2738, 4785, -2176, -1896, +2148, 1350, 768, 249, 1001, 1499, 797, -2182, +-1443, -229, -32, 827, 401, 270, 581, 380, +-2370, -2376, -2679, -3099, -1742, -1149, 4666, -693, +1109, 7547, -2496, -3063, -2818, -2621, -2016, 5722, +4932, 1217, 2161, 2449, -2207, -2954, 3769, -2824, +-1809, -2946, -1693, -377, 1565, 4100, -2947, 3063, +-3062, -2919, -3093, -2520, -1712, 2383, 1305, 1867, +10145, -2912, -3307, 7519, -3502, -1063, -2782, 8595, +-750, -1503, -3141, -2486, 2923, -2574, -1826, -1244, +3537, 2494, 2583, 1560, -2722, 3284, 2245, -1258, +-658, -394, 483, 719, 1121, 1073, -2949, -1013, +-3048, 597, -3103, -2510, -1970, 7207, 8635, 1917, +-1772, -483, -2318, -1860, -2500, 2981, -1651, 550, +696, 615, -2121, -2055, -1619, -2126, 3108, 3417, +-485, -47, 848, 1608, -2636, -1707, 3142, 3798, +479, -1112, 597, -323, 1555, 1531, -2930, 2106, +-2398, -2314, -1835, 0, 2920, 896, 2356, 1259, +-2911, -3184, 593, -3570, -3389, -3263, 7340, 7640, +6874, 6549, -1912, -1334, -1749, -568, -1718, -405, +-1375, 3456, -1024, -1903, 9384, -2721, -2485, -2377, +-3026, -899, -3133, -3032, -2452, 7715, 2492, -2450, +-1721, -2138, -1497, -55, 760, 2382, 1183, 1105, +-2782, 389, -1528, -927, 664, -531, 1405, 363, +582, -292, -1678, -2718, -2763, -3140, -2799, -2178, +-2715, -2592, -972, -1226, 3278, -1173, 2916, -1548, +-446, -1241, -209, 379, 689, 538, 3110, 2857, +-1735, -1244, -589, -413, 65, 471, 522, 323, +-2043, -212, 1309, -471, -564, -16, 378, -320, +-437, 228, -2194, -2637, -2513, -2670, -1863, -954, +-2082, -2398, -2270, 5563, -2959, -2444, -2794, -1736, +-1631, -1324, 1482, -481, 2317, 1470, -2871, -2007, +702, -1980, -491, -146, -695, -145, 2817, 1268, +-3395, -3456, -3069, -3433, -2874, -205, 806, 3038, +3806, 2623, -2954, -1861, -712, 1017, -326, 44, +-93, 910, 775, 346, -2625, -2570, -2974, -2344, +-2712, -1930, -2213, 3521, -1341, 4327, -141, 835, +-1119, -1336, -1092, -1891, -860, -727, 315, 2562, +4119, -2638, -2584, -1951, -2710, -2499, -1561, -952, +2821, 2505, -2388, -1855, -2926, 1742, -2563, -2655, +-1802, 3082, 3063, 2456, -3304, -2670, -2147, -1504, +-309, 1421, 1661, 1546, 560, 615, -2590, -1593, +-1523, 2025, 3167, -841, -356, -648, 309, 1165 diff --git a/src/main/resources/vavi/sound/twinvq/fcb08m.txt b/src/main/resources/vavi/sound/twinvq/fcb08m.txt new file mode 100644 index 0000000..7dd5566 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb08m.txt @@ -0,0 +1,40 @@ +-2962, -2140, -2166, -1454, -1638, -1100, -835, 686, +978, 550, -1630, -1021, -1424, -1867, -1118, -474, +66, 6104, 904, 603, -829, -475, -1368, -1199, +7255, -890, -465, 114, 118, 224, -2453, -1279, +8192, -1289, -452, -47, 180, 324, 627, 209, +-2770, 11214, -857, -1720, -895, -531, -291, -264, +232, -402, -2699, -2561, -2433, -2093, -1315, 86, +2666, 1663, 1351, 2349, -2788, 4576, 3680, -1365, +-995, -513, 46, 44, 522, 142, -2739, -1654, +-1950, 4573, -659, -536, 285, 72, 875, 627, +3142, 105, -941, 1245, -489, -495, -229, 44, +-236, -1083, -2336, -1193, -1620, -1859, -1339, -655, +205, 1032, 5581, 1195, -2635, -1740, 2656, 1976, +-52, 784, -96, -165, 419, -486, 8850, -624, +-792, -1531, -765, -674, -730, -829, -150, -27, +2255, -1177, 2727, -1430, 737, -902, -780, -729, +169, 278, 3729, 3763, -32, -1581, -563, -573, +77, -372, -64, -477, -2500, 526, -1682, 1464, +-830, -124, -548, 561, 202, 1115, -1682, -1552, +-2014, -2127, -1374, -749, -720, 64, 2097, 6944, +-2771, 4929, -1680, -2212, -1430, -801, 114, 891, +1176, 855, 3571, -2187, -1566, -1694, 84, -46, +932, 786, 765, 856, -1038, -498, -117, -1582, +-1379, -1162, 6293, -367, 594, 132, -2487, 2119, +-2153, -1749, 833, 1089, 507, 133, 337, 423, +-2777, 2507, 277, -1455, -1019, 1811, 639, -595, +136, -1050, -2941, 4474, -176, 1095, 1113, -479, +182, -295, -229, -605, -2035, -1649, -1171, 51, +0, 125, 2844, -310, -82, -640, -2251, -2138, +-2270, -1567, 2260, 92, 368, 95, 1433, 1346, +820, -2339, -1822, -895, -69, 158, 190, 911, +1008, 764, 684, -1756, -1013, -1625, -1610, 6062, +-499, -1036, -139, 1129, 488, 524, -665, -870, +-347, -76, 123, 91, -12, 14, -2867, -2019, +2858, -1903, -1165, 309, 287, 1250, 767, 776, +-2784, -2446, -1157, 460, 2589, 437, -285, 711, +-299, 402, -2683, -2271, -1714, -1535, -547, 4118, +510, 1158, 700, 631, -2084, -1236, 509, -1009, +-510, -193, -1075, -793, 727, 2150, -2722, 968, +1077, -1579, -1410, -894, 401, 1043, 427, 182 diff --git a/src/main/resources/vavi/sound/twinvq/fcb08s.txt b/src/main/resources/vavi/sound/twinvq/fcb08s.txt new file mode 100644 index 0000000..c9a1f5a --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb08s.txt @@ -0,0 +1,40 @@ +-2368, -2340, -1735, -1897, -1493, 984, 3062, 2826, +1049, 164, 1181, -1990, -1833, -1720, -1360, 24, +1485, 1923, 460, 511, 69, 78, -353, -3, +3761, -480, -1538, -1063, 540, -64, -1546, -988, +1514, -1167, -1354, -563, 1435, 880, 1123, 182, +-2243, -2109, -2378, -2201, -1491, -836, -124, 605, +6159, 3636, -2770, -2959, -2956, -3019, -2154, -648, +1805, 4698, 2929, 2078, -975, -360, -895, -623, +-593, -879, -345, 4333, 492, -56, -2102, -781, +-476, 1268, 606, -670, 1686, -105, 370, 461, +-221, -868, -1381, 297, 128, -578, -809, -938, +3896, 490, 4032, 2675, -684, -1108, -1235, -915, +-874, -919, -802, -1040, -1324, -16, 2156, 1943, +-652, -666, -47, -1499, 168, -210, 4213, -1895, +-1734, -1767, -1412, -867, -71, 329, 855, 1294, +-1849, 4393, -1312, -1597, -564, 434, -454, 269, +892, -31, -1170, 67, 370, -1144, -320, 3706, +-811, -190, -123, -166, -659, -1033, -789, -902, +-347, -280, -108, -313, 452, 3701, -1505, -2610, +-2758, -2550, -2034, -1361, -676, 713, 2263, 8286, +-2241, -2508, -2540, -1721, 182, 1947, 306, 1773, +1220, 2909, -60, 73, -235, -1631, -1302, -692, +4171, -830, 49, -188, -471, -2208, -2265, -1518, +-196, 2995, 2571, -579, -68, 805, -1294, 1274, +4294, -1356, -702, -532, -465, -123, -400, -719, +336, 3093, 1634, -906, -71, -502, -938, -982, +-742, -1187, -1757, 2890, -1591, 1303, 216, -311, +-404, -29, 501, -543, -1466, 1587, 309, -578, +-173, 34, 1116, 1286, -1184, -1174, -175, -732, +-619, 3508, -80, 191, -1059, -174, -429, -470, +10000, -933, -1511, -1601, -1571, -1445, -1065, -1407, +-1053, -932, 1183, 7875, -460, -1609, -1618, -1398, +-1154, -1227, -1012, -1450, 20, 28, -235, -110, +203, 105, 252, -154, -51, -58, 2940, -490, +17, -51, 131, -106, -526, -566, -822, -1177, +-1335, 2749, 608, -1575, -1322, -1351, 111, 641, +1441, -9, 733, -207, -273, -665, -630, -588, +-78, 254, 304, 762, -2661, -2677, -1238, -82, +2569, 3001, 932, -1032, 211, -324, 40, 1395, +-836, -1119, -635, -1425, -1514, -1135, 1509, 2963 diff --git a/src/main/resources/vavi/sound/twinvq/fcb11l.txt b/src/main/resources/vavi/sound/twinvq/fcb11l.txt new file mode 100644 index 0000000..501550a --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb11l.txt @@ -0,0 +1,80 @@ +-3004, -2927, -2672, -2356, -735, 179, 950, 1734, +1101, 1641, -1610, -1161, -1606, -179, -1634, 3383, +-610, 240, 73, 1128, 818, -1052, -1641, 724, +-1938, -1741, -1211, 3967, 1988, 1445, 3010, 2203, +-1685, -1698, -1838, -759, -144, 515, 999, 1215, +3239, -1912, -2048, -1739, -1488, -148, 1590, 1370, +1066, 1270, -2721, -1637, 99, -1964, 224, -946, +-1437, -954, 755, 1420, -2800, -2211, -2304, -2048, +4853, -714, -383, 2159, 1823, 2328, -1619, -1584, +-1839, 5462, -1703, -802, -227, 485, 1017, 1695, +-2459, 2399, -1820, 2254, -1373, -767, 53, 705, +1074, 1293, -1582, -2486, -2208, -2341, -2264, -2132, +-1578, -1043, 322, 7685, -2198, -1768, -2106, 16, +-2207, -1495, -1106, -961, -482, 1642, 6785, -1540, +-1540, -1449, -1177, -854, -307, 853, 1279, 1449, +3253, -1427, 2314, -1473, -985, -1025, -321, 923, +1140, 1166, -2704, 2664, -2444, -2717, 481, 3083, +-1449, 1225, 3168, 2389, -2124, -1981, -1342, -1939, +-1904, 4736, -885, -826, 3866, 2046, -290, -567, +-1986, -1880, 1966, -465, 1638, 683, 1005, 1099, +-2842, -2537, -2559, -2427, -1243, 4039, 1371, 3897, +2529, 2400, -2586, -1328, 785, -1697, 1733, 2382, +-442, 190, 901, 1281, -2669, 2198, -1502, -1404, +2593, -694, -186, 466, 1065, 1199, -1905, -1389, +6171, -1817, -513, -989, -356, 246, 1619, 1883, +36, -2178, -1602, 608, -1523, 23, 1265, 578, +953, 1038, -483, -2278, -2138, -1740, 584, 244, +-54, -192, 915, 1097, -213, -1569, 1861, -1401, +3686, -1625, -1234, -614, 860, 1311, -1397, 2315, +1896, -1608, -1326, -1487, -99, 2241, 697, 1156, +1711, -2099, -1507, -135, 1422, -695, -57, 1390, +823, 937, -122, 479, 47, -2144, -1514, 955, +-1317, -726, 480, 1153, -2959, -2558, -2573, -1355, +-1879, -1446, 6435, 677, 3124, 3134, 1850, 1834, +-1396, -1417, 1290, -896, -561, 1428, 1007, 1105, +-2101, -2044, 1779, -1913, -1868, 1410, 916, 1232, +1112, 1335, -2663, -104, -513, -96, -470, 480, +1516, -150, 298, 714, -2558, 3076, 468, -745, +-945, -443, -849, -989, 341, 1102, 433, 588, +-1772, 462, -527, 670, -128, -108, 583, 701, +-2281, -2149, -2398, -2749, -2557, -1691, -1095, 1336, +9088, 3844, -1799, -1861, -1908, -2242, -2184, 2313, +3779, -809, 519, 2229, -1914, -1673, 1764, -634, +-1955, -1721, 405, -499, 243, 1632, -2377, 7289, +-1659, -1752, -1341, -948, -323, 841, 1703, 1774, +-2029, 2384, -1877, -1918, -1729, 1483, 483, 1916, +576, 1258, -2310, -1796, 2208, -1579, 57, -1735, +-1161, 5177, 1674, 2468, -1907, -1499, 1868, 2275, +-620, -356, -228, 489, 1064, 849, -683, -1204, +-1761, -2211, -606, -764, -1056, 3888, 253, 1518, +-2555, -2075, 119, -1567, 971, -1178, 2683, 1476, +978, 1419, -2947, -2418, -2164, 1178, 1582, 1470, +896, 645, 1671, 1462, -2234, -1363, -1184, 1408, +1042, -1091, -208, -49, 527, 917, 1266, -1444, +-2174, -2447, -2300, -1732, 3076, 5631, 248, 2195, +-2477, -1724, -2434, -2477, -2524, -1828, 2331, 845, +1423, 1767, -2393, -1946, -857, -462, 344, 17, +-896, 2391, 892, 882, -828, -280, -752, -1136, +-1563, -1040, 1222, -1173, 1763, 1179, -1448, 1946, +-1815, -1588, -1638, -1282, 3302, 132, 509, 1408, +-2760, -2338, -1935, 1353, -1531, -1074, 1156, 3086, +1374, 1667, 2302, -1623, -1897, -1991, -494, 2603, +-754, 524, 1265, 1304, 3062, -1359, -1365, 1987, +-1334, -916, -146, -40, 635, 1033, 1724, -1057, +49, -1159, -774, 106, 1053, -153, 134, 691, +-119, -1226, 332, -363, -197, -69, -133, 573, +190, 216, -2236, -294, 1288, -2110, -1537, -1005, +-1175, 56, 4227, 1623, -2440, -1894, -1623, -2377, +2287, -1220, -1506, 177, 5689, 2849, -2857, -2166, +-2546, 2174, -2414, -2343, 559, -1020, 4650, 3514, +-2875, 1309, -2557, -2534, -2235, -1901, 1559, 4412, +2301, 2204, -2969, -2018, -2399, -2834, -2431, 1316, +-1474, 1269, 2533, 3485, -2892, -2387, -2716, -2317, +-2031, -1992, -1311, 8071, 3933, 3807, -2139, 1909, +-2200, -2344, -2060, -1638, -1154, -210, 2781, 2139, +1119, -1828, -2069, -2306, -1975, -1165, -444, 789, +2409, 1551, -2929, -103, -1920, -2010, -904, 694, +-188, 4, 1051, 1190, -2649, -2454, -2205, -1651, +-1856, -1552, -1165, 352, 3351, 1266, -1719, 57, +-1828, -420, -938, -1251, -461, 1294, 1158, 893 diff --git a/src/main/resources/vavi/sound/twinvq/fcb11m.txt b/src/main/resources/vavi/sound/twinvq/fcb11m.txt new file mode 100644 index 0000000..8a68220 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb11m.txt @@ -0,0 +1,40 @@ +-2704, -2459, -2349, -1535, 2807, 365, 1064, 892, +830, 1222, -2190, -1542, -2285, 6443, -1607, -1362, +-605, 637, 883, 877, -2378, 2292, 3106, -1057, +1776, -1094, -859, 249, 199, 256, -1537, 2098, +-1126, 2243, -1186, -193, -211, 211, 502, 308, +3369, 3197, -1271, -1370, -355, -423, -537, 468, +-237, -99, -1439, -1748, -2185, -1972, -1357, -814, +-470, 815, 1306, 6390, 1983, -1169, -1749, -29, +-1368, 5929, -1539, -900, 576, 701, 1708, -1608, +-1148, 3522, -822, -120, -461, -158, -43, 39, +-2543, 8872, -1347, -1580, 222, -488, -162, 295, +382, 291, 11143, -1223, -1270, -1399, -392, -563, +-500, -604, -544, -135, -1787, -1313, -1490, -1395, +-1100, -1278, -818, 6172, 768, 1597, -623, -681, +-1128, -1575, 7257, -665, -1021, -439, 932, 703, +-1496, -2168, -1945, -1454, -808, -1261, -354, 875, +6706, 1956, -1773, -1503, -1536, -1162, -1386, -1885, +-1607, -318, -72, -7, -1932, -1349, 6150, -1852, +-345, -18, -81, 223, 339, 425, 362, -1623, +-1432, -1973, -1042, -1373, 7830, 38, -116, 1000, +421, -2375, -1808, -1832, -1046, 2077, 955, 1576, +581, 824, -2021, -1582, -1402, -1420, 69, 3549, +-513, 192, 262, 483, -2503, 4173, -11, -1532, +-893, 282, 187, 320, 176, 259, -2308, 2342, +-2385, -2147, -784, -375, 413, 833, 889, 1297, +1415, -1085, -1009, -1501, -1246, -1298, 1553, 1384, +332, 662, 2226, -2399, -1752, -857, 1899, 131, +501, 209, 217, 346, 4294, -1811, -1694, -1080, +-752, -263, -228, 249, 628, 971, 2508, -1031, +2871, -1054, 42, -202, -738, -170, -239, -290, +-2751, -2379, -2379, -1999, -1448, -380, 1594, 1279, +1399, 1633, -2376, -1839, 1367, 1685, 356, -126, +-50, 143, 31, 33, 314, 160, -663, -687, +25, 388, -267, -188, -188, -129, -2614, 1063, +-1835, -285, 2549, 205, -30, 370, 319, 297, +-87, -2208, -1164, -839, 894, -266, -410, 375, +1263, 924, -2606, -2325, -1854, 1792, 407, 328, +-110, 575, 1090, 971, -2517, -1583, 1355, -1892, +-490, -203, 846, 724, 597, 779, -1650, -1281, +-1294, 549, -146, -548, 2947, -28, 265, 339 diff --git a/src/main/resources/vavi/sound/twinvq/fcb11s.txt b/src/main/resources/vavi/sound/twinvq/fcb11s.txt new file mode 100644 index 0000000..891b792 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb11s.txt @@ -0,0 +1,40 @@ +-1536, -2360, -2378, -2138, -1380, -346, 1575, 2779, +3247, 1689, -340, -1788, -1839, 103, 31, 853, +-653, 3159, 365, 154, 404, -835, -716, -35, +4309, -155, -1214, -1180, -750, -522, -753, 350, +-1660, -1603, -1159, -582, -489, 1067, 2615, 1747, +-1755, -2351, -2314, -1453, 922, 3458, 867, 439, +493, 1212, -1584, -1655, 1300, 1783, 1641, 1442, +816, -1283, -1456, -1417, 4998, 1923, -200, -1086, +-1060, -1016, -1074, -1217, -1285, -1245, 633, 390, +-1443, -1099, -507, 3041, 343, -163, -745, -667, +2333, -2144, -2460, -2247, -2063, -1736, -742, 418, +3124, 3504, 227, -735, 799, -1326, -20, -543, +1900, 237, -671, -545, -1727, 121, -1750, 3700, +-485, -553, -77, -212, 942, 62, 1647, -688, +-1506, -1429, -619, -839, 172, 3209, -500, -371, +-1680, -1408, -1122, -563, 3627, -115, 510, 534, +-65, 199, 800, 5040, 631, -744, -612, -1023, +-1099, -1319, -1520, -1460, -1120, -274, -1220, 349, +1848, -620, -1411, -616, 1771, 1024, -1223, -2195, +-2345, -2144, -1517, -1055, -385, 557, 1482, 6797, +-2274, 818, -460, -707, -274, 646, 654, 731, +268, 347, 4583, -1289, -1452, -1193, -1072, -681, +-178, -131, -108, 547, -1521, -781, -1298, 239, +-486, -445, 3453, -226, 90, 653, -1237, 624, +4692, -482, -798, -799, -766, -645, -890, -915, +3748, -909, -1012, 85, 963, 375, -100, -1010, +-1269, -1508, 2106, -1194, 2632, 595, -826, -221, +-411, -1104, -1365, -1050, -2112, -863, 1943, -727, +-1079, -733, 78, 1990, 363, 953, 1325, 459, +-891, 3364, -410, -362, -547, -994, -1371, -1258, +12270, -43, -1668, -1868, -2004, -2133, -1863, -1949, +-1805, -1288, -1640, 3783, -1414, -578, -505, -464, +-158, 252, 71, 76, 22, -20, -72, -13, +-19, -95, -14, 2, 23, -5, 1289, 630, +291, -707, -794, -857, -715, -122, 551, 219, +-2358, -1905, -1397, 277, 572, 343, 789, 526, +1629, 991, -980, 222, 740, 1199, 19, 1200, +-864, -467, -656, -138, 820, -2005, -924, 154, +195, 393, 267, -183, 1024, 100, 1243, -872, +-705, -781, -422, -377, -910, -637, 89, 2849 diff --git a/src/main/resources/vavi/sound/twinvq/fcb16l.txt b/src/main/resources/vavi/sound/twinvq/fcb16l.txt new file mode 100644 index 0000000..6d73220 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb16l.txt @@ -0,0 +1,80 @@ +-2676, -2246, -3119, -2904, -2707, -1946, 7718, 2292, +2451, 4206, -1214, -362, 1116, -860, 30, -993, +-888, -1046, -3732, -2268, -2541, 6060, -2220, -1597, +-1650, -1320, 88, 1229, 2118, 2348, 1430, -1865, +-2190, -2122, -1844, -2069, -1746, 15, -1746, 1321, +-2671, -2993, -3247, -2811, -2141, -1360, 1886, 270, +-381, 5676, -2070, -444, -674, -1082, -1144, -346, +-823, 4630, -224, 1940, -2441, -2072, -2194, -295, +2175, 1209, -734, 168, 923, 1359, -2667, 389, +-2585, -2279, -2195, -1141, -1016, -218, 109, 1926, +5184, -2226, -1888, -1273, -1044, 25, 461, 886, +1125, 1249, -2215, -2381, 3109, -1963, 3015, -2027, +-790, 1192, 1646, 2188, -2906, -2598, 484, -2372, +-1372, -1082, 1718, 664, 1391, 2396, -2518, 1937, +-2362, -2510, -1504, 2947, 446, 684, 1947, 2059, +-3263, -3001, -3240, -3034, -2598, 3367, 4407, 2327, +2450, 2994, -2379, -1875, -1862, 6387, -1956, -1417, +-525, 1098, 1836, 2932, 1408, -1130, -1417, 1693, +-262, -645, -515, 443, 735, 619, -2834, -2246, +-2646, -2521, -811, 6608, -421, 1572, 2015, 3234, +-2086, -1435, 89, 1648, 838, -986, -1159, -1208, +-32, 1354, -2135, -2159, 7796, -2424, -949, -2040, +-1179, 228, 1187, 3008, -2963, -2500, -2074, -2025, +-1439, 1692, -378, -596, -62, 2419, -3522, -3132, +-2899, -3290, -2929, 2844, 49, 4307, 2754, 3897, +-2960, 1305, -1858, -831, -1379, -773, 3257, 979, +975, 1513, -2849, -1610, 2483, 456, -1395, -634, +847, 1320, 1116, 1175, 2497, -1554, 2176, -1697, +-997, -799, -120, 339, 996, 1379, 11359, -1557, +-2219, -2237, -1792, -2084, -1009, 781, 3341, 939, +1954, -1860, -2347, -2117, -2000, -1394, 3825, 106, +2595, 2162, -2938, -2488, -2112, 772, -1059, 1822, +159, 1017, 2452, 1506, 1313, -2615, -2479, -2941, +-2220, -2510, -726, 4703, 1778, 3375, -3133, -2664, +-2821, -2771, 1559, -1000, -434, 1874, 4130, 2987, +-2998, -2692, -2326, 1580, -2231, -1347, 4166, 2021, +1177, 2531, -2880, -2337, -2589, 1505, -2843, -2468, +-339, -1059, 3212, 4264, -3112, -2885, -2889, 975, +-2522, -2278, 721, 5057, 3989, 3373, -3098, -2947, +-1128, -2251, 1935, 2981, 3007, 975, 1983, 2048, +-2861, -2302, -2431, -1460, -1492, -1524, -944, 1556, +1778, 1549, -2658, -2259, 2768, -2460, -1447, 2957, +759, 324, 2533, 2477, -2935, -1687, -2554, -2647, +-1431, 118, -365, 10280, 1526, 3447, -2570, 2268, +-2351, -2115, 2588, -9, -834, 1115, 1878, 2365, +79, 1132, -1619, -1406, -1568, -1766, -224, 825, +2113, 1382, -548, -2669, -1797, -2691, -2139, -2495, +-210, 1276, 13623, 2315, 1965, -1713, -1610, -2187, +2534, -1495, -1301, 622, 563, 2154, 2743, 3230, +-1784, -1774, -792, -493, -131, 156, 944, 1211, +-1886, 357, -1018, 225, -285, 1025, -134, 218, +290, 153, 5869, -2407, -2856, -3051, -2540, -3238, +-2260, -370, -451, 6314, -500, -2554, -2110, -879, +-323, -537, 570, 1228, 1556, 1342, -2486, 3366, +1838, -937, -959, -683, 63, 937, 652, 1212, +-2164, -1448, 166, -799, -550, -1317, 481, 299, +5494, 1360, -3147, -2574, -989, 1550, 1952, -1502, +-96, 3517, 1304, 2311, -2931, -2146, -2174, -2052, +579, 680, 896, 2697, 703, 1365, 4130, -2367, +-2627, -3125, -934, -3093, -2155, -955, 6025, 5024, +-3121, -3064, -2883, -2458, 1723, -842, 3032, 4391, +2327, 2837, -2536, -2208, -1610, -2189, 6509, -1424, +-1116, 1427, 2830, 3370, 1084, -1562, -1655, -1628, +-491, 2260, -321, 421, 774, 1237, -3267, 977, +-3170, -3144, -2698, -1324, 1424, 3034, 3323, 3347, +-3021, -3061, 2027, -2345, 852, -2832, -1714, 5926, +4517, 3839, -1490, -2416, -1726, -1268, -1458, -2137, +-1715, -580, 1403, 13408, -3005, -2706, -3063, -2745, +-2777, -2136, 2786, 202, 5141, 3407, -3104, -3001, +-3176, -3388, -3507, -2863, -2097, 2325, 2618, 6146, +-1997, -3152, -1036, -2694, -2587, -2986, -2750, -2219, +-1607, 5944, -2893, -2633, -2229, -2811, -2482, -2115, +-2219, -1180, 5246, 3252, -3111, -2052, -2693, -2934, +-1805, 2583, 353, 1262, 8588, 3900, -2468, -2726, +-1861, -2352, -2237, -2750, -2345, -1936, 9793, 8392, +-3490, -3124, -3596, -3630, -3154, -2390, 743, 6652, +6366, 6143, -2852, -3547, -3124, -2718, -1094, -494, +49, -1053, -3005, 32767, -1721, -1229, -1715, -1590, +1587, -1233, 3384, -252, 312, 1120, -3287, -2926, +-3048, -2828, -2502, -1185, 2028, 3778, 487, 2083 diff --git a/src/main/resources/vavi/sound/twinvq/fcb16m.txt b/src/main/resources/vavi/sound/twinvq/fcb16m.txt new file mode 100644 index 0000000..9d42049 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb16m.txt @@ -0,0 +1,40 @@ +616, -1065, -1622, -1949, -1283, -863, 6819, 517, +1135, 1282, 2631, -1447, -1477, -1004, 286, 1358, +-135, -340, 147, -130, 5435, -1609, -1916, -1758, +-1066, -1126, 478, 995, 1098, 1437, -1737, -1339, +-1864, -2009, -1038, -1004, -573, 810, 5974, 2840, +349, -1559, -1496, -1151, -307, -82, 681, 827, +550, 776, 1930, 166, -1100, -1489, -1185, -1182, +-1210, -326, 858, 1688, -2561, 3514, -736, 1555, +-59, -906, -123, 87, 102, 274, 1902, -459, +3008, -984, -707, -334, -571, -317, -190, -371, +-2862, 607, 1346, -1517, -1220, -617, 2494, 697, +190, 64, 3264, 3926, -1249, -1542, -933, -302, +-246, -248, 69, -283, -1766, -750, -1898, -1259, +6841, -1546, -785, -64, 1208, 1294, -1522, -1742, +-1873, -1898, -1455, 7128, -752, 1718, 1398, 1123, +-2742, 4733, -1552, -2483, -2210, -495, 355, 864, +830, 759, -2721, -2115, -1891, -1696, -1137, -1559, +-1265, -658, -591, 850, -699, 1262, -551, -1055, +877, 96, -388, -192, -479, -1091, -2763, -1379, +3290, 2331, -874, -307, -386, 615, 366, 133, +-2671, 5181, 4339, -894, -871, -634, -165, 409, +91, -291, -2649, -411, 8039, -1947, -1156, 57, +351, 1014, 472, -198, -1816, -590, 2887, -1702, +-1113, 3414, -556, 117, 483, -377, -1707, -1146, +-1155, 2518, 2014, -382, 3, -6, 206, -98, +10770, 274, -1415, -1670, -1020, -1036, -786, -782, +-463, -552, -2500, 10460, -1624, -1787, -707, -1327, +-59, 375, 91, 22, -2776, -2343, -2104, 825, +-759, -823, 482, 1149, 1265, 570, -1676, -1826, +-1848, 6125, -1391, -820, -449, 844, 586, 535, +-2873, -2475, -2607, -2611, -1830, -487, 1643, 1680, +2088, 2570, -2357, -993, 3189, -1473, 3506, -1203, +-793, 662, 464, 98, -2507, 1617, -1793, -1935, +-1307, -169, 9, 885, 728, 1178, -2010, -1346, +-1375, -187, -548, 2753, -464, -105, 799, 511, +-2170, -2428, -2177, -1497, 2072, 828, 441, 1020, +873, 1000, -1297, -1531, -1863, -1967, -1516, -1088, +-758, -230, 1561, 6655, -2173, -1787, -1548, -1763, +-1366, -24, -645, 6836, 1480, 1923, -2728, -1859, +1798, -2010, -1585, -677, -371, 1405, 1254, 1278 diff --git a/src/main/resources/vavi/sound/twinvq/fcb16s.txt b/src/main/resources/vavi/sound/twinvq/fcb16s.txt new file mode 100644 index 0000000..975678c --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb16s.txt @@ -0,0 +1,40 @@ +-2250, -2771, -2879, -2775, -2240, -1363, -272, 1233, +6172, 5074, -2882, -2419, -2054, -2420, -1252, 347, +1325, 1799, 1723, 4361, 774, 2066, 1874, 280, +-707, -605, -581, -662, -1104, -2038, 7111, -137, +-883, -1079, -1001, -54, -847, -1013, -1045, -832, +4696, 3781, -624, -1485, -1360, -1359, -1307, -1219, +-866, -945, 5419, -1512, -2307, -2134, -2056, -1724, +-1653, -630, 157, 3399, -727, -860, -1381, -380, +-716, -1335, 3819, 78, -2, 277, -3185, -3118, +-2715, -3110, -1500, 1626, 3352, 3075, 1956, -539, +16640, -1204, -2281, -2307, -2272, -2349, -2009, -2184, +-2777, -2375, -1015, 6208, -402, -1331, -1182, -763, +-730, -81, -591, -1184, -1927, 543, 4464, -1095, +-131, -542, -129, 486, -366, -1097, -1594, -554, +-15, -337, 3152, -723, 71, -40, 385, -309, +-769, 290, -853, -1058, -1196, -1557, -595, 3695, +1129, 438, 1729, -1309, -971, -871, 90, 1418, +1261, -23, -1382, -223, -1551, -713, -1044, 4495, +-160, -867, -1242, 1188, 159, 120, -1657, -951, +1536, -159, -1310, 1101, -404, 155, 1717, -24, +-1607, 2347, 2056, -1943, -1313, -1297, -81, 34, +1441, 354, -2110, -1873, -516, 1102, 2174, 2131, +0, -946, -729, 61, 107, -14, -108, -50, +42, -164, -177, -92, -29, 162, 1349, -2380, +-2099, -1692, -980, -49, -94, 331, 1317, 3819, +-482, -782, -775, -909, -640, -1099, -615, -225, +1556, 2973, -630, 70, -186, -1599, -1076, 4440, +-890, 78, -76, -517, -855, -1886, -1521, -1206, +-1152, -900, 753, 1338, 1758, 2431, -2433, -1569, +-1294, -583, 552, 2040, -154, 250, 513, 2333, +-820, -1987, -2291, -2238, -1880, -1651, -1120, -262, +2013, 9756, -2803, -2574, -2634, -2789, 356, -1838, +325, 4584, 3584, 2486, -1524, 1874, -337, -1800, +-1659, 406, 2450, 1252, -245, -1030, 1985, -397, +-1565, -51, 148, 2039, -1212, -729, -700, -11, +904, 649, 531, -2287, -1640, 766, -725, 171, +-1596, 1387, 3189, -672, -459, -794, -422, -714, +-195, -231, 185, 99, -952, -2248, -2170, -1190, +-457, 1458, 34, 1179, 2427, 1683, -1658, 3749, +-1816, -2000, 2823, -1243, -1415, 713, 875, 75 diff --git a/src/main/resources/vavi/sound/twinvq/fcb22l_1.txt b/src/main/resources/vavi/sound/twinvq/fcb22l_1.txt new file mode 100644 index 0000000..4464e55 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb22l_1.txt @@ -0,0 +1,64 @@ +2198, -2215, -2251, -1966, -1540, -467, 403, 1647, +-2867, -2589, -34, -2314, -602, 2371, 2614, 2218, +-2494, 3659, 2708, -1076, -914, 233, 1149, 1425, +319, -979, 1023, -682, 110, 239, 427, 703, +-2979, -2513, -2649, -2265, 7420, 526, 2174, 2932, +-2868, -2056, -2232, 1651, -1325, -856, -218, 2091, +458, 1508, -1208, -845, 244, -441, 558, 752, +-700, -1370, -395, 980, -321, -232, -241, 293, +10391, -1792, -1948, -1518, -1049, 43, 1524, 2033, +-2434, 303, 1730, -1205, -1432, -1183, -694, 1185, +-2531, -2656, -2751, -1756, -1321, -1100, 287, 8605, +-2868, -2554, 721, -2065, -1671, -771, 675, 2223, +-2690, -2501, -2313, 1829, 3189, 45, 1825, 2024, +-3153, -2824, -2729, -2308, 1686, -370, 482, 2606, +-2972, -2324, 2492, -1762, -1662, 28, 4976, 3214, +-2769, -316, -1146, -1954, 86, -60, -370, 1144, +5519, -1785, -1538, -1044, -580, -89, 704, 1151, +-2586, -1094, 7473, -1220, -1076, -50, 1029, 1850, +3546, 3279, -1806, -1191, -528, 682, 1160, 1341, +-2852, 1541, -2358, -1841, -2317, -1351, 993, 2417, +-2675, 2482, -2061, -2089, 3681, 626, 1619, 1818, +-2916, 2821, -2482, -2166, -1084, 1137, 5537, 2864, +-2499, -1782, 2156, 2558, -1117, 127, 1147, 1556, +-2572, 3865, -2008, -1805, -679, 119, 35, 1319, +-2704, -1872, -1756, 6843, -911, 322, 1641, 2461, +-2652, -1957, 1972, -1582, 3082, 84, 1086, 1487, +-2983, -2325, -2780, -2532, -1858, -279, 10092, 4519, +-2364, 2718, -1907, 2678, -1005, 246, 1499, 1679, +-2570, 8779, -2004, -1627, -844, 89, 1712, 2145, +3316, -1763, -1642, 2819, -599, 9, 906, 1401, +-2289, -2224, 2462, -1580, -843, 2501, -24, 1310, +3091, -1745, 2398, -1264, -731, 113, 831, 1328, +-2803, -2380, -2808, -2379, -2290, -1376, -234, 2242, +3537, -2137, -2050, -1260, 2881, 177, 1158, 1424, +-3303, -3123, -3130, -2861, -2075, 2528, -43, 3890, +-3106, -2672, -2554, 1833, -826, 55, 4910, 3324, +3993, -2176, -2446, -1848, -786, 3346, 1590, 2034, +-2725, -265, 303, 1076, -1985, 3661, 1556, 1983, +-3182, -2712, -2988, -2841, -1332, 4816, 6422, 4184, +-2230, -1248, -2176, -1806, -1617, -878, 3764, 1309, +-2280, 509, -211, 426, 773, 99, 513, 628, +167, 196, -2256, -1802, -1157, 724, 1405, 1383, +2384, -409, -672, -453, -205, -89, -12, 240, +114, -2220, -807, -1302, -1612, -405, 1134, 1381, +699, -1816, -2151, -1883, 2975, 928, 1527, 1565, +775, -2141, -1981, -1532, -591, 3338, 683, 1763, +466, -2028, -2086, 1448, -622, 589, 1294, 1150, +145, -2382, -1093, -367, 986, 323, 404, 931, +-371, -2868, -2737, -2103, 129, 771, 1498, 1974, +-1481, -1060, -2398, -1125, 285, 2777, 2975, 1431, +-2720, 1748, -2375, -1847, -912, 3829, 808, 2034, +-2492, -2447, -1248, -991, 1449, 1304, 867, 1171, +-2999, -2556, -2763, -2298, 3359, 4277, 1991, 2850, +-2692, -2640, -2593, 1813, -458, 3068, 1012, 2049, +-3258, -2820, -2845, -2395, 2787, -45, 5457, 3568, +-2491, -2114, -1884, 6, -332, -232, 1680, 1139, +2032, -2383, -2183, -1725, -914, 192, 4175, 2059, +-2922, -2972, -2920, -2210, -1143, 1850, 2468, 1871, +-3138, -99, -2651, -2510, -129, 631, 1677, 1925, +-3302, -3124, -3214, -3143, -2616, -761, 3978, 4234, +-1698, -824, -1975, -742, 2449, -610, 21, 998, +-3047, -2697, -2747, -1919, -1545, 7534, 1243, 3548, +-1863, -1257, 339, -1027, 122, -613, 1989, 953, +-2232, -1759, -1751, -969, -1591, 1917, -325, 889 diff --git a/src/main/resources/vavi/sound/twinvq/fcb22l_2.txt b/src/main/resources/vavi/sound/twinvq/fcb22l_2.txt new file mode 100644 index 0000000..876497c --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb22l_2.txt @@ -0,0 +1,64 @@ +2441, -2086, -2129, -2146, -1839, -1035, 295, 2465, +-2785, -2597, -81, -2162, -991, 3060, 3056, 2985, +-2415, 4009, 3058, -1165, -1281, -322, 629, 2232, +481, -2255, 1165, -1455, -621, -29, 923, 1371, +-2822, -2421, -2596, -1908, 6338, 279, 1845, 3532, +-2955, -2571, -2554, 744, -1785, -909, 775, 3156, +738, 1760, -458, -590, -73, 22, -91, 326, +-1098, -1511, -1000, 1741, -1024, -562, -399, 736, +9669, -2109, -1872, -1539, -1208, -265, 994, 2364, +-2121, -98, 1523, -1427, -1450, -1157, -294, 1375, +-3007, -2669, -2847, -1777, -1196, -1257, 1065, 9128, +-2948, -2509, 470, -2521, -1947, -728, 503, 3810, +-2538, -2469, -2217, 1957, 2580, -229, 1212, 2263, +-3174, -2660, -2792, -2692, 1226, -512, 555, 3960, +-2979, -2426, 1978, -2182, -1868, -455, 4681, 4580, +-2514, -1642, -1029, -1712, 416, -838, -362, 1208, +5211, -2128, -1867, -1337, -549, -70, 828, 1508, +-2272, -1611, 7307, -1612, -1244, -461, 749, 2510, +3669, 3236, -1845, -1333, -866, 268, 850, 1686, +-2805, 1079, -2258, -2075, -2017, -1115, 214, 2735, +-2719, 2676, -2154, -1976, 2884, 393, 1247, 2382, +-3043, 2188, -2703, -2353, -1861, -208, 4419, 4511, +-2187, -1630, 2246, 2331, -1105, -198, 818, 1721, +-2180, 3571, -1841, -1738, -1020, 14, 407, 1028, +-2536, -2171, -2115, 6630, -968, -306, 1438, 3574, +-2411, -1857, 1911, -1546, 2709, 57, 910, 1727, +-3159, -2565, -2675, -2746, -2017, -534, 8461, 6103, +-2299, 2912, -1851, 2660, -1479, -97, 1148, 2204, +-2510, 8781, -2194, -1790, -1114, -110, 1140, 2885, +3261, -1921, -1633, 2766, -788, -403, 610, 1651, +-2515, -2021, 2415, -1606, -1149, 2479, 297, 1693, +3823, -1538, 2514, -1261, -904, -236, 550, 1581, +-2903, -2440, -2922, -2749, -2480, -1849, -423, 3613, +3420, -1876, -1929, -1537, 2955, 58, 1014, 1950, +-3295, -3009, -3161, -2926, -2353, 2355, 351, 5502, +-3140, -2745, -2781, 1247, -1037, 538, 4939, 4382, +3584, -2284, -2321, -1844, -743, 3156, 1546, 2358, +-562, -101, -497, -1196, -1023, 1972, 1255, 1374, +-3146, -2824, -3057, -2757, -1736, 3746, 5609, 5118, +-2155, -1665, -1701, -1780, -1975, -1127, 3185, 2036, +-2540, 324, -481, 311, 624, 719, 543, 1030, +550, 513, -2430, -1817, -1129, 62, 1526, 1809, +2172, -1314, -1035, -586, -292, 233, 209, 543, +-252, -2372, -1961, -1629, -1306, -408, 451, 1339, +792, -2619, -2316, -1624, 1941, 678, 977, 1710, +428, -2499, -2369, -2101, -1448, 2988, 874, 2497, +451, -2263, -2204, 1403, -631, 694, 1424, 1658, +-243, -2104, -378, 355, 1446, 373, 377, 973, +-756, -2802, -2508, -2081, 177, 352, 2428, 2359, +-1533, -2710, -2544, -1102, 419, 3132, 1222, 1942, +-2756, 1844, -2429, -1854, -1283, 3960, 1633, 2917, +-2858, -2784, -2106, -1025, 1588, 905, 1092, 1657, +-3028, -2715, -2782, -2218, 2852, 4006, 2534, 3726, +-2783, -2355, -2146, 2113, -1201, 3361, 1178, 2670, +-3199, -2796, -2682, -2489, 1905, -471, 5097, 4436, +-2197, -1078, -2327, 420, -637, 10, 1647, 1362, +1815, -2519, -2363, -2174, -1454, -31, 4125, 3446, +-3054, -2953, -2738, -2328, -1636, 1086, 2238, 2132, +-3089, -432, -2674, -2515, -168, 745, 2236, 2305, +-3214, -2953, -3159, -3086, -2748, -1200, 3346, 5127, +-1150, -501, -2109, -1662, 2301, -401, 651, 1320, +-3072, -2608, -2833, -2249, -1387, 7704, 1811, 4960, +-2474, -2589, 83, -499, -785, 194, 1312, 1442, +-2716, -1663, -2088, -1812, -1396, 1862, -369, 1397 diff --git a/src/main/resources/vavi/sound/twinvq/fcb22m_1.txt b/src/main/resources/vavi/sound/twinvq/fcb22m_1.txt new file mode 100644 index 0000000..eada23f --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb22m_1.txt @@ -0,0 +1,80 @@ +13531, -1278, -2217, -1956, -1360, -892, -650, -866, +-255, 192, -1139, -1242, -2101, -1682, -1601, 2950, +2340, 121, 662, 446, -2636, 1711, 615, -1864, +-1297, -1098, -296, 1070, 1284, 891, 7332, -2292, +-2334, -1889, -1170, 1884, -570, 52, 1146, 944, +-2083, -2192, -2420, -2165, -1542, -1474, -278, 4147, +1506, 1666, 1014, -1657, -2225, -2261, 8568, -1445, +-523, -115, 999, 602, -2762, -2261, 271, -1797, +-1633, -790, 391, 907, 1302, 1076, -1907, -2219, +-2443, -1963, -1495, -1294, 4722, 935, 1691, 1370, +-2355, -1585, -2510, -2297, 2690, -1491, -647, 360, +1460, 1479, -2041, 368, 10454, -1277, -716, -172, +-538, -287, 169, -232, 960, -1087, -2459, -2196, +-1189, -1967, -1586, -783, 5275, 2811, -1523, -1733, +-2373, -1946, -1586, -1280, -442, -205, 2330, 6319, +-2483, -2115, -2645, -2016, -1464, 89, 529, 1338, +5291, 3186, 5770, -2311, -2696, -2420, -619, -2322, +8434, -129, 1661, 1232, -1377, -1277, -1193, 406, +-1332, -1246, -999, -497, 1024, 1500, -2791, -1417, +-2173, 2419, -1492, -734, 2795, 559, 750, 519, +-2714, -509, 4622, 3679, -294, 73, -805, 602, +-99, 94, -2658, -1984, 6907, -1780, -1244, 272, +874, 140, 1326, 693, -2679, -2274, -2551, 13351, +-2619, 4570, -1739, 2309, 1280, 1235, -1011, -2084, +-1968, -1404, 2568, 3147, -336, 270, 499, 506, +-1567, -2240, -2685, -1951, -2254, 2783, -1411, 8878, +2321, 1691, -2567, -2450, -2572, -2286, -2038, -1803, +-1316, -315, 464, 1223, -1988, -927, -2035, 2165, +3663, -919, -328, 229, -2, 217, -2773, -2160, +-2637, -2183, 5081, -1434, 1526, 2830, 1698, 1153, +-2810, -1132, 5408, -1992, 4267, -1357, 809, 563, +9, -64, -2949, 7061, 4604, -1424, -1839, -610, +-251, 370, 901, 147, -2264, 3135, 3241, -1102, +-397, -1292, 39, 17, 380, 383, -1483, -1458, +820, 2135, -646, -479, 173, 23, -274, -442, +-978, -1216, -1928, 7260, -1249, -956, -24, 250, +438, 128, 4080, 152, 2677, -587, -667, -672, +-662, -492, -722, -688, -1907, -787, 3101, -1404, +-1234, -508, 3817, 424, 657, -86, -2179, -599, +2141, -1446, -1847, 4341, -801, -26, -57, 216, +-1625, -802, 1752, -1301, 2617, -1545, -513, -401, +234, 658, 1299, -1279, 874, -1408, -1135, -40, +-423, 394, 660, 684, 3341, -937, -1842, -1177, +1945, -621, 19, -93, 141, -59, -2626, 3368, +-1588, -1959, -1506, 3729, -347, 218, 497, 585, +-2495, -2452, -2118, 578, -225, 378, 40, 1080, +908, 761, -2070, -1607, 2534, -1535, 1493, 2664, +215, 634, 317, -233, 4188, -1446, -2129, -1812, +-1428, -1579, -1038, 97, 989, 2038, 3671, -2707, +-2608, -2198, -1119, 1601, 1042, 1325, 1230, 1149, +-2566, -1054, 3659, -2173, -1772, -713, -1080, -101, +987, 805, -1555, -749, -1510, 3443, -1402, 4172, +-696, 437, 276, 219, -2735, -2453, -2082, 3898, +-867, -582, -726, 1134, 1227, 1121, 2333, -963, +-1474, 2386, -959, -327, -138, 4, 268, 479, +-2889, -2896, -2701, -1975, -593, 1212, 1511, 1087, +1482, 1612, -1703, 4874, 46, -1364, -1342, -544, +-879, -455, -488, -396, -2616, 849, -2424, -1976, +-1491, -739, 325, 1284, 1831, 1223, -48, -1457, +-2123, -1318, 1617, -1064, 2484, -467, 533, 707, +351, 422, -525, -657, 202, -476, 133, -679, +-945, -832, 1906, -2981, -2605, -1911, -2541, 11553, +-1585, 1555, 2196, 1616, -2669, -2345, -2423, -1848, +-1756, 4918, -711, 1186, 1873, 1399, -672, -1401, +-1524, -1138, -674, 1285, 195, 884, -377, -1067, +-2125, 377, -1747, -1604, 837, -334, -115, -59, +160, 483, -2220, 12861, -1633, -1616, -926, -1203, +-113, -90, 378, 148, 5740, 88, -2246, -1598, +-1546, -1694, 2790, -72, 590, 28, -2608, 4312, +-1068, 3091, -632, -651, 366, 63, 744, 375, +1746, 2753, -2075, -1621, -1033, -471, 972, 199, +575, 655, -2148, 2407, -2180, -1764, -1030, -1089, +4083, -80, 417, 384, 1196, -2284, -2549, -1771, +-773, 213, 1188, 788, 1343, 1358, -2584, 7723, +-2171, -2301, -1497, -438, 1001, 110, 671, 939, +6435, 5777, -1765, -1287, -1181, -1014, 87, -919, +-422, -444, -1930, 4906, -1660, -1558, 3617, -1177, +261, 9, 261, -47, -2539, 2749, -2476, -2298, +-1047, -1319, -341, -604, 2111, 2779, -2935, 5011, +-1860, -2363, -1686, -1033, 800, 1774, 1700, 1478 diff --git a/src/main/resources/vavi/sound/twinvq/fcb22m_2.txt b/src/main/resources/vavi/sound/twinvq/fcb22m_2.txt new file mode 100644 index 0000000..adf2ed2 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb22m_2.txt @@ -0,0 +1,80 @@ +8809, -2291, -2452, -1982, -1356, -423, 419, 588, +897, 1086, 79, -2155, -1957, 367, 1080, 233, +718, 441, 515, 642, 730, 2454, 774, -2299, +-1526, -784, -359, 96, 385, 482, 4905, -2501, +-2431, -2047, -1139, 131, 743, 999, 1243, 1294, +-2154, -433, -2461, -2201, -1552, -163, -200, 4009, +1731, 1652, -2381, 5295, -1457, -895, 3480, -1230, +-94, 471, 554, 669, -2458, -1271, 278, -2238, +-1852, -813, 888, 1032, 801, 1008, -258, -538, +-1744, -2087, -1651, -1239, 2222, -4, 783, 882, +478, 782, -1335, -1453, 1728, -627, -387, -205, +221, 193, -2282, -518, 7464, -1808, -1134, -199, +340, 321, 410, 617, 2278, -436, -2082, -1958, +-1493, -885, 628, 794, 855, 989, 232, -1115, +-2617, -2152, -1290, -1299, -458, 222, 3936, 3349, +-2240, -2787, -2689, -2255, -1241, 816, 2307, 1566, +1685, 1723, 2960, -2134, -2532, -1798, -1128, -1073, +5380, 1013, 1525, 1415, -1976, 456, -538, -1433, +-1347, 22, -496, 284, 387, 465, -2214, -1863, +-2261, 1049, -1487, -1222, 1610, 621, 1000, 1116, +-2393, -731, 4075, 2375, -1178, -908, -383, 327, +543, 572, -2071, -2039, 3310, -1903, -1502, -72, +123, 693, 721, 918, -1866, -1251, -1065, 5630, +-1574, -541, 1, 1014, 813, 887, -2145, -2421, +-2176, -1756, 1856, 408, -1, 759, 1109, 1276, +3053, -2705, -2467, -2068, -1160, 1405, 459, 1167, +1219, 1318, -2198, -2037, -2005, -2204, -2039, -1473, +-1529, 264, 1333, 1822, -2121, -1434, -472, 1901, +2448, -589, -424, 248, 376, 602, -1571, -1032, +-1243, -1619, 5682, -1162, 362, 570, 865, 852, +-1875, -805, 4258, -1569, 2992, -1175, 51, 164, +314, 648, -2083, 5574, 2553, -1866, -1156, -642, +-198, 330, 446, 602, -2365, 1601, 2873, -2043, +-1510, -1142, -20, 588, 535, 676, -2207, -1637, +626, 745, -1548, -590, 745, 540, 505, 618, +749, -1389, 857, 1387, -398, -606, -75, -86, +11, 78, 3322, -1347, 1978, -1431, -745, -280, +-42, 135, 350, 376, -508, -1349, 2961, -1184, +-647, -1257, 3009, -374, 523, 616, -1848, -41, +2652, -1609, -1603, 3284, -24, 502, 122, 448, +-2337, -1029, 734, -1533, 1523, -1312, -754, 335, +510, 774, 769, -117, 139, -1254, -1468, -965, +-375, 2, 227, 518, 3187, -1524, -776, -1253, +2977, -530, 319, -61, 244, 413, -2290, 3085, +-1763, -1480, -1374, 3272, -87, 323, 421, 652, +-2317, -2182, -1604, -1, -801, 1320, -156, 907, +799, 918, -1494, -2205, 1137, 69, 1249, 3437, +925, 29, 419, 448, 3574, -1564, -1713, 2374, +-941, -252, 123, 263, 366, 539, 1059, -1856, +-1753, 766, -1704, 106, 262, 596, 684, 820, +-2503, -1878, 1835, -594, -1024, -2105, -1567, 488, +794, 883, -1626, -613, -1410, 2846, -1413, 3557, +-348, 460, 332, 577, -907, 700, -1680, 1130, +-1637, -793, -160, -38, 473, 630, 1487, 1872, +-1526, 1379, -806, 121, -383, 149, 259, 413, +759, -2817, -2758, -2290, -1348, 460, 1782, 1536, +1513, 1503, -2265, 3193, 117, -1704, -1367, -487, +125, 365, 594, 651, -2287, 1272, -2537, -2038, +-1515, -578, 2994, 582, 941, 1058, -1556, -1583, +-720, -1584, 956, -1032, 1861, 146, 402, 429, +-2184, 1667, 1241, 289, 52, -232, -265, 210, +248, 331, 1133, -1813, -1869, -1429, -1484, 5620, +-400, 1316, 1146, 1150, -1975, -818, -1921, -2054, +-1768, 2953, -544, 426, 856, 1107, 493, -2019, +176, -1915, -1040, 717, -91, 728, 647, 776, +-2360, 739, -2136, 30, 636, -447, -116, 498, +531, 775, -2250, 8607, -2075, -1928, -1072, -450, +38, 439, 558, 778, 4484, 1056, -1830, -1716, +-988, -412, 260, 56, 425, 579, -2243, 4094, +-1267, 2172, -990, -562, 97, 304, 533, 609, +790, 780, -2029, -1947, -1327, 1224, 255, 344, +516, 660, -591, 1702, -118, -1402, 396, -1387, +2268, -247, 177, 355, 1393, -2318, -1975, -1563, +863, -939, -365, 411, 800, 1019, -2370, 4656, +-2301, -2111, -1679, -698, 458, 788, 1004, 1138, +2285, 4924, -1940, -1955, -1159, -436, 237, 5, +300, 364, -2492, 2165, -2021, -2072, 1504, -612, +-93, 249, 676, 799, -2411, 1952, -1752, -2418, +-2285, -1323, -621, 837, 1043, 1266, 76, 3160, +-2176, -2176, -1717, -1105, 1045, 410, 728, 940 diff --git a/src/main/resources/vavi/sound/twinvq/fcb22s_1.txt b/src/main/resources/vavi/sound/twinvq/fcb22s_1.txt new file mode 100644 index 0000000..3767b27 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb22s_1.txt @@ -0,0 +1,80 @@ +11523, -796, -1488, -1897, -1888, -1691, -1767, -1794, +-1622, -1210, -2284, -2777, -2382, -1371, -238, 2997, +3182, 588, 1129, 704, 248, 1703, -264, -1306, +-1147, -560, -1513, -956, 1667, 1340, 5220, -2276, +-2215, -2049, -1479, -1294, -774, 66, 1270, 2075, +-1435, -1981, -2322, -1896, -1321, -462, 138, 5022, +2549, 1683, -100, -1744, -1528, -423, 6093, -61, +-288, -623, -650, -828, -1521, 134, 1240, -1399, +-1450, 612, -969, 2585, 945, -312, -1138, -2488, +-2513, -1988, -1607, -773, 3384, 1192, 2651, 2580, +-984, -2015, -1465, -1576, 2273, -1221, 91, 2615, +840, 1299, -1069, -2151, -1899, -735, 440, 888, +-241, 502, 953, 3613, 1806, -1855, -2303, -1758, +-1318, -1484, -10, 597, 3723, 1992, -488, -2063, +-2284, -2172, -1905, -1547, -937, -18, 3276, 7184, +-1942, -2302, -2399, -1972, -1378, -635, 302, 1081, +5454, 3358, -447, -807, 205, -1805, -1546, -446, +6364, -916, 151, -377, -582, -856, -204, -731, +-884, -674, -257, -67, 1564, 2486, 1003, -1508, +-1692, 1515, -889, -622, 2366, 9, -17, -245, +3733, -1057, -284, 3197, -31, -440, -1115, -1609, +-1834, -1930, 230, 262, 7344, -39, -1746, -562, +-1554, -1838, -1648, -1310, 2157, 80, -102, 238, +-823, -622, -720, -115, -274, 16, -1562, -1785, +-1535, -334, 2604, 3388, -410, -103, -348, -142, +1676, -441, -2267, -1988, -1421, -680, 1302, 2682, +383, -10, 1487, -1086, -251, -1134, 141, -84, +-1003, -898, 95, 2304, 802, -1549, -1562, 2650, +2180, 64, -512, -832, -705, -429, 1826, -2283, +-1976, -1277, 2699, 504, 249, -9, 178, -33, +-1357, -1138, 3005, 293, 229, 1633, -197, -540, +-1245, -1617, -1269, 6639, 2437, -647, -1501, -1097, +-1051, -1150, -1183, -1461, 71, 1529, 2847, 1149, +-705, -1345, -1605, -629, -617, -60, -2081, -1435, +938, 844, -1055, -841, 1179, 392, 1112, 946, +-1252, -1728, -266, 7063, -1335, -920, -1048, 206, +48, -619, 4764, 274, 2394, -799, -798, -1003, +-1278, -1800, -1626, -1415, -498, 1439, 1643, -1978, +-1258, -1136, 1285, -9, 596, 141, -2211, 908, +802, -470, -1125, 3216, -234, -412, 3, -980, +15, -1047, 1530, 660, 1986, -480, -499, -550, +-733, -531, 1326, -1607, 787, -1136, -1002, -65, +358, 743, 253, -294, 3498, -1033, -1270, -790, +537, 1788, 309, -72, -1241, -1999, 609, 2981, +-1025, -1642, -958, 3845, -1221, -962, -965, -1612, +-1993, -33, -1136, 1086, -46, 1178, -229, 139, +644, 718, -1696, 2411, 1019, -1056, 52, 224, +-487, -395, -40, 125, 3001, -1955, -1950, -784, +-1111, 897, -514, 159, 785, 1095, 2944, -2554, +-2407, -1975, -632, 1030, 1712, 366, 463, 125, +-2354, -796, 5663, -1055, -1151, -870, 348, -676, +1447, 215, -1005, -1531, -910, 2249, -438, 2889, +107, -404, -271, -534, -1022, -2117, -1738, 2261, +-257, -788, 32, 1747, 1196, 910, 33, 1, +-23, 28, -25, 19, 13, -29, -23, -48, +-907, -2113, -1978, -1426, -535, 1589, 1908, 2724, +1646, -897, 758, 2326, 674, -1449, 111, 220, +475, -162, -1465, -2036, -528, 1308, -2087, -2031, +-1308, 183, 35, 1097, 1008, 1864, -2116, -2303, +-1928, -261, 2342, -292, 1480, 268, 1582, 1079, +-1183, -1154, -777, 309, 1218, 683, 1314, 1677, +-758, -1745, 1422, -1331, -1638, -1100, -303, 5003, +-57, -379, -511, -756, -727, -2315, -1860, -1775, +-676, 3854, -67, -52, 2018, 1532, -160, -197, +-75, -1934, -1134, 2025, 1810, -491, 83, 646, +390, -297, -441, -342, -479, -486, -296, -30, +443, 1151, 3508, 6119, -493, -1427, -1393, -1273, +-1280, -1687, -1683, -1511, 5109, -1008, -1137, -638, +-649, -342, -590, -478, -577, -349, -579, 2548, +-463, 2107, -568, -678, -788, -454, -608, -452, +1934, 1485, -1746, -1007, -1174, -573, 239, -119, +679, -76, -1687, 1956, -898, -477, 456, -156, +1460, 13, 92, -987, 554, -2772, -2578, -1694, +-235, 753, 1527, 1106, 1539, 1342, -1305, 6560, +-1526, -1765, -793, -600, 248, -542, -63, -421, +4828, 1288, -1580, -1826, -1163, -1014, -221, -818, +-109, -61, 1265, 1939, -1265, -414, 1912, -190, +-1157, -675, -756, -935, 2529, 136, -1709, -1727, +-1819, -1504, -1232, -959, 1128, 4142, -1945, 2958, +-900, -1432, -1720, -1380, 381, 1473, 1235, 1062 diff --git a/src/main/resources/vavi/sound/twinvq/fcb22s_2.txt b/src/main/resources/vavi/sound/twinvq/fcb22s_2.txt new file mode 100644 index 0000000..7ba87ce --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb22s_2.txt @@ -0,0 +1,80 @@ +6946, -1850, -1986, -1590, -1276, -1063, -1026, -1017, +-805, -346, 9, -2911, -2843, -1899, -198, 2193, +3325, 1315, 37, -528, -371, 599, -751, -2157, +-1912, -855, 988, 1222, 1085, 953, 3212, -2793, +-2564, -1707, -657, 683, 1109, 683, 647, 446, +-1906, -2315, -2569, -2428, -1698, -600, 1100, 3790, +3368, 2172, 2017, -895, -1354, -734, 2552, -403, +-68, -402, -752, -932, -1205, -1937, 572, -1434, +-500, -579, 291, 1723, 1312, 1695, -238, -1715, +-2029, -1525, -816, -363, 2816, 167, 2196, 1793, +897, -1081, -262, -1338, 1052, -1231, -94, 1296, +503, 184, 588, -2057, -911, -1933, -1769, 167, +1013, 1774, 1414, 1289, 2406, -1906, -2055, -1952, +-1726, -1618, -451, 575, 3021, 2569, -776, -1649, +-2111, -1930, -1499, -1349, -595, 329, 3090, 5458, +-1954, -1309, -1554, -1159, -1132, 329, 714, 760, +2529, 2417, 1046, -1025, -1114, -1325, -154, -1501, +4160, -696, 230, 398, -2010, 385, -1344, 36, +-1269, -987, 1009, 1453, 1163, 1591, 916, -1534, +-508, 221, -1596, -1130, 1394, 539, 676, 676, +1263, 2029, 284, 1592, 161, -124, -572, -1362, +-1946, -2148, -1488, -222, 4967, -1202, -939, -375, +-80, -593, -445, -418, -781, -1560, 31, 4757, +-1417, -954, -402, 193, -316, -278, -926, -895, +-1024, -436, 2673, 1991, 254, 28, -861, -1291, +1475, -2708, -2689, -2118, -703, 290, 1841, 2048, +1213, 594, 132, -2598, -2427, -988, -1111, -158, +478, 2118, 2571, 830, -1430, -678, -773, 1340, +2473, -798, -751, 215, 274, -65, 335, -1947, +-1796, -1436, 3862, -611, 105, -31, 775, 669, +1439, -1266, 1670, -739, -1259, -572, -17, -107, +176, 130, 3899, 3478, -548, -1429, -1176, -1104, +-1147, -1503, -1277, -1068, -258, 2645, 1753, -333, +-827, -1306, -827, -502, -306, -119, -1602, -1644, +1922, 1127, -628, -1073, 348, 195, 616, 685, +1750, -898, -1852, 1813, -700, 254, 598, -234, +-433, -1035, 2502, 94, 467, -1672, -905, 776, +679, -11, -1071, -1845, -1083, -320, 690, 110, +-708, -1077, 2514, 70, -412, -300, -371, -717, +1700, -1625, -1346, 1954, 14, -64, -121, 181, +-673, -909, 2274, -1389, 2058, -1503, 306, -187, +-209, -69, 1523, -632, -695, -1283, -988, -569, +-798, -521, 398, 2834, 1953, -2215, -1626, 106, +6, -498, -57, 173, 731, 1002, -1706, 1701, +-328, -1745, -1398, 2176, -19, 311, 492, 667, +-1073, -1803, -1684, 703, -1316, 1803, 659, 913, +906, 1033, -1982, -102, 945, -1620, 718, 555, +613, 38, 394, 421, 2738, -1159, -2248, -1852, +-1568, 33, 363, 1490, 935, 561, 1464, -2466, +-1209, -1204, -692, 2009, 129, 354, 372, 380, +-2053, 1122, 2272, -824, -1355, -926, -122, 567, +526, 923, -1320, 59, -226, 1674, -1512, 1498, +-631, 221, 26, -247, -40, -1615, -1597, 2111, +34, -813, 200, 219, 758, 1000, 306, 394, +-430, -117, -409, -81, -207, 16, 36, 176, +-1737, -2898, -3005, -2214, -568, 2140, 4132, 2592, +504, -521, -1509, 3610, 1070, -1890, -1319, -11, +174, -148, -212, -347, -464, -1068, -2568, -2532, +-1973, -519, 2104, 3713, 1882, -145, -1319, -2375, +-1862, -843, 2061, -266, 1465, 866, 912, 1183, +-1784, 2072, 205, -375, 1112, -374, -534, -430, +-162, -204, 375, 82, -823, -1148, -752, 4681, +-339, -247, -790, -1088, -494, -2302, -2310, -1603, +46, 3367, -50, 393, 1383, 1457, -1377, -2005, +643, 326, 312, 1189, -225, 563, 261, -70, +-667, -1191, -2255, -470, 1000, 142, -525, 2285, +756, 2061, -953, 5888, -1339, -1534, -1252, -16, +-116, -305, -375, -596, 3611, -889, -511, 43, +-809, -659, -737, -510, -258, -108, -1515, 2806, +-1555, 1025, -932, -601, 146, 164, 207, 71, +1606, 93, -2420, -2311, -1641, -244, 1785, 804, +1040, 427, -1510, 38, -2490, -1987, 44, 699, +1407, 988, 1061, 411, 1162, -1382, -2669, -1635, +-905, 1503, 674, 1357, 869, 244, 411, 2612, +-1792, -2147, -1693, 1434, 281, 38, 228, 424, +2291, 1354, -2128, -1377, -1014, -609, 131, -151, +418, 602, 111, 2200, -1547, -1153, 1435, -1282, +6, -111, -1, 92, 238, 613, -2271, -1181, +-1455, -919, -182, 1066, 1932, 1679, -1715, 2825, +-1764, -1759, -741, -829, 501, 746, 1056, 1416 diff --git a/src/main/resources/vavi/sound/twinvq/fcb44l.txt b/src/main/resources/vavi/sound/twinvq/fcb44l.txt new file mode 100644 index 0000000..c75a8f3 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb44l.txt @@ -0,0 +1,80 @@ +4868, -1851, -2031, -2019, -1751, -552, 756, 929, +1389, 1590, -2090, -1202, -1317, 516, -1798, -1020, +-694, 4322, 1388, 1904, -2605, -1239, 1005, -757, +-1248, -358, 699, -201, 409, 1093, -2901, -2254, +-2605, -2595, -2104, -1681, 6854, 2692, 3155, 3446, +-2535, -1421, -1745, 898, -2046, -1457, -1044, -269, +1748, 1873, -2268, -1098, 407, -1865, -2103, 1510, +-1217, -399, 1718, 2017, 3638, -1685, -1547, -1480, +1637, -744, 580, 586, 1313, 1409, 617, -2020, +-1919, -2179, 932, -937, 559, 1795, 1528, 1596, +-2867, -2553, -2507, -2653, -2365, -1985, -170, 8679, +4271, 4273, 2263, -1835, -1934, -1719, -1778, 2357, +125, 1319, 1543, 1765, 3689, -1215, 2369, -1533, +-1611, -771, -123, 1005, 1297, 1465, -2491, 2631, +-1636, -1655, 1244, -1178, 386, 961, 1300, 1553, +-2357, -2404, -2305, -2177, -1714, -383, -98, 258, +3902, 2475, -2923, -2580, -2685, -2803, -2678, -2428, +-1247, 450, 8174, 5035, -2302, -1629, -1495, 1832, +1616, -577, 639, 872, 1122, 1437, 785, -1947, +-1976, 823, -1909, -1005, 430, 1244, 1713, 1664, +-2537, 8025, -1705, -2005, -2030, -1155, 64, 1106, +1975, 2277, -2410, -2639, -2292, -1858, 162, 744, +555, 1559, 1719, 1806, -2282, -1982, -1914, 1415, +-1785, 2197, 254, 763, 1338, 1741, -2509, -1991, +-2328, -1853, -2299, 5145, -34, 1495, 2913, 3018, +-2009, -1736, 2411, -1595, 1877, -1316, 693, 1042, +1565, 1744, -2657, -2161, -2222, -2135, 4454, -1784, +1331, 3208, 2852, 2955, 3738, -1338, -1425, 2090, +-1601, -279, -2, 712, 1220, 1436, -2385, -1265, +7093, -1561, -1742, -1003, 283, 1009, 1843, 2055, +-2251, -2175, 2310, -1321, -1976, 1874, 164, 2781, +2721, 2487, 2519, -1101, -1539, -1575, -1487, -724, +-25, 355, 643, 1011, -2296, -1799, -1895, -1700, +2743, -924, -254, 32, 1504, 1910, -2811, 898, +-2363, -2518, -2408, -1737, -936, 221, 2588, 2527, +-2535, -2360, -2477, -1861, -1882, 1833, 3587, 1307, +2141, 2274, -433, -1994, -1692, -1318, -1398, -350, +1518, 1923, 835, 1262, -2246, 3383, 2458, -1464, +-1874, -983, -157, 531, 1490, 1729, 9543, -1713, +-2011, -2015, -1870, -969, -34, 1160, 1724, 1919, +-2530, 140, -1923, -1730, -1720, -605, 629, 1577, +974, 1373, -2268, -1582, -933, 1124, -1624, -514, +4156, -118, 1515, 1907, -2267, -574, -1311, -954, +-47, -1259, 15, 364, 854, 1009, -2221, 629, +994, -1646, -1324, -1509, 2359, 3453, 1393, 1912, +3586, -2286, -2537, -2560, -2415, -1748, -368, 3093, +2881, 2611, -2556, 2792, -1558, 1117, -1681, -65, +-36, 516, 1233, 1514, 531, -1814, 998, -1795, +-1693, -871, 725, 868, 1504, 1465, 907, 300, +-2060, -2366, -2392, -1881, -596, 1754, 2169, 2104, +-2755, 2709, -2298, -2627, -2423, -1875, -733, 3886, +2648, 2821, 623, -541, -163, -319, 85, 84, +15, 716, 511, 572, 3948, 2773, -1504, -1746, +-1832, -934, -78, 988, 1277, 1518, -2678, 2216, +-2162, -2331, -2076, -968, 3445, 1070, 2077, 2206, +-2892, -2425, -2674, -2905, -2844, -2584, -1381, 3269, +2696, 3281, -2090, -369, -1515, -1367, -200, 2089, +739, 700, 866, 1169, -2276, -1057, 2851, 2589, +-1686, -515, -65, 579, 1278, 1593, -2837, -2458, +-2565, -2783, -2843, -2468, -1704, -1531, 1475, 4153, +-2209, -1857, -1873, -2177, 758, -1531, 3207, 1163, +1506, 1851, -2383, -1683, -1839, 5772, -1815, -465, +361, 1086, 1912, 2140, -2629, -1688, 1608, -2190, +-2419, -2064, -1253, 1397, 2099, 2306, 513, 1664, +-1683, -1629, -1682, -109, 269, 695, 1072, 1317, +208, -1602, -1918, -1038, -813, 312, 24, 26, +761, 990, -2288, -2225, -1948, -1932, -1832, -949, +-450, 920, 805, 1468, -2897, -2633, -2557, 464, +-2174, -1157, 1170, 2230, 2550, 2522, -2643, -1928, +-2255, -2578, 82, -2206, -63, 2663, 2007, 2292, +226, -2541, -2687, -2753, -2229, -1556, 785, 3837, +2331, 2492, -2496, -1740, -2465, -2295, -2151, 1142, +363, 3967, 1943, 2432, -2619, -2400, 520, -2274, +-1900, -1486, 2135, 1407, 2300, 2288, -2811, -3066, +-3128, -3098, -2529, -1475, 2172, 3413, 3613, 3571, +564, -2347, -2257, -2377, -1944, -1771, -582, 509, +1683, 1975, -285, -2136, -2529, -2464, -2117, 278, +1094, 1042, 2192, 1976, 1781, -1874, -2042, -2103, +-1744, -1044, 3373, 1252, 1861, 1873, -2688, -1849, +-2462, -2494, -2105, -1903, 2221, 250, 1653, 2233 diff --git a/src/main/resources/vavi/sound/twinvq/fcb44m.txt b/src/main/resources/vavi/sound/twinvq/fcb44m.txt new file mode 100644 index 0000000..cd8d2e8 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb44m.txt @@ -0,0 +1,80 @@ +13151, -1763, -2583, -2518, -2181, -1036, -537, -112, +214, 590, -608, -2270, -2228, -1301, -1018, 3687, +-471, -282, 909, 1665, -2426, 1713, -808, -1240, +-1366, -976, -140, 1730, 683, 191, 7253, -2076, +-2733, -2698, -2253, -1116, 376, 687, 1314, 1532, +-820, -1471, -2092, -2047, -1796, -1347, -732, 6348, +2529, 1441, -1460, -1845, -1046, -1643, 8086, -928, +90, 660, 428, -188, 604, -2022, 556, -1680, +-1641, -902, 834, 941, 1480, 1906, -2439, -2573, +-3091, -2853, -2419, -1606, 2312, 2624, 2659, 2659, +-1286, -2273, -2400, -1826, 2443, -1391, 685, 1822, +1810, 1625, -1993, -731, 9737, -1476, -1183, -1244, +34, -85, 0, 201, 4171, -2430, -2869, -2866, +-2488, -1154, -1253, 282, 2715, 3643, -2130, -2522, +-3259, -3051, -2977, -2204, -1264, 1103, 7113, 7948, +-1271, -1694, -2011, -1294, -1607, 247, -303, 715, +4276, 1908, -2337, -2111, -2232, -2123, -1648, -1302, +7686, 1213, 982, 984, -2594, -2127, -1981, -2104, +-2405, -1966, -936, -95, 326, 672, -2263, -893, +-1367, 1288, -1321, -1351, 2503, 747, 390, -247, +-2220, -860, 3641, 3766, -1724, -1487, -531, 239, +134, -82, -2563, -1537, 3883, -1911, -2109, -1713, +1056, 726, 977, 1091, -1874, -1366, -1628, 11069, +-1653, -696, 118, -78, 337, 29, 2449, -1438, +-601, -1533, -816, 1262, 540, 79, -460, -1403, +3204, -1918, -1892, -1911, -1468, -976, -42, 2785, +1088, 564, -236, -2267, -2324, -2130, -1880, -427, +-258, -543, 903, 5142, -1791, -1611, -1073, 2911, +2993, -1295, -400, 229, 192, -85, 4461, -1711, +-1431, -1640, 3525, -1398, -101, -219, 327, 415, +-669, -1520, 6595, -1291, 5123, 155, -480, -518, +-552, -890, -2609, 7074, 3220, -1054, -1852, -1165, +-25, 89, -361, -140, -1610, 2214, 2903, -1737, +-1704, -1178, -708, -171, 177, 674, -1075, -890, +82, 463, -1432, -1048, -703, -759, -247, 344, +2448, -656, -1135, 4366, -583, -705, 40, -314, +-676, -1271, 4389, -952, 3249, -1606, -1524, -1172, +-490, 97, 128, -91, -66, -1293, 1696, -1114, +-1455, -519, 2620, 479, -257, -1512, -2037, -1281, +1752, -1285, -1812, 2789, -52, 676, 409, 296, +-1977, -1043, 270, -1615, 2131, -1051, -161, -498, +767, 1673, 1044, 27, -1107, -1730, -1856, -1264, +-275, -167, 893, 443, 3850, 97, -1244, -1691, +-1566, -1088, -1062, -837, -159, 1830, -1424, 2494, +-1878, -1532, -1991, 2919, 62, 399, 524, 381, +-1340, -2415, -2028, 218, -1342, 410, 815, 533, +948, 1998, -1213, -1847, 3691, -2123, 1822, -1548, +537, 987, 356, 123, 3876, -2476, -2021, -2195, +-1562, -737, 2250, 709, 797, 1102, 2065, -2258, +-2394, -1816, -1536, 1059, 4653, 1457, 456, -27, +-2226, -736, 765, -1879, -2188, -1793, -928, 892, +1793, 2257, -1182, -1646, -1789, 6105, -1936, 4316, +-307, -143, 223, 236, -2213, -1862, -1823, 3326, +-1810, -1384, -453, 1007, 1331, 1405, 4135, -2298, +-1657, 1981, -1702, -853, -318, 298, 760, 1025, +-2537, -2782, -2985, -2687, -2839, 4493, -448, 4249, +3048, 2678, 1045, 3227, -690, -1390, -976, -652, +587, 194, -749, -1358, -730, 250, -2404, -2548, +-2157, -1027, 32, 2091, 1059, 1360, 262, -2135, +-2061, -1777, -1614, -246, 2004, 2605, 1516, -948, +-1060, -1076, -1643, -748, 144, 1595, 1730, 531, +-1086, -2182, -483, -2191, -2411, -1983, -2345, 10051, +-841, 1456, 924, 207, 4652, -1831, -2026, -1710, +-2235, 4036, -755, -70, 533, 887, -1899, -2326, +-2129, -2115, -1606, 1443, 2557, 941, 618, 527, +949, -1547, -2067, -1785, 455, -60, 79, 202, +912, 954, -2527, 14551, -1893, -2315, -2609, -1844, +497, 287, -197, 626, 6839, -804, -1299, -1259, +-1109, -97, 976, 144, -343, -1375, -2334, 3740, +-1049, 2980, -1739, -474, 223, 137, 155, -171, +2962, 1814, -2378, -2643, -2249, -1109, 858, 643, +1630, 1399, -2098, 974, -1718, -2193, -2146, -1488, +3353, -147, 1187, 1266, 1559, -2532, -2941, -2759, +-2101, -1098, 1562, 1049, 2045, 2159, -2298, 7439, +-2129, -2361, -2318, -1552, -422, 482, 985, 1111, +6050, 5657, -1698, -2267, -2127, -1135, -140, -286, +-352, -124, -1230, 3492, -1370, -1221, 2958, -1239, +-472, -722, -169, -89, -2310, 2988, -2367, -2421, +-2589, -2034, -662, 421, 1863, 2736, -2612, 5429, +-2104, -2257, -2440, -1817, 4819, 883, 622, 636 diff --git a/src/main/resources/vavi/sound/twinvq/fcb44s.txt b/src/main/resources/vavi/sound/twinvq/fcb44s.txt new file mode 100644 index 0000000..e7a0bfb --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/fcb44s.txt @@ -0,0 +1,80 @@ +11239, -328, -2011, -1713, -1662, -1290, -1225, -1520, +-1541, -912, 400, -1103, -2698, -162, 263, -964, +668, 405, 732, 2493, -2491, 1000, -2910, -793, +-1351, -515, 1051, 2002, 1757, 2150, -2010, -2021, +-2254, -1896, -1953, 664, 7067, 2632, 531, -1367, +-2228, 2113, -2019, 2309, -1458, -426, 1242, 338, +205, -222, -1317, -1806, -2477, -2427, -2477, -1852, +-1472, -911, 2261, 10280, -2369, 382, 3180, -1210, +-1601, -748, -732, 504, 1440, 1142, -13, 610, +-2457, -739, -1318, -1013, -52, -470, 627, 4734, +1248, 2947, -631, 1560, 2096, -833, -1173, -1475, +-2060, -2189, 967, -1451, -1544, -758, -538, -31, +1395, 3550, -3, -1999, -1975, -1734, -2680, -2512, +-2037, -1306, -252, 1288, 6012, 4834, -1087, 3259, +3115, -1369, -1136, -948, -264, -582, -677, -643, +-2500, 1284, -317, -1872, -1150, -1150, 310, 832, +1597, 2842, 6295, 3806, -671, -1536, -1460, -1256, +-1223, -1504, -1672, -1471, 1358, 1004, -1893, 1114, +-1643, -103, -513, 189, 303, 140, -1618, -648, +-720, 7274, 573, -180, -731, -1226, -1564, -1742, +151, 2103, -1562, -974, 94, 546, 3536, -205, +-1657, -2534, -2187, 2840, -1248, 451, 2615, 171, +479, -305, -1299, -1708, -2144, -1593, -1289, 2766, +2287, -400, 188, -51, 141, 105, -2128, 4976, +-1690, -1216, -1175, 297, 1454, 449, -478, -970, +-1914, -1459, 3036, 2668, -950, -634, -507, -374, +4, 34, -1664, 2901, 847, 2817, -1154, -1651, +-1262, -1160, -624, 629, 1578, 765, -2002, -2121, +-1527, 1938, -272, 113, 287, 955, -1473, 60, +8047, 137, -534, -841, -1077, -1504, -1788, -1758, +-1871, 119, 931, 1775, -704, 2792, 354, -501, +-1370, -2038, -1031, -1631, -1914, -879, 377, 7589, +173, -196, -491, -1658, 3790, -773, -1731, 3028, +49, -1013, -563, -1232, -953, -730, -2568, -1926, +-679, -267, -324, -962, 51, 461, 2728, 3631, +3533, -1690, -2846, -2370, -1945, -917, -551, 276, +2634, 3558, -2592, -1750, -2422, -1586, -1204, -1001, +4603, 1802, 2673, 1685, 2710, -853, -2321, -1919, +-1603, -868, 3706, 290, 570, 338, -2245, -1704, +-1915, 545, -787, 1635, 1725, 526, 666, 1604, +642, -1154, 3231, -1232, -1772, -623, 217, 27, +3, 641, -2411, 1924, -967, -1583, -1499, 2316, +1354, -115, 333, 559, -1721, 2475, -1942, -2114, +-1196, -571, 1769, 2350, 1315, -607, 4510, -1414, +-2228, -1312, 1439, 469, -248, -399, -270, -721, +-1517, -1247, -771, -36, 6488, 942, -279, -572, +-1041, -1908, -2388, -2281, -2595, -2275, -1529, 51, +471, 4435, 3002, 2738, 4049, 1562, -2706, -1672, +-1649, -1204, -518, -280, 774, 1344, 6, -1950, +-1521, -1768, -972, 1420, 3011, -191, 644, 1478, +3220, -313, 3030, -153, -841, -739, -378, -1013, +-1410, -1815, -2104, -1033, -2097, -1992, -943, 2391, +424, 369, 1601, 3331, 1494, -2060, -2027, 1579, +-1407, 1120, -280, -197, 761, 1048, -710, 4094, +-1533, -1984, -1620, -1132, -515, -485, 971, 2644, +3979, -661, -1891, -1120, -897, 2484, 1623, 21, +-1534, -2438, 3201, -1510, 858, -1459, -711, -1332, +-833, -240, 763, 1096, -1435, -29, 3174, -1773, +-19, 708, 1680, 403, -910, -2224, -2670, -619, +1320, -751, -1323, -1022, 2875, 1080, 985, 1, +191, 7823, -475, -604, -1126, -967, -1139, -1600, +-1767, -1161, -1342, -1960, -2112, -1793, -1596, 3103, +535, 2001, 3235, 151, -2266, -807, -1977, -1661, +-1255, 2328, 2632, 3189, 621, -1130, -2183, -1127, +2391, -884, 2173, -690, -354, -516, 352, 954, +1847, -74, -1260, -1839, 2557, -1221, 228, -630, +-162, 386, 1462, -1889, -2596, -2216, -1869, -518, +1281, 2329, 2653, 1117, -1535, -1038, -1752, -1862, +-1635, -1067, 994, 5212, 2719, -264, -2021, 1824, +-2110, -619, 1538, -397, -332, -153, 860, 1281, +6568, -1790, -2459, -1707, -1708, -799, 294, 89, +475, 992, -1668, -1819, -2010, -1623, 2079, 3255, +-388, 591, 1477, 581, -1544, 476, -1825, -959, +-1296, -1037, -453, 1146, 4693, 839, 2027, 3021, +-1731, -1746, -1964, -1115, 1197, 102, 164, -162, +-2301, -1281, -2022, 3983, -1122, -281, 85, 352, +1042, 1599, 6463, -93, -2010, -1988, -2282, -2189, +-1915, -1721, 17, 4694, 424, -998, -111, -1995, +-1246, -1176, 78, -116, 1951, 3059, -1974, -1783, +-2243, -1238, 3935, -928, -15, 1265, 1536, 1907 diff --git a/src/main/resources/vavi/sound/twinvq/noncommercial_license.html b/src/main/resources/vavi/sound/twinvq/obsolate/noncommercial_license.html similarity index 97% rename from src/main/resources/vavi/sound/twinvq/noncommercial_license.html rename to src/main/resources/vavi/sound/twinvq/obsolate/noncommercial_license.html index 08a1334..be7ef75 100644 --- a/src/main/resources/vavi/sound/twinvq/noncommercial_license.html +++ b/src/main/resources/vavi/sound/twinvq/obsolate/noncommercial_license.html @@ -1,229 +1,229 @@ - - - - - - - -

    SOFTWARE LICENSE AGREEMENT (LIB Version)

    -

    The copyright in and to this software listed -in Exhibit (consisting of TwinVQ Library -Program("Library Program"), operation -manuals thereof, library interface specification -and this Agreement) ("Software") -shall solely belong to Nippon Telegraph and -Telephone Corporation ("NTT"). -NTT shall enter into this Agreement with -such person who possesses the Software (hereinafter -referred to as "Licensee") with -respect to a non-exclusive, and royalty-free -license of the Software under the following -terms and conditions.

    -

    Article 1. Conclusion, Effect and Termination -of this Agreement
    -1.1 Upon using any program included in the -Software, or copying the whole or a part -of the Software, Licensee shall be deemed -to agree to and enter into this Agreement. -For the purpose of this Agreement, the use -of a program shall mean to execute such program -on a computer.
    -
    -1.2 Upon decision by Licensee not to use -a program included in the Software, this -Agreement shall be terminated.
    -
    -1.3 NTT may terminate this Agreement upon -expiration of the termdetermined by NTT, -by giving notice to each Licensee respectively -or making an announcement in any periodical -publications with a circulation of 100,000 -copies or more selected by NTT to that effect、without -prejudice to the right of earlier termination -of this Agreement pursuant to Article 1.2 -above.
    -
    -1.4 If the term of this Agreement set forth -in Article 1.3 above shall have expired at -the time when Licensee agreed to and entered -into this Agreement, this Agreement shall -be terminated immediately.
    -
    -1.5 If Licensee breaches any of the provisions -of this Agreement, NTT may cancel and terminate -this Agreement immediately.
    -
    -1.6 Licensee shall, upon termination of this -Agreement pursuant to Articles 1.3, 1.4 and -1.5, promptly erase the Software and any -and all copies thereof in its possession. -
    -
    -1.7 Licensee may not demand any compensation -or payment whatever from NTT for any reason -of termination of this Agreement.
    -
    -1.8 The provisions of Articles 3, 4.1 and -4.2 shall survive any termination of this -Agreement.

    -

    Article 2. Rights and Prohibitions
    -
    2.1 Solely for non-Commercial Purpose, Licensee -shall be granted the rights set forth from -Articles 2.2 through 2.5 hereof. The term -"Commercial Purpose" shall mean -that a software (including program) is utilized -with receiving consideration or compensation -from third party or utilized for the purposes -of receiving consideration or compensation -from third party, which shall also include: -a. The utilization of a software (including -program) by a company or other corporation -(regardless of the purpose of receiving consideration -or compensation); b. The utilization of a -software (including program) within a business -place or its facility of a company or other -corporation (regardless of the purpose of -receiving consideration or compensation ); -and c. The utilization of the Software for -the purpose of receiving consideration or -compensation from third party to evaluate -the Software, to develop an application program -utilizing the Software or to conduct a market -research.
    -
    -2.2 Licensee may use any program included -in the Software; provided, however, that -Licensee may not use such program for arms -or for manufacture of arms.
    -
    -2.3 Licensee may incorporate Library Program -of the Software set forth in Exhibit into -application program created by Licensee ("Application -Program") except that such Application -Program is used or distributed to third party -for any Commercial Purpose.
    -
    -2.4 Licensee may copy the Software.
    -
    -2.5 Licensee may distribute the Application -Program set forth in Article 2.3 incorporating -the Software or a copy thereof to any third -party, only without consideration or compensation; -provided, however, that NTT agrees that Licensee -shall be entitled to charge any actual expenses -reasonably necessary to distribute the Application -Program.
    -
    -2.6 With respect to distribution set forth -in Article 2.5, Licensee shall not modify -the contents or configuration of the Software -set forth in the Exhibit; provided, however, -that if Licensee compresses the Software -by using a data compression program, and, -if the compressed Software can be restored -to the original status with an adequate method, -such compression shall not be deemed as modification. -
    -
    -2.7 Licensee shall not re-assemble or reverse-engineer -the Software in order to analyze and convert -the programs included therein in man readable -form.
    -
    -2.8 Licensee shall not commit any act which -would infringe upon NTT's or any third party's -rights, including copyrights, industrial -property rights or privacy rights, which -would injure the reputation of NTT or any -third party or which would cause NTT or any -third party any trouble by utilizing the -Software or Application Program.
    -
    -2.9 With respect to all utilization, including -the use or distribution of the Software or -Application Program created by Licensee using -the Software, Licensee shall comply with -all applicable laws and regulations.

    -

    Article 3. No Warranty and Indemnification
    -3.1 NTT shall not be responsible against -Licensee for providing any technical services -(including maintenance services) with respect -to the Software.

    -

    3.2 NTT shall provide the Software to be -delivered to Licensee on an "as is" -basis, and shall make no warranty (including -without limitation any warranties of non-infringement -of any third party's industrial property -right, copyright or any other right and fitness -for a particular purpose), whether express -or implied, and whether legal or contractual, -including any warranty that there is no legal -or physical defect.

    -

    3.3 Licensee shall be liable for any and -all damages suffered by Licensee with respect -to the Software and in no event shall NTT -be liable for such damages.

    -

    3.4 In no event NTT shall be liable for any -claim alleged against Licensee by any third -party with respect to the Software or Application -Program created by Licensee for any reason -whatsoever, including that such third party's -industrial property right, copyright or any -other right is infringed upon by Licensee.

    -

    3.5 Licensee shall, at its expenses and costs, -indemnify and hold harmless NTT, its management, -its officers and employees ("Indemnitees"), -from and against any and all claims (including, -but not limited to, damages, costs and expenses -and attorney's fees) brought by a third party -against NTT arising out of or related to -the Software or Application Program for any -reason, including that such third party's -industrial property right, copyright or any -other right is infringed upon by use of the -Software or Application Program. In such -case, Licensee shall be liable for any damages -or costs, including attorney's fees incurred -by Indemnitees arising out of or related -to such claim.

    -

    Article 4 Other Provisions
    -4.1 This Agreement shall be governed by and -construed in accordance with the laws of -Japan.

    -

    4.2 Any and all disputes which may arise -between NTT and Licensee arising out of or -in connection with this Agreement shall be -submitted to the Tokyo District Court as -the court of first instance with exclusive -jurisdiction.

    -

    4.3 This Agreement shall apply to those to -whom the Application Program are distributed, -directly or indirectly, by Licensee ("Application -Users") pursuant to Article 2.5 of this -Agreement; provided, however, that "Licensee" -shall read "Application Users" -appropriately; further provided, however, -that Application Users shall not be granted -the right set forth in Article 2.3 of this -Agreement (the right to incorporate such -Library Program as incorporated in Application -Program distributed by Licensee under Article -2.5 into application Program created by Application -Users).
    -
    -END

    -

    Exhibit 1.
    -
    -Deliverables from NTT (including licensed -products)
    -(1) TwinVQ Library Programs
    -(2) Manuals
    -(3) Library Program Interface Condition
    -(4) Sample Program
    -(5) Software License Agreement (this Agreement).

    -

    2. Configuration at the time of distribution -of the Application Programs to third party; -Deliverables set forth in 1(1) and 1(5)above -shall be distributed at least.

    - - + + + + + + + +

    SOFTWARE LICENSE AGREEMENT (LIB Version)

    +

    The copyright in and to this software listed +in Exhibit (consisting of TwinVQ Library +Program("Library Program"), operation +manuals thereof, library interface specification +and this Agreement) ("Software") +shall solely belong to Nippon Telegraph and +Telephone Corporation ("NTT"). +NTT shall enter into this Agreement with +such person who possesses the Software (hereinafter +referred to as "Licensee") with +respect to a non-exclusive, and royalty-free +license of the Software under the following +terms and conditions.

    +

    Article 1. Conclusion, Effect and Termination +of this Agreement
    +1.1 Upon using any program included in the +Software, or copying the whole or a part +of the Software, Licensee shall be deemed +to agree to and enter into this Agreement. +For the purpose of this Agreement, the use +of a program shall mean to execute such program +on a computer.
    +
    +1.2 Upon decision by Licensee not to use +a program included in the Software, this +Agreement shall be terminated.
    +
    +1.3 NTT may terminate this Agreement upon +expiration of the termdetermined by NTT, +by giving notice to each Licensee respectively +or making an announcement in any periodical +publications with a circulation of 100,000 +copies or more selected by NTT to that effect、without +prejudice to the right of earlier termination +of this Agreement pursuant to Article 1.2 +above.
    +
    +1.4 If the term of this Agreement set forth +in Article 1.3 above shall have expired at +the time when Licensee agreed to and entered +into this Agreement, this Agreement shall +be terminated immediately.
    +
    +1.5 If Licensee breaches any of the provisions +of this Agreement, NTT may cancel and terminate +this Agreement immediately.
    +
    +1.6 Licensee shall, upon termination of this +Agreement pursuant to Articles 1.3, 1.4 and +1.5, promptly erase the Software and any +and all copies thereof in its possession. +
    +
    +1.7 Licensee may not demand any compensation +or payment whatever from NTT for any reason +of termination of this Agreement.
    +
    +1.8 The provisions of Articles 3, 4.1 and +4.2 shall survive any termination of this +Agreement.

    +

    Article 2. Rights and Prohibitions
    +
    2.1 Solely for non-Commercial Purpose, Licensee +shall be granted the rights set forth from +Articles 2.2 through 2.5 hereof. The term +"Commercial Purpose" shall mean +that a software (including program) is utilized +with receiving consideration or compensation +from third party or utilized for the purposes +of receiving consideration or compensation +from third party, which shall also include: +a. The utilization of a software (including +program) by a company or other corporation +(regardless of the purpose of receiving consideration +or compensation); b. The utilization of a +software (including program) within a business +place or its facility of a company or other +corporation (regardless of the purpose of +receiving consideration or compensation ); +and c. The utilization of the Software for +the purpose of receiving consideration or +compensation from third party to evaluate +the Software, to develop an application program +utilizing the Software or to conduct a market +research.
    +
    +2.2 Licensee may use any program included +in the Software; provided, however, that +Licensee may not use such program for arms +or for manufacture of arms.
    +
    +2.3 Licensee may incorporate Library Program +of the Software set forth in Exhibit into +application program created by Licensee ("Application +Program") except that such Application +Program is used or distributed to third party +for any Commercial Purpose.
    +
    +2.4 Licensee may copy the Software.
    +
    +2.5 Licensee may distribute the Application +Program set forth in Article 2.3 incorporating +the Software or a copy thereof to any third +party, only without consideration or compensation; +provided, however, that NTT agrees that Licensee +shall be entitled to charge any actual expenses +reasonably necessary to distribute the Application +Program.
    +
    +2.6 With respect to distribution set forth +in Article 2.5, Licensee shall not modify +the contents or configuration of the Software +set forth in the Exhibit; provided, however, +that if Licensee compresses the Software +by using a data compression program, and, +if the compressed Software can be restored +to the original status with an adequate method, +such compression shall not be deemed as modification. +
    +
    +2.7 Licensee shall not re-assemble or reverse-engineer +the Software in order to analyze and convert +the programs included therein in man readable +form.
    +
    +2.8 Licensee shall not commit any act which +would infringe upon NTT's or any third party's +rights, including copyrights, industrial +property rights or privacy rights, which +would injure the reputation of NTT or any +third party or which would cause NTT or any +third party any trouble by utilizing the +Software or Application Program.
    +
    +2.9 With respect to all utilization, including +the use or distribution of the Software or +Application Program created by Licensee using +the Software, Licensee shall comply with +all applicable laws and regulations.

    +

    Article 3. No Warranty and Indemnification
    +3.1 NTT shall not be responsible against +Licensee for providing any technical services +(including maintenance services) with respect +to the Software.

    +

    3.2 NTT shall provide the Software to be +delivered to Licensee on an "as is" +basis, and shall make no warranty (including +without limitation any warranties of non-infringement +of any third party's industrial property +right, copyright or any other right and fitness +for a particular purpose), whether express +or implied, and whether legal or contractual, +including any warranty that there is no legal +or physical defect.

    +

    3.3 Licensee shall be liable for any and +all damages suffered by Licensee with respect +to the Software and in no event shall NTT +be liable for such damages.

    +

    3.4 In no event NTT shall be liable for any +claim alleged against Licensee by any third +party with respect to the Software or Application +Program created by Licensee for any reason +whatsoever, including that such third party's +industrial property right, copyright or any +other right is infringed upon by Licensee.

    +

    3.5 Licensee shall, at its expenses and costs, +indemnify and hold harmless NTT, its management, +its officers and employees ("Indemnitees"), +from and against any and all claims (including, +but not limited to, damages, costs and expenses +and attorney's fees) brought by a third party +against NTT arising out of or related to +the Software or Application Program for any +reason, including that such third party's +industrial property right, copyright or any +other right is infringed upon by use of the +Software or Application Program. In such +case, Licensee shall be liable for any damages +or costs, including attorney's fees incurred +by Indemnitees arising out of or related +to such claim.

    +

    Article 4 Other Provisions
    +4.1 This Agreement shall be governed by and +construed in accordance with the laws of +Japan.

    +

    4.2 Any and all disputes which may arise +between NTT and Licensee arising out of or +in connection with this Agreement shall be +submitted to the Tokyo District Court as +the court of first instance with exclusive +jurisdiction.

    +

    4.3 This Agreement shall apply to those to +whom the Application Program are distributed, +directly or indirectly, by Licensee ("Application +Users") pursuant to Article 2.5 of this +Agreement; provided, however, that "Licensee" +shall read "Application Users" +appropriately; further provided, however, +that Application Users shall not be granted +the right set forth in Article 2.3 of this +Agreement (the right to incorporate such +Library Program as incorporated in Application +Program distributed by Licensee under Article +2.5 into application Program created by Application +Users).
    +
    +END

    +

    Exhibit 1.
    +
    +Deliverables from NTT (including licensed +products)
    +(1) TwinVQ Library Programs
    +(2) Manuals
    +(3) Library Program Interface Condition
    +(4) Sample Program
    +(5) Software License Agreement (this Agreement).

    +

    2. Configuration at the time of distribution +of the Application Programs to third party; +Deliverables set forth in 1(1) and 1(5)above +shall be distributed at least.

    + + diff --git a/src/main/resources/vavi/sound/twinvq/shape08.txt b/src/main/resources/vavi/sound/twinvq/shape08.txt new file mode 100644 index 0000000..1daae94 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/shape08.txt @@ -0,0 +1,160 @@ +5279, 1101, 12974, 5624, 2029, 3853, 5918, 1516, +-2905, -224, -92, -819, 803, 1091, 3091, -3355, +152, -1214, -7317, -738, -8973, 546, 12035, -937, +2216, 2113, 1214, -6577, 2006, -1661, -673, -5880, +496, 454, 3400, 676, -322, 11388, 634, -1169, +12556, -5804, -7724, 588, -6801, 1080, 354, -1681, +-942, 1926, -487, -580, 156, 79, 15253, 667, +1155, 655, -719, 1999, -785, 214, 2822, 1020, +-1967, 73, -387, -137, -15225, -1552, -357, 2830, +2140, 3070, -2552, 2410, 1230, 4131, 999, 248, +531, -909, 3948, 12858, -8056, 2205, -2837, -171, +-1633, -129, -93, 1852, -1920, 157, 9647, -84, +-150, -1365, -1522, -13197, 6168, -3195, 5890, -1724, +-6407, -1340, -7435, -621, -5732, -2895, 145, 3974, +728, 9840, -494, 7357, -394, -13614, -256, -1930, +468, -266, 8001, -153, -365, 7652, 135, 1400, +-3869, 1091, -4935, -2884, 1259, 6819, 1025, -6667, +1079, -9794, 6827, -4166, 1108, 1149, 18861, 593, +-177, -1067, -644, -2164, 4727, 85, -101, -10805, +-247, 8918, 2261, 5475, 756, 3018, -6535, 1941, +359, -4229, 1206, 958, -878, 554, -18780, 2289, +4906, -7412, -7685, 7932, 965, 2460, 4423, -563, +-3668, -3482, 3307, -1737, 971, -7480, 10742, 1978, +2365, 20, -3625, 466, 2056, -6602, 9396, 3145, +3162, 1857, -630, -6905, 1660, -3024, -2159, 1109, +1282, 2767, 210, -2203, 3099, -7889, 1805, -13115, +988, -6235, 1566, -1399, -9612, 1821, -519, -57, +3428, -14024, 1141, -2542, -9396, -17, 440, -8591, +2271, -7811, 1891, -935, -4330, -1303, 362, 426, +319, 1176, 3176, 2202, -14308, -619, -2942, -2271, +-531, -652, 345, 17681, 1453, -1561, 341, -2077, +933, 433, 1529, 463, -1095, 4912, -840, 16266, +973, 1732, -718, 6702, -3659, 4037, -704, -2707, +1423, 1291, 2300, 149, -933, -1338, 2019, 6173, +481, 14937, -364, 3896, -443, 992, -896, 378, +-226, -1505, 268, -428, -2622, -289, -2069, 10472, +-3880, -5330, 385, 3053, -4642, 1525, -1557, 716, +2504, 848, -450, -2018, -458, -705, -7120, -543, +-2138, 2548, -351, 737, 12906, -1012, 63, 15357, +332, -837, -225, -1299, 2843, 1334, -669, 2083, +-707, 1171, 8219, 2190, 10567, 1370, -1376, -2919, +2108, 10098, -388, 4442, 164, 490, 7580, 26, +-1848, -2919, 640, 4758, -108, 8194, -1325, -2314, +447, 5178, -1095, 9902, -693, -3624, -223, 690, +10495, 776, -919, -1621, 2046, 469, 1454, 3681, +-1090, -1776, 1457, 212, 2054, -994, 698, -496, +22347, -623, 254, 960, -4073, 531, -2572, -14393, +-1022, 258, -3667, 994, 15242, 5078, -3618, 1925, +-1229, -1754, 1715, 4358, 1286, -2360, -4590, 1824, +7864, 1423, -2146, -2763, -10635, 474, -829, 1159, +-157, -54, -158, -29, 202, -383, 285, -2, +862, -364, 415, -123, -145, -9733, 1167, 10199, +-1408, -2992, 2131, -412, 4743, 2992, 3555, -617, +9606, -2831, 2357, 5300, 625, -678, -500, -128, +-56, -6327, -1122, -2567, 1904, -1804, 709, 3194, +-148, -1371, -6534, -1748, -1490, 14159, 1466, 1395, +1101, -2725, 503, 68, -1486, 0, 211, -1218, +-3, 20920, 1709, -208, -839, 4574, -6084, -6557, +-103, -984, -375, 8409, 1715, -2170, -5003, -3296, +13482, 1211, -4159, 3496, 1040, 6925, 213, -1398, +441, -1231, -814, 842, 1574, 1145, 1359, 437, +-1777, 20566, 259, -4573, -1412, -158, 10144, 1269, +1405, -12631, -1104, -615, -15892, 355, -3795, -1158, +3241, 252, 232, -179, -617, -2038, 285, -1014, +-1248, 1835, -1558, 1266, -10207, 629, -312, 11376, +154, -288, 5915, -353, 60, 2695, -853, -103, +15659, 2403, -1184, 3, 9236, -10953, 4434, 829, +2563, -164, -848, -646, 7247, 895, 1726, -752, +-979, 1053, -971, 318, 2180, 927, 804, -262, +446, 3261, -4926, -4523, 1247, 2039, 12770, -1191, +-1310, -5574, 4763, 657, -4139, 10821, -805, -1109, +-3189, -1721, 167, -10022, -1877, 2123, 328, -7048, +-2130, 2431, 1522, 3209, -8448, 1810, -5412, 9815, +-3677, 6575, -6237, -929, -434, -2375, -13586, 3497, +-1140, 1227, -6354, -507, 329, -1690, 1079, -880, +-3743, -4021, -4645, -6053, 958, 4594, -1122, -11628, +1537, -3418, -1242, 133, -9335, 1611, -432, 10733, +-885, -468, -13466, 690, 214, 8968, 3441, 5451, +-219, 5492, -377, 409, 3812, 2450, 508, 6542, +3824, -3705, -514, -8262, 1537, 7969, 946, -2869, +8762, 417, 5094, 2104, 6694, -342, 1259, -4779, +-1445, -1519, 333, 4385, 652, -386, -580, -1892, +-873, 1862, 2704, 13837, -5415, -1975, 5881, 7150, +8272, -6412, 704, 1854, 257, -3746, -9789, -9634, +-924, 1393, -3237, 259, -56, 4390, 4902, 1172, +5114, -2616, -4409, -1180, 4691, 7400, -625, 8873, +6846, -1224, -213, -5296, -3504, -147, 17828, -1347, +3251, 1702, 1440, -2364, -491, -227, 1765, -446, +-9746, -2019, 11287, -195, -9559, -312, 888, 5789, +-1753, -11069, 2537, -265, -1762, -779, -8501, -308, +-89, 1973, 3640, 17344, 1326, -689, -398, -3820, +2167, 229, -636, 2142, -6587, -751, 13243, 465, +-5946, -202, -968, -1060, -240, -10626, 3405, 1302, +-1263, 972, 11351, 100, 2266, -930, -2108, 5350, +-3186, 11130, 2073, -5616, 650, 2000, 1048, 5628, +-531, 674, 8453, 1030, 1152, 12095, 352, 409, +-1029, -1236, -190, -5724, -589, 3550, 1958, -14081, +-339, 1672, -1659, 4518, -75, -638, 5501, 277, +-578, -2185, 157, 2066, 8634, -2403, 1617, -12487, +-1881, 8273, 179, -2152, -1294, -512, -415, 456, +-141, -125, -405, 132, 49, -1978, -19085, -451, +-1480, 324, -5397, 235, -1217, 346, -1258, 3540, +10075, 10291, 5060, -2057, 6156, -992, 9344, -3718, +4296, 895, -8464, 341, 1426, 648, 1494, 2895, +-3760, 10139, 15531, -984, -1550, -1319, -1542, -119, +-517, -185, -3368, -9279, -3455, -4257, 1092, -10120, +5072, 3099, 986, -2562, -12068, 1932, 6489, 950, +-2417, 1362, -567, 591, -715, -515, 3506, -726, +6319, 214, -364, 3611, 1895, -2005, -273, 1513, +2379, 475, -4855, -527, -11493, 27, 4343, -2394, +-639, -744, -2601, 10917, 1910, 2449, 1238, -2175, +5322, -4054, -40, 4274, 684, 8152, 966, 10882, +-13, 4253, -287, -3192, 548, 2020, 189, -6894, +797, 2160, 579, 4084, 1767, -4011, -640, 7697, +791, 945, 1230, 6491, 1508, -3762, -433, 11340, +-129, -1131, -5121, 3148, 1544, -7648, 1866, 9660, +2365, -2110, 782, -82, 3666, -701, 303, 298, +-1934, -125, -1427, -17589, -1188, 175, -7046, -488, +1121, -6594, 489, -1551, 14349, 1499, -544, 17132, +198, 2516, 2479, -978, -214, -3399, -1223, 2094, +130, -1020, 1049, -710, 12801, -498, 297, -1365, +-187, -3169, -123, 9019, 958, 221, 14234, -590, +961, 3092, 8, 255, -4586, 1789, 2522, -12577, +-91, -822, -805, -714, 5298, 1299, 3306, -1288, +13176, 235, 1754, -67, 1912, -604, 3240, -2048, +-200, 772, -173, -996, 1368, 2380, 294, 763, +19665, -196, 528, 182, -2394, 923, 749, -13578, +855, 589, -9553, 0, 5737, 10399, 9147, -1655, +-3735, 1246, -2429, -1147, -2199, -2953, 614, -1404, +-449, -8524, -2271, 5001, -9517, 2940, -204, 3625, +-258, 32, 1521, -299, -1786, -2836, 1523, 2427, +-835, 3139, -197, 3351, -279, -14766, -1267, 5169, +-1039, -10967, 58, 641, -767, -1193, -591, -716, +-834, 8109, -915, -711, -10427, -1680, -638, 2643, +-850, -258, 10452, 362, -5394, -349, -14727, -655, +1040, 1722, -10265, 551, -283, 9888, 408, -400, +5980, 1878, 781, -923, -667, -789, -348, 624, +-260, 14515, -804, 1721, -2, 5356, 1802, 1218, +498, 1871, -988, 16295, 4163, -2342, -4290, 3121, +3269, 112, -3492, 1124, -1496, 1863, -1426, -1090, +1598, -197, 1160, -1660, -1094, 477, -4104, -396, +1605, 26134, 746, -12876, 2320, -1690, 8626, 39, +1341, -1254, -1890, 2555, -13996, -1218, 3827, 1216, +-909, -180, 1720, -87, -143, 989, 340, -1426, +-4029, 3141, -9424, 466, -8227, 422, -7379, 2038, +401, 98, 3602, -1223, -946, 2469, 1159, 727, +-268, 467, 203, -11079, 3850, -3469, -1965, -1857, +-1415, -2477, 3173, 7352, 9483, -5541, 6212, 1886, +-3868, 2728, 577, -5057, 321, 972, -77, 47, +227, -38, -1037, -222, -347, -341, 1179, -948, +592, -7485, 2218, -5955, 2698, 11798, 197, 6260, +1711, 998, 8, -6223, -1184, 1145, -1781, 1376, +1394, 388, -689, 2279, 6511, 2542, -4903, 3917, +-790, 535, -1903, -4448, 4216, -22, -6715, 5204, +4807, 3193, -1064, 5403, 4503, -2434, -4296, 1383, +-1514, -4103, 747, 3928, 2987, 9513, 2492, -8691, +-993, -2667, -40, -170, -3116, 611, 2367, 16297, +-1256, -1404, -3462, 466, -524, 5464, 491, 706, +-7491, 2027, 373, -4086, 1620, -7789, 704, 5002, +1706, 8325, -851, -9883, -3072, 4475, 2696, -8549 diff --git a/src/main/resources/vavi/sound/twinvq/shape11.txt b/src/main/resources/vavi/sound/twinvq/shape11.txt new file mode 100644 index 0000000..69b4fa7 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/shape11.txt @@ -0,0 +1,160 @@ +44, -10592, -832, -413, 612, 530, 379, 753, +1442, -3006, -858, -1077, -12018, -196, -771, -1142, +-628, -2938, -439, -3323, 20, 12513, -2462, -1270, +-57, -8417, -690, 790, 276, 2349, -341, -1644, +230, -2176, -202, -14725, 170, 1725, 3030, 683, +-231, 641, -242, -3252, 110, -1440, 2886, -1467, +-1155, 14395, 297, 52, 240, 3938, 9880, -7555, +-1214, 3351, 129, -1269, -168, 669, 13765, -1289, +-465, 10017, -632, -328, -276, -33, 31, 18883, +-148, -131, 525, 1669, 2288, -203, 868, -660, +248, -409, -91, 295, -9174, -1484, 929, 2824, +1097, -3205, -113, 2712, -1544, 527, 1419, -963, +-388, 691, -16791, -84, 72, -3802, -357, 1633, +-15182, 62, -6024, -742, -5396, 4470, -198, 1, +1428, -1691, 18715, 1402, -2539, -375, -8455, -901, +-147, -3274, 9359, -277, -8941, 714, 2834, 2924, +-6326, 907, -123, 10487, -484, -4772, 877, 9840, +-505, -7562, 301, 671, 116, -371, 3740, 359, +385, -5145, -908, 156, 9639, 3782, -9688, -4214, +-945, -7685, 334, 2185, -1342, 388, -1741, 278, +-231, -912, 905, -1039, 598, 2049, 662, -198, +22378, 166, 116, -1699, 335, -8380, 1279, 1536, +14955, 1254, 190, -2519, -608, 364, -561, 5748, +-1178, -923, 3183, -59, 13880, -2530, 241, -564, +-319, -7510, -9, -124, -20346, 305, -25, -400, +222, -16943, -488, 802, -1685, 3323, -6198, 1000, +-903, -846, -387, 462, 847, 526, 10024, 2020, +2090, -9563, 1416, 169, -12182, -428, 10388, 869, +1068, 2201, -1041, -3180, 152, -646, 4, 4017, +-1069, 307, 5283, 3021, -13662, -493, 9, 542, +152, -2617, -3870, -514, 13497, 1180, -603, 1255, +2396, 7418, 8902, -11165, -2626, -5719, 1764, 858, +1105, 1476, -1764, 1969, 977, -1738, -928, -13940, +1444, -4157, 836, -12243, -369, -256, -15681, 5320, +-5170, -509, 353, -1581, -1455, 965, 716, 209, +-883, -317, -1961, 9128, -8197, 2173, -2434, -1126, +4066, 1025, -16663, -7013, -147, 1617, -745, -3205, +1496, 1822, -1199, -2999, 117, 619, -20002, -232, +142, 3207, 561, -292, -1635, 1035, 37, 2712, +-243, -8269, 305, -2601, 495, 14516, 831, 260, +-54, 4217, 675, -1632, 4962, 793, 1066, 133, +-344, -12428, 95, 6164, -1298, -1860, 3622, -467, +-867, -1178, 11053, 118, -36, -6997, -763, 16019, +16, 2459, 306, -820, -1135, 847, -709, 928, +-164, -293, -5736, 543, -11548, 5389, -2012, 300, +-228, -1043, 5107, -558, 1187, -140, -13034, -1571, +740, -4967, -432, -6289, -1778, 3449, -337, -12607, +344, -3790, -1598, -274, -346, -1494, -108, 325, +-1215, 819, 404, -568, -286, -21364, 15495, -2297, +606, 117, 10, -193, -972, -292, -573, -1155, +-1289, -1025, 472, 1154, 843, 187, 586, 20569, +-5, -236, -1181, -1092, 700, 891, -603, -601, +21648, -449, -193, -1103, -298, 2084, -251, 449, +-1414, 17168, -391, 104, -5465, 401, 8839, 781, +1741, 201, -369, 466, 12358, -636, -945, 3928, +-605, -17445, 5020, -1289, 977, -6202, 1783, -507, +-76, 267, -31, -2731, -1560, -1225, 1348, 11176, +1669, 754, 1671, -4038, 151, -371, 7283, 243, +1387, 126, 1007, 1292, -15, 696, 282, -2623, +1065, -1026, 191, -632, -132, -12957, -32, -1697, +-422, -240, 1352, 10252, 1067, 8296, -1244, -9, +-301, -3014, -249, -372, 10731, 535, 2147, -8959, +346, -408, -8329, -1905, -48, -8176, 2782, 412, +1425, -946, -748, 1095, -1370, 9086, -99, -143, +68, -544, 264, 494, -377, 13, -618, 237, +193, 3549, 317, -168, -7148, 2351, -244, -13240, +-3355, -2322, -533, 9554, 6906, 124, -694, -901, +-2762, 207, -915, -2520, -143, 8544, -678, -2788, +12926, 791, 1296, 4861, -1470, 889, 3675, 806, +290, -11146, 422, 9217, -31, 1608, 140, 3939, +-6903, -276, -704, 2353, -344, -1038, -230, -177, +670, -617, -129, -857, -8231, 638, -411, -252, +-15709, -1218, 210, 288, 542, 533, -9087, -10493, +-624, 1175, 611, -230, 746, 1455, -590, 830, +1756, -15800, 823, -1077, 788, 1071, 468, -1654, +660, 983, -9697, -1300, 662, 2053, -281, 12949, +389, -915, 197, -1742, -4587, 1746, 707, 1625, +9021, 2204, 759, 1303, -428, -220, 41, -5499, +-16080, -193, 443, 443, -78, 889, -561, 5629, +-1073, 7019, 222, 1661, 1190, 1108, 94, 5624, +-3796, 407, -706, -122, 744, 363, 1648, -10896, +595, 953, 85, -267, 195, 851, 17173, -636, +243, 907, 2029, -700, 351, 1495, -157, -575, +-11664, 1252, 8341, -616, 3708, 5693, -6, -1753, +1072, 863, -823, -4278, -12043, 750, 597, 3145, +38, -8140, 3136, 290, 7, 11084, -876, 1842, +175, 3458, 460, 1615, 11698, -827, 16, -12482, +428, 411, 2625, -1352, 142, 529, 229, -48, +-965, -145, -592, 655, 499, 22095, 22141, 37, +-1875, 701, 45, 724, 1111, 1631, 262, -252, +-9092, 5325, 408, -637, -612, 647, 1268, 834, +-510, 603, 199, 816, -9904, 9533, -1580, 2669, +1824, -2092, -701, -271, 7489, 46, -3295, -844, +-304, -226, -260, -692, -5, -527, 37, -49, +-1542, -69, -1087, 20519, 367, 1, 3487, 2535, +-5110, 642, 1223, -2130, -2894, 1752, -1618, 9732, +-1633, 6904, 137, 654, -358, 355, -21, -277, +-68, -188, 132, 530, 372, -315, -11498, 221, +815, 2480, -1398, -123, 353, 3114, -12025, -1212, +-1111, 916, 6452, -1880, 1867, 307, -66, 1857, +138, -980, -3088, -174, -41, -393, -656, 847, +15824, -379, 358, 672, -389, 920, -21145, -393, +350, -574, 1005, -2083, 26, 79, -203, -7967, +-3302, -5805, 772, -302, 2104, -1240, 13710, 6816, +2282, -3709, -1512, -81, -2216, -3005, 444, -795, +751, 2163, 20751, 780, 542, -480, 624, -425, +769, 2474, -5903, 399, 10564, -112, 69, -1409, +1885, 2339, 67, -620, 196, -2432, 6046, -1673, +6512, 809, 7904, -516, 4278, 223, 359, 16512, +1224, -480, -505, -735, -502, -593, -4565, 1914, +122, -531, 1442, 464, 69, 292, 410, -581, +-19848, 1059, 132, 1392, 5917, 705, -7706, 2496, +-1487, -791, 11939, 185, -265, -2412, 630, -8028, +1434, 10315, -1541, -3756, -2403, -1918, 1050, 8057, +234, 13546, -92, -2172, -671, 11631, 103, 116, +-171, -4604, -267, -602, 15, 454, 6859, -2151, +-8707, -1664, 61, 2518, -969, 903, 1209, -1435, +13531, 590, 236, -821, 598, 1186, -7690, 134, +-1005, -18177, -148, 519, 900, 951, 406, -3584, +47, 9439, 1418, -797, -3353, -703, -1798, -1244, +291, -2784, 14612, 2029, -161, 1040, -4130, 3064, +1721, -2898, 269, 3367, 1379, 14359, -690, -655, +2010, -4935, -681, -2606, 11651, 748, 101, 13593, +629, 28, -540, -854, 1405, 558, -8785, -1016, +-13043, 121, -556, 4959, 1694, -720, -138, -3897, +182, 1938, 844, 919, -683, 12042, -1101, -155, +-1375, -1509, 11, 220, 821, 21721, -367, -634, +-1468, -174, 1002, -1203, 318, 11672, -2114, 2472, +-1701, 5932, -661, 1094, 2500, -5609, 254, 437, +-911, -1611, -8005, 217, -1139, 1321, -10713, -2183, +1163, -890, -622, 12820, 1021, -13578, 1040, 3216, +592, 686, 737, -2881, -1693, 3995, -455, 4666, +-4124, -9316, 2061, 10645, 271, 264, -6829, 641, +2061, -6683, -512, -747, -9131, 2445, 343, -9944, +-2888, 607, -10855, 871, 418, 504, 936, 1079, +273, 400, -17752, -391, -1543, -6193, 1482, 737, +2096, -982, 167, 972, 336, 1063, -1272, -1602, +-1907, 9, -191, -15207, -119, 4047, 1479, -1405, +526, -18462, -627, -1996, -1022, -1544, 312, 7972, +-227, 797, -5204, -2160, 391, -423, 257, 3836, +442, -1931, 22, 143, -203, 362, -73, 15679, +-289, -1445, 577, 858, 11408, -1970, -1022, 1550, +882, -3699, -2697, 3978, 600, 86, 3858, 8683, +-7681, -4856, 4051, -1321, -587, 46, -499, -354, +-655, -15717, 67, 490, -2670, 474, -1374, 5601, +60, -17615, -808, 87, 367, 579, 1057, 1020, +-394, 1181, -189, -10846, 763, 2635, 282, -3279, +-866, -15257, -449, 112, -15577, 227, 269, 13964, +-1273, 1513, -1487, 195, 319, 2527, -286, -5883, +-5360, -959, 2791, -3335, -945, -1985, -903, -11418, +8525, 669, 6106, 153, -1169, -1198, -553, 7037, +528, -4237, 717, -214, 1824, 10108, 961, 9077, +1899, 10407, -207, -29, 355, -6794, 111, -13627, +1361, -3577, 291, 4534, 2209, -1579, 109, 523, +456, 10990, 31, -448, 385, 1481, 2, 15266, +798, 5759, 860, -16424, -1315, 1631, -456, -977, +-180, -2593, 1191, 5959, -32, 8112, -506, -7766, +-1871, -15310, 662, 196, -20401, 925, 446, -2035, +-620, -686, -249, -2517, 423, 703, 633, 828, +-182, -37, -406, -149, 821, -22255, 652, 522 diff --git a/src/main/resources/vavi/sound/twinvq/shape16.txt b/src/main/resources/vavi/sound/twinvq/shape16.txt new file mode 100644 index 0000000..f545b05 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/shape16.txt @@ -0,0 +1,240 @@ +-786, 193, -15441, 200, 1050, -16545, -41, 329, +-869, -170, -858, 2725, 217, 447, 2107, -23, +-387, -10280, -383, -320, 387, 16012, -79, -967, +3528, -2123, -537, -636, -1761, 949, 100, -17, +-446, 261, 22527, 331, 26, -87, -206, -2292, +-1178, -164, 598, 147, 889, -14487, -2823, -1280, +-1892, 33, -1763, 993, 4807, -953, 2181, -588, +59, -296, 218, 291, -104, 495, -1092, 2232, +-14904, -983, -2919, 795, -17207, -2045, 2988, 597, +-10312, -718, -2196, -5822, 847, 1304, -757, -4714, +-148, 831, -734, 806, 4348, -308, 244, 566, +2706, 604, -748, -864, -568, -219, -128, -688, +-218, 110, -29289, 482, 76, -1447, -142, -417, +-253, 8124, -19775, 990, 4546, -1012, -8082, 133, +-1612, -2243, -3788, 1568, -2892, 852, -1642, -3479, +-23, 1300, -564, -1037, 249, -14533, -43, 321, +-680, 10, -417, 23426, 397, -108, 1843, 180, +11976, -9613, 353, 3768, 130, -1035, 4340, 218, +596, -224, -779, -1680, 1326, 152, -971, -9725, +-355, 5328, -459, 16242, -438, 926, 6210, 1912, +769, 2621, -148, -1008, 517, 341, -3594, -965, +11383, -874, -16949, 1167, -3371, -1655, 586, -132, +3990, -770, 211, 246, 514, -166, -734, 30408, +-258, -521, -20, 339, 499, -2572, 2110, 272, +1357, 123, 2841, -320, -31, -444, -501, 215, +-42, 595, 108, 484, -223, 937, 475, -72, +-319, 75, -205, -978, -9155, 145, 2020, -3, +2438, 4046, -1281, -875, 1532, -598, 12288, 369, +-2046, 343, -778, 1769, -2589, -641, 17437, 1793, +-592, -1954, -1607, 6184, 3440, -512, -2710, -1330, +-127, 8765, 83, -243, -315, 709, 256, 1176, +-1198, -463, 970, -302, -568, -997, -1022, 159, +11008, 27, 13074, 1523, -3239, 2330, -4808, 6115, +-9933, 1449, 2153, -3111, 1780, -731, 121, -881, +-14289, -265, 566, -611, -253, -2965, 250, -105, +-66, 2570, -1922, 2712, 1907, -2025, -454, 173, +1463, -29, -31955, -113, -1751, -3353, 254, 1001, +6781, -29, -639, -1289, 288, 498, -21505, 48, +109, -2151, -223, 1360, -3430, 658, -4185, -1706, +1244, 1899, 124, 12, -35, 289, 382, 433, +261, -131, 54, -646, -280, 86, 180, 153, +-169, -20242, -95, 734, -524, 77, 102, 8468, +-421, 29, -3, 51, 1526, -600, -264, 355, +1949, -985, -291, -86, 10212, -789, -393, -182, +-51, 946, -16716, -954, 1179, -2745, -509, -4774, +-587, -608, 7657, -509, -388, 987, 109, -218, +-17579, -524, -467, -1643, -444, 1430, 2541, -124, +1785, 27, 7905, -73, -3135, -1241, -254, -2114, +1175, 780, -50, 4055, 535, 438, 32, -113, +-260, 81, 1102, -59, 29188, -48, 212, -29, +-344, 559, 856, -483, 608, -40, -1498, 112, +10374, 1198, -434, 4053, 1286, 236, 1823, 16046, +592, 1583, 78, -5243, 1311, 456, -1342, -546, +-353, 13289, -333, -529, -20859, 183, -167, -1368, +-338, -690, 4248, -205, -666, -634, -1653, 1174, +234, -18622, 891, 284, -2632, -1516, 289, 11242, +727, 133, 284, -323, -1370, 908, -13169, -412, +1155, 410, 610, -3072, -8220, -637, 242, -647, +-2072, 16041, 2292, -8009, 351, -3137, -3075, -1051, +4569, 125, 23, 1281, 2487, 520, -209, -688, +205, -1248, 246, -601, 533, -12209, -2298, 826, +-2762, 45, 15123, 721, 1128, 798, -676, 349, +-153, 263, 89, -854, -24, -350, -227, 157, +587, -240, -185, 663, -32328, -148, -204, -2396, +-597, -344, 8104, -280, -375, 264, 648, 741, +-290, -321, 263, -569, -381, 167, 1757, -29636, +30, 393, 398, 590, -242, 81, 1601, 3683, +787, -336, 675, -1080, -713, 261, 18420, 1760, +609, -4610, -551, 2790, 19807, 1347, -125, -9412, +-261, 548, 1056, 179, -917, -181, 12637, -267, +621, -11908, 1366, 76, 5875, -742, 394, 155, +-370, 2481, 46, -15392, -344, -9750, -1353, -2242, +-1685, -1286, 2320, -2176, -1729, 705, -1582, 1590, +1603, 21129, -3555, 2192, -883, 3438, 233, 1965, +-537, 399, -4818, -4085, 559, -292, 1290, -2700, +10, -301, -1865, 226, 52, -1346, 306, 316, +-12281, -525, 285, 9631, -2, -849, 1620, 128, +176, -1021, -473, 7929, -133, 2459, -33, -1517, +-22047, -2300, 98, -3513, 334, 4617, -193, -1309, +-1279, 738, -443, 95, 406, 660, -705, -54, +-39, 26396, -766, 249, -2423, 7759, -689, -3909, +-17404, 65, 1849, 945, 15907, 1386, -433, -831, +-6349, -3919, 1870, 8096, 311, 15043, 1709, -315, +1288, 7522, -215, -5072, 1246, -1486, 3762, 4526, +1517, -1936, -543, -263, 771, -10215, -425, -5098, +59, -266, -1012, -380, -2131, 630, 405, 665, +-4550, 1403, 8, -46, -879, 398, -532, -185, +-286, 921, -65, 378, 669, 174, -15280, 91, +-776, 8480, 2463, 184, 2065, -666, -561, 4122, +594, 732, 4007, -852, -71, 194, -126, 1765, +-1570, 968, -257, -288, 950, 27482, -333, 370, +-1429, 285, 558, 11245, -135, 565, 1296, -261, +-62, 600, 1455, 1457, 820, 357, -1203, 169, +16611, -893, 359, 231, 418, -547, -95, 3866, +-511, -6344, -205, 923, -239, -16205, -1619, 217, +-3362, -6342, -1551, 649, -492, 264, -55, 170, +16992, -91, 306, 43, -2770, 582, -1740, 77, +-882, 268, -515, -45, -6093, 24, -5596, 9034, +284, 3211, 846, 1158, -1118, -604, -514, 1402, +-493, -938, -3892, 242, 643, 1421, -434, -406, +-102, -88, -11733, 161, 518, 978, 1508, 248, +-1036, 1407, -396, 293, 1154, -1435, 495, 8243, +20, -845, -5373, 659, 2366, 29148, 145, 603, +4088, -251, -2841, -2526, 20682, -1357, -2454, 660, +-125, 347, 11772, -113, -357, -2181, -1234, 1908, +-432, 16555, -248, 822, 15516, -158, -653, 1573, +93, -2730, -1111, 958, -1550, -1153, 17, 610, +781, -372, -1640, 144, -135, -1171, 22140, -427, +-26, 690, -800, -1497, -300, 5438, 390, 11304, +9253, 1098, 5564, -9, 3856, 965, 2016, -12797, +1687, 915, 3687, 539, 2496, 702, -1324, -71, +-12955, 7456, 4626, -848, -1815, 831, 2151, 7921, +-3000, 123, 1189, -1489, 222, 4973, 1936, 54, +-10527, -1238, -1157, 628, 14112, -2164, 1478, -985, +-4102, 635, 225, -311, -609, -1015, 301, 507, +-85, 443, 186, -552, -711, -16988, -1327, 220, +565, -1673, -543, 18633, 331, 127, -342, 22, +-77, -360, -439, -501, -1848, -1147, -483, 1133, +-351, 41, 908, 502, -658, 474, -430, -11348, +-1, -531, 451, 709, 227, -978, 348, -265, +269, -376, 2511, -188, -111, -387, 809, 1009, +1570, -755, -11463, 667, -895, 446, 276, 145, +-513, -117, -462, -340, 1457, -963, 191, -788, +-150, -979, -507, -27540, 122, 368, -73, 10051, +-465, 642, 507, -6828, 241, -5025, 1598, -1174, +2373, -2272, -1910, -108, 15, 166, 2, 10518, +933, -12716, 510, 778, -424, 414, 4899, 759, +862, -438, -886, 457, 304, 23639, 136, -203, +478, -565, 244, -541, 2419, -773, 1107, -217, +1579, -1037, 476, -97, 995, 17973, 161, 16466, +-178, -718, -1606, 947, 1991, 2266, 1249, 2708, +-611, 1424, -142, -53, 36, 509, 26159, -144, +357, -37, -234, 587, 311, -509, -1639, -332, +-1618, -382, 302, -8657, -68, -30, 545, -12834, +158, 158, 135, 621, -354, -871, 451, 1220, +-31, 2, -13414, 60, 3, -380, 541, -44, +552, -366, 155, -462, 61, -232, -15426, 317, +688, 1121, 2933, 7151, -168, -9167, -2521, 745, +2792, -10448, 569, -3823, 630, -4626, -95, -416, +828, 259, 72, 171, 635, -250, -128, -426, +-153, 260, -771, 314, 235, 26, 32281, -343, +751, -1443, 324, -684, 1900, -1334, 2022, 30, +1073, -2406, 2080, -485, -320, 15328, -860, -529, +-16444, -219, 1736, -149, -160, -828, 1089, 413, +241, 3720, -90, 146, 1109, 243, -321, -256, +-68, 88, -50, 571, 1179, -25030, 104, 929, +35, 529, 117, -13724, 734, -1344, 456, 5586, +1566, -12573, -840, -1617, -2494, 1791, 1901, 3066, +-2159, -414, -3856, -9894, -1608, -657, 15355, -773, +-9217, -658, -972, 4730, -2986, -3478, -757, -1416, +-3702, 18089, 629, 7061, 124, 5843, 158, 19017, +-2204, -6976, 1629, -5657, 1101, -1859, -1425, -548, +-1132, -5043, 1074, -592, -196, 1902, 22705, -1228, +214, -685, -2036, -2368, -315, -914, 533, 218, +1091, -627, 2031, 13922, 104, -450, 4494, -498, +-361, 24734, 623, 1029, 2437, -1123, -5092, -6551, +438, 16562, 375, -13102, -193, -2004, 3556, 179, +1832, 2086, 798, -534, -195, -7105, 796, 3969, +-12269, 1570, 4273, -2692, 1240, -2901, -2045, -2453, +372, 613, -548, -245, 687, 258, -8964, -1500, +-1519, -993, 17571, -357, 916, -1202, 1752, 2081, +-536, -3185, -1062, 19335, 721, -9958, 1052, -872, +248, -3133, 456, 1641, 149, -11, 2955, 310, +-3178, -18823, 497, -971, -6587, -1380, 351, 106, +-43, 607, -4754, 213, 1030, 5377, -804, -2557, +850, 1081, -706, 1325, -14922, -794, -14060, -1953, +891, -3296, 329, -510, -1126, 1113, 1753, -411, +1769, 429, -185, -1020, 194, -106, 11470, -591, +-272, 422, 337, 524, -150, 822, 51, -120, +7193, 802, 640, -140, -42, 28125, -1020, 285, +-465, 3195, 69, 482, -953, 262, -7672, -373, +5158, 5625, -3003, 550, 5371, 5619, -2200, 5392, +-804, 135, 1300, -3610, -23, -433, 13503, 224, +911, -14421, -502, -2151, -1667, -1933, 2888, -277, +547, -989, 3115, -32, -680, -164, 804, 412, +62, -154, -190, 156, -10938, -360, -88, 843, +328, -773, -267, -12668, 856, 1496, -243, -586, +736, -2175, -677, -3069, 7480, -1764, -4024, -2569, +1805, 194, -6814, -1135, -237, 2682, -156, -890, +1285, 368, 1802, -683, -163, 1191, -13063, -496, +-335, 17482, 746, 818, 48, 21419, -598, -1753, +-1169, -2135, 40, -9114, 592, -3912, 1980, -264, +-304, 8138, -185, 286, -3024, 48, -1630, 909, +661, -662, 18085, 240, -201, 69, 192, 305, +-22167, 692, -1135, -996, 398, -74, 18553, -958, +1223, -5578, 508, -352, 1234, -450, 497, 780, +79, 51, -221, 255, -26, 13352, -170, 231, +590, 169, -733, -812, -65, -219, -20939, 200, +35, -177, -454, 632, -267, -407, -120, 623, +-176, -664, 715, -23, 318, 148, 1125, 16, +709, -21687, -230, -413, 1398, -1235, -283, 1615, +175, -299, 349, 400, -112, 21762, -665, 364, +1089, 1303, -54, 523, -381, -1312, 48, -886, +-1260, 408, 415, -8349, 7115, 180, -774, 3508, +-971, -255, -195, 81, -2674, -977, -355, -1500, +178, -2081, -4432, -1014, 340, 5818, 138, -106, +16917, 1203, 349, 3271, 961, 363, 6008, -6043, +3736, -730, -4201, -514, -6131, -68, -14935, -1781, +-3898, -40, -18944, -461, -1694, -1269, -755, -81, +2369, 484, 531, 14114, 85, 32, -10142, -142, +600, -2374, 375, 675, -2663, 155, -947, 6427, +11476, 1253, 5049, 1063, 2003, -1608, 2463, -2168, +-1128, 1079, 383, -996, 368, 1208, -3554, -959, +4596, -1209, -4154, 1270, 9365, -2775, -1751, 998, +-20023, -347, 1505, 218, -142, 342, -128, -523, +-159, 75, -467, 257, -133, -142, 712, -621, +428, -29584, 13, 402, -455, 119, -483, 1121, +-461, 960, 807, -46, 297, 14856, 221, -356, +221, 15037, -4744, -2555, 447, -1418, 1464, 1391, +-1404, -5812, 512, -2321, 9882, 242, -2298, -137, +-849, -3182, 9394, 1412, 1052, 1369, -904, -494, +-231, 1113, 1087, -13317, 768, -1178, -3011, 24, +229, 164, -10170, 328, 308, -591, 213, -543, +-82, -790, -875, 794, -558, -7651, -573, 1266, +-2084, 2275, -187, 97, 384, -11830, -185, -472, +1365, 11636, -1405, 360, -487, -440, -1820, -349, +-293, 285, 25, -139, -415, -540, -108, 1136, +-673, 230, 19202, -545, -542, 919, 1221, -518, +196, -21900, 795, 115, -16, 459, 3339, -347, +-346, -186, -695, -267, -714, 185, 266, -1218, +120, -249, 233, -110, -30412, 285, 219, 2256, +536, -442, 673, -1487, -477, -60, -1806, 183, +-7195, -577, 2230, -7594, -3230, 65, 22963, 111, +390, 7134, -3716, -5123, -475, -32, -98, -466, +-118, -43, 74, -1071, -902, 1714, 4004, 26, +97, 1680, 423, 252, 9667, 550, 354, -222, +19, -224, -807, 365, 593, 363, -851, -28, +553, 238, -481, 769, 279, 18367, -462, 286, +4825, -141, 500, 20383, 1618, -31, -514, -2484, +-327, -8506, -705, -872, 530, -9997, -36, -431, +2824, 3185, 1712, -318, 9513, -10065, 614, -503, +389, 12830, -113, -15, -1007, -523, -1293, -2102, +-543, -1157, -583, 1228, 262, -674, -1847, -242, +299, -12025, 547, -591, -9173, 275, 412, 2493, +997, 1229, 1982, 27554, 245, 106, -1320, -153, +-423, -955, -449, 392, 824, 796, -1181, 1640, +-884, -70, 8789, 10021, -1806, 1019, 90, 1494, +2071, -911, -1159, 212, 2207, -994, -2500, -497, +92, -11544, -398, -774, 1474, 32, -671, -171, +-1250, -249, 1161, -654, -205, -36, 1733, 763 diff --git a/src/main/resources/vavi/sound/twinvq/shape22_1.txt b/src/main/resources/vavi/sound/twinvq/shape22_1.txt new file mode 100644 index 0000000..26c30e8 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/shape22_1.txt @@ -0,0 +1,144 @@ +987, -6, -621, -220, -2438, -387, -535, -23, +-934, -68, -4985, 575, 483, 7243, -1075, 917, +1739, -1832, -580, 1564, 131, -180, -1271, 3672, +161, 1040, 1737, 2719, 1101, -185, -1410, 221, +-422, -8675, -753, -401, -5388, 13, 762, 1378, +1113, 1768, -177, 3397, 2162, 267, 2261, -156, +1708, -848, -79, -1819, -3159, -5548, -745, 7208, +-1039, 7555, -134, 2661, -2112, 2270, -1991, 441, +-6248, 246, 166, 2092, -1402, -242, -13600, -539, +391, 2395, 11001, -981, 10906, -403, 823, 1647, +-294, 93, 504, -5448, 1213, -1849, -3077, 790, +-841, 12812, -11266, -1882, -805, -274, 1968, -49, +1189, -80, -281, -40, 409, 2423, 581, -1362, +207, -869, -589, 3294, -318, -4592, -476, 1014, +-135, -17999, -194, 807, -2946, -222, 44, -514, +-4407, -1201, 1155, -235, 98, 4432, -342, 2386, +1402, -956, 3357, 1959, 4790, -139, -3494, -4280, +-589, -8422, 363, -746, 640, -360, -1007, -1100, +-7989, -12630, 1006, -1608, -864, -226, -915, -2032, +1274, 596, 1864, 1067, 1597, 460, -2003, -5560, +-8020, 2354, 379, -3151, 44, 7024, -698, -2901, +4976, 927, 1223, -93, 172, 189, 6639, -6082, +-726, -524, -3068, -3802, 16, -1039, -105, 2333, +-350, -306, -379, -832, 1282, 56, 3529, 562, +-603, 5954, 294, -1265, 8045, -3990, -169, -123, +-3267, 572, -879, 1562, -1185, 799, -9589, 407, +-590, 65, -2848, 433, -5547, -19, 7180, -7904, +-392, 323, -448, -4481, -3773, -5286, 1957, 226, +-2040, 3292, 2987, -1704, 2835, -149, 1435, 823, +1775, -2769, 146, 234, -131, -15, 268, 37, +139, 22, -196, 91, -3503, -5421, 24, -280, +58, 370, 655, 1412, 113, 306, 16404, -234, +315, -957, 72, -1129, 1993, -18719, -1415, 1349, +2340, 541, 313, -1360, 31, 1441, -78, -9905, +-393, 367, -712, -2009, 372, -297, -123, 303, +-458, -323, 46, 8701, -1301, -8768, -43, 1818, +212, -543, -5077, -8037, -2536, 702, 792, -381, +-272, 1941, 6320, -1871, -13938, -262, -2063, 108, +-861, 485, -440, 768, 5665, -302, 305, -13784, +2889, -127, -94, 145, 1308, 7911, -8376, -643, +-596, 1357, -943, 1329, -84, -62, 1651, 391, +-2295, -5456, -357, -4611, 1361, 3961, -295, 642, +-698, 8614, 1613, -526, -120, -205, 17, -20171, +1252, -261, 535, -1244, 92, -315, 878, 380, +157, 3217, -493, -773, 513, -510, 11304, -899, +-27, 398, -6386, 659, -1001, -2737, -13295, 1219, +-1014, -193, 445, -2393, 344, -25, -599, -2848, +884, 94, -11, -564, -36, 9939, -3530, 462, +-942, 10089, 824, 2994, -293, 71, 10167, -457, +711, -964, -2128, 2530, 160, -2558, 2451, 1654, +-3828, 1560, 879, -1023, -8354, 851, -77, -112, +19572, 2010, -1077, -1329, -1282, 1277, 252, -5622, +4617, 58, -2315, -459, -1249, 92, 708, -737, +-3323, 182, 1557, -657, 546, -447, 19117, 1645, +-336, -26, -2041, 5926, 4746, -1866, 3922, 2798, +5320, 7, 470, 842, 229, -567, 742, -3306, +659, -871, -226, -2593, -1003, -1373, 595, -768, +20658, 944, 1228, 279, -1531, -618, 361, -4019, +-343, -351, 7143, 293, 92, -2713, -269, -30, +-332, 4093, 216, 239, -563, 1943, -944, -2268, +70, -209, 440, 1493, -446, 491, -362, 25, +-331, 433, -1585, 173, 1126, -3614, -234, -2649, +1181, -641, -160, 3727, -841, -2134, -1396, -5758, +-14, 364, -4651, 1151, 194, -5234, 5878, -1348, +-1388, -233, 3810, -860, 9479, -24, -6616, 1387, +-455, 447, -224, -2997, 12, 3502, -73, 470, +-9170, 1677, -740, -592, -1638, 675, -93, -17842, +1750, -847, 993, -2393, -49, -2029, 1940, 588, +475, -3467, 55, 5087, 2989, 380, 915, -2782, +2418, 11303, 1098, 1009, 1372, -5780, -303, 1451, +972, -7433, -571, 1661, 64, 10265, 1541, -50, +-964, -738, -253, -3105, -695, -546, -775, -18971, +-3094, -2379, 738, 1625, 623, 1073, 782, 723, +-3417, -578, -189, 4108, 1115, -1222, -9102, -4736, +347, 946, 322, -3699, 193, -15139, 367, 969, +-788, -694, -620, -26, -16, 4, -478, 20792, +-1175, -231, 2566, -1270, 162, 181, -1451, -5370, +-2429, -8910, -3794, -5807, -1655, 248, 4432, 1393, +-2451, -2706, -744, 687, 842, -1281, 2960, -2348, +153, -1671, -1433, -1250, -1096, 2501, -5393, 4266, +-1098, 880, -1215, 817, -443, 10053, 705, -689, +-2679, -1205, -3302, -809, -918, -1005, 124, -329, +108, -52, -5305, -419, 128, -8137, 1427, 387, +-235, -2582, 190, -173, -1031, 2672, -985, 3309, +-5927, 7327, -8463, -2, 6035, 743, 552, -14, +-580, -68, -11886, 476, 61, 1172, -529, -988, +871, -776, -332, 20870, 384, 7795, -10830, 723, +1690, -519, 962, 663, 1300, -465, 47, -3578, +56, -8131, 2041, -8524, -1303, 6349, 1903, -6726, +1156, -224, 1286, -2355, -3415, 985, -502, -2474, +49, -2789, -3616, -1707, 3363, -140, 1702, -1919, +-11518, -404, 62, -6933, -1187, 10830, 132, 284, +-639, 1349, 2367, -311, -626, 745, 5660, -152, +-121, -5236, -481, 5889, -1263, -8443, -33, 936, +423, -117, 111, -1055, -103, -321, 1286, -611, +777, 827, 422, -162, -6767, -241, 289, -441, +-1344, 2706, -1260, -4649, -847, -16107, -263, -1826, +-521, -760, 942, 309, -2692, -4835, -853, -806, +-276, -322, 5647, 1219, -433, -346, -1171, -1028, +191, -406, 444, 33, 272, 3502, 475, -2178, +1915, -290, -1037, 833, -695, -121, 415, 556, +1025, -2268, 334, 2847, -1768, -389, -14034, -3878, +836, 4605, -1985, -359, 1478, -149, 823, -926, +-828, 135, 469, -645, -328, -94, -178, 2820, +781, -2361, -5778, 1312, 3918, -1, -3654, -942, +-2495, 615, 210, -17006, -396, -445, 382, 563, +-1738, 95, -9107, 4869, 348, 527, 5688, -145, +-1195, -2367, -749, -187, 6697, 27, 347, 12571, +-64, -427, 3765, 824, -1216, -1126, 5997, 586, +110, -294, -240, 1646, -186, 1360, 413, -6459, +-1535, -3208, -520, -621, 8613, 1098, -19, -199, +-11446, -657, -353, 906, 678, -19375, -126, 1688, +644, 1231, -2151, -742, 320, -68, -12426, -2750, +1483, -1603, -2639, 3028, 2662, -140, 5405, -917, +-407, 207, 9392, -569, 931, -124, -82, 6370, +477, -12264, 1093, 3427, -732, -50, 232, -67, +609, 1615, -463, 583, 1808, 1499, -509, -24431, +231, -72, -192, -333, -7554, -342, -9036, -304, +136, -15450, 1333, -1147, -1488, -1440, 75, 63, +747, 297, -251, 30, -301, -1810, -86, 544, +-10446, 1300, 10468, 218, -2471, 1982, 423, 3046, +-1112, -657, -104, 10671, -46, -10953, -6205, -1275, +1972, 937, -75, -330, -529, -2581, 1510, -1881, +-1372, -1725, 14541, -560, -884, 946, -307, -5031, +7798, -190, 720, 1525, 29, 868, 1238, 372, +-462, 2467, -2661, 2721, -1514, 723, -2782, -494, +240, -7147, 587, 751, 1613, 11054, 1074, 275, +972, -970, 27, -75, 24, -9, 163, 88, +21, 87, -78, -743, -128, -2336, -235, -743, +-3918, -333, 1088, -195, -166, 782, -119, -3263, +604, 2155, -258, -1282, -129, 43, -5124, -472, +685, -14243, -1294, -99, -1922, -284, -422, -1112, +-3194, -1977, 1448, -419, -7172, 20, -70, 2102, +0, 278, 1882, -10005, 1612, 6020, 71, -141, +1027, -43, -864, -448, -21257, -336, -2090, 5207, +674, 722, 1030, 1367, 1963, 6057, 984, -1087, +-3690, 47, -61, 104, -81, 895, 22, 728, +-191, 3219, 5228, -27, -802, 1438, -9026, -1352, +-581, 912, -664, -23, -522, -912, 178, -603, +571, 574, 406, 564, 175, -405, -2965, -1072, +1749, -957, -402, 9431, 1649, -409, 291, 5765, +808, 6754, 727, -37, -254, 1530, 213, 3253, +357, 371, 45, -1276, -12432, 2799, -1924, -176, +-1107, -183, 198, 3662, 20, -1166, 2507, -3484 diff --git a/src/main/resources/vavi/sound/twinvq/shape22_2.txt b/src/main/resources/vavi/sound/twinvq/shape22_2.txt new file mode 100644 index 0000000..e05e344 --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/shape22_2.txt @@ -0,0 +1,144 @@ +1688, -307, -590, 971, -3616, -1632, -218, 1861, +-1479, -367, -6584, 487, -951, 10808, -232, 444, +89, -1216, -1577, 1283, 249, -3, -3646, 2205, +-1116, 2630, 2110, 3193, 270, -189, 78, -826, +1010, -10520, -370, 1234, -5604, -262, 1277, 1440, +2225, 2466, 305, 2469, -740, 120, 3184, 2125, +1185, -3230, 1597, -1670, -8283, -9857, -129, 8932, +-1355, 8755, 707, -256, -135, 423, 1543, 1782, +-4875, 403, 373, 1570, -183, 782, -9617, -2539, +1090, 523, 6929, -1226, 10329, -278, -999, -260, +-1810, 666, -463, -6100, 2040, 256, 532, -1475, +383, 13137, -10953, -2226, -1243, 1584, -2348, -809, +3602, -816, 194, 480, 84, 2297, 344, -5181, +-6243, -2616, 2093, 7112, -2373, -1346, 291, -372, +-863, -16911, -1878, 378, -826, 579, 737, -468, +-2288, 264, 634, 108, -254, 4717, -1286, 2885, +986, -4944, -98, 2007, 991, -2252, -2887, -6141, +-605, -10474, 896, 6, 235, -407, -70, 478, +-8392, -10870, 575, -672, 103, 320, -179, -229, +445, -380, 1124, 3271, -1327, -275, -239, -10381, +-9102, 1361, 96, -1255, -277, 9316, -415, -2258, +8992, -117, 1625, -704, -980, 752, 9133, -8792, +-423, -272, -865, -2285, 443, -2014, -2592, 3180, +1198, 2570, 3360, -7090, 3311, 697, 2229, 46, +-472, 6984, -140, -780, 10391, -1078, 48, -564, +-5073, 1576, -826, -483, 952, 1099, -11536, -652, +375, 440, -7319, 2646, -2089, 2804, 3795, -6704, +251, 811, -1224, -1976, -4943, -6671, 780, -2856, +-7907, 2447, 3755, -135, 1127, 328, 553, 3450, +351, -5054, -5, 1077, 109, -254, -391, -511, +404, -61, 510, 395, -6044, -7454, 364, -575, +65, -410, -1921, -248, 128, 311, 17131, -2135, +-563, -884, 2356, -3951, -1176, -16695, -1534, 1977, +626, 2478, 1554, -1070, 38, -551, 370, -11053, +-331, 1062, -1385, -1681, 1028, 3350, 239, -76, +-156, 49, 397, 7060, -2834, -6527, 22, 1920, +-951, 356, -7674, -8903, -120, 317, -303, 160, +530, 4611, 1083, 514, -12207, -283, 1413, -848, +-645, -432, 0, -192, 4780, -3485, -1192, -10574, +1274, -3057, 475, -188, 183, 7865, -11214, -268, +491, 1422, -28, 149, 515, -1651, 670, -450, +-958, -4288, 567, -182, 668, 4069, -213, -1176, +148, 8854, -151, 474, 599, 1297, 237, -19186, +2993, -482, -591, -1322, 25, -628, -828, -203, +-1500, 5519, -84, 723, -1137, 1217, 13045, -707, +-372, -200, -4142, -790, 188, -6760, -8288, 766, +366, 444, -517, -2679, -1470, -61, 161, -3734, +3053, 2012, 439, 627, 524, 5538, 549, -473, +-2244, 8399, -6395, 5811, 851, 58, 11376, -6, +-337, -689, -1510, -690, -388, -3587, 2665, 3371, +-1850, -953, -513, 581, -10296, 548, 1092, 565, +18045, 215, -1486, -1270, 450, -880, 407, -6547, +8393, 206, -515, -1565, -219, -1872, 1479, 382, +-569, -5002, -1247, -45, -740, -1791, 17177, -1210, +761, 132, -1627, 4970, 5563, 722, 5614, 430, +5659, 139, 1193, 1513, 1144, -1319, 561, -5145, +1010, 199, 656, -3958, 3544, -1758, 810, -1578, +15976, -139, -1035, -416, -543, -418, 2824, -6541, +94, -673, 11741, 426, -15, -5280, 780, 1795, +-4616, 8192, -297, -206, 883, 2369, -395, -4266, +-3120, -199, 985, 1240, 352, 232, -170, 176, +413, -495, -1399, 754, 618, -6103, -179, -2546, +965, -1362, -806, 838, -3912, -1346, -3135, -937, +219, 307, -3509, 1210, 2381, -7923, 6358, -885, +2902, 284, 2560, 1789, 6878, 6, -4418, -2206, +-1091, 1840, -118, -2659, 1008, 2192, 1651, 1363, +-7772, 1252, -1200, 133, -757, 501, -98, -17197, +98, -543, 1743, 621, -809, -1950, -793, 1168, +-743, -7124, 166, 7875, -4466, 356, -1430, -467, +8589, 9931, 520, -866, 1945, -599, -434, 113, +589, -3456, 597, 6076, 1114, 9660, 1532, 2073, +-138, -721, -1030, -1309, 625, -4040, 1211, -18836, +-3963, -4468, 197, 600, -1004, -816, -560, -476, +-2160, -2, 26, 8162, 1057, -178, -11739, -1882, +1000, -227, 109, -1852, -1163, -17143, 140, -718, +-1150, 33, 1397, -45, -205, 153, -1494, 20509, +-51, -904, -599, 1915, 884, 504, -1819, -4487, +1252, -1259, -2200, -5601, -448, -686, 5778, 873, +-4282, -533, 295, -450, 1422, 2393, 3267, -3911, +249, -3605, -3190, -1096, -2422, 274, -1918, 4070, +-206, -432, 1919, -645, -275, 12954, 311, 1479, +-2664, -852, -4809, 1102, -375, 20, 1659, -1179, +1199, 44, -5590, -1112, -566, -11369, -125, -871, +158, 1208, 265, -519, -405, 2439, -1129, 1827, +-9461, 8548, -1606, 380, 4924, 662, 1314, -391, +-2024, 827, -13381, -198, -142, 1600, 3329, 125, +-672, -220, 557, 18642, 60, 7296, -10472, -712, +1188, 808, 64, 479, 555, 264, 394, -611, +-810, -7943, -235, -6889, -1575, 1320, -381, -7414, +1740, -744, 369, -626, -6899, -2144, -593, 668, +-351, -3756, -5143, -1814, 806, -475, 588, -507, +-9088, -629, 154, -6945, -1105, 10658, -435, 384, +-757, 1183, 3806, -747, -378, 535, 10224, 626, +-866, -1931, -1484, 5818, -750, -9628, -250, 589, +-653, -198, 104, -934, 1207, 46, 960, -1032, +4236, 4471, -2896, 1551, -7714, -1921, 746, -671, +5114, 5482, -522, -3344, -1905, -9220, -663, -1355, +-611, 65, 1368, 628, -1276, -6780, -2623, -661, +-117, -437, 5507, 3205, 928, 537, -9487, 80, +-102, -538, -277, 863, -1421, 6054, 1227, 696, +3582, -508, -1757, 145, -1705, -1201, 4157, -3314, +2291, -834, 821, 552, -724, 513, -9730, -8944, +1913, 501, -216, 716, 2766, -823, 2535, 314, +1774, -3372, 235, 244, -1216, -710, 689, 6736, +-52, 218, -8382, -444, 920, 569, -4890, -2050, +-612, 1708, -481, -15500, -2878, -691, 538, -125, +-81, -862, -10094, 12050, -1392, -326, 133, 61, +-50, 715, -6662, -673, 10745, -596, 44, 3906, +247, -745, 4950, -210, 497, -1875, 8197, 2141, +1454, -23, -1480, 2184, -804, 5515, -1311, -8893, +-2880, -3606, -282, -116, 8084, 618, -403, 1106, +-14405, 1159, 229, 742, -184, -19445, -329, -747, +-1240, 1487, -1670, -839, -77, -882, -10986, -2851, +-24, -747, -3615, 1939, 1389, 132, 5367, 1355, +408, -1272, 11388, 153, 2708, -1503, 169, 7357, +51, -13586, -404, -304, 626, 163, -1814, -515, +445, 589, -1194, 770, 555, 246, -165, -21192, +184, -265, -1116, -485, -8107, -1992, -10805, -880, +-1455, -15154, 2312, -1712, -11, -1899, -400, -2, +314, -318, -280, -658, -1066, -2584, 1027, 801, +-11960, 1519, 8873, 465, -3229, 1801, -348, 749, +7, 1079, -2051, 11521, -831, -13425, -6315, -1135, +1088, 1056, -46, -1006, 374, -5065, 1163, -402, +-50, -1459, 9586, 514, -1439, -638, -155, -5289, +8043, -612, 739, 1084, -60, 891, 786, -6, +-1078, 2097, -5333, 3497, 23, -913, 1303, 957, +-35, -6418, -146, -971, 2738, 9695, -1722, -2002, +905, -1749, -917, 122, 379, -325, -455, 230, +825, -137, -335, -96, -160, 390, 731, -2621, +-5889, -3949, 5138, 839, -1190, -66, 961, -4600, +2345, 1607, -2448, -6653, -592, -106, -7619, -794, +-1186, -12587, -11, -2224, -225, -2903, 534, 1355, +-7002, 314, 494, 1950, -8545, -2531, -2438, -77, +886, -1851, 944, -10156, 3003, 1846, 1919, 2019, +471, 451, -436, -1012, -20121, 275, 98, 1776, +578, 96, -16, 1156, 3689, 7, -207, 920, +105, -58, -175, 163, 697, -407, -61, 1261, +1297, 5061, 5326, -1126, 516, 1208, -11108, 441, +7, -899, -19, -368, 438, -1911, 602, 716, +313, 853, 1448, -817, -1453, 1384, -4371, 1043, +1884, 1619, 2196, 10075, -1548, -1201, -796, 5228, +2657, 8244, -605, 422, -693, 3171, 657, 5438, +-171, 633, 1579, -1718, -12265, 1083, -976, -293, +-3802, -306, -668, 7818, -1340, -402, 2231, -4472 diff --git a/src/main/resources/vavi/sound/twinvq/shape44.txt b/src/main/resources/vavi/sound/twinvq/shape44.txt new file mode 100644 index 0000000..bfd72ff --- /dev/null +++ b/src/main/resources/vavi/sound/twinvq/shape44.txt @@ -0,0 +1,144 @@ +-40, -282, 1366, -1173, -3484, 355, -1078, 3800, +4386, -35, -4192, 523, 1291, 678, 156, 2272, +-1043, 1075, -1849, -314, -522, 392, 2098, -79, +473, -275, 2, 6398, 451, 94, 173, -431, +1115, -10788, 35, 1823, -3380, -97, -98, -350, +-23, -1264, -308, 8948, -695, -79, 3520, 308, +340, -362, -547, 1207, -1182, -10392, -148, 3580, +481, -425, 862, 4894, 736, -152, -626, 23, +-5853, 39, -143, 418, -103, -1457, -12826, -122, +283, -225, 10561, -153, 8872, -806, -51, 93, +420, -209, 345, -7661, -732, -48, 479, -225, +276, 13385, -12578, -1440, -265, -274, 1105, -3376, +-691, -579, -972, 300, 349, 362, 722, -472, +185, 814, 14, 4746, 761, -336, 1691, 888, +-1669, -18717, 827, -2605, 921, 155, 68, 112, +-3032, -287, 414, -86, -62, -213, -106, 807, +-619, 598, -178, 3104, -481, -1553, 1250, -8363, +-686, -9608, 116, -47, 321, -89, 939, -35, +-7995, -10159, -526, 145, 363, 2170, 1077, -1223, +-738, 120, -408, -390, -80, -404, -1607, -10187, +-6432, 961, 94, -1459, 489, 6641, 372, 1007, +5958, -834, 222, 51, 282, -1005, 4473, -8841, +-73, -477, -557, 121, -165, -1195, 438, 139, +-190, -4205, -4278, -4617, -7592, 40, -422, -459, +594, 7331, 164, 297, 2631, -9075, -78, 372, +-6213, -1053, 182, -71, -386, -604, -11720, 552, +-617, 413, 1292, 4, -485, 1162, 6051, -5168, +-181, 1024, -630, -275, -4067, -8627, 1386, 970, +-423, 2973, 2360, 363, -274, 410, 48, 768, +2958, -427, 86, 64, -128, -273, -182, -292, +868, 463, 73, -116, -6509, -5295, -37, 691, +344, -120, 168, 419, 494, -1175, 18896, -135, +-376, -218, -453, -916, -1040, -22179, -846, -1005, +264, 159, 597, -952, -825, 393, -328, -14694, +371, -263, 740, 38, -1001, 1289, -668, 187, +-155, 143, 683, 7133, -563, -8383, -291, 176, +75, 613, -6965, -11480, 324, -490, 586, 416, +762, 5777, 64, -47, -4124, -1196, -113, 701, +-211, 2335, 130, 684, 7278, -158, -213, 297, +10845, -1439, -465, 17, -792, 6499, -10187, -444, +-1416, 482, 636, 1472, 752, 157, -334, -3230, +-19, -6747, 660, -3082, 4057, 6801, -19, 635, +19, 9807, 526, 126, 444, -190, -418, -26754, +-202, 243, 597, 10, 345, 814, -330, 160, +344, 3986, 470, 459, 2387, -549, 11889, -1837, +-30, 2608, 615, 2301, -771, -1589, -6935, 1321, +4287, 295, -558, -1503, -611, 2104, 411, -218, +1145, -426, 58, -102, 13, 7499, 476, -4032, +-2237, -2658, -1943, 5268, 1039, 389, 7091, -22, +156, -186, 2432, -878, 305, -1726, 3209, 361, +-1030, 505, 618, -262, -1877, 268, 757, 24, +24306, 102, 973, 142, -953, -1199, 116, -255, +5370, -347, -365, 937, -6939, -1189, -760, 531, +-1759, -705, -557, -620, 1151, 250, 21629, -1532, +-128, 1421, -211, 592, 5126, 197, -716, 1113, +5844, -266, -12, -813, 85, 994, -2106, -3915, +1402, 533, 521, -883, 87, -386, -2, -4350, +19790, -180, -363, 60, 101, -1717, 119, -381, +100, -565, 3264, 3052, 200, -7319, 26, 347, +-482, 10609, -766, 526, -623, 3495, 339, -4406, +-59, -213, 686, -603, 133, 99, 48, 1716, +-1214, 1397, -2396, -384, -901, -3750, -660, -4314, +313, 192, 292, 259, -644, 176, 2099, 7961, +-29, 642, -2970, 1792, -61, -4348, 578, 1867, +-1868, 32, 5262, 137, 6109, 443, -176, 351, +400, 1874, -175, -4065, 697, 292, -744, 121, +-5134, 6996, -198, 628, 1073, -599, -116, -17900, +647, -1049, -663, 1427, -94, 721, 311, 337, +1376, -2784, 3947, 1342, 1577, -406, -260, -10228, +109, 2358, 2437, 346, 1261, -308, -2094, 1682, +144, -675, 183, 428, -950, 1249, -1546, 33, +-254, 681, -1264, -964, -310, 838, 100, -21952, +-1484, -1564, 339, 298, 67, -338, 89, 709, +53, 258, -359, 2803, 1553, -312, -7993, -1627, +1189, 476, -123, 336, -767, -18522, 589, 942, +-645, -381, -1913, -582, 55, -876, -509, 25143, +690, -787, -1136, 114, 162, 342, -231, -8742, +99, -646, -474, -1384, -110, -98, 8634, -14, +-9676, -312, 358, 496, -676, -97, 1904, -2124, +-66, -1868, 502, -513, -3244, 2079, -1476, 5440, +-40, -381, 500, -238, -471, 12160, 248, -1005, +-2886, 173, -3369, -355, -256, -117, -474, -1282, +-355, 130, -4833, 31, -232, -12931, -826, 322, +839, 1537, 73, 226, -1888, -483, -2848, -190, +1271, 3597, -4514, -38, 6093, 347, -68, -415, +-105, -1664, -11461, -110, -399, 389, -511, 935, +-424, -1708, -1026, 23239, 298, 7363, -9206, -566, +259, -412, -1213, 335, 614, 928, 972, -1919, +-407, 509, 303, -13762, -524, 10360, 1318, -2758, +2350, -106, -119, -68, -6155, -255, -448, -34, +-64, -4382, 47, 635, -339, 406, -447, -445, +-10592, 233, 160, -5515, -1333, 6755, -952, 172, +-1260, -294, 3480, -352, -231, 415, 482, -498, +-191, -2034, 7934, 7997, -688, -9503, 376, -228, +-500, 222, -1021, -407, 261, 179, 622, 1217, +-443, -763, -508, -719, -4509, 91, 449, -283, +91, -39, 961, -10148, 1596, -9161, -327, 221, +-470, 676, 12, 1416, 984, -10988, -5500, -189, +-727, 226, 4691, 688, 759, 930, -6444, -114, +-539, -526, -21, -1218, 650, 6088, 419, 6185, +-1200, 84, -1232, -34, -107, 60, 2248, 450, +1187, 1264, -181, 857, 2235, -2859, -13483, -192, +-586, -207, -5569, 503, 3376, 1243, -700, 2119, +-2186, -296, 896, 299, 177, 184, 1375, 2498, +161, 579, -3683, 443, -21, -186, -3474, 238, +274, 277, -325, -8325, -223, 125, 191, 333, +-345, -1391, -7372, 11389, -1055, 4066, -1098, 87, +-203, 443, 363, -959, 15395, 4016, -254, 1611, +-168, -1070, 2709, -768, 506, -1245, 5821, 2499, +1564, 27, 85, 1989, -1092, 150, -972, 660, +-33, 687, 545, -1564, 720, -196, -52, -1751, +-25380, -1246, -615, 391, -512, -23289, 460, 360, +-85, -723, -250, -163, -48, -921, -3988, 425, +-1268, -1695, 3233, -1093, -1166, 198, 7602, 21, +354, 733, 12213, -347, 532, -427, 22, 2218, +-578, -3382, -474, -625, 78, -4546, 863, -53, +-357, -1529, 1014, 710, 1356, -430, -1633, -24823, +95, 26, 590, -591, -7833, -1355, -9771, -502, +-907, -15433, 957, 463, 35, -496, 294, 2129, +1274, -160, -83, 531, -767, 285, 232, 5983, +-6122, 1620, 4112, -239, -1733, -46, -1321, 467, +613, -3747, -2284, 13991, 373, -17357, -219, -80, +-210, 1462, 37, -1692, 548, -5845, 420, 54, +-350, -285, 1981, 262, -874, 2844, -435, -6305, +6449, 72, 631, -94, 96, -442, 1137, 89, +364, 3392, -3512, -387, 1055, 318, -1111, -6971, +344, -9105, -96, -9362, 190, -225, 370, 161, +-73, -1830, 174, 48, -518, -3486, 137, -235, +810, 23, 80, -642, -35, -316, -269, -373, +-2413, -933, 2525, 267, -508, -200, 422, -3470, +-1273, 640, -1956, 139, 394, -1043, -11008, -158, +-1089, -2023, 202, -979, -744, -159, -392, -37, +-1679, 2183, 1365, -2883, -4752, -2255, 109, 1660, +-613, -511, 1284, -7331, 947, 7009, -2072, -321, +-936, -551, -875, 160, -27027, 654, 265, 164, +376, 726, -149, 2813, -94, 5728, 702, -1118, +-2555, 217, -186, -107, 146, -83, -62, -196, +708, 146, 3729, -416, 212, -163, -7861, 347, +83, -1079, -994, 271, -1054, -1647, 139, -20, +354, 1298, -3420, 1130, 161, 475, -3913, 468, +23, 285, -1699, 8234, -947, 222, 260, 4276, +-341, 6387, 21, 490, -1908, -1654, -60, 2471, +733, -135, 109, -1136, -14756, 4922, 1165, 149, +-3976, -66, -594, 6181, -110, 292, 1129, -591 diff --git a/src/samples/java/jmf/AVReceive2.java b/src/samples/java/jmf/AVReceive2.java index 62fbe42..edcd078 100644 --- a/src/samples/java/jmf/AVReceive2.java +++ b/src/samples/java/jmf/AVReceive2.java @@ -66,17 +66,17 @@ * AVReceive2 to receive RTP transmission using the new RTP API. */ public class AVReceive2 implements ReceiveStreamListener, SessionListener, ControllerListener { - String sessions[] = null; + String[] sessions = null; - RTPManager mgrs[] = null; + RTPManager[] mgrs = null; List playerWindows = null; boolean dataReceived = false; - Object dataSync = new Object(); + final Object dataSync = new Object(); - public AVReceive2(String sessions[]) { + public AVReceive2(String[] sessions) { this.sessions = sessions; } @@ -154,7 +154,7 @@ protected boolean initialize() { dataSync.wait(1000); } } - } catch (Exception e) { + } catch (Exception ignored) { } if (!dataReceived) { @@ -167,7 +167,7 @@ protected boolean initialize() { } public boolean isDone() { - return playerWindows.size() == 0; + return playerWindows.isEmpty(); } /** @@ -175,10 +175,10 @@ public boolean isDone() { */ protected void close() { - for (int i = 0; i < playerWindows.size(); i++) { + for (PlayerWindow playerWindow : playerWindows) { try { - playerWindows.get(i).close(); - } catch (Exception e) { + playerWindow.close(); + } catch (Exception ignored) { } } @@ -195,8 +195,7 @@ protected void close() { } PlayerWindow find(Player p) { - for (int i = 0; i < playerWindows.size(); i++) { - PlayerWindow pw = playerWindows.get(i); + for (PlayerWindow pw : playerWindows) { if (pw.player == p) return pw; } @@ -204,8 +203,7 @@ PlayerWindow find(Player p) { } PlayerWindow find(ReceiveStream strm) { - for (int i = 0; i < playerWindows.size(); i++) { - PlayerWindow pw = playerWindows.get(i); + for (PlayerWindow pw : playerWindows) { if (pw.stream == strm) return pw; } @@ -215,6 +213,7 @@ PlayerWindow find(ReceiveStream strm) { /** * SessionListener. */ + @Override public synchronized void update(SessionEvent evt) { if (evt instanceof NewParticipantEvent) { Participant p = ((NewParticipantEvent) evt).getParticipant(); @@ -225,87 +224,89 @@ public synchronized void update(SessionEvent evt) { /** * ReceiveStreamListener */ + @Override public synchronized void update(ReceiveStreamEvent evt) { // RTPManager mgr = (RTPManager) evt.getSource(); Participant participant = evt.getParticipant(); // could be null. ReceiveStream stream = evt.getReceiveStream(); // could be null. - if (evt instanceof RemotePayloadChangeEvent) { + switch (evt) { + case RemotePayloadChangeEvent remotePayloadChangeEvent -> { - System.err.println(" - Received an RTP PayloadChangeEvent."); - System.err.println("Sorry, cannot handle payload change."); - System.exit(0); + System.err.println(" - Received an RTP PayloadChangeEvent."); + System.err.println("Sorry, cannot handle payload change."); + System.exit(0); + } + case NewReceiveStreamEvent newReceiveStreamEvent -> { - } + try { + stream = evt.getReceiveStream(); + DataSource ds = stream.getDataSource(); + + // Find out the formats. + RTPControl ctl = (RTPControl) ds.getControl("javax.media.rtp.RTPControl"); + if (ctl != null) { + System.err.println(" - Recevied new RTP stream: " + ctl.getFormat()); + } else + System.err.println(" - Recevied new RTP stream"); + + if (participant == null) + System.err.println(" The sender of this stream had yet to be identified."); + else { + System.err.println(" The stream comes from: " + participant.getCNAME()); + } - else if (evt instanceof NewReceiveStreamEvent) { + // create a player by passing datasource to the Media Manager + Player p = javax.media.Manager.createPlayer(ds); + if (p == null) + return; - try { - stream = ((NewReceiveStreamEvent) evt).getReceiveStream(); - DataSource ds = stream.getDataSource(); - - // Find out the formats. - RTPControl ctl = (RTPControl) ds.getControl("javax.media.rtp.RTPControl"); - if (ctl != null) { - System.err.println(" - Recevied new RTP stream: " + ctl.getFormat()); - } else - System.err.println(" - Recevied new RTP stream"); - - if (participant == null) - System.err.println(" The sender of this stream had yet to be identified."); - else { - System.err.println(" The stream comes from: " + participant.getCNAME()); - } - - // create a player by passing datasource to the Media Manager - Player p = javax.media.Manager.createPlayer(ds); - if (p == null) - return; + p.addControllerListener(this); + p.realize(); + PlayerWindow pw = new PlayerWindow(p, stream); + playerWindows.add(pw); - p.addControllerListener(this); - p.realize(); - PlayerWindow pw = new PlayerWindow(p, stream); - playerWindows.add(pw); + // Notify intialize() that a new stream had arrived. + synchronized (dataSync) { + dataReceived = true; + dataSync.notifyAll(); + } - // Notify intialize() that a new stream had arrived. - synchronized (dataSync) { - dataReceived = true; - dataSync.notifyAll(); + } catch (Exception e) { + System.err.println("NewReceiveStreamEvent exception " + e.getMessage()); } - - } catch (Exception e) { - System.err.println("NewReceiveStreamEvent exception " + e.getMessage()); - return; } - - } else if (evt instanceof StreamMappedEvent) { - - if (stream != null && stream.getDataSource() != null) { - DataSource ds = stream.getDataSource(); - // Find out the formats. - RTPControl ctl = (RTPControl) ds.getControl("javax.media.rtp.RTPControl"); - System.err.println(" - The previously unidentified stream "); - if (ctl != null) - System.err.println(" " + ctl.getFormat()); - System.err.println(" had now been identified as sent by: " + participant.getCNAME()); + case StreamMappedEvent streamMappedEvent -> { + + if (stream != null && stream.getDataSource() != null) { + DataSource ds = stream.getDataSource(); + // Find out the formats. + RTPControl ctl = (RTPControl) ds.getControl("javax.media.rtp.RTPControl"); + System.err.println(" - The previously unidentified stream "); + if (ctl != null) + System.err.println(" " + ctl.getFormat()); + System.err.println(" had now been identified as sent by: " + participant.getCNAME()); + } } + case ByeEvent byeEvent -> { - } else if (evt instanceof ByeEvent) { - - System.err.println(" - Got \"bye\" from: " + participant.getCNAME()); - PlayerWindow pw = find(stream); - if (pw != null) { - pw.close(); - playerWindows.remove(pw); + System.err.println(" - Got \"bye\" from: " + participant.getCNAME()); + PlayerWindow pw = find(stream); + if (pw != null) { + pw.close(); + playerWindows.remove(pw); + } + } + default -> { } } - } /** * ControllerListener for the Players. */ + @Override public synchronized void controllerUpdate(ControllerEvent ce) { Player p = (Player) ce.getSourceController(); @@ -341,7 +342,7 @@ public synchronized void controllerUpdate(ControllerEvent ce) { /** * A utility class to parse the session addresses. */ - class SessionLabel { + static class SessionLabel { public String addr = null; @@ -354,14 +355,14 @@ class SessionLabel { int off; String portStr = null, ttlStr = null; - if (session != null && session.length() > 0) { + if (session != null && !session.isEmpty()) { while (session.length() > 1 && session.charAt(0) == '/') session = session.substring(1); // Now see if there's a addr specified. off = session.indexOf('/'); if (off == -1) { - if (!session.equals("")) + if (!session.isEmpty()) addr = session; } else { addr = session.substring(0, off); @@ -369,7 +370,7 @@ class SessionLabel { // Now see if there's a port specified off = session.indexOf('/'); if (off == -1) { - if (!session.equals("")) + if (!session.isEmpty()) portStr = session; } else { portStr = session.substring(0, off); @@ -377,7 +378,7 @@ class SessionLabel { // Now see if there's a ttl specified off = session.indexOf('/'); if (off == -1) { - if (!session.equals("")) + if (!session.isEmpty()) ttlStr = session; } else { ttlStr = session.substring(0, off); @@ -391,9 +392,7 @@ class SessionLabel { if (portStr != null) { try { - Integer integer = Integer.valueOf(portStr); - if (integer != null) - port = integer.intValue(); + port = Integer.parseInt(portStr); } catch (Throwable t) { throw new IllegalArgumentException(); } @@ -402,9 +401,7 @@ class SessionLabel { if (ttlStr != null) { try { - Integer integer = Integer.valueOf(ttlStr); - if (integer != null) - ttl = integer.intValue(); + ttl = Integer.parseInt(ttlStr); } catch (Throwable t) { throw new IllegalArgumentException(); } @@ -415,11 +412,11 @@ class SessionLabel { /** * GUI classes for the Player. */ - class PlayerWindow extends Frame { + static class PlayerWindow extends Frame { - Player player; + final Player player; - ReceiveStream stream; + final ReceiveStream stream; PlayerWindow(Player p, ReceiveStream strm) { player = p; @@ -436,6 +433,7 @@ public void close() { dispose(); } + @Override public void addNotify() { super.addNotify(); pack(); @@ -445,9 +443,10 @@ public void addNotify() { /** * GUI classes for the Player. */ - class PlayerPanel extends Panel { + static class PlayerPanel extends Panel { - Component vc, cc; + final Component vc; + final Component cc; PlayerPanel(Player p) { setLayout(new BorderLayout()); @@ -457,6 +456,7 @@ class PlayerPanel extends Panel { add("South", cc); } + @Override public Dimension getPreferredSize() { int w = 0, h = 0; if (vc != null) { @@ -476,7 +476,7 @@ public Dimension getPreferredSize() { } } - public static void main(String argv[]) { + public static void main(String[] argv) { if (argv.length == 0) prUsage(); @@ -490,7 +490,7 @@ public static void main(String argv[]) { try { while (!avReceive.isDone()) Thread.sleep(1000); - } catch (Exception e) { + } catch (Exception ignored) { } System.err.println("Exiting AVReceive2"); diff --git a/src/samples/java/jmf/Cut.java b/src/samples/java/jmf/Cut.java index 38d424e..db6e129 100644 --- a/src/samples/java/jmf/Cut.java +++ b/src/samples/java/jmf/Cut.java @@ -83,7 +83,7 @@ public static void main(String[] args) throws Exception { String inputURL = null; String outputURL = null; - long start[], end[]; + long[] start, end; Vector startV = new Vector<>(); Vector endV = new Vector<>(); boolean frameMode = false; @@ -95,38 +95,40 @@ public static void main(String[] args) throws Exception { int i = 0; while (i < args.length) { - if (args[i].equals("-o")) { - i++; - if (i >= args.length) { - prUsage(); - } - outputURL = new File(args[i]).toURL().toString(); - } else if (args[i].equals("-f")) { - frameMode = true; - } else if (args[i].equals("-s")) { - i++; - if (i >= args.length) { - prUsage(); + switch (args[i]) { + case "-o" -> { + i++; + if (i >= args.length) { + prUsage(); + } + outputURL = new File(args[i]).toURI().toString(); } - startV.addElement(new Long(args[i])); - } else if (args[i].equals("-e")) { - i++; - if (i >= args.length) { - prUsage(); + case "-f" -> frameMode = true; + case "-s" -> { + i++; + if (i >= args.length) { + prUsage(); + } + startV.addElement(Long.parseLong(args[i])); } - endV.addElement(new Long(args[i])); - - // For every end point, there should be a matching - // start point; unless is the first point. - if (startV.size() != endV.size()) { - if (startV.size() == 0) { - startV.addElement(new Long(0)); - } else { + case "-e" -> { + i++; + if (i >= args.length) { prUsage(); } + endV.addElement(Long.parseLong(args[i])); + + // For every end point, there should be a matching + // start point; unless is the first point. + if (startV.size() != endV.size()) { + if (startV.isEmpty()) { + startV.addElement(0L); + } else { + prUsage(); + } + } } - } else { - inputURL = new File(args[i]).toURL().toString(); + default -> inputURL = new File(args[i]).toURI().toString(); } i++; } @@ -141,7 +143,7 @@ public static void main(String[] args) throws Exception { prUsage(); } - if (startV.size() == 0 && endV.size() == 0) { + if (startV.isEmpty() && endV.isEmpty()) { System.err.println("No start and end point specified."); prUsage(); } @@ -149,7 +151,7 @@ public static void main(String[] args) throws Exception { // Pad the last end point if necessary. if (startV.size() > endV.size()) { if (startV.size() == endV.size() + 1) - endV.addElement(new Long(Long.MAX_VALUE)); + endV.addElement(Long.MAX_VALUE); else prUsage(); } @@ -214,7 +216,7 @@ public static void main(String[] args) throws Exception { * Given a source media locator, destination media locator and a start and * end point, this program cuts the pieces out. */ - public boolean doIt(MediaLocator inML, MediaLocator outML, long start[], long end[], boolean frameMode) { + public boolean doIt(MediaLocator inML, MediaLocator outML, long[] start, long[] end, boolean frameMode) { // Guess the output content descriptor from the file extension. ContentDescriptor cd; @@ -355,35 +357,35 @@ public boolean doIt(MediaLocator inML, MediaLocator outML, long start[], long en */ void checkTrackFormats(Processor p) { - TrackControl tc[] = p.getTrackControls(); + TrackControl[] tc = p.getTrackControls(); VideoFormat mpgVideo = new VideoFormat(VideoFormat.MPEG); AudioFormat rawAudio = new AudioFormat(AudioFormat.LINEAR); - for (int i = 0; i < tc.length; i++) { + for (TrackControl trackControl : tc) { Format preferred = null; - if (tc[i].getFormat().matches(mpgVideo)) { + if (trackControl.getFormat().matches(mpgVideo)) { preferred = new VideoFormat(VideoFormat.JPEG); - } else if (tc[i].getFormat() instanceof AudioFormat && !tc[i].getFormat().matches(rawAudio)) { + } else if (trackControl.getFormat() instanceof AudioFormat && !trackControl.getFormat().matches(rawAudio)) { preferred = rawAudio; } if (preferred != null) { - Format supported[] = tc[i].getSupportedFormats(); + Format[] supported = trackControl.getSupportedFormats(); Format selected = null; - for (int j = 0; j < supported.length; j++) { - if (supported[j].matches(preferred)) { - selected = supported[j]; + for (Format format : supported) { + if (format.matches(preferred)) { + selected = format; break; } } if (selected != null) { System.err.println(" Transcode:"); - System.err.println(" from: " + tc[i].getFormat()); + System.err.println(" from: " + trackControl.getFormat()); System.err.println(" to: " + selected); - tc[i].setFormat(selected); + trackControl.setFormat(selected); } } } @@ -395,24 +397,24 @@ void checkTrackFormats(Processor p) { */ void setJPEGQuality(Player p, float val) { - Control cs[] = p.getControls(); + Control[] cs = p.getControls(); QualityControl qc = null; VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG); // Loop through the controls to find the Quality control for // the JPEG encoder. - for (int i = 0; i < cs.length; i++) { + for (Control c : cs) { - if (cs[i] instanceof QualityControl && cs[i] instanceof Owned) { - Object owner = ((Owned) cs[i]).getOwner(); + if (c instanceof QualityControl && c instanceof Owned) { + Object owner = ((Owned) c).getOwner(); // Check to see if the owner is a Codec. // Then check for the output format. if (owner instanceof Codec) { - Format fmts[] = ((Codec) owner).getSupportedOutputFormats(null); - for (int j = 0; j < fmts.length; j++) { - if (fmts[j].matches(jpegFmt)) { - qc = (QualityControl) cs[i]; + Format[] fmts = ((Codec) owner).getSupportedOutputFormats(null); + for (Format fmt : fmts) { + if (fmt.matches(jpegFmt)) { + qc = (QualityControl) c; qc.setQuality(val); System.err.println("- Set quality to " + val + " on " + qc); break; @@ -435,9 +437,9 @@ boolean isRawAudio(Format fmt) { /** * Utility class to block until a certain state had reached. */ - public class StateWaiter implements ControllerListener { + public static class StateWaiter implements ControllerListener { - Processor p; + final Processor p; boolean error = false; @@ -473,6 +475,7 @@ public synchronized boolean waitForState(int state) { return !(error); } + @Override public void controllerUpdate(ControllerEvent ce) { if (ce instanceof ControllerErrorEvent) { error = true; @@ -520,6 +523,7 @@ boolean waitForState(Processor p, int state) { /** * Controller Listener. */ + @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ControllerErrorEvent) { @@ -530,7 +534,7 @@ public void controllerUpdate(ControllerEvent evt) { } } - Object waitFileSync = new Object(); + final Object waitFileSync = new Object(); boolean fileDone = false; @@ -550,13 +554,14 @@ boolean waitForFileDone() { } catch (Exception e) { } } - System.err.println(""); + System.err.println(); return fileSuccess; } /** * Event handler for the file writer. */ + @Override public void dataSinkUpdate(DataSinkEvent evt) { if (evt instanceof EndOfStreamEvent) { @@ -609,7 +614,7 @@ String getMimeType(String name) { try { Class clazz = Class.forName("com.sun.media.MimeManager"); Method method = clazz.getMethod("getMimeType", String.class); - return String.class.cast(method.invoke(null, name)); + return (String) method.invoke(null, name); } catch (Exception e) { return null; } @@ -657,23 +662,23 @@ static void prUsage() { */ class SuperCutDataSource extends PushBufferDataSource { - Processor p; + final Processor p; - MediaLocator ml; + final MediaLocator ml; - PushBufferDataSource ds; + final PushBufferDataSource ds; - SuperCutStream streams[]; + final SuperCutStream[] streams; - public SuperCutDataSource(Processor p, MediaLocator ml, long start[], long end[]) { + public SuperCutDataSource(Processor p, MediaLocator ml, long[] start, long[] end) { Debug.println("start: " + start.length + ", end: " + end.length); Debug.println("start: " + start[0] + ", end: " + end[0]); this.p = p; this.ml = ml; this.ds = (PushBufferDataSource) p.getDataOutput(); //Debug.println("ds: " + ds); - TrackControl tcs[] = p.getTrackControls(); - PushBufferStream pbs[] = ds.getStreams(); + TrackControl[] tcs = p.getTrackControls(); + PushBufferStream[] pbs = ds.getStreams(); streams = new SuperCutStream[pbs.length]; for (int i = 0; i < pbs.length; i++) { @@ -681,46 +686,57 @@ public SuperCutDataSource(Processor p, MediaLocator ml, long start[], long end[] } } + @Override public void connect() throws java.io.IOException { } + @Override public PushBufferStream[] getStreams() { return streams; } + @Override public void start() throws java.io.IOException { p.start(); ds.start(); } + @Override public void stop() throws java.io.IOException { } + @Override public Object getControl(String name) { // No controls return null; } + @Override public Object[] getControls() { // No controls return new Control[0]; } + @Override public Time getDuration() { return ds.getDuration(); } + @Override public void disconnect() { } + @Override public String getContentType() { return ContentDescriptor.RAW; } + @Override public MediaLocator getLocator() { return ml; } + @Override public void setLocator(MediaLocator ml) { System.err.println("Not interested in a media locator"); } @@ -731,13 +747,15 @@ public void setLocator(MediaLocator ml) { */ class SuperCutStream implements PushBufferStream, BufferTransferHandler { - TrackControl tc; + final TrackControl tc; - PushBufferStream pbs; + final PushBufferStream pbs; - long start[], end[]; + final long[] start; + final long[] end; - boolean startReached[], endReached[]; + final boolean[] startReached; + final boolean[] endReached; int idx = 0; @@ -756,11 +774,11 @@ class SuperCutStream implements PushBufferStream, BufferTransferHandler { Format format; // Single buffer Queue. - Buffer buffer; + final Buffer buffer; int bufferFilled = 0; - public SuperCutStream(TrackControl tc, PushBufferStream pbs, long start[], long end[]) { + public SuperCutStream(TrackControl tc, PushBufferStream pbs, long[] start, long[] end) { this.tc = tc; this.pbs = pbs; this.start = start; @@ -836,11 +854,10 @@ void processData() { /** * This is invoked from the consumer processor to read a frame from me. */ + @Override public void read(Buffer rdBuf) throws IOException { - /** - * Check if there's any buffer in the Q to read. - */ + // Check if there's any buffer in the Q to read. synchronized (buffer) { while (bufferFilled == 0) { try { @@ -971,43 +988,50 @@ public long computeDuration(int len, Format fmt) { * Compute the length based on the duration and format of the audio. */ public int computeLength(long duration, Format fmt) { - if (!(fmt instanceof AudioFormat)) + if (!(fmt instanceof AudioFormat af)) return -1; - AudioFormat af = (AudioFormat) fmt; // Multiplication is done is stages to avoid overflow. - return (int) ((((duration / 1000) * (af.getChannels() * af.getSampleSizeInBits())) / 1000) * af.getSampleRate() / 8000); + return (int) ((((duration / 1000f) * (af.getChannels() * af.getSampleSizeInBits())) / 1000) * af.getSampleRate() / 8000); } + @Override public ContentDescriptor getContentDescriptor() { return new ContentDescriptor(ContentDescriptor.RAW); } + @Override public boolean endOfStream() { return eos; } + @Override public long getContentLength() { return LENGTH_UNKNOWN; } + @Override public Format getFormat() { return tc.getFormat(); } + @Override public void setTransferHandler(BufferTransferHandler bth) { this.bth = bth; } + @Override public Object getControl(String name) { // No controls return null; } + @Override public Object[] getControls() { // No controls return new Control[0]; } + @Override public synchronized void transferData(PushBufferStream pbs) { processData(); } diff --git a/src/samples/java/jmf/DataSourceReader.java b/src/samples/java/jmf/DataSourceReader.java index fbd37db..c766845 100644 --- a/src/samples/java/jmf/DataSourceReader.java +++ b/src/samples/java/jmf/DataSourceReader.java @@ -79,7 +79,7 @@ public class DataSourceReader extends Frame implements ControllerListener, DataS Processor p; - Object waitSync = new Object(); + final Object waitSync = new Object(); boolean stateTransitionOK = true; @@ -154,13 +154,12 @@ public boolean open(DataSource ds) { setLayout(new BorderLayout()); - Control controls[] = p.getControls(); + Control[] controls = p.getControls(); Panel monitorPanel = null; Component monitorComp = null; - for (int i = 0; i < controls.length; i++) { - if (controls[i] instanceof MonitorControl) { - MonitorControl mc = (MonitorControl) controls[i]; + for (Control control : controls) { + if (control instanceof MonitorControl mc) { monitorComp = mc.getControlComponent(); if (monitorPanel == null) { monitorPanel = new Panel(); @@ -190,6 +189,7 @@ public boolean open(DataSource ds) { return true; } + @Override public void addNotify() { super.addNotify(); pack(); @@ -230,6 +230,7 @@ boolean waitForState(int state) { /** * Controller Listener. */ + @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ConfigureCompleteEvent || @@ -253,6 +254,7 @@ public void controllerUpdate(ControllerEvent evt) { /** * DataSink Listener */ + @Override public void dataSinkUpdate(DataSinkEvent evt) { if (evt instanceof EndOfStreamEvent) { @@ -262,10 +264,9 @@ public void dataSinkUpdate(DataSinkEvent evt) { } } - /*************************************************************************** - * Inner class - * - **************************************************************************/ + // + // Inner class + // /** * This DataSourceHandler class reads from a DataSource and display @@ -274,20 +275,20 @@ public void dataSinkUpdate(DataSinkEvent evt) { class DataSourceHandler implements DataSink, BufferTransferHandler { DataSource source; - PullBufferStream pullStrms[] = null; + PullBufferStream[] pullStrms = null; - PushBufferStream pushStrms[] = null; + PushBufferStream[] pushStrms = null; // Data sink listeners. - private Vector listeners = new Vector<>(1); + private final Vector listeners = new Vector<>(1); // Stored all the streams that are not yet finished (i.e. EOM // has not been received. - SourceStream unfinishedStrms[] = null; + SourceStream[] unfinishedStrms = null; // Loop threads to pull data from a PullBufferDataSource. // There is one thread per each PullSourceStream. - Loop loops[] = null; + Loop[] loops = null; Buffer readBuffer; @@ -295,6 +296,7 @@ class DataSourceHandler implements DataSink, BufferTransferHandler { * Sets the media source this MediaHandler should use to * obtain content. */ + @Override public void setSource(DataSource source) throws IncompatibleSourceException { // Different types of DataSources need to handled differently. @@ -338,13 +340,16 @@ public void setSource(DataSource source) throws IncompatibleSourceException { * For completeness, DataSink's require this method. But we don't need * it. */ + @Override public void setOutputLocator(MediaLocator ml) { } + @Override public MediaLocator getOutputLocator() { return null; } + @Override public String getContentType() { return source.getContentType(); } @@ -352,9 +357,11 @@ public String getContentType() { /** * Our DataSink does not need to be opened. */ + @Override public void open() { } + @Override public void start() { try { source.start(); @@ -365,11 +372,11 @@ public void start() { // Start the processing loop if we are dealing with a // PullBufferDataSource. if (loops != null) { - for (int i = 0; i < loops.length; i++) - loops[i].restart(); + for (Loop loop : loops) loop.restart(); } } + @Override public void stop() { try { source.stop(); @@ -380,25 +387,26 @@ public void stop() { // Start the processing loop if we are dealing with a // PullBufferDataSource. if (loops != null) { - for (int i = 0; i < loops.length; i++) - loops[i].pause(); + for (Loop loop : loops) loop.pause(); } } + @Override public void close() { stop(); if (loops != null) { - for (int i = 0; i < loops.length; i++) - loops[i].kill(); + for (Loop loop : loops) loop.kill(); } } + @Override public void addDataSinkListener(DataSinkListener dsl) { if (dsl != null) if (!listeners.contains(dsl)) listeners.addElement(dsl); } + @Override public void removeDataSinkListener(DataSinkListener dsl) { if (dsl != null) listeners.removeElement(dsl); @@ -420,6 +428,7 @@ protected void sendEvent(DataSinkEvent event) { * This will get called when there's data pushed from the * PushBufferDataSource. */ + @Override public void transferData(PushBufferStream stream) { try { @@ -501,10 +510,12 @@ void printDataInfo(Buffer buffer) { System.err.printf("V: %7d, %07d, %d\n", buffer.getSequenceNumber(), buffer.getTimeStamp() / 1000000, buffer.getLength()); } + @Override public Object[] getControls() { return new Object[0]; } + @Override public Object getControl(String name) { return null; } @@ -516,9 +527,9 @@ public Object getControl(String name) { */ class Loop extends Thread { - DataSourceHandler handler; + final DataSourceHandler handler; - PullBufferStream stream; + final PullBufferStream stream; boolean paused = true; @@ -553,6 +564,7 @@ public synchronized void kill() { /** * This is the processing loop to pull data from a PullBufferDataSource. */ + @Override public void run() { while (!killed) { try { diff --git a/src/samples/java/jmf/JMF_Movie_Processor.java b/src/samples/java/jmf/JMF_Movie_Processor.java index 7831b4a..9eb5917 100644 --- a/src/samples/java/jmf/JMF_Movie_Processor.java +++ b/src/samples/java/jmf/JMF_Movie_Processor.java @@ -47,15 +47,16 @@ public class JMF_Movie_Processor { - MovieProcessor MP; + final MovieProcessor MP; - Frame frm; + final Frame frm; int skip = 1; Rectangle theRoi = null; - int firstF, lastF; + final int firstF; + final int lastF; boolean playing = false; @@ -65,15 +66,20 @@ public class JMF_Movie_Processor { int framecount; - Panel p0, p1, p2; + final Panel p0; + final Panel p1; + final Panel p2; - Button stepBW, stepFW; + final Button stepBW; + final Button stepFW; - Button playF, playB, pauseB; + final Button playF; + final Button playB; + final Button pauseB; - Button goToAcqB; + final Button goToAcqB; - Scrollbar delaySB; + final Scrollbar delaySB; int timeDelay = 25; @@ -192,7 +198,8 @@ public void updateTitle(Frame frm) { // LISTENERS... /** Key Listener */ - KeyListener keyListener = new KeyAdapter() { + final KeyListener keyListener = new KeyAdapter() { + @Override public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); @@ -235,7 +242,8 @@ public void keyPressed(KeyEvent e) { }; /** Action Listener (Buttons) */ - ActionListener actionListener = new ActionListener() { + final ActionListener actionListener = new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { Object b = e.getSource(); @@ -270,7 +278,8 @@ public void actionPerformed(ActionEvent e) { }; /** Adjustment Listener (Scroll bar) */ - AdjustmentListener adjustmentListener = new AdjustmentListener() { + final AdjustmentListener adjustmentListener = new AdjustmentListener() { + @Override public void adjustmentValueChanged(AdjustmentEvent evt) { Object s = evt.getSource(); { @@ -283,13 +292,15 @@ public void adjustmentValueChanged(AdjustmentEvent evt) { }; /** Window Listener */ - WindowListener windowListener = new WindowAdapter() { + final WindowListener windowListener = new WindowAdapter() { + @Override public void windowClosing(WindowEvent we) { end_flag = true; frm.setVisible(false); frm.dispose(); } + @Override public void windowClosed(java.awt.event.WindowEvent evt) { p0.removeKeyListener(keyListener); MP.kill(); @@ -311,7 +322,7 @@ class MovieProcessor implements ControllerListener { FrameGrabbingControl fgc; - Object waitSync = new Object(); + final Object waitSync = new Object(); boolean stateTransitionOK = true; @@ -366,7 +377,7 @@ public String encodeURL(String url) { while (index > -1) { index = url.indexOf(' '); if (index > -1) { - url = url.substring(0, index) + "%20" + url.substring(index + 1, url.length()); + url = url.substring(0, index) + "%20" + url.substring(index + 1); } } return url; @@ -536,6 +547,7 @@ boolean waitForState(int state) { } /** Controller Listener */ + @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ConfigureCompleteEvent || evt instanceof RealizeCompleteEvent || evt instanceof PrefetchCompleteEvent) { diff --git a/src/samples/java/jmf/RTPExport.java b/src/samples/java/jmf/RTPExport.java index 7f72112..699dd2c 100644 --- a/src/samples/java/jmf/RTPExport.java +++ b/src/samples/java/jmf/RTPExport.java @@ -188,7 +188,7 @@ void setContentDescriptor(Processor p, MediaLocator outML) { */ boolean setTrackFormats(Processor p) { - Format supported[]; + Format[] supported; TrackControl[] tracks = p.getTrackControls(); @@ -222,24 +222,24 @@ boolean setTrackFormats(Processor p) { */ void setJPEGQuality(Player p, float val) { - Control cs[] = p.getControls(); + Control[] cs = p.getControls(); QualityControl qc = null; VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG); // Loop through the controls to find the Quality control for // the JPEG encoder. - for (int i = 0; i < cs.length; i++) { + for (Control c : cs) { - if (cs[i] instanceof QualityControl && cs[i] instanceof Owned) { - Object owner = ((Owned) cs[i]).getOwner(); + if (c instanceof QualityControl && c instanceof Owned) { + Object owner = ((Owned) c).getOwner(); // Check to see if the owner is a Codec. // Then check for the output format. if (owner instanceof Codec) { - Format fmts[] = ((Codec) owner).getSupportedOutputFormats(null); - for (int j = 0; j < fmts.length; j++) { - if (fmts[j].matches(jpegFmt)) { - qc = (QualityControl) cs[i]; + Format[] fmts = ((Codec) owner).getSupportedOutputFormats(null); + for (Format fmt : fmts) { + if (fmt.matches(jpegFmt)) { + qc = (QualityControl) c; qc.setQuality(val); System.err.println("- Set quality to " + val + " on " + qc); break; @@ -278,7 +278,7 @@ DataSink createDataSink(Processor p, MediaLocator outML) { return dsink; } - Object waitSync = new Object(); + final Object waitSync = new Object(); boolean stateTransitionOK = true; @@ -300,6 +300,7 @@ boolean waitForState(Processor p, int state) { /** * Controller Listener. */ + @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ConfigureCompleteEvent || evt instanceof RealizeCompleteEvent || evt instanceof PrefetchCompleteEvent) { @@ -320,7 +321,7 @@ public void controllerUpdate(ControllerEvent evt) { } } - Object waitFileSync = new Object(); + final Object waitFileSync = new Object(); boolean fileDone = false; @@ -342,13 +343,14 @@ boolean waitForFileDone(int duration) { } catch (Exception e) { } } - System.err.println(""); + System.err.println(); return fileSuccess; } /** * Event handler for the file writer. */ + @Override public void dataSinkUpdate(DataSinkEvent evt) { if (evt instanceof EndOfStreamEvent) { @@ -399,7 +401,7 @@ String getMimeType(String name) { try { Class clazz = Class.forName("com.sun.media.MimeManager"); Method method = clazz.getMethod("getMimeType", String.class); - return String.class.cast(method.invoke(null, name)); + return (String) method.invoke(null, name); } catch (Exception e) { return null; } @@ -410,7 +412,8 @@ String getMimeType(String name) { */ public static void main(String[] args) { - String outputURL = null, inputURL = null; + String outputURL = null; + StringBuilder inputURL = null; int duration = -1; if (args.length == 0) @@ -430,11 +433,11 @@ public static void main(String[] args) { prUsage(); Integer integer = Integer.valueOf(args[i]); if (integer != null) - duration = integer.intValue(); + duration = integer; } else if (inputURL == null) { - inputURL = "rtp://" + args[i]; + inputURL = new StringBuilder("rtp://" + args[i]); } else { - inputURL = inputURL + "&" + args[i]; + inputURL.append("&").append(args[i]); } i++; } @@ -452,7 +455,7 @@ public static void main(String[] args) { // Generate the input and output media locators. MediaLocator iml, oml; - if ((iml = createMediaLocator(inputURL)) == null) { + if ((iml = createMediaLocator(inputURL.toString())) == null) { System.err.println("Cannot build media locator from: " + inputURL); System.exit(0); } diff --git a/src/samples/java/jmf/RtpReceiver.java b/src/samples/java/jmf/RtpReceiver.java index 2476f56..534b8fa 100644 --- a/src/samples/java/jmf/RtpReceiver.java +++ b/src/samples/java/jmf/RtpReceiver.java @@ -18,7 +18,6 @@ import javax.media.RealizeCompleteEvent; import javax.media.control.TrackControl; import javax.media.datasink.DataSinkErrorEvent; -import javax.media.datasink.DataSinkEvent; import javax.media.datasink.DataSinkListener; import javax.media.datasink.EndOfStreamEvent; import javax.media.format.AudioFormat; @@ -40,12 +39,12 @@ public class RtpReceiver { Processor processor; Timer timer; - MediaLocator sourceML; + final MediaLocator sourceML; /** in msec */ - int interval; + final int interval; long playingTime = 0; public static void main(String[] args) throws Exception { - new RtpReceiver(new File(args[0]).toURL().toString(), Integer.parseInt(args[1])); + new RtpReceiver(new File(args[0]).toURI().toString(), Integer.parseInt(args[1])); } /** * @param url @@ -57,23 +56,27 @@ public RtpReceiver(String url, int interval) throws Exception { sourceML = new MediaLocator(url); processor = Manager.createProcessor(sourceML); processor.addControllerListener(new ControllerAdapter() { + @Override public void configureComplete(ConfigureCompleteEvent event) { // Set the output content type and realize the processor checkTrackFormats(processor); processor.realize(); } + @Override public void realizeComplete(RealizeCompleteEvent event) { System.err.println("start play"); timer.setInitialDelay(0); timer.start(); } + @Override public void endOfMedia(EndOfMediaEvent event) { System.err.println("stop play"); timer.stop(); event.getSourceController().close(); System.exit(0); } + @Override public void controllerError(ControllerErrorEvent event) { System.err.println(event); System.exit(-1); @@ -81,9 +84,10 @@ public void controllerError(ControllerErrorEvent event) { }); timer = new Timer(this.interval, new ActionListener() { - UrlMaker urlMaker = new MyUrlMaker(); + final UrlMaker urlMaker = new MyUrlMaker(); Processor outProcessor; /** Capture for 10 seconds */ + @Override public void actionPerformed(ActionEvent event) { try { long start = playingTime * 1000 * 1000; @@ -97,15 +101,18 @@ public void actionPerformed(ActionEvent event) { outProcessor = Manager.createProcessor(dataSource); outProcessor.addControllerListener(new ControllerAdapter() { + @Override public void configureComplete(ConfigureCompleteEvent event) { outProcessor.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.WAVE)); outProcessor.realize(); Debug.println("outProcessor: configured"); } + @Override public void realizeComplete(RealizeCompleteEvent event) { outProcessor.prefetch(); Debug.println("outProcessor: realized"); } + @Override public void prefetchComplete(PrefetchCompleteEvent event) { try { // create a File protocol MediaLocator with the location of the @@ -135,9 +142,11 @@ public void prefetchComplete(PrefetchCompleteEvent event) { e.printStackTrace(System.err); } } + @Override public void endOfMedia(EndOfMediaEvent event) { event.getSourceController().close(); } + @Override public void controllerError(ControllerErrorEvent event) { System.err.println(event); } @@ -154,7 +163,7 @@ public void controllerError(ControllerErrorEvent event) { } /** */ - private Object waitFileSync = new Object(); + private final Object waitFileSync = new Object(); /** */ private boolean fileDone = false; @@ -184,22 +193,20 @@ private boolean waitForFileDone() { /** * Event handler for the file writer. */ - private DataSinkListener dataSinkListener = new DataSinkListener() { - public void dataSinkUpdate(DataSinkEvent event) { + private final DataSinkListener dataSinkListener = event -> { - if (event instanceof EndOfStreamEvent) { - synchronized (waitFileSync) { - fileDone = true; - waitFileSync.notifyAll(); + if (event instanceof EndOfStreamEvent) { + synchronized (waitFileSync) { + fileDone = true; + waitFileSync.notifyAll(); System.err.print("O"); - } - } else if (event instanceof DataSinkErrorEvent) { - synchronized (waitFileSync) { - fileDone = true; - fileSuccess = false; - waitFileSync.notifyAll(); + } + } else if (event instanceof DataSinkErrorEvent) { + synchronized (waitFileSync) { + fileDone = true; + fileSuccess = false; + waitFileSync.notifyAll(); System.err.print("X"); - } } } }; @@ -210,35 +217,35 @@ public void dataSinkUpdate(DataSinkEvent event) { */ void checkTrackFormats(Processor p) { - TrackControl tc[] = p.getTrackControls(); + TrackControl[] tc = p.getTrackControls(); VideoFormat mpgVideo = new VideoFormat(VideoFormat.MPEG); AudioFormat rawAudio = new AudioFormat(AudioFormat.LINEAR); - for (int i = 0; i < tc.length; i++) { + for (TrackControl trackControl : tc) { Format preferred = null; - if (tc[i].getFormat().matches(mpgVideo)) { + if (trackControl.getFormat().matches(mpgVideo)) { preferred = new VideoFormat(VideoFormat.JPEG); - } else if (tc[i].getFormat() instanceof AudioFormat && !tc[i].getFormat().matches(rawAudio)) { + } else if (trackControl.getFormat() instanceof AudioFormat && !trackControl.getFormat().matches(rawAudio)) { preferred = rawAudio; } if (preferred != null) { - Format supported[] = tc[i].getSupportedFormats(); + Format[] supported = trackControl.getSupportedFormats(); Format selected = null; - for (int j = 0; j < supported.length; j++) { - if (supported[j].matches(preferred)) { - selected = supported[j]; + for (Format format : supported) { + if (format.matches(preferred)) { + selected = format; break; } } if (selected != null) { System.err.println(" Transcode:"); - System.err.println(" from: " + tc[i].getFormat()); + System.err.println(" from: " + trackControl.getFormat()); System.err.println(" to: " + selected); - tc[i].setFormat(selected); + trackControl.setFormat(selected); } } } @@ -247,7 +254,7 @@ void checkTrackFormats(Processor p) { /** Get the file corresponding to the current second {@link #interval} [mesc] */ class MyUrlMaker implements UrlMaker { /** */ - Calendar calendar = Calendar.getInstance(); + final Calendar calendar = Calendar.getInstance(); /** */ MyUrlMaker() { calendar.roll(Calendar.SECOND, 10); @@ -256,6 +263,7 @@ class MyUrlMaker implements UrlMaker { int currentNo = 0; /** */ + @Override public String getUrl() { // if (currentNo == 0) { diff --git a/src/samples/java/jmf/RtpTransmitter.java b/src/samples/java/jmf/RtpTransmitter.java index 4319d22..2f65809 100644 --- a/src/samples/java/jmf/RtpTransmitter.java +++ b/src/samples/java/jmf/RtpTransmitter.java @@ -22,13 +22,13 @@ */ public class RtpTransmitter { // Socket - private DatagramSocket socket; + private final DatagramSocket socket; // destination IP address - private String destIP; + private final String destIP; // destination UDP port number - private String destPort; + private final String destPort; // sending thread private TransmitThread transmitThread; @@ -80,11 +80,11 @@ public void setMediaType(int mediaType) { */ class TransmitThread extends Thread { - private String destIP; + private final String destIP; - private String destPort; + private final String destPort; - private DatagramSocket socket; + private final DatagramSocket socket; private boolean isStop; @@ -98,6 +98,7 @@ public TransmitThread(DatagramSocket socket, String destIP, String destPort) { } // Microphone capture -> Send Start thread + @Override public void run() { try { byte[] voicePacket = new byte[160]; @@ -145,7 +146,7 @@ public void transmitStop() { this.isStop = true; } - class RtpHeader { + static class RtpHeader { // Init RTP Headerstop RtpHeader() { Random r = new Random(); @@ -160,20 +161,20 @@ class RtpHeader { // time stamp private int timeStamp; // sync source ID - private int syncSourceId; + private final int syncSourceId; // marker bit private byte marker; // version number 10000000 - byte version = -128; + final byte version = -128; // padding - byte padding = 0; + final byte padding = 0; // expansion bit - byte extention = 0; + final byte extention = 0; // contribution count - byte contribute = 0; + final byte contribute = 0; // payload type - byte payload = 0; + final byte payload = 0; void writeTo(OutputStream os) throws IOException { // RTP header diff --git a/src/samples/java/jmf/Split.java b/src/samples/java/jmf/Split.java index 6d8526d..37e5a19 100644 --- a/src/samples/java/jmf/Split.java +++ b/src/samples/java/jmf/Split.java @@ -72,9 +72,9 @@ */ public class Split { - SplitDataSource splitDS[]; + SplitDataSource[] splitDS; - Object fileSync = new Object(); + final Object fileSync = new Object(); boolean allDone = false; @@ -182,7 +182,7 @@ public boolean doIt(MediaLocator inML, String audExt, String vidExt) { // Get the output data streams from the first processor. // Create a SplitDataSource for each of these elementary stream. PushBufferDataSource pbds = (PushBufferDataSource) p.getDataOutput(); - PushBufferStream pbs[] = pbds.getStreams(); + PushBufferStream[] pbs = pbds.getStreams(); splitDS = new SplitDataSource[pbs.length]; allDone = false; @@ -215,8 +215,8 @@ public boolean doIt(MediaLocator inML, String audExt, String vidExt) { */ void doneFile() { synchronized (fileSync) { - for (int i = 0; i < splitDS.length; i++) { - if (!splitDS[i].done) { + for (SplitDataSource splitD : splitDS) { + if (!splitD.done) { return; } } @@ -238,7 +238,7 @@ void waitForFileDone() { } } } - System.err.println(""); + System.err.println(); } /** @@ -247,15 +247,15 @@ void waitForFileDone() { */ void transcodeMPEGToRaw(Processor p) { - TrackControl tc[] = p.getTrackControls(); + TrackControl[] tc = p.getTrackControls(); AudioFormat afmt; - for (int i = 0; i < tc.length; i++) { - if (tc[i].getFormat() instanceof VideoFormat) - tc[i].setFormat(new VideoFormat(VideoFormat.JPEG)); - else if (tc[i].getFormat() instanceof AudioFormat) { - afmt = (AudioFormat) tc[i].getFormat(); - tc[i].setFormat(new AudioFormat(AudioFormat.LINEAR, afmt.getSampleRate(), afmt.getSampleSizeInBits(), afmt.getChannels())); + for (TrackControl trackControl : tc) { + if (trackControl.getFormat() instanceof VideoFormat) + trackControl.setFormat(new VideoFormat(VideoFormat.JPEG)); + else if (trackControl.getFormat() instanceof AudioFormat) { + afmt = (AudioFormat) trackControl.getFormat(); + trackControl.setFormat(new AudioFormat(AudioFormat.LINEAR, afmt.getSampleRate(), afmt.getSampleSizeInBits(), afmt.getChannels())); } } } @@ -266,24 +266,24 @@ else if (tc[i].getFormat() instanceof AudioFormat) { */ void setJPEGQuality(Player p, float val) { - Control cs[] = p.getControls(); + Control[] cs = p.getControls(); QualityControl qc = null; VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG); // Loop through the controls to find the Quality control for // the JPEG encoder. - for (int i = 0; i < cs.length; i++) { + for (Control c : cs) { - if (cs[i] instanceof QualityControl && cs[i] instanceof Owned) { - Object owner = ((Owned) cs[i]).getOwner(); + if (c instanceof QualityControl && c instanceof Owned) { + Object owner = ((Owned) c).getOwner(); // Check to see if the owner is a Codec. // Then check for the output format. if (owner instanceof Codec) { - Format fmts[] = ((Codec) owner).getSupportedOutputFormats(null); - for (int j = 0; j < fmts.length; j++) { - if (fmts[j].matches(jpegFmt)) { - qc = (QualityControl) cs[i]; + Format[] fmts = ((Codec) owner).getSupportedOutputFormats(null); + for (Format fmt : fmts) { + if (fmt.matches(jpegFmt)) { + qc = (QualityControl) c; qc.setQuality(val); System.err.println("- Set quality to " + val + " on " + qc); break; @@ -299,9 +299,9 @@ void setJPEGQuality(Player p, float val) { /** * Utility class to block until a certain state had reached. */ - public class StateWaiter implements ControllerListener { + public static class StateWaiter implements ControllerListener { - Processor p; + final Processor p; boolean error = false; @@ -337,6 +337,7 @@ public synchronized boolean waitForState(int state) { return !(error); } + @Override public void controllerUpdate(ControllerEvent ce) { if (ce instanceof ControllerErrorEvent) { error = true; @@ -389,7 +390,7 @@ String getMimeType(String name) { try { Class clazz = Class.forName("com.sun.media.MimeManager"); Method method = clazz.getMethod("getMimeType", String.class); - return String.class.cast(method.invoke(null, name)); + return (String) method.invoke(null, name); } catch (Exception e) { return null; } @@ -425,25 +426,24 @@ static void prUsage() { System.exit(0); } - // ////////////////////////////////////// // // Inner classes. - // ////////////////////////////////////// + // /** * The custom DataSource to split input. */ - class SplitDataSource extends PushBufferDataSource { + static class SplitDataSource extends PushBufferDataSource { - Processor p; + final Processor p; - PushBufferDataSource ds; + final PushBufferDataSource ds; - PushBufferStream pbs[]; + final PushBufferStream[] pbs; - SplitStream streams[]; + final SplitStream[] streams; - int idx; + final int idx; boolean done = false; @@ -456,9 +456,11 @@ public SplitDataSource(Processor p, int idx) { streams[0] = new SplitStream(pbs[idx]); } + @Override public void connect() throws java.io.IOException { } + @Override public PushBufferStream[] getStreams() { return streams; } @@ -467,39 +469,48 @@ public Format getStreamFormat() { return pbs[idx].getFormat(); } + @Override public void start() throws java.io.IOException { p.start(); ds.start(); } + @Override public void stop() throws java.io.IOException { } + @Override public Object getControl(String name) { // No controls return null; } + @Override public Object[] getControls() { // No controls return new Control[0]; } + @Override public Time getDuration() { return ds.getDuration(); } + @Override public void disconnect() { } + @Override public String getContentType() { return ContentDescriptor.RAW; } + @Override public MediaLocator getLocator() { return ds.getLocator(); } + @Override public void setLocator(MediaLocator ml) { System.err.println("Not interested in a media locator"); } @@ -508,9 +519,9 @@ public void setLocator(MediaLocator ml) { /** * Utility Source stream for the SplitDataSource. */ - class SplitStream implements PushBufferStream, BufferTransferHandler { + static class SplitStream implements PushBufferStream, BufferTransferHandler { - PushBufferStream pbs; + final PushBufferStream pbs; BufferTransferHandler bth; @@ -521,40 +532,49 @@ public SplitStream(PushBufferStream pbs) { pbs.setTransferHandler(this); } + @Override public void read(Buffer buf) /* throws IOException */{ // This wouldn't be used. } + @Override public ContentDescriptor getContentDescriptor() { return new ContentDescriptor(ContentDescriptor.RAW); } + @Override public boolean endOfStream() { return pbs.endOfStream(); } + @Override public long getContentLength() { return LENGTH_UNKNOWN; } + @Override public Format getFormat() { return pbs.getFormat(); } + @Override public void setTransferHandler(BufferTransferHandler bth) { this.bth = bth; } + @Override public Object getControl(String name) { // No controls return null; } + @Override public Object[] getControls() { // No controls return new Control[0]; } + @Override public synchronized void transferData(PushBufferStream pbs) { if (bth != null) bth.transferData(pbs); @@ -654,6 +674,7 @@ boolean write(SplitDataSource ds) { /** * Controller Listener. */ + @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ControllerErrorEvent) { @@ -667,6 +688,7 @@ public void controllerUpdate(ControllerEvent evt) { /** * Event handler for the file writer. */ + @Override public void dataSinkUpdate(DataSinkEvent evt) { if (evt instanceof EndOfStreamEvent || evt instanceof DataSinkErrorEvent) { diff --git a/src/samples/java/jmf/Transcode.java b/src/samples/java/jmf/Transcode.java index c58c32a..20061a0 100644 --- a/src/samples/java/jmf/Transcode.java +++ b/src/samples/java/jmf/Transcode.java @@ -80,7 +80,7 @@ public class Transcode implements ControllerListener, DataSinkListener { * formats, this method will transcode the source to the dest into the * specified formats. */ - public boolean doIt(MediaLocator inML, MediaLocator outML, Format fmts[], int start, int end) { + public boolean doIt(MediaLocator inML, MediaLocator outML, Format[] fmts, int start, int end) { Processor p; @@ -191,12 +191,12 @@ void setContentDescriptor(Processor p, MediaLocator outML) { /** * Set the target transcode format on the processor. */ - boolean setTrackFormats(Processor p, Format fmts[]) { + boolean setTrackFormats(Processor p, Format[] fmts) { if (fmts.length == 0) return true; - TrackControl tcs[]; + TrackControl[] tcs; if ((tcs = p.getTrackControls()) == null) { // The processor does not support any track control. @@ -204,12 +204,12 @@ boolean setTrackFormats(Processor p, Format fmts[]) { return false; } - for (int i = 0; i < fmts.length; i++) { + for (Format fmt : fmts) { - System.err.println("- set track format to: " + fmts[i]); + System.err.println("- set track format to: " + fmt); - if (!setEachTrackFormat(p, tcs, fmts[i])) { - System.err.println("Cannot transcode any track to: " + fmts[i]); + if (!setEachTrackFormat(p, tcs, fmt)) { + System.err.println("Cannot transcode any track to: " + fmt); return false; } } @@ -221,9 +221,9 @@ boolean setTrackFormats(Processor p, Format fmts[]) { * We'll loop through the tracks and try to find a track that can be * converted to the given format. */ - boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) { + boolean setEachTrackFormat(Processor p, TrackControl[] tcs, Format fmt) { - Format supported[]; + Format[] supported; Format f; // for (int i = 0; i < tcs.length; i++) { @@ -233,16 +233,16 @@ boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) { // } // } - for (int i = 0; i < tcs.length; i++) { + for (TrackControl tc : tcs) { - supported = tcs[i].getSupportedFormats(); + supported = tc.getSupportedFormats(); if (supported == null) continue; - for (int j = 0; j < supported.length; j++) { + for (Format format : supported) { - if (fmt.matches(supported[j]) && (f = fmt.intersects(supported[j])) != null && tcs[i].setFormat(f) != null) { + if (fmt.matches(format) && (f = fmt.intersects(format)) != null && tc.setFormat(f) != null) { // Success. return true; @@ -259,24 +259,24 @@ boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) { */ void setJPEGQuality(Player p, float val) { - Control cs[] = p.getControls(); + Control[] cs = p.getControls(); QualityControl qc = null; VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG); // Loop through the controls to find the Quality control for // the JPEG encoder. - for (int i = 0; i < cs.length; i++) { + for (Control c : cs) { - if (cs[i] instanceof QualityControl && cs[i] instanceof Owned) { - Object owner = ((Owned) cs[i]).getOwner(); + if (c instanceof QualityControl && c instanceof Owned) { + Object owner = ((Owned) c).getOwner(); // Check to see if the owner is a Codec. // Then check for the output format. if (owner instanceof Codec) { - Format fmts[] = ((Codec) owner).getSupportedOutputFormats(null); - for (int j = 0; j < fmts.length; j++) { - if (fmts[j].matches(jpegFmt)) { - qc = (QualityControl) cs[i]; + Format[] fmts = ((Codec) owner).getSupportedOutputFormats(null); + for (Format fmt : fmts) { + if (fmt.matches(jpegFmt)) { + qc = (QualityControl) c; qc.setQuality(val); System.err.println("- Set quality to " + val + " on " + qc); break; @@ -315,7 +315,7 @@ DataSink createDataSink(Processor p, MediaLocator outML) { return dsink; } - Object waitSync = new Object(); + final Object waitSync = new Object(); boolean stateTransitionOK = true; @@ -337,6 +337,7 @@ boolean waitForState(Processor p, int state) { /** * Controller Listener. */ + @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ConfigureCompleteEvent || evt instanceof RealizeCompleteEvent || evt instanceof PrefetchCompleteEvent) { @@ -359,7 +360,7 @@ public void controllerUpdate(ControllerEvent evt) { } } - Object waitFileSync = new Object(); + final Object waitFileSync = new Object(); boolean fileDone = false; @@ -379,13 +380,14 @@ boolean waitForFileDone() { } catch (Exception e) { } } - System.err.println(""); + System.err.println(); return fileSuccess; } /** * Event handler for the file writer. */ + @Override public void dataSinkUpdate(DataSinkEvent evt) { if (evt instanceof EndOfStreamEvent) { @@ -436,7 +438,7 @@ String getMimeType(String name) { try { Class clazz = Class.forName("com.sun.media.MimeManager"); Method method = clazz.getMethod("getMimeType", String.class); - return String.class.cast(method.invoke(null, name)); + return (String) method.invoke(null, name); } catch (Exception e) { return null; } @@ -458,37 +460,42 @@ public static void main(String[] args) { int i = 0; while (i < args.length) { - if (args[i].equals("-v")) { - i++; - if (i >= args.length) - prUsage(); - vidFmt.addElement(args[i]); - } else if (args[i].equals("-a")) { - i++; - if (i >= args.length) - prUsage(); - audFmt.addElement(args[i]); - } else if (args[i].equals("-o")) { - i++; - if (i >= args.length) - prUsage(); - outputURL = args[i]; - } else if (args[i].equals("-s")) { - i++; - if (i >= args.length) - prUsage(); - Integer integer = Integer.valueOf(args[i]); - if (integer != null) - mediaStart = integer.intValue(); - } else if (args[i].equals("-e")) { - i++; - if (i >= args.length) - prUsage(); - Integer integer = Integer.valueOf(args[i]); - if (integer != null) - mediaEnd = integer.intValue(); - } else { - inputURL = args[i]; + switch (args[i]) { + case "-v" -> { + i++; + if (i >= args.length) + prUsage(); + vidFmt.addElement(args[i]); + } + case "-a" -> { + i++; + if (i >= args.length) + prUsage(); + audFmt.addElement(args[i]); + } + case "-o" -> { + i++; + if (i >= args.length) + prUsage(); + outputURL = args[i]; + } + case "-s" -> { + i++; + if (i >= args.length) + prUsage(); + Integer integer = Integer.valueOf(args[i]); + if (integer != null) + mediaStart = integer; + } + case "-e" -> { + i++; + if (i >= args.length) + prUsage(); + Integer integer = Integer.valueOf(args[i]); + if (integer != null) + mediaEnd = integer; + } + default -> inputURL = args[i]; } i++; } @@ -504,7 +511,7 @@ public static void main(String[] args) { } int j = 0; - Format fmts[] = new Format[audFmt.size() + vidFmt.size()]; + Format[] fmts = new Format[audFmt.size() + vidFmt.size()]; Format fmt; // Parse the audio format spec. into real AudioFormat's. @@ -585,14 +592,14 @@ static Format parseAudioFormat(String fmtStr) { // Parser the media locator to extract the requested format. - if (fmtStr != null && fmtStr.length() > 0) { + if (fmtStr != null && !fmtStr.isEmpty()) { while (fmtStr.length() > 1 && fmtStr.charAt(0) == ':') fmtStr = fmtStr.substring(1); // Now see if there's a encode rate specified. int off = fmtStr.indexOf(':'); if (off == -1) { - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) encodeStr = fmtStr; } else { encodeStr = fmtStr.substring(0, off); @@ -600,7 +607,7 @@ static Format parseAudioFormat(String fmtStr) { // Now see if there's a sample rate specified off = fmtStr.indexOf(':'); if (off == -1) { - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) rateStr = fmtStr; } else { rateStr = fmtStr.substring(0, off); @@ -608,7 +615,7 @@ static Format parseAudioFormat(String fmtStr) { // Now see if there's a size specified off = fmtStr.indexOf(':'); if (off == -1) { - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) bitsStr = fmtStr; } else { bitsStr = fmtStr.substring(0, off); @@ -616,7 +623,7 @@ static Format parseAudioFormat(String fmtStr) { // Now see if there's channels specified. off = fmtStr.indexOf(':'); if (off == -1) { - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) channelsStr = fmtStr; } else { channelsStr = fmtStr.substring(0, off); @@ -624,11 +631,11 @@ static Format parseAudioFormat(String fmtStr) { // Now see if there's endian specified. off = fmtStr.indexOf(':'); if (off == -1) { - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) endianStr = fmtStr.substring(off + 1); } else { endianStr = fmtStr.substring(0, off); - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) signedStr = fmtStr.substring(off + 1); } } @@ -643,7 +650,7 @@ static Format parseAudioFormat(String fmtStr) { try { Integer integer = Integer.valueOf(rateStr); if (integer != null) - rate = integer.intValue(); + rate = integer; } catch (Throwable t) { } } @@ -654,7 +661,7 @@ static Format parseAudioFormat(String fmtStr) { try { Integer integer = Integer.valueOf(bitsStr); if (integer != null) - bits = integer.intValue(); + bits = integer; } catch (Throwable t) { } } @@ -665,7 +672,7 @@ static Format parseAudioFormat(String fmtStr) { try { Integer integer = Integer.valueOf(channelsStr); if (integer != null) - channels = integer.intValue(); + channels = integer; } catch (Throwable t) { } } @@ -701,14 +708,14 @@ static Format parseVideoFormat(String fmtStr) { // Parser the media locator to extract the requested format. - if (fmtStr != null && fmtStr.length() > 0) { + if (fmtStr != null && !fmtStr.isEmpty()) { while (fmtStr.length() > 1 && fmtStr.charAt(0) == ':') fmtStr = fmtStr.substring(1); // Now see if there's a encode rate specified. int off = fmtStr.indexOf(':'); if (off == -1) { - if (!fmtStr.equals("")) + if (!fmtStr.isEmpty()) encodeStr = fmtStr; } else { encodeStr = fmtStr.substring(0, off); @@ -716,7 +723,7 @@ static Format parseVideoFormat(String fmtStr) { } } - if (encodeStr == null || encodeStr.equals("")) + if (encodeStr == null || encodeStr.isEmpty()) prUsage(); if (sizeStr == null) @@ -738,10 +745,10 @@ static Format parseVideoFormat(String fmtStr) { try { Integer integer = Integer.valueOf(widthStr); if (integer != null) - width = integer.intValue(); + width = integer; integer = Integer.valueOf(heightStr); if (integer != null) - height = integer.intValue(); + height = integer; } catch (Throwable t) { prUsage(); } diff --git a/src/samples/java/jmf/Transcoder.java b/src/samples/java/jmf/Transcoder.java index fc3489a..99558c4 100644 --- a/src/samples/java/jmf/Transcoder.java +++ b/src/samples/java/jmf/Transcoder.java @@ -12,7 +12,6 @@ import javax.media.ConfigureCompleteEvent; import javax.media.Controller; -import javax.media.ControllerEvent; import javax.media.ControllerListener; import javax.media.DataSink; import javax.media.EndOfMediaEvent; @@ -30,7 +29,6 @@ import javax.media.Time; import javax.media.control.TrackControl; import javax.media.datasink.DataSinkErrorEvent; -import javax.media.datasink.DataSinkEvent; import javax.media.datasink.DataSinkListener; import javax.media.datasink.EndOfStreamEvent; import javax.media.format.AudioFormat; @@ -61,7 +59,7 @@ public class Transcoder { * @param start start time * @param end end time */ - public void doIt(MediaLocator inML, MediaLocator outML, Format fmts[], int start, int end) throws NoProcessorException, IOException, NoDataSinkException { + public void doIt(MediaLocator inML, MediaLocator outML, Format[] fmts, int start, int end) throws NoProcessorException, IOException, NoDataSinkException { Processor processor = Manager.createProcessor(inML); processor.addControllerListener(controllerListener); @@ -147,23 +145,23 @@ private void setContentDescriptor(Processor processor, MediaLocator outML) { /** * Set the target transcode format on the processor. */ - private void setTrackFormats(Processor p, Format fmts[]) { + private void setTrackFormats(Processor p, Format[] fmts) { if (fmts.length == 0) { return; } - TrackControl tcs[] = p.getTrackControls(); + TrackControl[] tcs = p.getTrackControls(); if (tcs == null) { throw new IllegalStateException("The Processor cannot transcode the tracks to the given formats"); } - for (int i = 0; i < fmts.length; i++) { + for (Format fmt : fmts) { -Debug.println("- set track format to: " + fmts[i]); + Debug.println("- set track format to: " + fmt); - if (!setEachTrackFormat(p, tcs, fmts[i])) { - throw new IllegalStateException("Cannot transcode any track to: " + fmts[i]); + if (!setEachTrackFormat(p, tcs, fmt)) { + throw new IllegalStateException("Cannot transcode any track to: " + fmt); } } } @@ -202,7 +200,7 @@ String getMimeType(String name) { try { Class clazz = Class.forName("com.sun.media.MimeManager"); Method method = clazz.getMethod("getMimeType", String.class); - return String.class.cast(method.invoke(null, name)); + return (String) method.invoke(null, name); } catch (Exception e) { return null; } @@ -212,9 +210,9 @@ String getMimeType(String name) { * We'll loop through the tracks and try to find a track that can be * converted to the given format. */ - private boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) { + private boolean setEachTrackFormat(Processor p, TrackControl[] tcs, Format fmt) { - Format supported[]; + Format[] supported; Format f; // for (int i = 0; i < tcs.length; i++) { @@ -224,17 +222,17 @@ private boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) // } // } - for (int i = 0; i < tcs.length; i++) { + for (TrackControl tc : tcs) { - supported = tcs[i].getSupportedFormats(); + supported = tc.getSupportedFormats(); if (supported == null) { continue; } - for (int j = 0; j < supported.length; j++) { + for (Format format : supported) { - if (fmt.matches(supported[j]) && (f = fmt.intersects(supported[j])) != null && tcs[i].setFormat(f) != null) { + if (fmt.matches(format) && (f = fmt.intersects(format)) != null && tc.setFormat(f) != null) { // Success. return true; @@ -266,7 +264,7 @@ private DataSink createDataSink(Processor p, MediaLocator outML) throws IOExcept } /** */ - private Object waitSync = new Object(); + private final Object waitSync = new Object(); /** */ private boolean stateTransitionOK = true; @@ -281,7 +279,7 @@ private boolean waitForState(Processor p, int state) { while (p.getState() < state && stateTransitionOK) { waitSync.wait(); } - } catch (Exception e) { + } catch (Exception ignored) { } } return stateTransitionOK; @@ -290,34 +288,32 @@ private boolean waitForState(Processor p, int state) { /** * Controller Listener. */ - private ControllerListener controllerListener = new ControllerListener() { - public void controllerUpdate(ControllerEvent event) { - - if (event instanceof ConfigureCompleteEvent || - event instanceof RealizeCompleteEvent || - event instanceof PrefetchCompleteEvent) { - synchronized (waitSync) { - stateTransitionOK = true; - waitSync.notifyAll(); - } - } else if (event instanceof ResourceUnavailableEvent) { - synchronized (waitSync) { - stateTransitionOK = false; - waitSync.notifyAll(); - } - } else if (event instanceof EndOfMediaEvent) { - event.getSourceController().close(); - } else if (event instanceof MediaTimeSetEvent) { + private final ControllerListener controllerListener = event -> { + + if (event instanceof ConfigureCompleteEvent || + event instanceof RealizeCompleteEvent || + event instanceof PrefetchCompleteEvent) { + synchronized (waitSync) { + stateTransitionOK = true; + waitSync.notifyAll(); + } + } else if (event instanceof ResourceUnavailableEvent) { + synchronized (waitSync) { + stateTransitionOK = false; + waitSync.notifyAll(); + } + } else if (event instanceof EndOfMediaEvent) { + event.getSourceController().close(); + } else if (event instanceof MediaTimeSetEvent) { System.err.println("- mediaTime set: " + ((MediaTimeSetEvent) event).getMediaTime().getSeconds()); - } else if (event instanceof StopAtTimeEvent) { + } else if (event instanceof StopAtTimeEvent) { System.err.println("- stop at time: " + ((StopAtTimeEvent) event).getMediaTime().getSeconds()); - event.getSourceController().close(); - } + event.getSourceController().close(); } }; /** */ - private Object waitFileSync = new Object(); + private final Object waitFileSync = new Object(); /** */ private boolean fileDone = false; @@ -336,30 +332,28 @@ private boolean waitForFileDone() { waitFileSync.wait(1000); System.err.print("."); } - } catch (Exception e) { + } catch (Exception ignored) { } } -System.err.println(""); +System.err.println(); return fileSuccess; } /** * Event handler for the file writer. */ - private DataSinkListener dataSinkListener = new DataSinkListener() { - public void dataSinkUpdate(DataSinkEvent event) { + private final DataSinkListener dataSinkListener = event -> { - if (event instanceof EndOfStreamEvent) { - synchronized (waitFileSync) { - fileDone = true; - waitFileSync.notifyAll(); - } - } else if (event instanceof DataSinkErrorEvent) { - synchronized (waitFileSync) { - fileDone = true; - fileSuccess = false; - waitFileSync.notifyAll(); - } + if (event instanceof EndOfStreamEvent) { + synchronized (waitFileSync) { + fileDone = true; + waitFileSync.notifyAll(); + } + } else if (event instanceof DataSinkErrorEvent) { + synchronized (waitFileSync) { + fileDone = true; + fileSuccess = false; + waitFileSync.notifyAll(); } } }; @@ -427,7 +421,7 @@ public static void main(String[] args) throws Exception { System.exit(0); } - // Trancode with the specified parameters. + // Transcode with the specified parameters. Transcoder transcode = new Transcoder(); transcode.doIt(iml, oml, new Format[] { fmt }, 0, 0); diff --git a/src/samples/java/jmfsample/media/protocol/live/DataSource.java b/src/samples/java/jmfsample/media/protocol/live/DataSource.java index 83cd8f7..cc7dea2 100644 --- a/src/samples/java/jmfsample/media/protocol/live/DataSource.java +++ b/src/samples/java/jmfsample/media/protocol/live/DataSource.java @@ -39,7 +39,7 @@ public class DataSource extends PushBufferDataSource { - protected Object[] controls = new Object[0]; + protected final Object[] controls = new Object[0]; protected boolean started = false; @@ -56,6 +56,7 @@ public class DataSource extends PushBufferDataSource { public DataSource() { } + @Override public String getContentType() { if (!connected) { System.err.println("Error: DataSource not connected"); @@ -64,12 +65,14 @@ public String getContentType() { return contentType; } + @Override public void connect() throws IOException { if (connected) return; connected = true; } + @Override public void disconnect() { try { if (started) @@ -79,6 +82,7 @@ public void disconnect() { connected = false; } + @Override public void start() throws IOException { // we need to throw error if connect() has not been called if (!connected) @@ -89,6 +93,7 @@ public void start() throws IOException { stream.start(true); } + @Override public void stop() throws IOException { if ((!connected) || (!started)) return; @@ -96,17 +101,19 @@ public void stop() throws IOException { stream.start(false); } + @Override public Object[] getControls() { return controls; } + @Override public Object getControl(String controlType) { try { Class cls = Class.forName(controlType); - Object cs[] = getControls(); - for (int i = 0; i < cs.length; i++) { - if (cls.isInstance(cs[i])) - return cs[i]; + Object[] cs = getControls(); + for (Object c : cs) { + if (cls.isInstance(c)) + return c; } return null; @@ -115,10 +122,12 @@ public Object getControl(String controlType) { } } + @Override public Time getDuration() { return duration; } + @Override public PushBufferStream[] getStreams() { if (streams == null) { streams = new LiveStream[1]; @@ -126,5 +135,4 @@ public PushBufferStream[] getStreams() { } return streams; } - } diff --git a/src/samples/java/jmfsample/media/protocol/live/LiveStream.java b/src/samples/java/jmfsample/media/protocol/live/LiveStream.java index 4d434ed..8bd05e0 100644 --- a/src/samples/java/jmfsample/media/protocol/live/LiveStream.java +++ b/src/samples/java/jmfsample/media/protocol/live/LiveStream.java @@ -46,9 +46,9 @@ public class LiveStream implements PushBufferStream, Runnable { - protected ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW); + protected final ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW); - protected int maxDataLength; + protected final int maxDataLength; protected byte[] data; @@ -66,7 +66,7 @@ public class LiveStream implements PushBufferStream, Runnable { protected BufferTransferHandler transferHandler; - protected Control[] controls = new Control[0]; + protected final Control[] controls = new Control[0]; protected boolean videoData = true; @@ -102,30 +102,34 @@ public LiveStream() { thread = new Thread(this); } - /*************************************************************************** - * SourceStream - **************************************************************************/ + // + // SourceStream + // + @Override public ContentDescriptor getContentDescriptor() { return cd; } + @Override public long getContentLength() { return LENGTH_UNKNOWN; } + @Override public boolean endOfStream() { return false; } - /*************************************************************************** - * PushBufferStream - **************************************************************************/ + // + // PushBufferStream + // int seqNo = 0; double freq = 2.0; + @Override public Format getFormat() { if (videoData) return rgbFormat; @@ -133,6 +137,7 @@ public Format getFormat() { return audioFormat; } + @Override public void read(Buffer buffer) throws IOException { synchronized (this) { Object outdata = buffer.getData(); @@ -167,6 +172,7 @@ public void read(Buffer buffer) throws IOException { } } + @Override public void setTransferHandler(BufferTransferHandler transferHandler) { synchronized (this) { this.transferHandler = transferHandler; @@ -185,10 +191,11 @@ void start(boolean started) { } } - /*************************************************************************** - * Runnable - **************************************************************************/ + // + // Runnable + // + @Override public void run() { while (started) { synchronized (this) { @@ -197,7 +204,7 @@ public void run() { wait(1000); } catch (InterruptedException ie) { } - } // while + } } if (started && transferHandler != null) { @@ -207,22 +214,26 @@ public void run() { } catch (InterruptedException ise) { } } - } // while (started) - } // run + } + } + // // Controls + // + @Override public Object[] getControls() { return controls; } + @Override public Object getControl(String controlType) { try { Class cls = Class.forName(controlType); - Object cs[] = getControls(); - for (int i = 0; i < cs.length; i++) { - if (cls.isInstance(cs[i])) - return cs[i]; + Object[] cs = getControls(); + for (Object c : cs) { + if (cls.isInstance(c)) + return c; } return null; diff --git a/src/samples/java/jse/AudioChannel.java b/src/samples/java/jse/AudioChannel.java index 2b84783..81f4cbe 100644 --- a/src/samples/java/jse/AudioChannel.java +++ b/src/samples/java/jse/AudioChannel.java @@ -21,6 +21,8 @@ package jse; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; import java.util.List; import javax.sound.sampled.AudioFormat; @@ -28,6 +30,8 @@ import javax.sound.sampled.AudioSystem; import javax.sound.sampled.SourceDataLine; +import static java.lang.System.getLogger; + /** * AudioChannel. @@ -36,11 +40,13 @@ * IDEA: can this class be derived from AudioStream?? */ public class AudioChannel extends Thread { - private static final boolean DEBUG = true; + + private static final Logger logger = getLogger(AudioChannel.class.getName()); + private static final int BUFFER_SIZE = 16384; - private List m_audioStreamQueue; - private SourceDataLine m_line; - private byte[] m_dataArray; + private final List m_audioStreamQueue; + private final SourceDataLine m_line; + private final byte[] m_dataArray; /** * Uses the passed Mixer. @@ -73,13 +79,9 @@ public AudioFormat getFormat() { } public boolean addAudioInputStream(AudioInputStream audioStream) { - if (DEBUG) { - System.out.println("AudioChannel.addAudioInputStream(): called."); - } + logger.log(Level.TRACE, "AudioChannel.addAudioInputStream(): called."); if (!getFormat().matches(audioStream.getFormat())) { - if (DEBUG) { - System.out.println("AudioChannel.addAudioInputStream(): audio formats do not match, trying to convert."); - } + logger.log(Level.DEBUG, "AudioChannel.addAudioInputStream(): audio formats do not match, trying to convert."); AudioInputStream asold = audioStream; audioStream = AudioSystem.getAudioInputStream(getFormat(), asold); @@ -87,42 +89,33 @@ public boolean addAudioInputStream(AudioInputStream audioStream) { System.out.println("### AudioChannel.addAudioInputStream(): could not convert."); return false; } - if (DEBUG) { - System.out.println(" converted"); - } + logger.log(Level.DEBUG, " converted"); } synchronized (m_audioStreamQueue) { m_audioStreamQueue.add(audioStream); m_audioStreamQueue.notifyAll(); } - if (DEBUG) { - System.out.println("AudioChannel.addAudioInputStream(): enqueued " + - audioStream); - } + logger.log(Level.DEBUG, "AudioChannel.addAudioInputStream(): enqueued " + audioStream); return true; } // TODO: termination of loop + @Override public void run() { - if (DEBUG) { - System.out.println("AudioChannel.run(): starting"); - } + logger.log(Level.TRACE, "AudioChannel.run(): starting"); while (true) { AudioInputStream audioStream = null; synchronized (m_audioStreamQueue) { - while (m_audioStreamQueue.size() == 0) { + while (m_audioStreamQueue.isEmpty()) { try { m_audioStreamQueue.wait(); } catch (InterruptedException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } - audioStream = m_audioStreamQueue.remove(0); - } - if (DEBUG) { - System.out.println("AudioChannel.run(): playing " + - audioStream); + audioStream = m_audioStreamQueue.removeFirst(); } + logger.log(Level.DEBUG, "AudioChannel.run(): playing " + audioStream); int nBytesRead; while (true) { @@ -137,7 +130,7 @@ public void run() { // Contract.check(nBytesWritten == nBytesRead); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); break; } } diff --git a/src/samples/java/jse/AudioChannelPlayer.java b/src/samples/java/jse/AudioChannelPlayer.java index fafedd4..93618b3 100644 --- a/src/samples/java/jse/AudioChannelPlayer.java +++ b/src/samples/java/jse/AudioChannelPlayer.java @@ -20,6 +20,8 @@ package jse; import java.io.File; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; @@ -27,6 +29,8 @@ import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; +import static java.lang.System.getLogger; + /* OLD DOCUMENTATION: @@ -58,41 +62,42 @@ Plays several soundfiles in sequence -DocBookXML */ -/* - * AudioChannelPlayer.java + +/** + * AudioChannelPlayer.java * - * This file is part of the Java Sound Examples. + * This file is part of the Java Sound Examples. */ public class AudioChannelPlayer { - private static final boolean DEBUG = true; + + private static final Logger logger = getLogger(AudioChannelPlayer.class.getName()); + private static final int BUFFER_SIZE = 16384; public static void main(String[] args) { // TODO: set AudioFormat after the first soundfile AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - 44100.0F, 16, 2, 4, 44100.0F, - true); + 44100.0F, 16, 2, 4, 44100.0F, true); SourceDataLine line = null; try { - DataLine.Info info = new DataLine.Info(SourceDataLine.class, - audioFormat); + DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat); line = (SourceDataLine) AudioSystem.getLine(info); line.open(audioFormat, line.getBufferSize()); } catch (LineUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } line.start(); AudioChannel channel = new AudioChannel(line); channel.start(); - for (int nArgPos = 0; nArgPos < args.length; nArgPos++) { - if (args[nArgPos].startsWith("-s")) { - String strDuration = args[nArgPos].substring(2); + for (String arg : args) { + if (arg.startsWith("-s")) { + String strDuration = arg.substring(2); int nDuration = Integer.parseInt(strDuration); handleSilence(nDuration, channel); } else { - handleFile(args[nArgPos], channel); + handleFile(arg, channel); } } @@ -109,12 +114,10 @@ private static void handleFile(String strFilename, AudioChannel channel) { try { audioInputStream = AudioSystem.getAudioInputStream(audioFile); } catch (Exception e) { - /* - * In case of an exception, we dump the exception - * including the stack trace to the console output. - * Then, we exit the program. - */ - e.printStackTrace(); + // In case of an exception, we dump the exception + // including the stack trace to the console output. + // Then, we exit the program. + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } if (audioInputStream != null) { diff --git a/src/samples/java/jse/AudioConcat.java b/src/samples/java/jse/AudioConcat.java index 4f9c882..3980e48 100644 --- a/src/samples/java/jse/AudioConcat.java +++ b/src/samples/java/jse/AudioConcat.java @@ -25,6 +25,8 @@ import gnu.getopt.Getopt; import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; import java.util.List; import javax.sound.sampled.AudioFileFormat; @@ -32,6 +34,8 @@ import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + // TODO: the name AudioConcat is no longer appropriate. There should be a name that is neutral to concat/mix. @@ -107,17 +111,13 @@ the name(s) of input file(s) -DocBookXML */ public class AudioConcat { + + private static final Logger logger = getLogger(AudioConcat.class.getName()); + private static final int MODE_NONE = 0; private static final int MODE_MIXING = 1; private static final int MODE_CONCATENATION = 2; - /** - * Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = false; - public static void main(String[] args) { // Mode of operation. // Determines what to do with the input files: @@ -139,10 +139,7 @@ public static void main(String[] args) { printUsageAndExit(); case 'o': strOutputFilename = g.getOptarg(); - if (DEBUG) { - System.out.println("AudioConcat.main(): output filename: " + - strOutputFilename); - } + logger.log(Level.DEBUG, "AudioConcat.main(): output filename: " + strOutputFilename); break; case 'c': nMode = MODE_CONCATENATION; @@ -150,14 +147,10 @@ public static void main(String[] args) { case 'm': nMode = MODE_MIXING; break; - case 'D': - DEBUG = true; - break; case '?': printUsageAndExit(); default: - System.out.println("AudioConcat.main(): getopt() returned " + - c); + System.out.println("AudioConcat.main(): getopt() returned " + c); break; } } @@ -178,7 +171,7 @@ public static void main(String[] args) { // In case of an exception, we dump the exception // including the stack trace to the console output. // Then, we exit the program. - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -189,17 +182,12 @@ public static void main(String[] args) { // this format. if (audioFormat == null) { audioFormat = format; - if (DEBUG) { - System.out.println("AudioConcat.main(): format: " + - audioFormat); - } + logger.log(Level.DEBUG, "AudioConcat.main(): format: " + audioFormat); } else if (!audioFormat.matches(format)) { // TODO try to convert System.out.println("AudioConcat.main(): WARNING: AudioFormats don't match"); - System.out.println("AudioConcat.main(): master format: " + - audioFormat); - System.out.println("AudioConcat.main(): this format: " + - format); + System.out.println("AudioConcat.main(): master format: " + audioFormat); + System.out.println("AudioConcat.main(): this format: " + format); } audioInputStreamList.add(audioInputStream); } @@ -212,12 +200,10 @@ public static void main(String[] args) { AudioInputStream audioInputStream = null; switch (nMode) { case MODE_CONCATENATION: - audioInputStream = new SequenceAudioInputStream(audioFormat, - audioInputStreamList); + audioInputStream = new SequenceAudioInputStream(audioFormat, audioInputStreamList); break; case MODE_MIXING: - audioInputStream = new MixingAudioInputStream(audioFormat, - audioInputStreamList); + audioInputStream = new MixingAudioInputStream(audioFormat, audioInputStreamList); break; default: System.out.println("you have to specify a mode (either -m or -c)."); @@ -231,15 +217,12 @@ public static void main(String[] args) { File outputFile = new File(strOutputFilename); try { - AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, - outputFile); + AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, outputFile); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } - if (DEBUG) { - System.out.println("AudioConcat.main(): before exit"); - } + logger.log(Level.DEBUG, "AudioConcat.main(): before exit"); System.exit(0); } diff --git a/src/samples/java/jse/AudioDecoder.java b/src/samples/java/jse/AudioDecoder.java index 803513c..35a1d36 100644 --- a/src/samples/java/jse/AudioDecoder.java +++ b/src/samples/java/jse/AudioDecoder.java @@ -1,9 +1,3 @@ -package jse; -/* - * AudioDecoder.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,13 +17,20 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -import java.io.IOException; + +package jse; + import java.io.File; +import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + /* +DocBookXML Decoding an encoded audio file @@ -89,7 +90,16 @@ -DocBookXML */ + +/** + * AudioDecoder.java + *

    + * This file is part of the Java Sound Examples. + */ public class AudioDecoder { + + private static final Logger logger = getLogger(AudioDecoder.class.getName()); + public static void main(String[] args) { if (args.length != 2) { printUsageAndExit(); @@ -101,7 +111,7 @@ public static void main(String[] args) { try { ais = AudioSystem.getAudioInputStream(encodedFile); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (ais == null) { System.out.println("cannot open audio file"); @@ -109,14 +119,13 @@ public static void main(String[] args) { } AudioFormat.Encoding targetEncoding = AudioFormat.Encoding.PCM_SIGNED; - AudioInputStream pcmAIS = AudioSystem.getAudioInputStream(targetEncoding, - ais); + AudioInputStream pcmAIS = AudioSystem.getAudioInputStream(targetEncoding, ais); AudioFileFormat.Type fileType = AudioFileFormat.Type.AU; int nWrittenFrames = 0; try { nWrittenFrames = AudioSystem.write(pcmAIS, fileType, pcmFile); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } diff --git a/src/samples/java/jse/AudioFileInfo.java b/src/samples/java/jse/AudioFileInfo.java index 31c80f5..6f23e4a 100644 --- a/src/samples/java/jse/AudioFileInfo.java +++ b/src/samples/java/jse/AudioFileInfo.java @@ -1,9 +1,3 @@ -package jse; -/* - * AudioFileInfo.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,14 +17,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.InputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.URL; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + /* +DocBookXML Getting information about an audio file @@ -100,7 +101,16 @@ -DocBookXML */ + +/** + * AudioFileInfo.java + *

    + * This file is part of the Java Sound Examples. + */ public class AudioFileInfo { + + private static final Logger logger = getLogger(AudioFileInfo.class.getName()); + private static final int LOAD_METHOD_STREAM = 1; private static final int LOAD_METHOD_FILE = 2; private static final int LOAD_METHOD_URL = 3; @@ -114,16 +124,12 @@ public static void main(String[] args) { boolean bCheckAudioInputStream = false; int nCurrentArg = 0; while (nCurrentArg < args.length) { - if (args[nCurrentArg].equals("-h")) { - printUsageAndExit(); - } else if (args[nCurrentArg].equals("-s")) { - nLoadMethod = LOAD_METHOD_STREAM; - } else if (args[nCurrentArg].equals("-f")) { - nLoadMethod = LOAD_METHOD_FILE; - } else if (args[nCurrentArg].equals("-u")) { - nLoadMethod = LOAD_METHOD_URL; - } else if (args[nCurrentArg].equals("-i")) { - bCheckAudioInputStream = true; + switch (args[nCurrentArg]) { + case "-h" -> printUsageAndExit(); + case "-s" -> nLoadMethod = LOAD_METHOD_STREAM; + case "-f" -> nLoadMethod = LOAD_METHOD_FILE; + case "-u" -> nLoadMethod = LOAD_METHOD_URL; + case "-i" -> bCheckAudioInputStream = true; } nCurrentArg++; @@ -135,36 +141,36 @@ public static void main(String[] args) { AudioInputStream ais = null; try { switch (nLoadMethod) { - case LOAD_METHOD_STREAM: - - InputStream inputStream = System.in; - aff = AudioSystem.getAudioFileFormat(inputStream); - strFilename = ""; - if (bCheckAudioInputStream) { - ais = AudioSystem.getAudioInputStream(inputStream); - } - break; - case LOAD_METHOD_FILE: - - File file = new File(strSource); - aff = AudioSystem.getAudioFileFormat(file); - strFilename = file.getCanonicalPath(); - if (bCheckAudioInputStream) { - ais = AudioSystem.getAudioInputStream(file); - } - break; - case LOAD_METHOD_URL: - - URL url = new URL(strSource); - aff = AudioSystem.getAudioFileFormat(url); - strFilename = url.toString(); - if (bCheckAudioInputStream) { - ais = AudioSystem.getAudioInputStream(url); - } - break; + case LOAD_METHOD_STREAM: + + InputStream inputStream = System.in; + aff = AudioSystem.getAudioFileFormat(inputStream); + strFilename = ""; + if (bCheckAudioInputStream) { + ais = AudioSystem.getAudioInputStream(inputStream); + } + break; + case LOAD_METHOD_FILE: + + File file = new File(strSource); + aff = AudioSystem.getAudioFileFormat(file); + strFilename = file.getCanonicalPath(); + if (bCheckAudioInputStream) { + ais = AudioSystem.getAudioInputStream(file); + } + break; + case LOAD_METHOD_URL: + + URL url = new URL(strSource); + aff = AudioSystem.getAudioFileFormat(url); + strFilename = url.toString(); + if (bCheckAudioInputStream) { + ais = AudioSystem.getAudioInputStream(url); + } + break; } } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } if (aff == null) { @@ -179,9 +185,8 @@ public static void main(String[] args) { String strAudioLength = null; if (aff.getFrameLength() != AudioSystem.NOT_SPECIFIED) { - strAudioLength = "" + aff.getFrameLength() + " frames (= " + - (aff.getFrameLength() * format.getFrameSize()) + - " bytes)"; + strAudioLength = aff.getFrameLength() + " frames (= " + + (aff.getFrameLength() * format.getFrameSize()) + " bytes)"; } else { strAudioLength = "unknown"; } @@ -189,18 +194,15 @@ public static void main(String[] args) { String strFileLength = null; if (aff.getByteLength() != AudioSystem.NOT_SPECIFIED) { - strFileLength = "" + aff.getByteLength() + " bytes)"; + strFileLength = aff.getByteLength() + " bytes)"; } else { strFileLength = "unknown"; } - System.out.println("Total length of file (including headers): " + - strFileLength); + System.out.println("Total length of file (including headers): " + strFileLength); if (bCheckAudioInputStream) { System.out.println("[AudioInputStream says:] Length of audio data: " + - ais.getFrameLength() + " frames (= " + - (ais.getFrameLength() * ais.getFormat() - .getFrameSize()) + - " bytes)"); + ais.getFrameLength() + " frames (= " + + (ais.getFrameLength() * ais.getFormat() .getFrameSize()) + " bytes)"); } System.out.println("---------------------------------------------------------------------------"); } diff --git a/src/samples/java/jse/AudioFileTypeConverter.java b/src/samples/java/jse/AudioFileTypeConverter.java index cec8d40..c60ac24 100644 --- a/src/samples/java/jse/AudioFileTypeConverter.java +++ b/src/samples/java/jse/AudioFileTypeConverter.java @@ -22,10 +22,14 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + /* * AudioFileTypeConverter.java @@ -33,11 +37,8 @@ * This file is part of the Java Sound Examples. */ public class AudioFileTypeConverter { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static final boolean DEBUG = false; + + private static final Logger logger = getLogger(AudioFileTypeConverter.class.getName()); public static void main(String[] args) { if (args.length == 1) { @@ -67,7 +68,7 @@ public static void main(String[] args) { try { ais = AudioSystem.getAudioInputStream(file); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (ais == null) { System.out.println("cannot open audio file"); @@ -83,20 +84,16 @@ public static void main(String[] args) { strTargetFilename = strFilename.substring(0, nDotPos) + targetFileType.getExtension(); } - if (DEBUG) { - System.out.println("Target filename: " + strTargetFilename); - } + logger.log(Level.DEBUG, "Target filename: " + strTargetFilename); int nWrittenBytes = 0; try { nWrittenBytes = AudioSystem.write(ais, targetFileType, new File(strTargetFilename)); } catch (IOException e) { - e.printStackTrace(); - } - if (DEBUG) { - System.out.println("Written bytes: " + nWrittenBytes); + logger.log(Level.ERROR, e.getMessage(), e); } + logger.log(Level.DEBUG, "Written bytes: " + nWrittenBytes); } else // args.length != 3 { printUsageAndExit(); @@ -113,17 +110,17 @@ private static void printUsageAndExit() { private static void listPossibleTargetTypes() { AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes(); System.out.print("Supported target types:"); - for (int i = 0; i < aTypes.length; i++) { - System.out.print(" " + aTypes[i].getExtension()); + for (AudioFileFormat.Type aType : aTypes) { + System.out.print(" " + aType.getExtension()); } System.out.print("\n"); } private static AudioFileFormat.Type findTargetType(String strExtension) { AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes(); - for (int i = 0; i < aTypes.length; i++) { - if (aTypes[i].getExtension().equals(strExtension)) { - return aTypes[i]; + for (AudioFileFormat.Type aType : aTypes) { + if (aType.getExtension().equals(strExtension)) { + return aType; } } return null; diff --git a/src/samples/java/jse/AudioLoop.java b/src/samples/java/jse/AudioLoop.java index c0eaf8b..f58b4fa 100644 --- a/src/samples/java/jse/AudioLoop.java +++ b/src/samples/java/jse/AudioLoop.java @@ -1,9 +1,3 @@ -package jse; -/* - * AudioLoop.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -23,7 +17,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -import gnu.getopt.Getopt; + +package jse; + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; @@ -32,6 +30,10 @@ import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.TargetDataLine; +import gnu.getopt.Getopt; + +import static java.lang.System.getLogger; + // TODO: params for audio quality, optionally use compression and decompression in the loop (see ~/AudioLoop.java) @@ -113,39 +115,38 @@ the buffer size to use in Java Sound ("intern") + * This file is part of the Java Sound Examples. + */ public class AudioLoop extends Thread { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = true; + + private static final Logger logger = getLogger(AudioLoop.class.getName()); + private static final int DEFAULT_INTERNAL_BUFSIZ = 40960; private static final int DEFAULT_EXTERNAL_BUFSIZ = 40960; - private TargetDataLine m_targetLine; - private SourceDataLine m_sourceLine; + private final TargetDataLine m_targetLine; + private final SourceDataLine m_sourceLine; private boolean m_bRecording; - private int m_nExternalBufferSize; + private final int m_nExternalBufferSize; - /* - * We have to pass an AudioFormat to describe in which - * format the audio data should be recorded and played. + /** + * We have to pass an AudioFormat to describe in which + * format the audio data should be recorded and played. */ - public AudioLoop(AudioFormat format, int nInternalBufferSize, - int nExternalBufferSize, String strMixerName) - throws LineUnavailableException { + public AudioLoop(AudioFormat format, int nInternalBufferSize, int nExternalBufferSize, String strMixerName) + throws LineUnavailableException { Mixer mixer = null; if (strMixerName != null) { Mixer.Info mixerInfo = getMixerInfo(strMixerName); mixer = AudioSystem.getMixer(mixerInfo); } - /* - * We retrieve and open the recording and the playback line. - */ - DataLine.Info targetInfo = new DataLine.Info(TargetDataLine.class, - format, nInternalBufferSize); - DataLine.Info sourceInfo = new DataLine.Info(SourceDataLine.class, - format, nInternalBufferSize); + // We retrieve and open the recording and the playback line. + DataLine.Info targetInfo = new DataLine.Info(TargetDataLine.class, format, nInternalBufferSize); + DataLine.Info sourceInfo = new DataLine.Info(SourceDataLine.class, format, nInternalBufferSize); if (mixer != null) { m_targetLine = (TargetDataLine) mixer.getLine(targetInfo); m_sourceLine = (SourceDataLine) mixer.getLine(sourceInfo); @@ -158,6 +159,7 @@ public AudioLoop(AudioFormat format, int nInternalBufferSize, m_nExternalBufferSize = nExternalBufferSize; } + @Override public void start() { m_targetLine.start(); m_sourceLine.start(); @@ -166,35 +168,25 @@ public void start() { super.start(); } -/* - public void stopRecording() - { - m_line.stop(); - m_line.close(); - m_bRecording = false; - } -*/ +// public void stopRecording() { +// m_line.stop(); +// m_line.close(); +// m_bRecording = false; +// } + + @Override public void run() { byte[] abBuffer = new byte[m_nExternalBufferSize]; int nBufferSize = abBuffer.length; m_bRecording = true; while (m_bRecording) { - if (DEBUG) { - System.out.println("Trying to read: " + nBufferSize); - } + logger.log(Level.DEBUG, "Trying to read: " + nBufferSize); - /* - * read a block of data from the recording line. - */ + // read a block of data from the recording line. int nBytesRead = m_targetLine.read(abBuffer, 0, nBufferSize); - if (DEBUG) { - System.out.println("Read: " + nBytesRead); - } + logger.log(Level.DEBUG, "Read: " + nBytesRead); - /* - * And now, we write the block to the playback - * line. - */ + // And now, we write the block to the playback line. m_sourceLine.write(abBuffer, 0, nBytesRead); } } @@ -209,67 +201,44 @@ public static void main(String[] args) { int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 'l': - listMixersAndExit(); - case 'r': - fFrameRate = Float.parseFloat(g.getOptarg()); + case 'h': + printUsageAndExit(); + case 'l': + listMixersAndExit(); + case 'r': + fFrameRate = Float.parseFloat(g.getOptarg()); -/* - if (DEBUG) - { - System.out.println("AudioPlayer.main(): mixer name: " + strMixerName); - } -*/ - break; - case 'i': - nInternalBufferSize = Integer.parseInt(g.getOptarg()); +// logger.log(Level.TRACE, "AudioPlayer.main(): mixer name: " + strMixerName); + break; + case 'i': + nInternalBufferSize = Integer.parseInt(g.getOptarg()); -/* - if (DEBUG) - { - System.out.println("AudioPlayer.main(): mixer name: " + strMixerName); - } -*/ - break; - case 'e': - nExternalBufferSize = Integer.parseInt(g.getOptarg()); +// logger.log(Level.TRACE, "AudioPlayer.main(): mixer name: " + strMixerName); + break; + case 'e': + nExternalBufferSize = Integer.parseInt(g.getOptarg()); -/* - if (DEBUG) - { - System.out.println("AudioPlayer.main(): mixer name: " + strMixerName); - } -*/ - break; - case 'M': - strMixerName = g.getOptarg(); - if (DEBUG) { - System.out.println("AudioPlayer.main(): mixer name: " + - strMixerName); - } - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - System.out.println("getopt() returned " + c); - break; +// logger.log(Level.TRACE, "AudioPlayer.main(): mixer name: " + strMixerName); + break; + case 'M': + strMixerName = g.getOptarg(); + logger.log(Level.DEBUG, "AudioPlayer.main(): mixer name: " + strMixerName); + break; + case '?': + printUsageAndExit(); + default: + System.out.println("getopt() returned " + c); + break; } } AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - fFrameRate, 16, 2, 4, - fFrameRate, false); + fFrameRate, 16, 2, 4, fFrameRate, false); AudioLoop audioLoop = null; try { - audioLoop = new AudioLoop(audioFormat, nInternalBufferSize, - nExternalBufferSize, strMixerName); + audioLoop = new AudioLoop(audioFormat, nInternalBufferSize, nExternalBufferSize, strMixerName); } catch (LineUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } audioLoop.start(); @@ -286,8 +255,8 @@ private static void listMixersAndExit() { System.out.println("Available Mixers:"); Mixer.Info[] aInfos = AudioSystem.getMixerInfo(); - for (int i = 0; i < aInfos.length; i++) { - System.out.println(aInfos[i].getName()); + for (Mixer.Info aInfo : aInfos) { + System.out.println(aInfo.getName()); } if (aInfos.length == 0) { System.out.println("[No mixers available]"); @@ -295,16 +264,16 @@ private static void listMixersAndExit() { System.exit(0); } - /* - * This method tries to return a MidiDevice.Info whose name - * matches the passed name. If no matching MidiDevice.Info is - * found, null is returned. + /** + * This method tries to return a MidiDevice.Info whose name + * matches the passed name. If no matching MidiDevice.Info is + * found, null is returned. */ private static Mixer.Info getMixerInfo(String strMixerName) { Mixer.Info[] aInfos = AudioSystem.getMixerInfo(); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strMixerName)) { - return aInfos[i]; + for (Mixer.Info aInfo : aInfos) { + if (aInfo.getName().equals(strMixerName)) { + return aInfo; } } return null; diff --git a/src/samples/java/jse/AudioPlayer.java b/src/samples/java/jse/AudioPlayer.java index 8165caf..2cd8873 100644 --- a/src/samples/java/jse/AudioPlayer.java +++ b/src/samples/java/jse/AudioPlayer.java @@ -1,9 +1,4 @@ package jse; -/* - * AudioPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -21,21 +16,22 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; -/* If the compilation fails because this class is not available, - get gnu.getopt from the URL given in the comment below. -*/ import gnu.getopt.Getopt; +import static java.lang.System.getLogger; + /* +DocBookXML Playing an audio file (advanced) @@ -112,58 +108,52 @@ the buffer size to use in Java Sound ("intern") + * This file is part of the Java Sound Examples. + */ public class AudioPlayer { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = false; - private static int DEFAULT_EXTERNAL_BUFFER_SIZE = 128000; + + private static final Logger logger = getLogger(AudioPlayer.class.getName()); + + private static final int DEFAULT_EXTERNAL_BUFFER_SIZE = 128000; public static void main(String[] args) { String strMixerName = null; int nExternalBufferSize = DEFAULT_EXTERNAL_BUFFER_SIZE; int nInternalBufferSize = AudioSystem.NOT_SPECIFIED; - /* - * Parsing of command-line options takes place... - */ + // Parsing of command-line options takes place... Getopt g = new Getopt("AudioPlayer", args, "hlM:e:i:D"); int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 'l': - listMixersAndExit(); - case 'M': - strMixerName = g.getOptarg(); - if (DEBUG) { - System.out.println("AudioPlayer.main(): mixer name: " + - strMixerName); - } - break; - case 'e': - nExternalBufferSize = Integer.parseInt(g.getOptarg()); - break; - case 'i': - nInternalBufferSize = Integer.parseInt(g.getOptarg()); - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - System.out.println("getopt() returned " + c); - break; + case 'h': + printUsageAndExit(); + case 'l': + listMixersAndExit(); + case 'M': + strMixerName = g.getOptarg(); + logger.log(Level.DEBUG, "AudioPlayer.main(): mixer name: " + strMixerName); + break; + case 'e': + nExternalBufferSize = Integer.parseInt(g.getOptarg()); + break; + case 'i': + nInternalBufferSize = Integer.parseInt(g.getOptarg()); + break; + case '?': + printUsageAndExit(); + default: + System.out.println("getopt() returned " + c); + break; } } - /* - * We make shure that there is only one more argument, which - * we take as the filename of the soundfile we want to play. - */ + // We make shure that there is only one more argument, which + // we take as the filename of the soundfile we want to play. String strFilename = null; for (int i = g.getOptind(); i < args.length; i++) { if (strFilename == null) { @@ -178,143 +168,102 @@ public static void main(String[] args) { File soundFile = new File(strFilename); - /* - * We have to read in the sound file. - */ + // We have to read in the sound file. AudioInputStream audioInputStream = null; try { audioInputStream = AudioSystem.getAudioInputStream(soundFile); } catch (Exception e) { - /* - * In case of an exception, we dump the exception - * including the stack trace to the console output. - * Then, we exit the program. - */ - e.printStackTrace(); + // In case of an exception, we dump the exception + // including the stack trace to the console output. + // Then, we exit the program. + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * From the AudioInputStream, i.e. from the sound file, - * we fetch information about the format of the - * audio data. - * These information include the sampling frequency, - * the number of - * channels and the size of the samples. - * These information - * are needed to ask Java Sound for a suitable output line - * for this audio file. - */ + // From the AudioInputStream, i.e. from the sound file, + // we fetch information about the format of the + // audio data. + // These information include the sampling frequency, + // the number of + // channels and the size of the samples. + // These information + // are needed to ask Java Sound for a suitable output line + // for this audio file. AudioFormat audioFormat = audioInputStream.getFormat(); - if (DEBUG) { - System.out.println("AudioPlayer.main(): format: " + audioFormat); - } + logger.log(Level.DEBUG, "AudioPlayer.main(): format: " + audioFormat); - SourceDataLine line = getSourceDataLine(strMixerName, audioFormat, - nInternalBufferSize); + SourceDataLine line = getSourceDataLine(strMixerName, audioFormat, nInternalBufferSize); // second chance for compression formats. if (line == null) { AudioFormat sourceFormat = audioFormat; AudioFormat targetFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - sourceFormat.getSampleRate(), - 16, - sourceFormat.getChannels(), - sourceFormat.getChannels() * 2, - sourceFormat.getSampleRate(), - false); - if (DEBUG) { - System.out.println("AudioPlayer.(): source format: " + - sourceFormat); - System.out.println("AudioPlayer.(): target format: " + - targetFormat); - } - audioInputStream = AudioSystem.getAudioInputStream(targetFormat, - audioInputStream); + sourceFormat.getSampleRate(), + 16, + sourceFormat.getChannels(), + sourceFormat.getChannels() * 2, + sourceFormat.getSampleRate(), + false); + logger.log(Level.DEBUG, "AudioPlayer.(): source format: " + sourceFormat); + logger.log(Level.DEBUG, "AudioPlayer.(): target format: " + targetFormat); + audioInputStream = AudioSystem.getAudioInputStream(targetFormat, audioInputStream); audioFormat = audioInputStream.getFormat(); - if (DEBUG) { - System.out.println("AudioPlayer.(): received target format: " + - audioFormat); - } - line = getSourceDataLine(strMixerName, audioFormat, - nInternalBufferSize); + logger.log(Level.DEBUG, "AudioPlayer.(): received target format: " + audioFormat); + line = getSourceDataLine(strMixerName, audioFormat, nInternalBufferSize); } if (line == null) { - System.out.println("AudioPlayer: cannot get SourceDataLine for format " + - audioFormat); + System.out.println("AudioPlayer: cannot get SourceDataLine for format " + audioFormat); System.exit(1); } - /* - * Still not enough. The line now can receive data, - * but will not pass them on to the audio output device - * (which means to your sound card). This has to be - * activated. - */ + // Still not enough. The line now can receive data, + // but will not pass them on to the audio output device + // (which means to your sound card). This has to be + // activated. line.start(); - /* - * Ok, finally the line is prepared. Now comes the real - * job: we have to write data to the line. We do this - * in a loop. First, we read data from the - * AudioInputStream to a buffer. Then, we write from - * this buffer to the Line. This is done until the end - * of the file is reached, which is detected by a - * return value of -1 from the read method of the - * AudioInputStream. - */ + // Ok, finally the line is prepared. Now comes the real + // job: we have to write data to the line. We do this + // in a loop. First, we read data from the + // AudioInputStream to a buffer. Then, we write from + // this buffer to the Line. This is done until the end + // of the file is reached, which is detected by a + // return value of -1 from the read method of the + // AudioInputStream. int nBytesRead = 0; byte[] abData = new byte[nExternalBufferSize]; while (nBytesRead != -1) { try { nBytesRead = audioInputStream.read(abData, 0, abData.length); } catch (IOException e) { - e.printStackTrace(); - } - if (DEBUG) { - System.out.println("AudioPlayer.main(): read from AudioInputStream (bytes): " + - nBytesRead); + logger.log(Level.ERROR, e.getMessage(), e); } + logger.log(Level.DEBUG, "AudioPlayer.main(): read from AudioInputStream (bytes): " + nBytesRead); if (nBytesRead >= 0) { int nBytesWritten = line.write(abData, 0, nBytesRead); - if (DEBUG) { - System.out.println("AudioPlayer.main(): written to SourceDataLine (bytes): " + - nBytesWritten); - } + logger.log(Level.DEBUG, "AudioPlayer.main(): written to SourceDataLine (bytes): " + nBytesWritten); } } - /* - * Wait until all data is played. - * This is only necessary because of the bug noted below. - * (If we do not wait, we would interrupt the playback by - * prematurely closing the line and exiting the VM.) - * - * Thanks to Margie Fitch for bringing me on the right - * path to this solution. - */ - if (DEBUG) { - System.out.println("AudioPlayer.main(): before drain"); - } + // Wait until all data is played. + // This is only necessary because of the bug noted below. + // (If we do not wait, we would interrupt the playback by + // prematurely closing the line and exiting the VM.) + // + // Thanks to Margie Fitch for bringing me on the right + // path to this solution. + logger.log(Level.DEBUG, "AudioPlayer.main(): before drain"); line.drain(); - /* - * All data are played. We can close the shop. - */ - if (DEBUG) { - System.out.println("AudioPlayer.main(): before close"); - } + // All data are played. We can close the shop. + logger.log(Level.DEBUG, "AudioPlayer.main(): before close"); line.close(); - /* - * There is a bug in the Sun jdk1.3. - * It prevents correct termination of the VM. - * So we have to exit ourselves. - */ - if (DEBUG) { - System.out.println("AudioPlayer.main(): before exit"); - } + // There is a bug in the Sun jdk1.3. + // It prevents correct termination of the VM. + // So we have to exit ourselves. + logger.log(Level.DEBUG, "AudioPlayer.main(): before exit"); System.exit(0); } @@ -329,8 +278,8 @@ private static void listMixersAndExit() { System.out.println("Available Mixers:"); Mixer.Info[] aInfos = AudioSystem.getMixerInfo(); - for (int i = 0; i < aInfos.length; i++) { - System.out.println(aInfos[i].getName()); + for (Mixer.Info aInfo : aInfos) { + System.out.println(aInfo.getName()); } if (aInfos.length == 0) { System.out.println("[No mixers available]"); @@ -338,52 +287,46 @@ private static void listMixersAndExit() { System.exit(0); } - /* - * This method tries to return a Mixer.Info whose name - * matches the passed name. If no matching Mixer.Info is - * found, null is returned. + /** + * This method tries to return a Mixer.Info whose name + * matches the passed name. If no matching Mixer.Info is + * found, null is returned. */ private static Mixer.Info getMixerInfo(String strMixerName) { Mixer.Info[] aInfos = AudioSystem.getMixerInfo(); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strMixerName)) { - return aInfos[i]; + for (Mixer.Info aInfo : aInfos) { + if (aInfo.getName().equals(strMixerName)) { + return aInfo; } } return null; } - private static SourceDataLine getSourceDataLine(String strMixerName, - AudioFormat audioFormat, - int nBufferSize) { - /* - * Asking for a line is a rather tricky thing. - * We have to construct an Info object that specifies - * the desired properties for the line. - * First, we have to say which kind of line we want. The - * possibilities are: SourceDataLine (for playback), Clip - * (for repeated playback) and TargetDataLine (for - * recording). - * Here, we want to do normal playback, so we ask for - * a SourceDataLine. - * Then, we have to pass an AudioFormat object, so that - * the Line knows which format the data passed to it - * will have. - * Furthermore, we can give Java Sound a hint about how - * big the internal buffer for the line should be. This - * isn't used here, signaling that we - * don't care about the exact size. Java Sound will use - * some default value for the buffer size. - */ + private static SourceDataLine getSourceDataLine(String strMixerName, AudioFormat audioFormat, int nBufferSize) { + // Asking for a line is a rather tricky thing. + // We have to construct an Info object that specifies + // the desired properties for the line. + // First, we have to say which kind of line we want. The + // possibilities are: SourceDataLine (for playback), Clip + // (for repeated playback) and TargetDataLine (for + // recording). + // Here, we want to do normal playback, so we ask for + // a SourceDataLine. + // Then, we have to pass an AudioFormat object, so that + // the Line knows which format the data passed to it + // will have. + // Furthermore, we can give Java Sound a hint about how + // big the internal buffer for the line should be. This + // isn't used here, signaling that we + // don't care about the exact size. Java Sound will use + // some default value for the buffer size. SourceDataLine line = null; - DataLine.Info info = new DataLine.Info(SourceDataLine.class, - audioFormat, nBufferSize); + DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, nBufferSize); try { if (strMixerName != null) { Mixer.Info mixerInfo = getMixerInfo(strMixerName); if (mixerInfo == null) { - System.out.println("AudioPlayer: mixer not found: " + - strMixerName); + System.out.println("AudioPlayer: mixer not found: " + strMixerName); System.exit(1); } @@ -393,19 +336,11 @@ private static SourceDataLine getSourceDataLine(String strMixerName, line = (SourceDataLine) AudioSystem.getLine(info); } - /* - * The line is there, but it is not yet ready to - * receive audio data. We have to open the line. - */ + // The line is there, but it is not yet ready to + // receive audio data. We have to open the line. line.open(audioFormat, nBufferSize); - } catch (LineUnavailableException e) { - if (DEBUG) { - e.printStackTrace(); - } } catch (Exception e) { - if (DEBUG) { - e.printStackTrace(); - } + logger.log(Level.DEBUG, e.getMessage(), e); } return line; } diff --git a/src/samples/java/jse/AudioPlayerApplication.java b/src/samples/java/jse/AudioPlayerApplication.java index c794f1c..f4f9612 100644 --- a/src/samples/java/jse/AudioPlayerApplication.java +++ b/src/samples/java/jse/AudioPlayerApplication.java @@ -18,17 +18,18 @@ */ import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; +import java.lang.System.Logger; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; +import static java.lang.System.getLogger; + /** * AudioPlayerApplication. @@ -36,18 +37,18 @@ * This file is part of the Java Sound Examples. */ public class AudioPlayerApplication extends JFrame { - // Flag for debugging messages. - // If true, some messages are dumped to the console - // during operation. - private static boolean DEBUG = false; - private JButton m_loadButton; - private JLabel m_fileLabel; + + private static final Logger logger = getLogger(AudioPlayerApplication.class.getName()); + + private final JButton m_loadButton; + private final JLabel m_fileLabel; private JFileChooser m_fileChooser; - private AudioPlayerPanel m_audioPlayerPanel; + private final AudioPlayerPanel m_audioPlayerPanel; public AudioPlayerApplication() { super("AudioPlayerApplication"); this.addWindowListener(new WindowAdapter() { + @Override public void windowClosing(WindowEvent we) { System.exit(0); } @@ -56,11 +57,7 @@ public void windowClosing(WindowEvent we) { JPanel filePanel = new JPanel(); filePanel.setLayout(new FlowLayout()); m_loadButton = new JButton("Load..."); - m_loadButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - loadAudioFile(); - } - }); + m_loadButton.addActionListener(ae -> loadAudioFile()); filePanel.add(m_loadButton); m_fileLabel = new JLabel("No audio file loaded"); filePanel.add(m_fileLabel); diff --git a/src/samples/java/jse/AudioPlayerPanel.java b/src/samples/java/jse/AudioPlayerPanel.java index 7822ce2..5c18020 100644 --- a/src/samples/java/jse/AudioPlayerPanel.java +++ b/src/samples/java/jse/AudioPlayerPanel.java @@ -1,9 +1,3 @@ -package jse; -/* - * AudioPlayerPanel.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 by Matthias Pfisterer * @@ -23,44 +17,49 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.URL; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JLabel; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSlider; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; + +import static java.lang.System.getLogger; +import static javax.swing.JOptionPane.showMessageDialog; +/** + * AudioPlayerPanel.java + * + * This file is part of the Java Sound Examples. + */ public class AudioPlayerPanel extends JPanel { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(AudioPlayerPanel.class.getName()); + private JButton m_loadButton; private JLabel m_fileLabel; - private JButton m_startButton; - private JButton m_stopButton; - private JButton m_pauseButton; - private JButton m_resumeButton; + private final JButton m_startButton; + private final JButton m_stopButton; + private final JButton m_pauseButton; + private final JButton m_resumeButton; private JCheckBox m_muteCheckBox; - private JSlider m_gainSlider; - private JSlider m_panSlider; + private final JSlider m_gainSlider; + private final JSlider m_panSlider; - /** The SimpleAudioStream object used to play the audio files. - */ + /** The SimpleAudioStream object used to play the audio files. */ private SimpleAudioStream m_audioStream; private Object m_dataSource; @@ -78,36 +77,20 @@ public AudioPlayerPanel(JPanel northPanel) { subControlPanel1.setLayout(new FlowLayout()); controlPanel.add(subControlPanel1); m_startButton = new JButton("Start"); - m_startButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - startPlayback(); - } - }); + m_startButton.addActionListener(ae -> startPlayback()); subControlPanel1.add(m_startButton); m_stopButton = new JButton("Stop"); - m_stopButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - stopPlayback(); - } - }); + m_stopButton.addActionListener(ae -> stopPlayback()); subControlPanel1.add(m_stopButton); JPanel subControlPanel2 = new JPanel(); subControlPanel2.setLayout(new FlowLayout()); controlPanel.add(subControlPanel2); m_pauseButton = new JButton("Pause"); - m_pauseButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - pausePlayback(); - } - }); + m_pauseButton.addActionListener(ae -> pausePlayback()); subControlPanel2.add(m_pauseButton); m_resumeButton = new JButton("Resume"); - m_resumeButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - resumePlayback(); - } - }); + m_resumeButton.addActionListener(ae -> resumePlayback()); subControlPanel2.add(m_resumeButton); m_startButton.setEnabled(false); m_stopButton.setEnabled(false); @@ -115,19 +98,11 @@ public void actionPerformed(ActionEvent ae) { m_resumeButton.setEnabled(false); subControlPanel1.add(new JLabel("Volume")); m_gainSlider = new JSlider(JSlider.HORIZONTAL, -90, 24, 0); - m_gainSlider.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent ce) { - changeGain(); - } - }); + m_gainSlider.addChangeListener(ce -> changeGain()); subControlPanel1.add(m_gainSlider); subControlPanel2.add(new JLabel("Balance")); m_panSlider = new JSlider(JSlider.HORIZONTAL, -100, 100, 0); - m_panSlider.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent ce) { - changePan(); - } - }); + m_panSlider.addChangeListener(ce -> changePan()); subControlPanel2.add(m_panSlider); } @@ -150,21 +125,14 @@ private boolean setDataSourceImpl(Object dataSource) { } else { m_audioStream = new SimpleAudioStream((File) dataSource); } - } catch (UnsupportedAudioFileException e) { - JOptionPane.showMessageDialog(null, - "The format of the audio data is not supported."); - return false; - } catch (IllegalArgumentException e) { - JOptionPane.showMessageDialog(null, - "The format of the audio data is not supported."); + } catch (UnsupportedAudioFileException | IllegalArgumentException e) { + showMessageDialog(null, "The format of the audio data is not supported."); return false; } catch (LineUnavailableException e) { - JOptionPane.showMessageDialog(null, - "There is currently no line to play."); + showMessageDialog(null, "There is currently no line to play."); return false; } catch (IOException e) { - JOptionPane.showMessageDialog(null, - "Error while reading audio data."); + showMessageDialog(null, "Error while reading audio data."); return false; } m_dataSource = dataSource; @@ -211,20 +179,14 @@ private void resumePlayback() { private void changeGain() { int nValue = m_gainSlider.getValue(); float fGain = nValue; - if (DEBUG) { - System.out.println("AudioPlayerPanel.changeGain(): setting gain to " + - fGain); - } + logger.log(Level.DEBUG, "AudioPlayerPanel.changeGain(): setting gain to " + fGain); m_audioStream.setGain(fGain); } private void changePan() { int nValue = m_panSlider.getValue(); float fPan = nValue * 0.01F; - if (DEBUG) { - System.out.println("AudioPlayerPanel.changeGain(): setting pan to " + - fPan); - } + logger.log(Level.DEBUG, "AudioPlayerPanel.changeGain(): setting pan to " + fPan); m_audioStream.setPan(fPan); } } diff --git a/src/samples/java/jse/AudioRecorder.java b/src/samples/java/jse/AudioRecorder.java index c5f4054..a8496ff 100644 --- a/src/samples/java/jse/AudioRecorder.java +++ b/src/samples/java/jse/AudioRecorder.java @@ -17,20 +17,26 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + package jse; -// IDEA: example 'recording and playback with byte arrays' (using ByteArrayIn/OutputStream) -import gnu.getopt.Getopt; import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.Mixer; import javax.sound.sampled.TargetDataLine; +import gnu.getopt.Getopt; + +import static java.lang.System.getLogger; +import static javax.sound.sampled.AudioFormat.Encoding.PCM_SIGNED; +import static javax.sound.sampled.AudioFormat.Encoding.PCM_UNSIGNED; + /* +DocBookXML Recording and playing back the recorded data immediately @@ -93,85 +99,47 @@ the buffer size to use in Java Sound ("intern") * This file is part of the Java Sound Examples. + * IDEA: example 'recording and playback with byte arrays' (using ByteArrayIn/OutputStream) */ public class AudioRecorder { - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(AudioRecorder.class.getName()); + private static final int DEFAULT_EXTERNAL_BUFFER_SIZE = 128000; private static final SupportedFormat[] SUPPORTED_FORMATS = { - new SupportedFormat("s8", - AudioFormat.Encoding.PCM_SIGNED, - 8, - true), - new SupportedFormat("u8", - AudioFormat.Encoding.PCM_UNSIGNED, - 8, - true), - new SupportedFormat("s16_le", - AudioFormat.Encoding.PCM_SIGNED, - 16, - false), - new SupportedFormat("s16_be", - AudioFormat.Encoding.PCM_SIGNED, - 16, - true), - new SupportedFormat("u16_le", - AudioFormat.Encoding.PCM_UNSIGNED, - 16, - false), - new SupportedFormat("u16_be", - AudioFormat.Encoding.PCM_UNSIGNED, - 16, - true), - new SupportedFormat("s24_le", - AudioFormat.Encoding.PCM_SIGNED, - 24, - false), - new SupportedFormat("s24_be", - AudioFormat.Encoding.PCM_SIGNED, - 24, - true), - new SupportedFormat("u24_le", - AudioFormat.Encoding.PCM_UNSIGNED, - 24, - false), - new SupportedFormat("u24_be", - AudioFormat.Encoding.PCM_UNSIGNED, - 24, - true), - new SupportedFormat("s32_le", - AudioFormat.Encoding.PCM_SIGNED, - 32, - false), - new SupportedFormat("s32_be", - AudioFormat.Encoding.PCM_SIGNED, - 32, - true), - new SupportedFormat("u32_le", - AudioFormat.Encoding.PCM_UNSIGNED, - 32, - false), - new SupportedFormat("u32_be", - AudioFormat.Encoding.PCM_UNSIGNED, - 32, - true), - }; - - /* + new SupportedFormat("s8", PCM_SIGNED, 8, true), + new SupportedFormat("u8", PCM_UNSIGNED, 8, true), + new SupportedFormat("s16_le", PCM_SIGNED, 16, false), + new SupportedFormat("s16_be", PCM_SIGNED, 16, true), + new SupportedFormat("u16_le", PCM_UNSIGNED, 16, false), + new SupportedFormat("u16_be", PCM_UNSIGNED, 16, true), + new SupportedFormat("s24_le", PCM_SIGNED, 24, false), + new SupportedFormat("s24_be", PCM_SIGNED, 24, true), + new SupportedFormat("u24_le", PCM_UNSIGNED, 24, false), + new SupportedFormat("u24_be", PCM_UNSIGNED, 24, true), + new SupportedFormat("s32_le", PCM_SIGNED, 32, false), + new SupportedFormat("s32_be", PCM_SIGNED, 32, true), + new SupportedFormat("u32_le", PCM_UNSIGNED, 32, false), + new SupportedFormat("u32_be", PCM_UNSIGNED, 32, true), + }; + + /** * This set of types is used if AudioSystem.getAudioFileTypes() * returns an array of length 0. This is necessary because the * Sun jdk1.3.0 does so (Yes, it is a bug). */ private static final AudioFileFormat.Type[] DEFAULT_TYPES = { - AudioFileFormat.Type.WAVE, - AudioFileFormat.Type.AU, - AudioFileFormat.Type.AIFF, - AudioFileFormat.Type.AIFC, - AudioFileFormat.Type.SND, - }; + AudioFileFormat.Type.WAVE, + AudioFileFormat.Type.AU, + AudioFileFormat.Type.AIFF, + AudioFileFormat.Type.AIFC, + AudioFileFormat.Type.SND, + }; public static void main(String[] args) { if (args.length == 0) { @@ -181,9 +149,7 @@ public static void main(String[] args) { // int nQuality = QUALITY_DEFAULT; String strExtension = null; - /* - * Parsing of command-line options takes place... - */ + // Parsing of command-line options takes place... String strMixerName = null; int nExternalBufferSize = DEFAULT_EXTERNAL_BUFFER_SIZE; int nInternalBufferSize = AudioSystem.NOT_SPECIFIED; @@ -191,59 +157,50 @@ public static void main(String[] args) { int nChannels = 2; float fRate = 44100.0F; - /* - * Parsing of command-line options takes place... - */ + // Parsing of command-line options takes place... Getopt g = new Getopt("AudioRecorder", args, "hlLM:e:i:f:c:r:t:D"); int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 'l': - listMixersAndExit(); - case 'L': - listPossibleTargetTypes(); - System.exit(0); - case 'M': - strMixerName = g.getOptarg(); - if (DEBUG) { + case 'h': + printUsageAndExit(); + case 'l': + listMixersAndExit(); + case 'L': + listPossibleTargetTypes(); + System.exit(0); + case 'M': + strMixerName = g.getOptarg(); out("AudioRecorder.main(): mixer name: " + strMixerName); - } - break; - case 'e': - nExternalBufferSize = Integer.parseInt(g.getOptarg()); - break; - case 'i': - nInternalBufferSize = Integer.parseInt(g.getOptarg()); - break; - case 'f': - strFormat = g.getOptarg().toLowerCase(); - break; - case 'c': - nChannels = Integer.parseInt(g.getOptarg()); - break; - case 'r': - fRate = Float.parseFloat(g.getOptarg()); - break; - case 't': - strExtension = g.getOptarg(); - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - out("getopt() returned " + c); - break; + break; + case 'e': + nExternalBufferSize = Integer.parseInt(g.getOptarg()); + break; + case 'i': + nInternalBufferSize = Integer.parseInt(g.getOptarg()); + break; + case 'f': + strFormat = g.getOptarg().toLowerCase(); + break; + case 'c': + nChannels = Integer.parseInt(g.getOptarg()); + break; + case 'r': + fRate = Float.parseFloat(g.getOptarg()); + break; + case 't': + strExtension = g.getOptarg(); + break; + case '?': + printUsageAndExit(); + default: + out("getopt() returned " + c); + break; } } - /* - * We make shure that there is only one more argument, which - * we take as the filename of the soundfile to store to. - */ + // We make shure that there is only one more argument, which + // we take as the filename of the soundfile to store to. String strFilename = null; for (int i = g.getOptind(); i < args.length; i++) { if (strFilename == null) { @@ -261,64 +218,60 @@ public static void main(String[] args) { AudioFormat.Encoding encoding = null; int nBitsPerSample = 0; boolean bBigEndian = true; - if (strFormat.equals("phone")) { - /* - * 8 kHz, 8 bit, mono - */ - encoding = AudioFormat.Encoding.PCM_SIGNED; - fRate = 8000.0F; - nBitsPerSample = 8; - nChannels = 1; - bBigEndian = true; - } else if (strFormat.equals("radio")) { - /* - * 22.05 kHz, 8 bit, mono - */ - encoding = AudioFormat.Encoding.PCM_SIGNED; - fRate = 22050.0F; - nBitsPerSample = 8; - nChannels = 1; - bBigEndian = true; - } else if (strFormat.equals("cd")) { - /* - * 44.1 kHz, 16 bit, stereo, little-endian - */ - encoding = AudioFormat.Encoding.PCM_SIGNED; - fRate = 44100.0F; - nBitsPerSample = 16; - nChannels = 2; - bBigEndian = false; - } else if (strFormat.equals("dat")) { - /* - * 48 kHz, 16 bit, stereo, little-endian - */ - encoding = AudioFormat.Encoding.PCM_SIGNED; - fRate = 48000.0F; - nBitsPerSample = 16; - nChannels = 2; - bBigEndian = false; - } else { - int nOutputFormatIndex = -1; - for (int i = 0; i < SUPPORTED_FORMATS.length; i++) { - if (SUPPORTED_FORMATS[i].getName().equals(strFormat)) { - nOutputFormatIndex = i; - break; - } + switch (strFormat) { + case "phone" -> { + // 8 kHz, 8 bit, mono + encoding = PCM_SIGNED; + fRate = 8000.0F; + nBitsPerSample = 8; + nChannels = 1; + bBigEndian = true; + } + case "radio" -> { + // 22.05 kHz, 8 bit, mono + encoding = PCM_SIGNED; + fRate = 22050.0F; + nBitsPerSample = 8; + nChannels = 1; + bBigEndian = true; + } + case "cd" -> { + // 44.1 kHz, 16 bit, stereo, little-endian + encoding = PCM_SIGNED; + fRate = 44100.0F; + nBitsPerSample = 16; + nChannels = 2; + bBigEndian = false; } - if (nOutputFormatIndex != -1) { - encoding = SUPPORTED_FORMATS[nOutputFormatIndex].getEncoding(); + case "dat" -> { + // 48 kHz, 16 bit, stereo, little-endian + encoding = PCM_SIGNED; + fRate = 48000.0F; + nBitsPerSample = 16; + nChannels = 2; + bBigEndian = false; + } + default -> { + int nOutputFormatIndex = -1; + for (int i = 0; i < SUPPORTED_FORMATS.length; i++) { + if (SUPPORTED_FORMATS[i].getName().equals(strFormat)) { + nOutputFormatIndex = i; + break; + } + } + if (nOutputFormatIndex != -1) { + encoding = SUPPORTED_FORMATS[nOutputFormatIndex].getEncoding(); - // TODO: - } else { - out("warning: output format " + strFormat + - " not supported; using default output format"); + // TODO: + } else { + out("warning: output format " + strFormat + " not supported; using default output format"); + } } } int nFrameSize = (nBitsPerSample / 8) * nChannels; - AudioFormat audioFormat = new AudioFormat(encoding, fRate, - nBitsPerSample, nChannels, - nFrameSize, fRate, bBigEndian); + AudioFormat audioFormat = new AudioFormat( + encoding, fRate, nBitsPerSample, nChannels, nFrameSize, fRate, bBigEndian); AudioFileFormat.Type targetType = AudioFileFormat.Type.AU; if (strExtension != null) { @@ -343,7 +296,7 @@ public static void main(String[] args) { try { System.in.read(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } recorder.start(); out("Recording..."); @@ -351,7 +304,7 @@ public static void main(String[] args) { try { System.in.read(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } recorder.stopRecording(); out("Recording stopped."); @@ -370,38 +323,35 @@ private static void printUsageAndExit() { private static void listPossibleTargetTypes() { AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes(); - /* - * Workaround for a bug in the Sun jdk1.3.0. - */ + // Workaround for a bug in the Sun jdk1.3.0. if (aTypes.length == 0) { aTypes = DEFAULT_TYPES; } System.out.print("Supported target types:"); - for (int i = 0; i < aTypes.length; i++) { - System.out.print(" " + aTypes[i].getExtension()); + for (AudioFileFormat.Type aType : aTypes) { + System.out.print(" " + aType.getExtension()); } System.out.print("\n"); } - /** Trying to get an audio file type for the passed extension. - * This works by examining all available file types. For each - * type, if the extension this type promisses to handle matches - * the extension we are trying to find a type for, this type is - * returned. - * If no appropriate type is found, null is returned. + /** + * Trying to get an audio file type for the passed extension. + * This works by examining all available file types. For each + * type, if the extension this type promisses to handle matches + * the extension we are trying to find a type for, this type is + * returned. + * If no appropriate type is found, null is returned. */ private static AudioFileFormat.Type findTargetType(String strExtension) { AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes(); - /* - * Workaround for a bug in the Sun jdk1.3.0. - */ + // Workaround for a bug in the Sun jdk1.3.0. if (aTypes.length == 0) { aTypes = DEFAULT_TYPES; } - for (int i = 0; i < aTypes.length; i++) { - if (aTypes[i].getExtension().equals(strExtension)) { - return aTypes[i]; + for (AudioFileFormat.Type aType : aTypes) { + if (aType.getExtension().equals(strExtension)) { + return aType; } } return null; @@ -411,8 +361,8 @@ private static void listMixersAndExit() { out("Available Mixers:"); Mixer.Info[] aInfos = AudioSystem.getMixerInfo(); - for (int i = 0; i < aInfos.length; i++) { - out(aInfos[i].getName()); + for (Mixer.Info aInfo : aInfos) { + out(aInfo.getName()); } if (aInfos.length == 0) { out("[No mixers available]"); @@ -421,45 +371,41 @@ private static void listMixersAndExit() { } /* - * This method tries to return a Mixer.Info whose name - * matches the passed name. If no matching Mixer.Info is - * found, null is returned. + // This method tries to return a Mixer.Info whose name + // matches the passed name. If no matching Mixer.Info is + // found, null is returned. */ private static Mixer.Info getMixerInfo(String strMixerName) { Mixer.Info[] aInfos = AudioSystem.getMixerInfo(); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strMixerName)) { - return aInfos[i]; + for (Mixer.Info aInfo : aInfos) { + if (aInfo.getName().equals(strMixerName)) { + return aInfo; } } return null; } - private static TargetDataLine getTargetDataLine(String strMixerName, - AudioFormat audioFormat, - int nBufferSize) { - /* - * Asking for a line is a rather tricky thing. - * We have to construct an Info object that specifies - * the desired properties for the line. - * First, we have to say which kind of line we want. The - * possibilities are: SourceDataLine (for playback), Clip - * (for repeated playback) and TargetDataLine (for - * recording). - * Here, we want to do normal capture, so we ask for - * a TargetDataLine. - * Then, we have to pass an AudioFormat object, so that - * the Line knows which format the data passed to it - * will have. - * Furthermore, we can give Java Sound a hint about how - * big the internal buffer for the line should be. This - * isn't used here, signaling that we - * don't care about the exact size. Java Sound will use - * some default value for the buffer size. - */ + private static TargetDataLine getTargetDataLine(String strMixerName, AudioFormat audioFormat, int nBufferSize) { + // Asking for a line is a rather tricky thing. + // We have to construct an Info object that specifies + // the desired properties for the line. + // First, we have to say which kind of line we want. The + // possibilities are: SourceDataLine (for playback), Clip + // (for repeated playback) and TargetDataLine (for + // recording). + // Here, we want to do normal capture, so we ask for + // a TargetDataLine. + // Then, we have to pass an AudioFormat object, so that + // the Line knows which format the data passed to it + // will have. + // Furthermore, we can give Java Sound a hint about how + // big the internal buffer for the line should be. This + // isn't used here, signaling that we + // don't care about the exact size. Java Sound will use + // some default value for the buffer size. TargetDataLine line = null; DataLine.Info info = new DataLine.Info(TargetDataLine.class, - audioFormat, nBufferSize); + audioFormat, nBufferSize); try { if (strMixerName != null) { Mixer.Info mixerInfo = getMixerInfo(strMixerName); @@ -474,19 +420,11 @@ private static TargetDataLine getTargetDataLine(String strMixerName, line = (TargetDataLine) AudioSystem.getLine(info); } - /* - * The line is there, but it is not yet ready to - * receive audio data. We have to open the line. - */ + // The line is there, but it is not yet ready to + // receive audio data. We have to open the line. line.open(audioFormat, nBufferSize); - } catch (LineUnavailableException e) { - if (DEBUG) { - e.printStackTrace(); - } } catch (Exception e) { - if (DEBUG) { - e.printStackTrace(); - } + logger.log(Level.DEBUG, e.getMessage(), e); } return line; } @@ -495,16 +433,17 @@ private static void out(String strMessage) { System.out.println(strMessage); } -///////////// inner classes //////////////////// + // inner classes + private static class SupportedFormat { - private String m_strName; - private AudioFormat.Encoding m_encoding; - private int m_nSampleSize; + + private final String m_strName; + private final AudioFormat.Encoding m_encoding; + private final int m_nSampleSize; private boolean m_bBigEndian; // sample size is in bits - public SupportedFormat(String strName, AudioFormat.Encoding encoding, - int nSampleSize, boolean bBigEndian) { + public SupportedFormat(String strName, AudioFormat.Encoding encoding, int nSampleSize, boolean bBigEndian) { m_strName = strName; m_encoding = encoding; m_nSampleSize = nSampleSize; diff --git a/src/samples/java/jse/AudioStream.java b/src/samples/java/jse/AudioStream.java index 8d07bdc..6ddf422 100644 --- a/src/samples/java/jse/AudioStream.java +++ b/src/samples/java/jse/AudioStream.java @@ -1,9 +1,3 @@ -package jse; -/* - * AudioStream.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,35 +17,44 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.URL; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; +import javax.sound.sampled.FloatControl; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; -import javax.sound.sampled.FloatControl; + +import static java.lang.System.getLogger; -/* IDEA: have a low-level class which only has the separated actions. - Have a high-level class that commbines them and catches some exceptions. +/** + * AudioStream.java + *

    + * This file is part of the Java Sound Examples. + *

    + * IDEA: have a low-level class which only has the separated actions. + * Have a high-level class that commbines them and catches some exceptions. */ public class AudioStream implements Runnable { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = true; - /* - * means that the stream has reached EOF or was not started. - * This value is returned in property change callbacks that - * report the current media position. + private static final Logger logger = getLogger(AudioStream.class.getName()); + + /** + * means that the stream has reached EOF or was not started. + * This value is returned in property change callbacks that + * report the current media position. */ public static final long MEDIA_POSITION_EOF = -1L; public static final String MEDIA_POSITION_PROPERTY = "AudioStream_media_position"; @@ -62,61 +65,56 @@ public class AudioStream implements Runnable { private SourceDataLine m_line; private FloatControl m_gainControl; private FloatControl m_panControl; - private PropertyChangeSupport m_propertyChangeSupport; + private final PropertyChangeSupport m_propertyChangeSupport; /** - * This variable is used to distinguish stopped state from - * paused state. In case of paused state, m_bRunning is still - * true. In case of stopped state, it is set to false. Doing so - * will terminate the thread. + * This variable is used to distinguish stopped state from + * paused state. In case of paused state, m_bRunning is still + * true. In case of stopped state, it is set to false. Doing so + * will terminate the thread. */ private boolean m_bRunning; - /* - * Holds the current media position in frames measured from the - * beginning of the stream. This value is reset on a restart of - * the stream. + /** + * Holds the current media position in frames measured from the + * beginning of the stream. This value is reset on a restart of + * the stream. */ private long m_lMediaPosition; - /* - * Holds the media position in frames that was the last reported - * in a property change callback. + /** + * Holds the media position in frames that was the last reported + * in a property change callback. */ private long m_lLastReportedMediaPosition; - private float m_fReportingIntervallInSeconds = 1.0F; + private final float m_fReportingIntervallInSeconds = 1.0F; public AudioStream() { m_propertyChangeSupport = new PropertyChangeSupport(this); m_dataSource = null; } - public AudioStream(File file) - throws UnsupportedAudioFileException, LineUnavailableException { + public AudioStream(File file) throws UnsupportedAudioFileException, LineUnavailableException { this(); setDataSource(file); } - public AudioStream(URL url) - throws UnsupportedAudioFileException, LineUnavailableException { + public AudioStream(URL url) throws UnsupportedAudioFileException, LineUnavailableException { this(); setDataSource(url); } - public void setDataSource(File file) - throws UnsupportedAudioFileException, LineUnavailableException { + public void setDataSource(File file) throws UnsupportedAudioFileException, LineUnavailableException { m_dataSource = file; initAudioInputStream(); } - public void setDataSource(URL url) - throws UnsupportedAudioFileException, LineUnavailableException { + public void setDataSource(URL url) throws UnsupportedAudioFileException, LineUnavailableException { m_dataSource = url; initAudioInputStream(); } - private void initAudioInputStream() - throws UnsupportedAudioFileException, LineUnavailableException { + private void initAudioInputStream() throws UnsupportedAudioFileException, LineUnavailableException { if (m_dataSource instanceof URL) { initAudioInputStream((URL) m_dataSource); } else if (m_dataSource instanceof File) { @@ -125,73 +123,60 @@ private void initAudioInputStream() initLine(); } - private void initAudioInputStream(File file) - throws UnsupportedAudioFileException { + private void initAudioInputStream(File file) throws UnsupportedAudioFileException { try { m_audioInputStream = AudioSystem.getAudioInputStream(file); } catch (IOException e) { - throw new IllegalArgumentException("cannot create AudioInputStream for " + - file); + throw new IllegalArgumentException("cannot create AudioInputStream for " + file); } if (m_audioInputStream == null) { - throw new IllegalArgumentException("cannot create AudioInputStream for " + - file); + throw new IllegalArgumentException("cannot create AudioInputStream for " + file); } } // from AudioPlayer.java - /* - * Compressed audio data cannot be fed directely to - * Java Sound. It has to be converted explicitely. - * To do this, we create a new AudioFormat that - * says to which format we want to convert to. Then, - * we try to get a converted AudioInputStream. - * Furthermore, we use the new format and the converted - * stream. - * - * Note that the technique shown here is partly non- - * portable. It is used here to keep the example - * simple. A more advanced, more portable technique - * will (hopefully) show up in AudioStream.java soon. - * - * Thanks to Christoph Hecker for finding out that this - * was missing. - */ -/* - if ((audioFormat.getEncoding() == AudioFormat.Encoding.ULAW) || - (audioFormat.getEncoding() == AudioFormat.Encoding.ALAW)) - { - if (DEBUG) - { - System.out.println("AudioPlayer.main(): converting"); - } - AudioFormat newFormat = new AudioFormat( - AudioFormat.Encoding.PCM_SIGNED, - audioFormat.getSampleRate(), - audioFormat.getSampleSizeInBits() * 2, - audioFormat.getChannels(), - audioFormat.getFrameSize() * 2, - audioFormat.getFrameRate(), - true); - AudioInputStream newStream = AudioSystem.getAudioInputStream(newFormat, audioInputStream); - audioFormat = newFormat; - audioInputStream = newStream; - } -*/ - private void initAudioInputStream(URL url) - throws UnsupportedAudioFileException { + // Compressed audio data cannot be fed directely to + // Java Sound. It has to be converted explicitely. + // To do this, we create a new AudioFormat that + // says to which format we want to convert to. Then, + // we try to get a converted AudioInputStream. + // Furthermore, we use the new format and the converted + // stream. + // + // Note that the technique shown here is partly non- + // portable. It is used here to keep the example + // simple. A more advanced, more portable technique + // will (hopefully) show up in AudioStream.java soon. + // + // Thanks to Christoph Hecker for finding out that this + // was missing. +// if ((audioFormat.getEncoding() == AudioFormat.Encoding.ULAW) || +// (audioFormat.getEncoding() == AudioFormat.Encoding.ALAW)) { +// logger.log(Level.DEBUG, "AudioPlayer.main(): converting"); +// AudioFormat newFormat = new AudioFormat( +// AudioFormat.Encoding.PCM_SIGNED, +// audioFormat.getSampleRate(), +// audioFormat.getSampleSizeInBits() * 2, +// audioFormat.getChannels(), +// audioFormat.getFrameSize() * 2, +// audioFormat.getFrameRate(), +// true); +// AudioInputStream newStream = AudioSystem.getAudioInputStream(newFormat, audioInputStream); +// audioFormat = newFormat; +// audioInputStream = newStream; +// } + + private void initAudioInputStream(URL url) throws UnsupportedAudioFileException { try { m_audioInputStream = AudioSystem.getAudioInputStream(url); } // TODO: better pass through? catch (IOException e) { - throw new IllegalArgumentException("cannot create AudioInputStream for " + - url); + throw new IllegalArgumentException("cannot create AudioInputStream for " + url); } if (m_audioInputStream == null) { - throw new IllegalArgumentException("cannot create AudioInputStream for " + - url); + throw new IllegalArgumentException("cannot create AudioInputStream for " + url); } } @@ -201,9 +186,7 @@ private void initLine() throws LineUnavailableException { openLine(); } else { AudioFormat lineAudioFormat = m_line.getFormat(); - AudioFormat audioInputStreamFormat = (m_audioInputStream == null) - ? null - : m_audioInputStream.getFormat(); + AudioFormat audioInputStreamFormat = (m_audioInputStream == null) ? null : m_audioInputStream.getFormat(); if (!lineAudioFormat.equals(audioInputStreamFormat)) { m_line.close(); openLine(); @@ -216,51 +199,36 @@ private void createLine() throws LineUnavailableException { return; } - /* - * From the AudioInputStream, i.e. from the sound file, we - * fetch information about the format of the audio data. These - * information include the sampling frequency, the number of - * channels and the size of the samples. There information - * are needed to ask Java Sound for a suitable output line - * for this audio file. - */ + // From the AudioInputStream, i.e. from the sound file, we + // fetch information about the format of the audio data. These + // information include the sampling frequency, the number of + // channels and the size of the samples. There information + // are needed to ask Java Sound for a suitable output line + // for this audio file. AudioFormat audioFormat = m_audioInputStream.getFormat(); - if (DEBUG) { - System.out.println("AudioStream.initLine(): audio format: " + - audioFormat); - } - - /* - * Asking for a line is a rather tricky thing. - * ... - * Furthermore, we have to give Java Sound a hint about how - * big the internal buffer for the line should be. Here, - * we say AudioSystem.NOT_SPECIFIED, signaling that we don't - * care about the exact size. Java Sound will use some default - * value for the buffer size. - */ - DataLine.Info info = new DataLine.Info(SourceDataLine.class, - audioFormat, - AudioSystem.NOT_SPECIFIED); + logger.log(Level.DEBUG, "AudioStream.initLine(): audio format: " + audioFormat); + + // Asking for a line is a rather tricky thing. + // ... + // Furthermore, we have to give Java Sound a hint about how + // big the internal buffer for the line should be. Here, + // we say AudioSystem.NOT_SPECIFIED, signaling that we don't + // care about the exact size. Java Sound will use some default + // value for the buffer size. + DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, AudioSystem.NOT_SPECIFIED); m_line = (SourceDataLine) AudioSystem.getLine(info); if (m_line.isControlSupported(FloatControl.Type.VOLUME)) { m_gainControl = (FloatControl) m_line.getControl(FloatControl.Type.VOLUME); - if (DEBUG) { - System.out.println("max gain: " + m_gainControl.getMaximum()); - System.out.println("min gain: " + m_gainControl.getMinimum()); - System.out.println("gain precision: " + - m_gainControl.getPrecision()); - } + logger.log(Level.DEBUG, "max gain: " + m_gainControl.getMaximum()); + logger.log(Level.DEBUG, "min gain: " + m_gainControl.getMinimum()); + logger.log(Level.DEBUG, "gain precision: " + m_gainControl.getPrecision()); } if (m_line.isControlSupported(FloatControl.Type.BALANCE)) { m_panControl = (FloatControl) m_line.getControl(FloatControl.Type.BALANCE); - if (DEBUG) { - System.out.println("max balance: " + m_panControl.getMaximum()); - System.out.println("min balance: " + m_panControl.getMinimum()); - System.out.println("balance precision: " + - m_panControl.getPrecision()); - } + logger.log(Level.DEBUG, "max balance: " + m_panControl.getMaximum()); + logger.log(Level.DEBUG, "min balance: " + m_panControl.getMinimum()); + logger.log(Level.DEBUG, "balance precision: " + m_panControl.getPrecision()); } } @@ -274,31 +242,21 @@ private void openLine() throws LineUnavailableException { } // TODO: if class can be instatiated without file or url, m_audioInputStream may - // be null + // be null public AudioFormat getFormat() { return m_audioInputStream.getFormat(); } public void start() { - if (DEBUG) { - System.out.println("start() called"); - } + logger.log(Level.DEBUG, "start() called"); if (!((m_thread == null) || !m_thread.isAlive())) { - if (DEBUG) { - System.out.println("WARNING: old thread still running!!"); - } - } - if (DEBUG) { - System.out.println("creating new thread"); + logger.log(Level.DEBUG, "WARNING: old thread still running!!"); } + logger.log(Level.DEBUG, "creating new thread"); m_thread = new Thread(this); m_thread.start(); - if (DEBUG) { - System.out.println("additional thread started"); - } - if (DEBUG) { - System.out.println("starting line"); - } + logger.log(Level.DEBUG, "additional thread started"); + logger.log(Level.DEBUG, "starting line"); m_line.start(); } @@ -310,19 +268,16 @@ public void stop() { } m_bRunning = false; - /* - * We re-initialize the AudioInputStream. Since doing - * a stop on the stream implies that there has been - * a successful creation of an AudioInputStream before, - * we can almost safely ignore this exception. - * The LineUnavailableException can be ignored because - * in case of reinitializing the same AudioInputStream, - * no new line is created or opened. - */ + // We re-initialize the AudioInputStream. Since doing + // a stop on the stream implies that there has been + // a successful creation of an AudioInputStream before, + // we can almost safely ignore this exception. + // The LineUnavailableException can be ignored because + // in case of reinitializing the same AudioInputStream, + // no new line is created or opened. try { initAudioInputStream(); - } catch (UnsupportedAudioFileException e) { - } catch (LineUnavailableException e) { + } catch (UnsupportedAudioFileException | LineUnavailableException e) { } } } @@ -335,13 +290,12 @@ public void resume() { m_line.start(); } + @Override public void run() { - if (DEBUG) { - System.out.println("thread start"); - } + logger.log(Level.DEBUG, "thread start"); long lReportingIntervallInFrames = (long) (m_fReportingIntervallInSeconds * m_line.getFormat() - .getSampleRate() /* * m_line.getFormat().getFrameSize()*/); + .getSampleRate() /* * m_line.getFormat().getFrameSize() */); int nBytesRead = 0; m_bRunning = true; @@ -349,90 +303,64 @@ public void run() { int nFrameSize = m_line.getFormat().getFrameSize(); m_lMediaPosition = 0L; m_lLastReportedMediaPosition = 0L; - fireMediaPositionPropertyChange(MEDIA_POSITION_EOF, - m_lLastReportedMediaPosition); + fireMediaPositionPropertyChange(MEDIA_POSITION_EOF, m_lLastReportedMediaPosition); while ((nBytesRead != -1) && m_bRunning) { try { nBytesRead = m_audioInputStream.read(abData, 0, abData.length); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (nBytesRead >= 0) { int nFramesToWrite = nBytesRead / nFrameSize; - if (DEBUG) { - System.out.println("Trying to write: " + nFramesToWrite); - } + logger.log(Level.DEBUG, "Trying to write: " + nFramesToWrite); int nFramesWritten = m_line.write(abData, 0, nFramesToWrite); - if (DEBUG) { - System.out.println("Written: " + nFramesWritten); - } + logger.log(Level.DEBUG, "Written: " + nFramesWritten); m_lMediaPosition += nFramesWritten; if ((m_lMediaPosition - m_lLastReportedMediaPosition) >= lReportingIntervallInFrames) { long lOldReportedMediaPosition = m_lLastReportedMediaPosition; m_lLastReportedMediaPosition += lReportingIntervallInFrames; - fireMediaPositionPropertyChange(lOldReportedMediaPosition, - m_lLastReportedMediaPosition); - if (DEBUG) { - System.out.println("Position (not always in seconds) = " + - (m_lLastReportedMediaPosition / lReportingIntervallInFrames)); - } + fireMediaPositionPropertyChange(lOldReportedMediaPosition, m_lLastReportedMediaPosition); + logger.log(Level.DEBUG, "Position (not always in seconds) = " + + (m_lLastReportedMediaPosition / lReportingIntervallInFrames)); } } } - /* - * Wait until all data are played. - * This is only necessary because of the bug noted below. - * (If we do not wait, we would interrupt the playback by - * prematurely closing the line and exiting the VM.) - */ + // Wait until all data are played. + // This is only necessary because of the bug noted below. + // (If we do not wait, we would interrupt the playback by + // prematurely closing the line and exiting the VM.) // TODO: check how this interferes with stop() m_line.drain(); - if (DEBUG) { - System.out.println("after drain()"); - } + logger.log(Level.DEBUG, "after drain()"); - /* - * Stop the line and reinitialize the AudioInputStream. - * This should be done before reporting end-of-media to be - * prepared if the EOM message triggers a new start(). - */ + // Stop the line and reinitialize the AudioInputStream. + // This should be done before reporting end-of-media to be + // prepared if the EOM message triggers a new start(). stop(); - if (DEBUG) { - System.out.println("after this.stop()"); - } - fireMediaPositionPropertyChange(m_lLastReportedMediaPosition, - MEDIA_POSITION_EOF); + logger.log(Level.DEBUG, "after this.stop()"); + fireMediaPositionPropertyChange(m_lLastReportedMediaPosition, MEDIA_POSITION_EOF); } public boolean hasGainControl() { return m_gainControl != null; } -/* - public void setMute(boolean bMute) - { - if (hasGainControl()) - { - m_gainControl.setMute(bMute); - } - } - - +// public void setMute(boolean bMute) { +// if (hasGainControl()) { +// m_gainControl.setMute(bMute); +// } +// } +// +// public boolean getMute() { +// if (hasGainControl()) { +// return m_gainControl.getMute(); +// } else { +// return false; +// } +// } - public boolean getMute() - { - if (hasGainControl()) - { - return m_gainControl.getMute(); - } - else - { - return false; - } - } -*/ public void setGain(float fGain) { if (hasGainControl()) { m_gainControl.setValue(fGain); @@ -497,10 +425,7 @@ public void removePropertyChangeListener(PropertyChangeListener listener) { m_propertyChangeSupport.removePropertyChangeListener(listener); } - private void fireMediaPositionPropertyChange(long lOldPosition, - long lNewPosition) { - m_propertyChangeSupport.firePropertyChange(MEDIA_POSITION_PROPERTY, - new Long(lOldPosition), - new Long(lNewPosition)); + private void fireMediaPositionPropertyChange(long lOldPosition, long lNewPosition) { + m_propertyChangeSupport.firePropertyChange(MEDIA_POSITION_PROPERTY, lOldPosition, lNewPosition); } } diff --git a/src/samples/java/jse/AudioStreamPlayer.java b/src/samples/java/jse/AudioStreamPlayer.java index 3ba2d95..804c4af 100644 --- a/src/samples/java/jse/AudioStreamPlayer.java +++ b/src/samples/java/jse/AudioStreamPlayer.java @@ -1,9 +1,3 @@ -package jse; -/* - * AudioStreamPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,11 +17,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; +import static java.lang.System.getLogger; + /* +DocBookXML AudioStream - encapsulating audio file playback @@ -69,61 +70,52 @@ -DocBookXML */ + +/** + * AudioStreamPlayer.java + *

    + * This file is part of the Java Sound Examples. + */ public class AudioStreamPlayer { + + private static final Logger logger = getLogger(AudioStreamPlayer.class.getName()); + public static void main(String[] args) { - /* - * We check that there is exactely one command-line - * argument. If not, we display the usage message and - * exit. - */ + // We check that there is exactely one command-line + // argument. If not, we display the usage message and + // exit. if (args.length != 1) { printUsageAndExit(); } - /* - * Now, that we're shure there is an argument, we take - * it as the filename of the soundfile we want to play. - */ + // Now, that we're shure there is an argument, we take + // it as the filename of the soundfile we want to play. String strFilename = args[0]; File soundFile = new File(strFilename); - /* - * We just create a SimpleAudioStream by passing a - * File object for the soundfile to the constructor. - * All hairy details are handled inside of this class. - */ + // We just create a SimpleAudioStream by passing a + // File object for the soundfile to the constructor. + // All hairy details are handled inside of this class. SimpleAudioStream audioStream = null; try { audioStream = new SimpleAudioStream(soundFile); } catch (LineUnavailableException e) { - /* - * In case of an exception, we dump the exception - * including the stack trace to the console - * output. Then, we exit the program. - */ - e.printStackTrace(); - System.exit(1); - } catch (UnsupportedAudioFileException e) { - e.printStackTrace(); - System.exit(1); - } catch (IOException e) { - e.printStackTrace(); + // In case of an exception, we dump the exception + // including the stack trace to the console + // output. Then, we exit the program. + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); - } catch (IllegalArgumentException e) { - e.printStackTrace(); + } catch (UnsupportedAudioFileException | IllegalArgumentException | IOException e) { + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * We start the playback. - */ + // We start the playback. audioStream.start(); - /* - * TODO: use some (yet to be defined) function in - * SimpleAudioStream to wait until it is finished, then - * exit the VM. - */ + // TODO: use some (yet to be defined) function in + // SimpleAudioStream to wait until it is finished, then + // exit the VM. } private static void printUsageAndExit() { diff --git a/src/samples/java/jse/AudioUtils.java b/src/samples/java/jse/AudioUtils.java index 462a378..44573f8 100644 --- a/src/samples/java/jse/AudioUtils.java +++ b/src/samples/java/jse/AudioUtils.java @@ -19,10 +19,11 @@ package jse; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; import java.util.Iterator; import java.util.List; - import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; @@ -31,15 +32,19 @@ import javax.sound.sampled.Mixer; import javax.sound.sampled.SourceDataLine; +import static java.lang.System.getLogger; + /** * AudioUtils.java - * @see AudioStream For an example of usage * + * @see AudioStream For an example of usage + *

    * This file is part of the Java Sound Examples. */ public class AudioUtils { - private static final boolean DEBUG = true; + + private static final Logger logger = getLogger(AudioUtils.class.getName()); public static Iterator getSupportedSourceDataLineFormats(Mixer mixer) { Line.Info[] aLineInfos = mixer.getSourceLineInfo(new Line.Info(SourceDataLine.class)); @@ -53,19 +58,17 @@ public static Iterator getSupportedSourceDataLineFormats() { private static Iterator getSupportedSourceDataLineFormatsImpl(Line.Info[] aLineInfos) { List formats = new ArrayList<>(); - for (int i = 0; i < aLineInfos.length; i++) { - if (aLineInfos[i] instanceof DataLine.Info) { - AudioFormat[] aFormats = ((DataLine.Info) aLineInfos[i]).getFormats(); - for (int nFormat = 0; nFormat < aFormats.length; nFormat++) { - if (!formats.contains(aFormats[nFormat])) { - formats.add(aFormats[nFormat]); + for (Line.Info aLineInfo : aLineInfos) { + if (aLineInfo instanceof DataLine.Info) { + AudioFormat[] aFormats = ((DataLine.Info) aLineInfo).getFormats(); + for (AudioFormat aFormat : aFormats) { + if (!formats.contains(aFormat)) { + formats.add(aFormat); } } } else { - /* - * No chance to get useful information, - * so do nothing. - */ + // No chance to get useful information, + // so do nothing. } } return formats.iterator(); @@ -90,9 +93,7 @@ public static AudioFormat getSuitableTargetFormatImpl(Iterator poss } } - /* - * No suitable format found. - */ + // No suitable format found. return null; } @@ -107,18 +108,12 @@ public static AudioInputStream getSuitableAudioInputStream(Mixer mixer, AudioInp } public static AudioInputStream getSuitableAudioInputStreamImpl(AudioInputStream sourceAudioInputStream, AudioFormat targetFormat) { - if (DEBUG) { - System.out.println("AudioUtils.getSuitableAudioInputStreamImpl(): target format: " + targetFormat); - } + logger.log(Level.DEBUG, "AudioUtils.getSuitableAudioInputStreamImpl(): target format: " + targetFormat); if (targetFormat != null) { - if (DEBUG) { - System.out.println("AudioUtils.getSuitableAudioInputStreamImpl(): trying to do a conversion."); - } + logger.log(Level.DEBUG, "AudioUtils.getSuitableAudioInputStreamImpl(): trying to do a conversion."); return AudioSystem.getAudioInputStream(targetFormat, sourceAudioInputStream); } else { - if (DEBUG) { - System.out.println("AudioUtils.getSuitableAudioInputStreamImpl(): returning null as resulting AudioInputStream."); - } + logger.log(Level.DEBUG, "AudioUtils.getSuitableAudioInputStreamImpl(): returning null as resulting AudioInputStream."); return null; } } diff --git a/src/samples/java/jse/BaseAudioStream.java b/src/samples/java/jse/BaseAudioStream.java index 272d98c..a3e0f91 100644 --- a/src/samples/java/jse/BaseAudioStream.java +++ b/src/samples/java/jse/BaseAudioStream.java @@ -1,9 +1,3 @@ -package jse; -/* - * BaseAudioStream.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,8 +17,13 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.URL; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -35,18 +34,22 @@ import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; +import static java.lang.System.getLogger; + +/** + * BaseAudioStream.java + *

    + * This file is part of the Java Sound Examples. + */ public class BaseAudioStream implements Runnable { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = true; + + private static final Logger logger = getLogger(BaseAudioStream.class.getName()); /** - * means that the stream has reached EOF or was not started. - * This value is returned in property change callbacks that - * report the current media position. + * means that the stream has reached EOF or was not started. + * This value is returned in property change callbacks that + * report the current media position. */ public static final long MEDIA_POSITION_EOF = -1L; public static final String MEDIA_POSITION_PROPERTY = "BaseAudioStream_media_position"; @@ -61,10 +64,10 @@ public class BaseAudioStream implements Runnable { private FloatControl m_panControl; /** - * This variable is used to distinguish stopped state from - * paused state. In case of paused state, m_bRunning is still - * true. In case of stopped state, it is set to false. Doing so - * will terminate the thread. + * This variable is used to distinguish stopped state from + * paused state. In case of paused state, m_bRunning is still + * true. In case of stopped state, it is set to false. Doing so + * will terminate the thread. */ private boolean m_bRunning; @@ -77,22 +80,19 @@ protected BaseAudioStream() { } protected void setDataSource(File file) - throws UnsupportedAudioFileException, LineUnavailableException, - IOException { + throws UnsupportedAudioFileException, LineUnavailableException, IOException { m_dataSource = file; initAudioInputStream(); } - protected void setDataSource(URL url) - throws UnsupportedAudioFileException, LineUnavailableException, - IOException { + protected void setDataSource(URL url) throws UnsupportedAudioFileException, LineUnavailableException, IOException { m_dataSource = url; initAudioInputStream(); } private void initAudioInputStream() - throws UnsupportedAudioFileException, LineUnavailableException, - IOException { + throws UnsupportedAudioFileException, LineUnavailableException, + IOException { if (m_dataSource instanceof URL) { initAudioInputStream((URL) m_dataSource); } else if (m_dataSource instanceof File) { @@ -100,97 +100,74 @@ private void initAudioInputStream() } } - private void initAudioInputStream(File file) - throws UnsupportedAudioFileException, IOException { -/* - try - { -*/ - m_audioInputStream = AudioSystem.getAudioInputStream(file); + private void initAudioInputStream(File file) throws UnsupportedAudioFileException, IOException { -/* - } - catch (IOException e) - { - throw new IllegalArgumentException("cannot create AudioInputStream for " + file); - } - if (m_audioInputStream == null) - { - throw new IllegalArgumentException("cannot create AudioInputStream for " + file); - } -*/ +// try { + + m_audioInputStream = AudioSystem.getAudioInputStream(file); + +// } catch (IOException e) { +// throw new IllegalArgumentException("cannot create AudioInputStream for " + file); +// } +// if (m_audioInputStream == null) { +// throw new IllegalArgumentException("cannot create AudioInputStream for " + file); +// } } - private void initAudioInputStream(URL url) - throws UnsupportedAudioFileException, IOException { -/* - try - { -*/ - m_audioInputStream = AudioSystem.getAudioInputStream(url); + private void initAudioInputStream(URL url) throws UnsupportedAudioFileException, IOException { -/* - } - catch (IOException e) - { - throw new IllegalArgumentException("cannot create AudioInputStream for " + url); - } - if (m_audioInputStream == null) - { - throw new IllegalArgumentException("cannot create AudioInputStream for " + url); - } -*/ +// try { + + m_audioInputStream = AudioSystem.getAudioInputStream(url); + +// } catch (IOException e) { +// throw new IllegalArgumentException("cannot create AudioInputStream for " + url); +// } +// if (m_audioInputStream == null) { +// throw new IllegalArgumentException("cannot create AudioInputStream for " + url); +// } } // from AudioPlayer.java - /* - * Compressed audio data cannot be fed directely to - * Java Sound. It has to be converted explicitely. - * To do this, we create a new AudioFormat that - * says to which format we want to convert to. Then, - * we try to get a converted AudioInputStream. - * Furthermore, we use the new format and the converted - * stream. - * - * Note that the technique shown here is partly non- - * portable. It is used here to keep the example - * simple. A more advanced, more portable technique - * will (hopefully) show up in BaseAudioStream.java soon. - * - * Thanks to Christoph Hecker for finding out that this - * was missing. - */ -/* - if ((audioFormat.getEncoding() == AudioFormat.Encoding.ULAW) || - (audioFormat.getEncoding() == AudioFormat.Encoding.ALAW)) - { - if (DEBUG) - { - System.out.println("AudioPlayer.main(): converting"); - } - AudioFormat newFormat = new AudioFormat( - AudioFormat.Encoding.PCM_SIGNED, - audioFormat.getSampleRate(), - audioFormat.getSampleSizeInBits() * 2, - audioFormat.getChannels(), - audioFormat.getFrameSize() * 2, - audioFormat.getFrameRate(), - true); - AudioInputStream newStream = AudioSystem.getAudioInputStream(newFormat, audioInputStream); - audioFormat = newFormat; - audioInputStream = newStream; - } -*/ + // Compressed audio data cannot be fed directely to + // Java Sound. It has to be converted explicitely. + // To do this, we create a new AudioFormat that + // says to which format we want to convert to. Then, + // we try to get a converted AudioInputStream. + // Furthermore, we use the new format and the converted + // stream. + // + // Note that the technique shown here is partly non- + // portable. It is used here to keep the example + // simple. A more advanced, more portable technique + // will (hopefully) show up in BaseAudioStream.java soon. + // + // Thanks to Christoph Hecker for finding out that this + // was missing. +// if ((audioFormat.getEncoding() == AudioFormat.Encoding.ULAW) || +// (audioFormat.getEncoding() == AudioFormat.Encoding.ALAW)) { +// logger.log(Level.DEBUG, "AudioPlayer.main(): converting"); +// AudioFormat newFormat = new AudioFormat( +// AudioFormat.Encoding.PCM_SIGNED, +// audioFormat.getSampleRate(), +// audioFormat.getSampleSizeInBits() * 2, +// audioFormat.getChannels(), +// audioFormat.getFrameSize() * 2, +// audioFormat.getFrameRate(), +// true); +// AudioInputStream newStream = AudioSystem.getAudioInputStream(newFormat, audioInputStream); +// audioFormat = newFormat; +// audioInputStream = newStream; +// } + protected void initLine() throws LineUnavailableException { if (m_line == null) { createLine(); openLine(); } else { AudioFormat lineAudioFormat = m_line.getFormat(); - AudioFormat audioInputStreamFormat = (m_audioInputStream == null) - ? null - : m_audioInputStream.getFormat(); + AudioFormat audioInputStreamFormat = (m_audioInputStream == null) ? null : m_audioInputStream.getFormat(); if (!lineAudioFormat.equals(audioInputStreamFormat)) { m_line.close(); openLine(); @@ -204,58 +181,45 @@ private void createLine() throws LineUnavailableException { } /* - * From the AudioInputStream, i.e. from the sound file, we - * fetch information about the format of the audio data. These - * information include the sampling frequency, the number of - * channels and the size of the samples. There information - * are needed to ask Java Sound for a suitable output line - * for this audio file. + // From the AudioInputStream, i.e. from the sound file, we + // fetch information about the format of the audio data. These + // information include the sampling frequency, the number of + // channels and the size of the samples. There information + // are needed to ask Java Sound for a suitable output line + // for this audio file. */ AudioFormat audioFormat = m_audioInputStream.getFormat(); - if (DEBUG) { - System.out.println("BaseAudioStream.initLine(): audio format: " + - audioFormat); - } + logger.log(Level.DEBUG, "BaseAudioStream.initLine(): audio format: " + audioFormat); /* - * Asking for a line is a rather tricky thing. - * ... - * Furthermore, we have to give Java Sound a hint about how - * big the internal buffer for the line should be. Here, - * we say AudioSystem.NOT_SPECIFIED, signaling that we don't - * care about the exact size. Java Sound will use some default - * value for the buffer size. + // Asking for a line is a rather tricky thing. + // ... + // Furthermore, we have to give Java Sound a hint about how + // big the internal buffer for the line should be. Here, + // we say AudioSystem.NOT_SPECIFIED, signaling that we don't + // care about the exact size. Java Sound will use some default + // value for the buffer size. */ DataLine.Info info = new DataLine.Info(SourceDataLine.class, - audioFormat, - AudioSystem.NOT_SPECIFIED); + audioFormat, + AudioSystem.NOT_SPECIFIED); m_line = (SourceDataLine) AudioSystem.getLine(info); if (m_line.isControlSupported(FloatControl.Type.MASTER_GAIN /*VOLUME*/)) { m_gainControl = (FloatControl) m_line.getControl(FloatControl.Type.MASTER_GAIN); - if (DEBUG) { - System.out.println("max gain: " + m_gainControl.getMaximum()); - System.out.println("min gain: " + m_gainControl.getMinimum()); - System.out.println("gain precision: " + - m_gainControl.getPrecision()); - } + logger.log(Level.DEBUG, "max gain: " + m_gainControl.getMaximum()); + logger.log(Level.DEBUG, "min gain: " + m_gainControl.getMinimum()); + logger.log(Level.DEBUG, "gain precision: " + m_gainControl.getPrecision()); } else { - if (DEBUG) { - System.out.println("FloatControl.Type.MASTER_GAIN is not supported"); - } + logger.log(Level.DEBUG, "FloatControl.Type.MASTER_GAIN is not supported"); } if (m_line.isControlSupported(FloatControl.Type.PAN /*BALANCE*/)) { m_panControl = (FloatControl) m_line.getControl(FloatControl.Type.PAN); - if (DEBUG) { - System.out.println("max balance: " + m_panControl.getMaximum()); - System.out.println("min balance: " + m_panControl.getMinimum()); - System.out.println("balance precision: " + - m_panControl.getPrecision()); - } + logger.log(Level.DEBUG, "max balance: " + m_panControl.getMaximum()); + logger.log(Level.DEBUG, "min balance: " + m_panControl.getMinimum()); + logger.log(Level.DEBUG, "balance precision: " + m_panControl.getPrecision()); } else { - if (DEBUG) { - System.out.println("FloatControl.Type.PAN is not supported"); - } + logger.log(Level.DEBUG, "FloatControl.Type.PAN is not supported"); } } @@ -269,31 +233,21 @@ private void openLine() throws LineUnavailableException { } // TODO: if class can be instatiated without file or url, m_audioInputStream may - // be null + // be null protected AudioFormat getFormat() { return m_audioInputStream.getFormat(); } public void start() { - if (DEBUG) { - System.out.println("start() called"); - } + logger.log(Level.DEBUG, "start() called"); if (!((m_thread == null) || !m_thread.isAlive())) { - if (DEBUG) { - System.out.println("WARNING: old thread still running!!"); - } - } - if (DEBUG) { - System.out.println("creating new thread"); + logger.log(Level.DEBUG, "WARNING: old thread still running!!"); } + logger.log(Level.DEBUG, "creating new thread"); m_thread = new Thread(this); m_thread.start(); - if (DEBUG) { - System.out.println("additional thread started"); - } - if (DEBUG) { - System.out.println("starting line"); - } + logger.log(Level.DEBUG, "additional thread started"); + logger.log(Level.DEBUG, "starting line"); m_line.start(); } @@ -305,20 +259,16 @@ protected void stop() { } m_bRunning = false; - /* - * We re-initialize the AudioInputStream. Since doing - * a stop on the stream implies that there has been - * a successful creation of an AudioInputStream before, - * we can almost safely ignore this exception. - * The LineUnavailableException can be ignored because - * in case of reinitializing the same AudioInputStream, - * no new line is created or opened. - */ + // We re-initialize the AudioInputStream. Since doing + // a stop on the stream implies that there has been + // a successful creation of an AudioInputStream before, + // we can almost safely ignore this exception. + // The LineUnavailableException can be ignored because + // in case of reinitializing the same AudioInputStream, + // no new line is created or opened. try { initAudioInputStream(); - } catch (UnsupportedAudioFileException e) { - } catch (LineUnavailableException e) { - } catch (IOException e) { + } catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { } } } @@ -331,86 +281,65 @@ public void resume() { m_line.start(); } + @Override public void run() { - if (DEBUG) { - System.out.println("thread start"); - } + logger.log(Level.DEBUG, "thread start"); int nBytesRead = 0; m_bRunning = true; byte[] abData = new byte[EXTERNAL_BUFFER_SIZE]; - // int nFrameSize = m_line.getFormat().getFrameSize(); +// int nFrameSize = m_line.getFormat().getFrameSize(); while ((nBytesRead != -1) && m_bRunning) { try { nBytesRead = m_audioInputStream.read(abData, 0, abData.length); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (nBytesRead >= 0) { - //int nFramesToWrite = nBytesRead / nFrameSize; - if (DEBUG) { - System.out.println("Trying to write: " + nBytesRead); - } +// int nFramesToWrite = nBytesRead / nFrameSize; + logger.log(Level.DEBUG, "Trying to write: " + nBytesRead); int nBytesWritten = m_line.write(abData, 0, nBytesRead); - if (DEBUG) { - System.out.println("Written: " + nBytesWritten); - } + logger.log(Level.DEBUG, "Written: " + nBytesWritten); } } - /* - * Wait until all data are played. - * This is only necessary because of the bug noted below. - * (If we do not wait, we would interrupt the playback by - * prematurely closing the line and exiting the VM.) - */ + // Wait until all data are played. + // This is only necessary because of the bug noted below. + // (If we do not wait, we would interrupt the playback by + // prematurely closing the line and exiting the VM.) // TODO: check how this interferes with stop() m_line.drain(); - if (DEBUG) { - System.out.println("after drain()"); - } + logger.log(Level.DEBUG, "after drain()"); - /* - * Stop the line and reinitialize the AudioInputStream. - * This should be done before reporting end-of-media to be - * prepared if the EOM message triggers a new start(). - */ + // Stop the line and reinitialize the AudioInputStream. + // This should be done before reporting end-of-media to be + // prepared if the EOM message triggers a new start(). stop(); - if (DEBUG) { - System.out.println("after this.stop()"); - } + logger.log(Level.DEBUG, "after this.stop()"); } public boolean hasGainControl() { return m_gainControl != null; } -/* - public void setMute(boolean bMute) - { - if (hasGainControl()) - { - m_gainControl.setMute(bMute); - } - } - +// public void setMute(boolean bMute) { +// if (hasGainControl()) { +// m_gainControl.setMute(bMute); +// } +// } +// +// +// public boolean getMute() { +// if (hasGainControl()) { +// return m_gainControl.getMute(); +// } else { +// return false; +// } +// } - - public boolean getMute() - { - if (hasGainControl()) - { - return m_gainControl.getMute(); - } - else - { - return false; - } - } -*/ public void setGain(float fGain) { if (hasGainControl()) { m_gainControl.setValue(fGain); diff --git a/src/samples/java/jse/CaptureStream.java b/src/samples/java/jse/CaptureStream.java index c3f523d..8a2cedf 100644 --- a/src/samples/java/jse/CaptureStream.java +++ b/src/samples/java/jse/CaptureStream.java @@ -1,9 +1,3 @@ -package jse; -/* - * CaptureStream.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 by Matthias Pfisterer * @@ -23,41 +17,48 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.IOException; import java.io.OutputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.TargetDataLine; +import static java.lang.System.getLogger; + +/** + * CaptureStream.java + *

    + * This file is part of the Java Sound Examples. + */ public class CaptureStream extends Thread { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static final boolean DEBUG = true; - private TargetDataLine m_line; - private OutputStream m_outputStream; + + private static final Logger logger = getLogger(CaptureStream.class.getName()); + + private final TargetDataLine m_line; + private final OutputStream m_outputStream; private boolean m_bRecording; - /* - * We have to pass: - * a) an AudioFormat to describe in which format the audio data - * should be recorded. - * b) an OutputStream to describe where the recorded data should - * be written. + /** + * We have to pass: + * a) an AudioFormat to describe in which format the audio data should be recorded. + * b) an OutputStream to describe where the recorded data should be written. */ - public CaptureStream(AudioFormat format, OutputStream outputStream) - throws LineUnavailableException { - DataLine.Info info = new DataLine.Info(TargetDataLine.class, format, - AudioSystem.NOT_SPECIFIED); + public CaptureStream(AudioFormat format, OutputStream outputStream) throws LineUnavailableException { + DataLine.Info info = new DataLine.Info(TargetDataLine.class, format, AudioSystem.NOT_SPECIFIED); m_line = (TargetDataLine) AudioSystem.getLine(info); m_line.open(format, m_line.getBufferSize()); m_outputStream = outputStream; } + @Override public void start() { m_line.start(); super.start(); @@ -69,6 +70,7 @@ public void stopRecording() { m_bRecording = false; } + @Override public void run() { // TODO: intelligent size byte[] abBuffer = new byte[65536]; @@ -76,20 +78,16 @@ public void run() { int nBufferFrames = abBuffer.length / nFrameSize; m_bRecording = true; while (m_bRecording) { - if (DEBUG) { - System.out.println("Trying to read: " + nBufferFrames); - } + logger.log(Level.DEBUG, "Trying to read: " + nBufferFrames); int nFramesRead = m_line.read(abBuffer, 0, nBufferFrames); - if (DEBUG) { - System.out.println("Read: " + nFramesRead); - } + logger.log(Level.DEBUG, "Read: " + nFramesRead); int nBytesToWrite = nFramesRead * nFrameSize; try { m_outputStream.write(abBuffer, 0, nBytesToWrite); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } } diff --git a/src/samples/java/jse/CaptureStreamRecorder.java b/src/samples/java/jse/CaptureStreamRecorder.java index 9e3f5aa..60ea7c6 100644 --- a/src/samples/java/jse/CaptureStreamRecorder.java +++ b/src/samples/java/jse/CaptureStreamRecorder.java @@ -1,9 +1,3 @@ -package jse; -/* - * CaptureStreamRecorder.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 by Matthias Pfisterer * @@ -23,11 +17,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -35,12 +34,20 @@ import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.TargetDataLine; +import static java.lang.System.getLogger; + +/** + * CaptureStreamRecorder.java + *

    + * This file is part of the Java Sound Examples. + */ public class CaptureStreamRecorder { - /* - * Codes for the audio quality that should be used - * in recording. - */ + + private static final Logger logger = getLogger(CaptureStreamRecorder.class.getName()); + + // Codes for the audio quality that should be used + // in recording. private static final int QUALITY_NONE = 0; private static final int QUALITY_PHONE = 1; private static final int QUALITY_RADIO = 2; @@ -55,62 +62,42 @@ public static void main(String[] args) { boolean bCheckAudioInputStream = false; int nCurrentArg = 0; while (nCurrentArg < (args.length - 1)) { - if (args[nCurrentArg].equals("-p")) { - nQuality = QUALITY_PHONE; - } else if (args[nCurrentArg].equals("-r")) { - nQuality = QUALITY_RADIO; - } else if (args[nCurrentArg].equals("-c")) { - nQuality = QUALITY_CD; - } + nQuality = switch (args[nCurrentArg]) { + case "-p" -> QUALITY_PHONE; + case "-r" -> QUALITY_RADIO; + case "-c" -> QUALITY_CD; + default -> nQuality; + }; + + // TODO: option to override the file format +// else if (args[nCurrentArg].equals("-i")) { +// bCheckAudioInputStream = true; +// } -/* TODO: option to override the file format - else if (args[nCurrentArg].equals("-i")) - { - bCheckAudioInputStream = true; - } -*/ nCurrentArg++; } String strFilename = args[nCurrentArg]; - AudioFormat format = null; - switch (nQuality) { - case QUALITY_PHONE: - - /* - * 8 kHz, 8 bit, mono - */ - format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000.0F, - 8, 1, 1, 8000.0F, true); - break; - case QUALITY_RADIO: - - /* - * 22.05 kHz, 8 bit, mono - */ - format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 22050.0F, - 8, 1, 1, 22050.0F, true); - break; - case QUALITY_CD:default: - - /* - * 44.1 kHz, 16 bit, stereo - */ - format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100.0F, - 16, 2, 4, 44100.0F, true); - break; - } - - /* - * We try to use a file format according to the extension - * of the filename the user specified. If this is not - * possible, we default to the .au file format. - */ + AudioFormat format = switch (nQuality) { + case QUALITY_PHONE -> // 8 kHz, 8 bit, mono + new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000.0F, + 8, 1, 1, 8000.0F, true); + case QUALITY_RADIO -> // 22.05 kHz, 8 bit, mono + new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 22050.0F, + 8, 1, 1, 22050.0F, true); + default -> // 44.1 kHz, 16 bit, stereo + new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 44100.0F, + 16, 2, 4, 44100.0F, true); + }; + + // We try to use a file format according to the extension + // of the filename the user specified. If this is not + // possible, we default to the .au file format. AudioFileFormat.Type fileType = AudioFileFormat.Type.AU; AudioFileFormat.Type[] types = AudioSystem.getAudioFileTypes(); - for (int i = 0; i < types.length; i++) { - if (strFilename.toLowerCase().endsWith(types[i].getExtension())) { - fileType = types[i]; + for (AudioFileFormat.Type type : types) { + if (strFilename.toLowerCase().endsWith(type.getExtension())) { + fileType = type; } } @@ -119,7 +106,7 @@ else if (args[nCurrentArg].equals("-i")) try { captureStream = new CaptureStream(format, byteArrayOutputStream); } catch (LineUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } System.out.println("Press ENTER to start the recording."); @@ -127,7 +114,7 @@ else if (args[nCurrentArg].equals("-i")) System.in.read(); System.in.read(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } captureStream.start(); System.out.println("Recording..."); @@ -135,40 +122,35 @@ else if (args[nCurrentArg].equals("-i")) try { System.in.read(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } captureStream.stopRecording(); System.out.println("Recording stopped."); // TODO: flush() ?? - /* - * We close the ByteArrayOutputStream - */ + // We close the ByteArrayOutputStream try { byteArrayOutputStream.close(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } byte[] abData = byteArrayOutputStream.toByteArray(); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(abData); AudioInputStream audioInputStream = new AudioInputStream(byteArrayInputStream, - format, - abData.length / format.getFrameSize()); + format, + abData.length / format.getFrameSize()); -/* AudioFileFormat audioFileFormat = new AudioFileFormat(fileType, format, abData.length / format.getFrameSize()); - */ +// AudioFileFormat audioFileFormat = new AudioFileFormat(fileType, format, abData.length / format.getFrameSize()); try { AudioSystem.write(audioInputStream, fileType, new File(strFilename)); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } - /* - * We're done. - */ + // We're done. System.exit(0); } } diff --git a/src/samples/java/jse/CddaPlayer.java b/src/samples/java/jse/CddaPlayer.java index 2ddda32..d79f553 100644 --- a/src/samples/java/jse/CddaPlayer.java +++ b/src/samples/java/jse/CddaPlayer.java @@ -21,6 +21,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.MalformedURLException; import java.net.URL; import javax.sound.sampled.AudioFormat; @@ -30,38 +32,38 @@ import javax.sound.sampled.Line; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; + import org.tritonus.sampled.cdda.CddaURLStreamHandlerFactory; +import static java.lang.System.getLogger; + /** command-line player */ public class CddaPlayer { + static { URL.setURLStreamHandlerFactory(new CddaURLStreamHandlerFactory()); } - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = false; - private static int DEFAULT_EXTERNAL_BUFFER_SIZE = 128000; + private static final Logger logger = getLogger(CddaPlayer.class.getName()); + + private static final int DEFAULT_EXTERNAL_BUFFER_SIZE = 128000; public static void main(String[] args) { int nExternalBufferSize = DEFAULT_EXTERNAL_BUFFER_SIZE; int nInternalBufferSize = AudioSystem.NOT_SPECIFIED; - /** CDROM drive number. - Defaults to first drive. [how is the order constituted?] - Not used for now. Hardcoded default to /dev/cdrom. - */ + // CDROM drive number. + // Defaults to first drive. [how is the order constituted?] + // Not used for now. Hardcoded default to /dev/cdrom. int nDrive = 0; boolean bTocOnly = true; int nTrack = 0; - // File outputFile = new File("output.wav"); +// File outputFile = new File("output.wav"); if (args.length < 1) { bTocOnly = true; } else if (args.length == 1) { @@ -77,14 +79,14 @@ public static void main(String[] args) { try { tocURL = new URL("cdda:" + strDrive); } catch (MalformedURLException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } InputStream tocInputStream = null; try { tocInputStream = tocURL.openStream(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } output(tocInputStream); } @@ -94,14 +96,14 @@ public static void main(String[] args) { try { trackURL = new URL("cdda://" + strDrive + "#" + nTrack); } catch (MalformedURLException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } InputStream trackInputStream = null; try { trackInputStream = trackURL.openStream(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } AudioInputStream audioInputStream = (AudioInputStream) trackInputStream; @@ -115,7 +117,7 @@ public static void main(String[] args) { line.open(); line.start(); } catch (LineUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } int nBytesRead = 0; @@ -124,18 +126,13 @@ public static void main(String[] args) { try { nBytesRead = audioInputStream.read(abData, 0, abData.length); } catch (IOException e) { - e.printStackTrace(); - } - if (DEBUG) { - System.out.println("AudioPlayer.main(): read from AudioInputStream (bytes): " + - nBytesRead); + logger.log(Level.ERROR, e.getMessage(), e); } + logger.log(Level.DEBUG, "AudioPlayer.main(): read from AudioInputStream (bytes): " + nBytesRead); if (nBytesRead >= 0) { int nBytesWritten = line.write(abData, 0, nBytesRead); - if (DEBUG) { - System.out.println("AudioPlayer.main(): written to SourceDataLine (bytes): " + + logger.log(Level.DEBUG, "AudioPlayer.main(): written to SourceDataLine (bytes): " + nBytesWritten); - } } } } @@ -153,7 +150,7 @@ private static void output(InputStream inputStream) { nBytesRead = inputStream.read(buffer); } } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } diff --git a/src/samples/java/jse/CddaRipper.java b/src/samples/java/jse/CddaRipper.java index 9b17df9..9e8d7cc 100644 --- a/src/samples/java/jse/CddaRipper.java +++ b/src/samples/java/jse/CddaRipper.java @@ -1,9 +1,3 @@ -package jse; -/* - * CddaRipper.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 2001 by Matthias Pfisterer * @@ -21,37 +15,44 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +package jse; + import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.MalformedURLException; import java.net.URL; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; + import org.tritonus.sampled.cdda.CddaURLStreamHandlerFactory; +import static java.lang.System.getLogger; + /** - command-line extractor/player + * CddaRipper.java + * command-line extractor/player + *

    + * This file is part of the Java Sound Examples. */ public class CddaRipper { + static { URL.setURLStreamHandlerFactory(new CddaURLStreamHandlerFactory()); } - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = false; + private static final Logger logger = getLogger(CddaRipper.class.getName()); public static void main(String[] args) { - /** CDROM drive number. - Defaults to first drive. [how is the order constituted?] - Not used for now. Hardcoded default to /dev/cdrom. - */ + // CDROM drive number. + // Defaults to first drive. [how is the order constituted?] + // Not used for now. Hardcoded default to /dev/cdrom. int nDrive = 0; boolean bTocOnly = true; @@ -73,23 +74,22 @@ public static void main(String[] args) { try { tocURL = new URL("cdda:" + strDrive); } catch (MalformedURLException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } InputStream tocInputStream = null; try { tocInputStream = tocURL.openStream(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } output(tocInputStream); } // System.out.println("First track: " + anValues[0]); // System.out.println("last track: " + anValues[1]); -// int nTracks = anValues[1] - anValues[0] + 1; -// for (int i = 0; i < nTracks; i++) -// { +// int nTracks = anValues[1] - anValues[0] + 1; +// for (int i = 0; i < nTracks; i++) { // System.out.println("Track " + (i + anValues[0]) + " start: " + anStart[i]); // System.out.println("Track " + (i + anValues[0]) + " type: " + anType[i]); // System.out.println("Track " + (i + anValues[0]) + " length (s): " + (anStart[i + 1] - anStart[i])/75); @@ -99,31 +99,25 @@ public static void main(String[] args) { try { trackURL = new URL("cdda://" + strDrive + "#" + nTrack); } catch (MalformedURLException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } InputStream trackInputStream = null; try { trackInputStream = trackURL.openStream(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } AudioInputStream audioInputStream = (AudioInputStream) trackInputStream; try { - if (DEBUG) { - out("before write()"); - } - - int nWritten = AudioSystem.write(audioInputStream, - AudioFileFormat.Type.WAVE, - outputFile); - if (DEBUG) { - out("after write()"); - } + logger.log(Level.TRACE, "before write()"); + + int nWritten = AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, outputFile); + logger.log(Level.TRACE, "after write()"); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } } @@ -140,11 +134,7 @@ private static void output(InputStream inputStream) { nBytesRead = inputStream.read(buffer); } } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } - - private static void out(String strMessage) { - System.out.println(strMessage); - } } diff --git a/src/samples/java/jse/ClipPlayer.java b/src/samples/java/jse/ClipPlayer.java index aefb7d3..0c4b91f 100644 --- a/src/samples/java/jse/ClipPlayer.java +++ b/src/samples/java/jse/ClipPlayer.java @@ -20,6 +20,8 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; @@ -29,24 +31,29 @@ import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; +import static java.lang.System.getLogger; + /** * ClipPlayer - * + *

    * This file is part of the Java Sound Examples. */ public class ClipPlayer implements LineListener { + + private static final Logger logger = getLogger(ClipPlayer.class.getName()); + private Clip m_clip; - /* - * The clip will be played nLoopCount + 1 times. + /** + * The clip will be played nLoopCount + 1 times. */ public ClipPlayer(File clipFile, int nLoopCount) { AudioInputStream audioInputStream = null; try { audioInputStream = AudioSystem.getAudioInputStream(clipFile); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (audioInputStream != null) { AudioFormat format = audioInputStream.getFormat(); @@ -55,27 +62,23 @@ public ClipPlayer(File clipFile, int nLoopCount) { m_clip = (Clip) AudioSystem.getLine(info); m_clip.addLineListener(this); m_clip.open(audioInputStream); - } catch (LineUnavailableException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); + } catch (LineUnavailableException | IOException e) { + logger.log(Level.ERROR, e.getMessage(), e); } m_clip.loop(nLoopCount); } else { - System.out.println("ClipPlayer.(): can't get data from file " + - clipFile.getName()); + System.out.println("ClipPlayer.(): can't get data from file " + clipFile.getName()); } } + @Override public void update(LineEvent event) { if (event.getType().equals(LineEvent.Type.STOP)) { m_clip.close(); } else if (event.getType().equals(LineEvent.Type.CLOSE)) { - /* - * There is a bug in the jdk1.3.0. - * It prevents correct termination of the VM. - * So we have to exit ourselves. - */ + // There is a bug in the jdk1.3.0. + // It prevents correct termination of the VM. + // So we have to exit ourselves. System.exit(0); } } diff --git a/src/samples/java/jse/Convert.java b/src/samples/java/jse/Convert.java index ce016aa..b37dd3d 100644 --- a/src/samples/java/jse/Convert.java +++ b/src/samples/java/jse/Convert.java @@ -20,17 +20,18 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + public class Convert { - /** - * Flag for debugging messages. If true, some messages are dumped to the - * console during operation. - */ - private static final boolean DEBUG = false; + + private static final Logger logger = getLogger(Convert.class.getName()); public static void main(String[] args) { if (args.length == 1) { @@ -60,7 +61,7 @@ public static void main(String[] args) { try { ais = AudioSystem.getAudioInputStream(file); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (ais == null) { System.out.println("cannot open audio file"); @@ -74,19 +75,15 @@ public static void main(String[] args) { } else { strTargetFilename = strFilename.substring(0, nDotPos) + targetFileType.getExtension(); } - if (DEBUG) { - System.out.println("Target filename: " + strTargetFilename); - } + logger.log(Level.DEBUG, "Target filename: " + strTargetFilename); int nWrittenBytes = 0; try { nWrittenBytes = AudioSystem.write(ais, targetFileType, new File(strTargetFilename)); } catch (IOException e) { - e.printStackTrace(); - } - if (DEBUG) { - System.out.println("Written bytes: " + nWrittenBytes); + logger.log(Level.ERROR, e.getMessage(), e); } + logger.log(Level.DEBUG, "Written bytes: " + nWrittenBytes); } else // args.length != 3 { printUsageAndExit(); @@ -103,17 +100,17 @@ private static void printUsageAndExit() { private static void listPossibleTargetTypes() { AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes(); System.out.print("Supported target types:"); - for (int i = 0; i < aTypes.length; i++) { - System.out.print(" " + aTypes[i].getExtension()); + for (AudioFileFormat.Type aType : aTypes) { + System.out.print(" " + aType.getExtension()); } System.out.print("\n"); } private static AudioFileFormat.Type findTargetType(String strExtension) { AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes(); - for (int i = 0; i < aTypes.length; i++) { - if (aTypes[i].getExtension().equals(strExtension)) { - return aTypes[i]; + for (AudioFileFormat.Type aType : aTypes) { + if (aType.getExtension().equals(strExtension)) { + return aType; } } return null; diff --git a/src/samples/java/jse/CookieCadence.java b/src/samples/java/jse/CookieCadence.java index 89d22b9..d4c6142 100644 --- a/src/samples/java/jse/CookieCadence.java +++ b/src/samples/java/jse/CookieCadence.java @@ -1,9 +1,3 @@ -package jse; -/* - * CookieCadence.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 2000 by Matthias Pfisterer * @@ -23,8 +17,13 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiEvent; import javax.sound.midi.MidiSystem; @@ -32,11 +31,21 @@ import javax.sound.midi.ShortMessage; import javax.sound.midi.Track; +import static java.lang.System.getLogger; + -// IDEA: if filename is omitted, play it instantly. +/** + * CookieCadence.java + *

    + * This file is part of the Java Sound Examples. + * IDEA: if filename is omitted, play it instantly. + */ public class CookieCadence { - /* - * This velocity is used for all notes. + + private static final Logger logger = getLogger(CookieCadence.class.getName()); + + /** + * This velocity is used for all notes. */ private static final int VELOCITY = 127; @@ -52,7 +61,7 @@ public static void main(String[] args) { try { sequence = new Sequence(Sequence.PPQ, 500000); } catch (InvalidMidiDataException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -69,13 +78,11 @@ public static void main(String[] args) { try { MidiSystem.write(sequence, 0, new File(strFilename)); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * This is only necessary because of a bug in the Sun jdk1.3/1.4 - */ + // This is only necessary because of a bug in the Sun jdk1.3/1.4 System.exit(0); } @@ -87,14 +94,12 @@ private static MidiEvent createNoteOffEvent(int nKey, long lTick) { return createNoteEvent(ShortMessage.NOTE_OFF, nKey, 0, lTick); } - private static MidiEvent createNoteEvent(int nCommand, int nKey, - int nVelocity, long lTick) { + private static MidiEvent createNoteEvent(int nCommand, int nKey, int nVelocity, long lTick) { ShortMessage message = new ShortMessage(); try { - message.setMessage(nCommand, 0, // always on channel 1 - nKey, nVelocity); + message.setMessage(nCommand, 0, /* always on channel 1 */ nKey, nVelocity); } catch (InvalidMidiDataException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } diff --git a/src/samples/java/jse/DecodingAudioPlayer.java b/src/samples/java/jse/DecodingAudioPlayer.java index 60b6570..c008889 100644 --- a/src/samples/java/jse/DecodingAudioPlayer.java +++ b/src/samples/java/jse/DecodingAudioPlayer.java @@ -1,9 +1,3 @@ -package jse; -/* - * DecodingAudioPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,15 +17,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; +import static java.lang.System.getLogger; + /* +DocBookXML Playing an encoded audio file @@ -83,7 +83,16 @@ -DocBookXML */ + +/** + * DecodingAudioPlayer.java + *

    + * This file is part of the Java Sound Examples. + */ public class DecodingAudioPlayer { + + private static final Logger logger = getLogger(DecodingAudioPlayer.class.getName()); + private static final int EXTERNAL_BUFFER_SIZE = 128000; public static void main(String[] args) { @@ -97,7 +106,7 @@ public static void main(String[] args) { try { audioInputStream = AudioSystem.getAudioInputStream(new File(strFilename)); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (audioInputStream == null) { System.out.println("### cannot read input file: " + strFilename); @@ -105,21 +114,19 @@ public static void main(String[] args) { AudioFormat sourceFormat = audioInputStream.getFormat(); -/* - AudioFormat targetFormat = new AudioFormat( - AudioFormat.Encoding.PCM_SIGNED, - sourceFormat.getSampleRate(), - 16, - sourceFormat.getChannels(), - sourceFormat.getChannels() * 2, - sourceFormat.getSampleRate(), - false); -*/ +// AudioFormat targetFormat = new AudioFormat( +// AudioFormat.Encoding.PCM_SIGNED, +// sourceFormat.getSampleRate(), +// 16, +// sourceFormat.getChannels(), +// sourceFormat.getChannels() * 2, +// sourceFormat.getSampleRate(), +// false); + AudioFormat.Encoding targetEncoding = AudioFormat.Encoding.PCM_SIGNED; - // audioInputStream = AudioSystem.getAudioInputStream(targetFormat, audioInputStream); - audioInputStream = AudioSystem.getAudioInputStream(targetEncoding, - audioInputStream); +// audioInputStream = AudioSystem.getAudioInputStream(targetFormat, audioInputStream); + audioInputStream = AudioSystem.getAudioInputStream(targetEncoding, audioInputStream); AudioFormat audioFormat = audioInputStream.getFormat(); @@ -128,10 +135,8 @@ public static void main(String[] args) { try { line = (SourceDataLine) AudioSystem.getLine(info); line.open(audioFormat); - } catch (LineUnavailableException e) { - e.printStackTrace(); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } line.start(); @@ -140,7 +145,7 @@ public static void main(String[] args) { try { nBytesRead = audioInputStream.read(abData, 0, abData.length); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (nBytesRead >= 0) { int nBytesWritten = line.write(abData, 0, nBytesRead); diff --git a/src/samples/java/jse/DirectRecordingStream.java b/src/samples/java/jse/DirectRecordingStream.java index cca9da0..30db51b 100644 --- a/src/samples/java/jse/DirectRecordingStream.java +++ b/src/samples/java/jse/DirectRecordingStream.java @@ -1,9 +1,3 @@ -package jse; -/* - * DirectRecordingStream.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,68 +17,70 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + +import java.io.File; import java.io.IOException; import java.io.OutputStream; -import java.io.File; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.TargetDataLine; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; +import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.TargetDataLine; +import static java.lang.System.getLogger; -/* - TODO: + +/** + * DirectRecordingStream.java + *

    + * This file is part of the Java Sound Examples. + * TODO: */ public class DirectRecordingStream extends Thread { + + private static final Logger logger = getLogger(DirectRecordingStream.class.getName()); + private TargetDataLine m_line; private AudioFileFormat.Type m_targetType; private AudioInputStream m_audioInputStream; private Object m_outputObject; private boolean m_bRecording; - public DirectRecordingStream(AudioFormat audioFormat, - AudioFileFormat.Type targetType, - OutputStream outputStream) - throws LineUnavailableException { + public DirectRecordingStream(AudioFormat audioFormat, AudioFileFormat.Type targetType, OutputStream outputStream) + throws LineUnavailableException { this(audioFormat, targetType, (Object) outputStream); } - public DirectRecordingStream(AudioFormat audioFormat, - AudioFileFormat.Type targetType, File file) - throws LineUnavailableException { + public DirectRecordingStream(AudioFormat audioFormat, AudioFileFormat.Type targetType, File file) + throws LineUnavailableException { this(audioFormat, targetType, (Object) file); } - private DirectRecordingStream(AudioFormat audioFormat, - AudioFileFormat.Type targetType, - Object destination) - throws LineUnavailableException { + private DirectRecordingStream(AudioFormat audioFormat, AudioFileFormat.Type targetType, Object destination) + throws LineUnavailableException { TargetDataLine line = getTargetDataLine(audioFormat); init(line, targetType, destination); } - public DirectRecordingStream(TargetDataLine line, - AudioFileFormat.Type targetType, - OutputStream outputStream) { + public DirectRecordingStream(TargetDataLine line, AudioFileFormat.Type targetType, OutputStream outputStream) { this(line, targetType, (Object) outputStream); } - public DirectRecordingStream(TargetDataLine line, - AudioFileFormat.Type targetType, File file) { + public DirectRecordingStream(TargetDataLine line, AudioFileFormat.Type targetType, File file) { this(line, targetType, (Object) file); } - private DirectRecordingStream(TargetDataLine line, - AudioFileFormat.Type targetType, - Object destination) { + private DirectRecordingStream(TargetDataLine line, AudioFileFormat.Type targetType, Object destination) { init(line, targetType, destination); } - private static TargetDataLine getTargetDataLine(AudioFormat audioFormat) - throws LineUnavailableException { + private static TargetDataLine getTargetDataLine(AudioFormat audioFormat) throws LineUnavailableException { DataLine.Info info = new DataLine.Info(TargetDataLine.class, audioFormat); TargetDataLine line = null; line = (TargetDataLine) AudioSystem.getLine(info); @@ -92,18 +88,19 @@ private static TargetDataLine getTargetDataLine(AudioFormat audioFormat) return line; } - private void init(TargetDataLine line, AudioFileFormat.Type targetType, - Object destination) { + private void init(TargetDataLine line, AudioFileFormat.Type targetType, Object destination) { m_line = line; m_audioInputStream = new AudioInputStream(line); m_targetType = targetType; m_outputObject = destination; } - /** Starts the recording. - * To accomplish this, (i) the line is started and (ii) the - * thread is started. + /** + * Starts the recording. + * To accomplish this, (i) the line is started and (ii) the + * thread is started. */ + @Override public void start() { m_line.start(); super.start(); @@ -115,20 +112,19 @@ public void stopRecording() { m_bRecording = false; } + @Override public void run() { if (m_outputObject instanceof File) { try { - AudioSystem.write(m_audioInputStream, m_targetType, - (File) m_outputObject); + AudioSystem.write(m_audioInputStream, m_targetType, (File) m_outputObject); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } else if (m_outputObject instanceof OutputStream) { try { - AudioSystem.write(m_audioInputStream, m_targetType, - (OutputStream) m_outputObject); + AudioSystem.write(m_audioInputStream, m_targetType, (OutputStream) m_outputObject); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } else { // TODO: error diff --git a/src/samples/java/jse/DumpReceiver.java b/src/samples/java/jse/DumpReceiver.java index 7b5569c..d62d472 100644 --- a/src/samples/java/jse/DumpReceiver.java +++ b/src/samples/java/jse/DumpReceiver.java @@ -25,21 +25,25 @@ * Ave, Cambridge, MA 02139, USA. * */ -import java.io.PrintStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.MetaMessage; import javax.sound.midi.MidiMessage; import javax.sound.midi.Receiver; import javax.sound.midi.ShortMessage; import javax.sound.midi.SysexMessage; +import static java.lang.System.getLogger; + /** * Receiver that outputs MIDI events as text. */ public class DumpReceiver implements Receiver { - private static final boolean DEBUG = false; - private static boolean sm_bPrintRawData = true; + private static final Logger logger = getLogger(DumpReceiver.class.getName()); + + private static final boolean sm_bPrintRawData = true; private static final String[] sm_astrKeyNames = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" @@ -192,65 +196,46 @@ public class DumpReceiver implements Receiver { null, // 0x7F, real-time universal }; - private PrintStream m_printStream; - - private boolean m_bDebug; - - private boolean m_bPrintTimeStampAsTicks; - - public DumpReceiver(PrintStream printStream) { - this(printStream, false); - } - - public DumpReceiver(PrintStream printStream, boolean bPrintTimeStampAsTicks) { - m_printStream = printStream; - m_bDebug = false; - m_bPrintTimeStampAsTicks = bPrintTimeStampAsTicks; - } - + @Override public void close() { // DO NOTHING } + @Override public void send(MidiMessage message, long lTimeStamp) { - if (DEBUG) { - m_printStream.println("DumpReceiver.send(): called"); - m_printStream.println("Class of Message: " + message.getClass().getName()); - } + logger.log(Level.DEBUG, "DumpReceiver.send(): called"); + logger.log(Level.DEBUG, "Class of Message: " + message.getClass().getName()); + if (sm_bPrintRawData) { - m_printStream.print("["); + logger.log(Level.DEBUG, "["); byte[] abData = message.getMessage(); int nLength = message.getLength(); - m_printStream.print(getHexString(abData, 0, nLength)); - m_printStream.println("] "); + logger.log(Level.DEBUG, getHexString(abData, 0, nLength)); + logger.log(Level.DEBUG, "] "); } - String strMessage = null; - if (message instanceof ShortMessage) { - strMessage = decodeMessage((ShortMessage) message); - } else if (message instanceof SysexMessage) { - strMessage = decodeMessage((SysexMessage) message); - } else if (message instanceof MetaMessage) { - strMessage = decodeMessage((MetaMessage) message); - } else { - strMessage = "unknown message type"; - } + String strMessage = switch (message) { + case ShortMessage shortMessage -> decodeMessage(shortMessage); + case SysexMessage sysexMessage -> decodeMessage(sysexMessage); + case MetaMessage metaMessage -> decodeMessage(metaMessage); + default -> "unknown message type"; + }; String strTimeStamp = null; - if (m_bPrintTimeStampAsTicks) { +// if (m_bPrintTimeStampAsTicks) { strTimeStamp = "tick " + lTimeStamp + ": "; - } else { - if (lTimeStamp == -1L) { - strTimeStamp = "timestamp [unknown]: "; - } else { - strTimeStamp = "timestamp " + lTimeStamp + " : "; - } - } - m_printStream.println(strTimeStamp + strMessage); +// } else { +// if (lTimeStamp == -1L) { +// strTimeStamp = "timestamp [unknown]: "; +// } else { +// strTimeStamp = "timestamp " + lTimeStamp + " : "; +// } +// } + logger.log(Level.DEBUG, strTimeStamp + strMessage); } - private String decodeMessage(ShortMessage message) { + private static String decodeMessage(ShortMessage message) { String strMessage = null; switch (message.getCommand()) { case 0x80: @@ -315,29 +300,25 @@ private String decodeMessage(SysexMessage message) { byte[] abData = message.getData(); String strMessage = null; - // System.out.println("sysex status: " + message.getStatus()); +// logger.log(Level.DEBUG, "sysex status: " + message.getStatus()); if (message.getStatus() == SysexMessage.SYSTEM_EXCLUSIVE) { strMessage = "Sysex message (F0): "; int nManufacturer = abData[0]; int nStart = 1; - if (nManufacturer == 0x7E) // non real-time universal - { + if (nManufacturer == 0x7E) { // non real-time universal strMessage += "[non real-time universal] (7E) "; strMessage += getHexString(abData, nStart, abData.length - nStart); - } else if (nManufacturer == 0x7F) // real-time universal - { + } else if (nManufacturer == 0x7F) { // real-time universal strMessage += "[real-time universal] (7F) "; strMessage += getHexString(abData, nStart, abData.length - nStart); - } else if (nManufacturer == 0) // three byte manufacturer id - { - // strMessage += MANUFACTURER_ID_THREE_BYTE[/*nManufacturer*/] + - // " (" + getHexString(abData, nStart - 1, 1) + ") "; + } else if (nManufacturer == 0) { // three byte manufacturer id +// strMessage += MANUFACTURER_ID_THREE_BYTE[/*nManufacturer*/]+ +// " (" + getHexString(abData, nStart - 1, 1) + ") "; strMessage += ("[three byte manufacturer code]" + " (" + getHexString(abData, nStart - 1, 3) + ") "); nStart += 2; strMessage += getHexString(abData, nStart, abData.length - nStart); - } else // one byte manufacturer id - { + } else { // one byte manufacturer id strMessage += MANUFACTURER_ID_ONE_BYTE[nManufacturer]; strMessage += (" (" + getHexString(abData, nStart - 1, 1) + ") "); if (nManufacturer == 0x43) { @@ -345,8 +326,7 @@ private String decodeMessage(SysexMessage message) { } else { strMessage += decodeSysexData(abData, nStart); - // strMessage += getHexString(abData, nStart, abData.length - // - nStart); +// strMessage += getHexString(abData, nStart, abData.length - nStart); } } } else if (message.getStatus() == SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE) { @@ -355,7 +335,7 @@ private String decodeMessage(SysexMessage message) { return strMessage; } - private String decodeSysexData(byte[] abData, int nStart) { + private static String decodeSysexData(byte[] abData, int nStart) { String strData = null; if (abData[abData.length - 1] == SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE) { strData = getHexString(abData, nStart, abData.length - nStart - 1) + "EOX (F7)"; @@ -368,40 +348,36 @@ private String decodeSysexData(byte[] abData, int nStart) { private String decodeYamahaSysexData(byte[] abData, int nStart) { return decodeSysexData(abData, nStart); - // String strData = null; - // strData = "device " + (abData[nStart + 0] + 1); - // switch (abData[nStart + 1]) - // { - // case 0x4B: - // strData += " CS1x"; - // break; - // case 0x4C: - // strData += " MU-80"; // or does it mean XG? - // break; - // default: - // strData += " unknown model"; - // } - // // byte 2,3,4: address - // // byte 5: data - // strData += " " + abData[nStart + 5]; - // if (abData[nStart + 6] == SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE) - // { - // strData += " EOX"; - // } - // else - // { - // strData += " [unknown data format, expected EOX]"; - // } - // return strData; +// String strData = null; +// strData = "device " + (abData[nStart + 0] + 1); +// switch (abData[nStart + 1]) { +// case 0x4B: +// strData += " CS1x"; +// break; +// case 0x4C: +// strData += " MU-80"; // or does it mean XG? +// break; +// default: +// strData += " unknown model"; +// } +// // byte 2,3,4: address +// // byte 5: data +// strData += " " + abData[nStart + 5]; +// if (abData[nStart + 6] == SysexMessage.SPECIAL_SYSTEM_EXCLUSIVE) { +// strData += " EOX"; +// } else { +// strData += " [unknown data format, expected EOX]"; +// } +// return strData; } - private String decodeMessage(MetaMessage message) { + private static String decodeMessage(MetaMessage message) { byte[] abMessage = message.getMessage(); byte[] abData = message.getData(); int nDataLength = message.getLength(); String strMessage = null; - // System.out.println("data array length: " + abData.length); +// logger.log(Level.DEBUG, "data array length: " + abData.length); switch (message.getType()) { case 0: @@ -453,20 +429,20 @@ private String decodeMessage(MetaMessage message) { break; case 0x51: - // int nTempo = signedByteToUnsigned(abData[0]) * 65536 + - // signedByteToUnsigned(abData[1]) * 256 + - // signedByteToUnsigned(abData[2]); - // strMessage = "Set Tempo (1s/quarter note): " + nTempo; +// int nTempo = signedByteToUnsigned(abData[0]) * 65536 + +// signedByteToUnsigned(abData[1]) * 256 + +// signedByteToUnsigned(abData[2]); +// strMessage = "Set Tempo (1s/quarter note): " + nTempo; int nTempo = ((abData[0] & 0xFF) << 16) | ((abData[1] & 0xFF) << 8) | (abData[2] & 0xFF); // tempo in microseconds per beat float bpm = convertTempo(nTempo); // truncate it to 2 digits after point - bpm = (Math.round(nTempo * 100) / 100.0f); + bpm = Math.round((nTempo * 100) / 100.0f); strMessage = "Set Tempo: " + bpm + " bpm"; break; case 0x54: - // System.out.println("data array length: " + abData.length); +// System.out.println("data array length: " + abData.length); strMessage = "SMTPE Offset: " + (abData[0] & 0xFF) + ":" + (abData[1] & 0xFF) + ":" + (abData[2] & 0xFF) + "." + (abData[3] & 0xFF) + "." + (abData[4] & 0xFF); break; case 0x58: @@ -531,7 +507,7 @@ private static String getHexString(byte[] aByte) { * TODO: */ private static String getHexString(byte[] aByte, int nStart, int nLength) { - StringBuffer sbuf = new StringBuffer((aByte.length * 3) + 2); + StringBuilder sbuf = new StringBuilder((aByte.length * 3) + 2); for (int i = nStart; i < nLength; i++) { sbuf.append(' '); diff --git a/src/samples/java/jse/DumpSequence.java b/src/samples/java/jse/DumpSequence.java index c836185..6beb8d8 100644 --- a/src/samples/java/jse/DumpSequence.java +++ b/src/samples/java/jse/DumpSequence.java @@ -27,6 +27,8 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiEvent; import javax.sound.midi.MidiMessage; @@ -35,8 +37,10 @@ import javax.sound.midi.Sequence; import javax.sound.midi.Track; +import static java.lang.System.getLogger; -/** + +/* * +DocBookXML Displaying the content of a MIDI file * * Purpose Dumps the decoded content of a MIDI file to the console. @@ -58,12 +62,19 @@ * * -DocBookXML */ + +/** + * DumpSequence. + */ public class DumpSequence { - private static String[] sm_astrKeyNames = { + + private static final Logger logger = getLogger(DumpSequence.class.getName()); + + private static final String[] sm_astrKeyNames = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; - private static Receiver sm_receiver = new DumpReceiver(System.out, true); + private static final Receiver sm_receiver = new DumpReceiver(); public static void main(String[] args) { /* @@ -87,11 +98,8 @@ public static void main(String[] args) { Sequence sequence = null; try { sequence = MidiSystem.getSequence(midiFile); - } catch (InvalidMidiDataException e) { - e.printStackTrace(); - System.exit(1); - } catch (IOException e) { - e.printStackTrace(); + } catch (InvalidMidiDataException | IOException e) { + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } diff --git a/src/samples/java/jse/GSMEncoder.java b/src/samples/java/jse/GSMEncoder.java index 1cf9376..39a1468 100644 --- a/src/samples/java/jse/GSMEncoder.java +++ b/src/samples/java/jse/GSMEncoder.java @@ -22,6 +22,8 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -29,8 +31,8 @@ import org.tritonus.share.sampled.AudioFileTypes; import org.tritonus.share.sampled.Encodings; +import static java.lang.System.getLogger; -// TODO: try a single conversion to 8kHz, 16 bit linear signed, mono /* +DocBookXML Encoding an audio file to GSM 06.10 @@ -93,8 +95,12 @@ * GSMEncoder.java * * This file is part of the Java Sound Examples. + * TODO: try a single conversion to 8kHz, 16 bit linear signed, mono */ public class GSMEncoder { + + private static final Logger logger = getLogger(GSMEncoder.class.getName()); + public static void main(String[] args) { if (args.length != 2) { printUsageAndExit(); @@ -106,7 +112,7 @@ public static void main(String[] args) { try { ais = AudioSystem.getAudioInputStream(pcmFile); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (ais == null) { System.out.println("cannot open audio file"); @@ -121,7 +127,7 @@ public static void main(String[] args) { try { nWrittenFrames = AudioSystem.write(gsmAIS, fileType, gsmFile); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } diff --git a/src/samples/java/jse/MidiConverter.java b/src/samples/java/jse/MidiConverter.java index 4c708c0..fea1428 100644 --- a/src/samples/java/jse/MidiConverter.java +++ b/src/samples/java/jse/MidiConverter.java @@ -21,11 +21,15 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiSystem; import javax.sound.midi.Sequence; import javax.sound.midi.Track; +import static java.lang.System.getLogger; + /* +DocBookXML Converting MIDI type 1 files to MIDI type 0 files @@ -98,6 +102,9 @@ selects single mode (default) * This file is part of the Java Sound Examples. */ public class MidiConverter { + + private static final Logger logger = getLogger(MidiConverter.class.getName()); + public static void main(String[] args) { if (args.length != 2) { System.out.println("usage:"); @@ -114,19 +121,16 @@ public static void main(String[] args) { bUseMultiMode = true; } else if (args[0].equals("-s")) { bUseMultiMode = false; -// } else { -// System.out.println("You have to specify either single mode (-s) or multi mode (-m)."); -// System.exit(1); +// } else { +// System.out.println("You have to specify either single mode (-s) or multi mode (-m)."); +// System.exit(1); } String strFilename = args[1]; Sequence sequence = null; try { sequence = MidiSystem.getSequence(new File(strFilename)); - } catch (InvalidMidiDataException e) { - e.printStackTrace(); - System.exit(1); - } catch (IOException e) { - e.printStackTrace(); + } catch (InvalidMidiDataException | IOException e) { + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -144,7 +148,7 @@ public static void main(String[] args) { try { singleTrackSequence = new Sequence(fDivisionType, nResolution); } catch (InvalidMidiDataException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -161,15 +165,15 @@ public static void main(String[] args) { strSingleTrackFilename = strFilename.substring(0, nDotPosition) + "-" + nTrack + strFilename.substring(nDotPosition); } -// MidiFileFormat fileFormat = new MidiFileFormat(0, fDivisionType, nResolution, MidiFileFormat.UNKNOWN_LENGTH, MidiFileFormat.UNKNOWN_LENGTH); +// MidiFileFormat fileFormat = new MidiFileFormat(0, fDivisionType, nResolution, MidiFileFormat.UNKNOWN_LENGTH, MidiFileFormat.UNKNOWN_LENGTH); try { MidiSystem.write(singleTrackSequence, 0, new File(strSingleTrackFilename)); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } } - } else { // single mode + } else { } // This is only necessary because of a bug in jdk1.3. diff --git a/src/samples/java/jse/MidiDestinationListModel.java b/src/samples/java/jse/MidiDestinationListModel.java index 04657f6..8ac144d 100644 --- a/src/samples/java/jse/MidiDestinationListModel.java +++ b/src/samples/java/jse/MidiDestinationListModel.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiDestinationListModel.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 2000 by Matthias Pfisterer * @@ -23,6 +17,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiDevice; import javax.sound.midi.MidiUnavailableException; @@ -31,20 +30,32 @@ import javax.swing.AbstractListModel; import javax.swing.ListSelectionModel; +import static java.lang.System.getLogger; + + +/** + * MidiDestinationListModel.java + * + * This file is part of the Java Sound Examples. + */ +public class MidiDestinationListModel extends AbstractListModel { + + private static final Logger logger = getLogger(MidiDestinationListModel.class.getName()); -public class MidiDestinationListModel extends AbstractListModel { - private MidiDevice m_source; - private MidiDevice.Info[] m_aDestinationInfos; + private final MidiDevice m_source; + private final MidiDevice.Info[] m_aDestinationInfos; public MidiDestinationListModel(MidiDevice source) { m_source = source; m_aDestinationInfos = MidiSystem.getMidiDeviceInfo(); } + @Override public int getSize() { return m_aDestinationInfos.length; } + @Override public Object getElementAt(int nIndex) { return m_aDestinationInfos[nIndex].getName(); } @@ -70,7 +81,7 @@ private void setConnection(int nDestinationIndex) { Transmitter transmitter = m_source.getTransmitter(); transmitter.setReceiver(receiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } } diff --git a/src/samples/java/jse/MidiFileInfo.java b/src/samples/java/jse/MidiFileInfo.java index 8a1cd7d..13447d1 100644 --- a/src/samples/java/jse/MidiFileInfo.java +++ b/src/samples/java/jse/MidiFileInfo.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiFileInfo.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,13 +17,20 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.InputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.net.URL; import javax.sound.midi.MidiFileFormat; import javax.sound.midi.MidiSystem; import javax.sound.midi.Sequence; +import static java.lang.System.getLogger; + /* +DocBookXML Getting information about a MIDI file @@ -97,7 +98,16 @@ MIDI file type, division type, timing resolution, length (in ticks) -DocBookXML */ + +/** + * MidiFileInfo.java + *

    + * This file is part of the Java Sound Examples. + */ public class MidiFileInfo { + + private static final Logger logger = getLogger(MidiFileInfo.class.getName()); + private static final int LOAD_METHOD_STREAM = 1; private static final int LOAD_METHOD_FILE = 2; private static final int LOAD_METHOD_URL = 3; @@ -111,16 +121,12 @@ public static void main(String[] args) { boolean bCheckSequence = false; int nCurrentArg = 0; while (nCurrentArg < args.length) { - if (args[nCurrentArg].equals("-h")) { - printUsageAndExit(); - } else if (args[nCurrentArg].equals("-s")) { - nLoadMethod = LOAD_METHOD_STREAM; - } else if (args[nCurrentArg].equals("-f")) { - nLoadMethod = LOAD_METHOD_FILE; - } else if (args[nCurrentArg].equals("-u")) { - nLoadMethod = LOAD_METHOD_URL; - } else if (args[nCurrentArg].equals("-i")) { - bCheckSequence = true; + switch (args[nCurrentArg]) { + case "-h" -> printUsageAndExit(); + case "-s" -> nLoadMethod = LOAD_METHOD_STREAM; + case "-f" -> nLoadMethod = LOAD_METHOD_FILE; + case "-u" -> nLoadMethod = LOAD_METHOD_URL; + case "-i" -> bCheckSequence = true; } nCurrentArg++; @@ -132,36 +138,36 @@ public static void main(String[] args) { Sequence sequence = null; try { switch (nLoadMethod) { - case LOAD_METHOD_STREAM: - - InputStream inputStream = System.in; - fileFormat = MidiSystem.getMidiFileFormat(inputStream); - strFilename = ""; - if (bCheckSequence) { - sequence = MidiSystem.getSequence(inputStream); - } - break; - case LOAD_METHOD_FILE: - - File file = new File(strSource); - fileFormat = MidiSystem.getMidiFileFormat(file); - strFilename = file.getCanonicalPath(); - if (bCheckSequence) { - sequence = MidiSystem.getSequence(file); - } - break; - case LOAD_METHOD_URL: - - URL url = new URL(strSource); - fileFormat = MidiSystem.getMidiFileFormat(url); - strFilename = url.toString(); - if (bCheckSequence) { - sequence = MidiSystem.getSequence(url); - } - break; + case LOAD_METHOD_STREAM: + + InputStream inputStream = System.in; + fileFormat = MidiSystem.getMidiFileFormat(inputStream); + strFilename = ""; + if (bCheckSequence) { + sequence = MidiSystem.getSequence(inputStream); + } + break; + case LOAD_METHOD_FILE: + + File file = new File(strSource); + fileFormat = MidiSystem.getMidiFileFormat(file); + strFilename = file.getCanonicalPath(); + if (bCheckSequence) { + sequence = MidiSystem.getSequence(file); + } + break; + case LOAD_METHOD_URL: + + URL url = new URL(strSource); + fileFormat = MidiSystem.getMidiFileFormat(url); + strFilename = url.toString(); + if (bCheckSequence) { + sequence = MidiSystem.getSequence(url); + } + break; } } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -198,11 +204,11 @@ public static void main(String[] args) { strResolutionType = " ticks per frame"; } System.out.println("Resolution: " + fileFormat.getResolution() + - strResolutionType); + strResolutionType); String strFileLength = null; if (fileFormat.getByteLength() != MidiFileFormat.UNKNOWN_LENGTH) { - strFileLength = "" + fileFormat.getByteLength() + " bytes"; + strFileLength = fileFormat.getByteLength() + " bytes"; } else { strFileLength = "unknown"; } @@ -210,8 +216,8 @@ public static void main(String[] args) { String strDuration = null; if (fileFormat.getMicrosecondLength() != MidiFileFormat.UNKNOWN_LENGTH) { - strDuration = "" + fileFormat.getMicrosecondLength() + - " microseconds)"; + strDuration = fileFormat.getMicrosecondLength() + + " microseconds)"; } else { strDuration = "unknown"; } @@ -219,8 +225,8 @@ public static void main(String[] args) { if (bCheckSequence) { System.out.println("[Sequence says:] Length: " + - sequence.getTickLength() + " ticks (= " + - sequence.getMicrosecondLength() + " us)"); + sequence.getTickLength() + " ticks (= " + + sequence.getMicrosecondLength() + " us)"); } System.out.println("---------------------------------------------------------------------------"); } diff --git a/src/samples/java/jse/MidiInDump.java b/src/samples/java/jse/MidiInDump.java index b291e90..a46227c 100644 --- a/src/samples/java/jse/MidiInDump.java +++ b/src/samples/java/jse/MidiInDump.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiInDump.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -22,18 +16,22 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -import javax.sound.midi.Transmitter; -import javax.sound.midi.Receiver; -import javax.sound.midi.MidiUnavailableException; + +package jse; + +import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.MidiDevice; import javax.sound.midi.MidiSystem; -import java.io.IOException; +import javax.sound.midi.MidiUnavailableException; +import javax.sound.midi.Receiver; +import javax.sound.midi.Transmitter; -/* If the compilation fails because this class is not available, - get gnu.getopt from the URL given in the comment below. -*/ import gnu.getopt.Getopt; +import static java.lang.System.getLogger; + /* +DocBookXML Listens to a MIDI port and dump the received event to the console @@ -84,56 +82,50 @@ reads from named device (see ) + * This file is part of the Java Sound Examples. + */ public class MidiInDump { - /** Flag for debugging messages. - If true, some messages are dumped to the console - during operation. - */ - private static boolean DEBUG = true; + + private static final Logger logger = getLogger(MidiInDump.class.getName()); public static void main(String[] args) { try { - /* - * The device name to listen to. - */ + // The device name to listen to. String strDeviceName = null; - /* - * Parsing of command-line options takes place... - */ + // Parsing of command-line options takes place... Getopt g = new Getopt("MidiInDump", args, "hld:D"); int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 'l': - listDevicesAndExit(); - case 'd': - strDeviceName = g.getOptarg(); - if (DEBUG) { - out("MidiInDump.main(): device name: " + strDeviceName); - } - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - out("MidiInDump.main(): getopt() returned " + c); - break; + case 'h': + printUsageAndExit(); + case 'l': + listDevicesAndExit(); + case 'd': + strDeviceName = g.getOptarg(); + logger.log(Level.DEBUG, "MidiInDump.main(): device name: " + strDeviceName); + break; + case '?': + printUsageAndExit(); + default: + logger.log(Level.DEBUG, "MidiInDump.main(): getopt() returned " + c); + break; } } if (strDeviceName == null) { - out("device name not specified!"); + logger.log(Level.DEBUG, "device name not specified!"); printUsageAndExit(); } MidiDevice.Info info = getMidiDeviceInfo(strDeviceName, false); if (info == null) { - out("no device info found for name " + strDeviceName); + logger.log(Level.DEBUG, "no device info found for name " + strDeviceName); System.exit(1); } @@ -142,25 +134,21 @@ public static void main(String[] args) { inputDevice = MidiSystem.getMidiDevice(info); inputDevice.open(); } catch (MidiUnavailableException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e); } if (inputDevice == null) { - out("wasn't able to retrieve MidiDevice"); + logger.log(Level.DEBUG, "wasn't able to retrieve MidiDevice"); System.exit(1); } - Receiver r = new DumpReceiver(System.out); + Receiver r = new DumpReceiver(); try { Transmitter t = inputDevice.getTransmitter(); t.setReceiver(r); } catch (MidiUnavailableException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e); } - out("now running; interupt the program with [ENTER] when finished"); + logger.log(Level.DEBUG, "now running; interupt the program with [ENTER] when finished"); try { System.in.read(); @@ -168,35 +156,33 @@ public static void main(String[] args) { } inputDevice.close(); -// out("Received "+((DumpReceiver) r).seCount+" sysex messages with a total of "+((DumpReceiver) r).seByteCount+" bytes"); -// out("Received "+((DumpReceiver) r).smCount+" short messages."); +// logger.log(Level.DEBUG, "Received "+((DumpReceiver) r).seCount+" sysex messages with a total of "+((DumpReceiver) r).seByteCount+" bytes"); +// logger.log(Level.DEBUG, "Received "+((DumpReceiver) r).smCount+" short messages."); try { Thread.sleep(1000); } catch (InterruptedException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e); } } catch (Throwable t) { - out(t); + logger.log(Level.DEBUG, t); } System.exit(0); } private static void printUsageAndExit() { - out("MidiInDump: usage:"); - out(" java MidiInDump -h"); - out(" gives help information"); - out(" java MidiInDump -l"); - out(" lists available MIDI devices"); - out(" java MidiInDump [-D] -d "); - out(" -d \treads from named device (see '-l')"); - out(" -D\tenables debugging output"); + System.err.println("MidiInDump: usage:"); + System.err.println(" java MidiInDump -h"); + System.err.println(" gives help information"); + System.err.println(" java MidiInDump -l"); + System.err.println(" lists available MIDI devices"); + System.err.println(" java MidiInDump [-D] -d "); + System.err.println(" -d \treads from named device (see '-l')"); + System.err.println(" -D\tenables debugging output"); System.exit(1); } private static void listDevicesAndExit() { - out("Available MIDI Devices:"); + logger.log(Level.DEBUG, "Available MIDI Devices:"); MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); for (int i = 0; i < aInfos.length; i++) { @@ -206,45 +192,43 @@ private static void listDevicesAndExit() { boolean bAllowsOutput = (device.getMaxReceivers() != 0); //if (bAllowsInput) { - out("" + i + " " + (bAllowsInput ? "IN " : " ") + - (bAllowsOutput ? "OUT " : " ") + - aInfos[i].getName() + ", " + aInfos[i].getVendor() + - ", " + aInfos[i].getVersion() + ", " + - aInfos[i].getDescription()); + logger.log(Level.DEBUG, i + " " + (bAllowsInput ? "IN " : " ") + + (bAllowsOutput ? "OUT " : " ") + + aInfos[i].getName() + ", " + aInfos[i].getVendor() + + ", " + aInfos[i].getVersion() + ", " + + aInfos[i].getDescription()); } } catch (MidiUnavailableException e) { - out(e); + logger.log(Level.DEBUG, e); } } if (aInfos.length == 0) { - out("[No devices available]"); + logger.log(Level.DEBUG, "[No devices available]"); } System.exit(1); } - /* - * This method tries to return a MidiDevice.Info whose name - * matches the passed name. If no matching MidiDevice.Info is - * found, null is returned. - * If forOutput is true, then only output devices are searched, - * otherwise only input devices. + /** + * This method tries to return a MidiDevice.Info whose name + * matches the passed name. If no matching MidiDevice.Info is + * found, null is returned. + * If forOutput is true, then only output devices are searched, + * otherwise only input devices. */ - private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, - boolean forOutput) { + private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean forOutput) { MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); - //out("Searching '"+strDeviceName+"' for "+(forOutput?"output":"input")); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strDeviceName)) { +// logger.log(Level.DEBUG, "Searching '" + strDeviceName + "' for " + (forOutput ? "output" : "input")); + for (MidiDevice.Info aInfo : aInfos) { + if (aInfo.getName().equals(strDeviceName)) { try { - MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]); + MidiDevice device = MidiSystem.getMidiDevice(aInfo); boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); - //out("Looking for at '"+aInfos[i].getName()+"' with "+dev.getMaxReceivers()+" receivers and "+dev.getMaxTransmitters()+" transmitters."); - if ((bAllowsOutput && forOutput) || - (bAllowsInput && !forOutput)) { - return aInfos[i]; +// logger.log(Level.DEBUG, "Looking for at '" + aInfos[i].getName() + "' with " + dev.getMaxReceivers() + " receivers and " + dev.getMaxTransmitters() + " transmitters."); + if ((bAllowsOutput && forOutput) || (bAllowsInput && !forOutput)) { + return aInfo; } } catch (MidiUnavailableException mue) { } @@ -252,12 +236,4 @@ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, } return null; } - - private static void out(String strMessage) { - System.out.println(strMessage); - } - - private static void out(Throwable t) { - t.printStackTrace(); - } } diff --git a/src/samples/java/jse/MidiLoop.java b/src/samples/java/jse/MidiLoop.java index a0d31e6..6ec6d02 100644 --- a/src/samples/java/jse/MidiLoop.java +++ b/src/samples/java/jse/MidiLoop.java @@ -101,9 +101,9 @@ public static void main(String[] args) { } MidiDevice inputDevice = MidiSystem.getMidiDevice(info); - out("opening input device '" + inDeviceName + "'..."); - inputDevice.open(); - try { + try (inputDevice) { + out("opening input device '" + inDeviceName + "'..."); + inputDevice.open(); out("getting output device '" + outDeviceName + "'..."); info = getMidiDeviceInfo(outDeviceName, true); if (info == null) { @@ -111,9 +111,9 @@ public static void main(String[] args) { } MidiDevice outputDevice = MidiSystem.getMidiDevice(info); - out("opening output device '" + outDeviceName + "'..."); - outputDevice.open(); - try { + try (outputDevice) { + out("opening output device '" + outDeviceName + "'..."); + outputDevice.open(); out("connecting input with output..."); inputDevice.getTransmitter().setReceiver(outputDevice.getReceiver()); @@ -121,16 +121,12 @@ public static void main(String[] args) { System.in.read(); } finally { out("Closing output device..."); - outputDevice.close(); } } finally { out("Closing input device..."); - inputDevice.close(); } - } catch (IOException ioe) { + } catch (IOException | MidiUnavailableException ioe) { out(ioe); - } catch (MidiUnavailableException mue) { - out(mue); } System.exit(0); } @@ -160,7 +156,7 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsInput && forInput) || (bAllowsOutput && forOutput)) { - out("" + i + " " + (bAllowsInput ? "IN " : " ") + + out(i + " " + (bAllowsInput ? "IN " : " ") + (bAllowsOutput ? "OUT " : " ") + aInfos[i].getName() + ", " + aInfos[i].getVendor() + ", " + aInfos[i].getVersion() + ", " + @@ -188,17 +184,17 @@ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); //out("Searching '"+strDeviceName+"' for "+(forOutput?"output":"input")); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strDeviceName)) { + for (MidiDevice.Info aInfo : aInfos) { + if (aInfo.getName().equals(strDeviceName)) { try { - MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]); + MidiDevice device = MidiSystem.getMidiDevice(aInfo); boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); //out("Looking for at '"+aInfos[i].getName()+"' with "+dev.getMaxReceivers()+" receivers and "+dev.getMaxTransmitters()+" transmitters."); if ((bAllowsOutput && forOutput) || - (bAllowsInput && !forOutput)) { - return aInfos[i]; + (bAllowsInput && !forOutput)) { + return aInfo; } } catch (MidiUnavailableException mue) { } diff --git a/src/samples/java/jse/MidiNote.java b/src/samples/java/jse/MidiNote.java index 3da3db7..1420b37 100644 --- a/src/samples/java/jse/MidiNote.java +++ b/src/samples/java/jse/MidiNote.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiNote.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -22,16 +16,20 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiDevice; -import javax.sound.midi.MidiMessage; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Receiver; import javax.sound.midi.ShortMessage; +import static java.lang.System.getLogger; -// TODO: an optional delay parameter that is added to getMicrosecondPosition to be used as timestamp for the event delivery. /* +DocBookXML Playing a note on a MIDI device @@ -83,12 +81,16 @@ -DocBookXML */ + +/** + * MidiNote.java + *

    + * This file is part of the Java Sound Examples. + * TODO: an optional delay parameter that is added to getMicrosecondPosition to be used as timestamp for the event delivery. + */ public class MidiNote { - /** Flag for debugging messages. - If true, some messages are dumped to the console - during operation. - */ - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(MidiNote.class.getName()); public static void main(String[] args) { try { @@ -98,11 +100,9 @@ public static void main(String[] args) { int nKey = 0; // MIDI key number int nVelocity = 0; - /* - * Time between note on and note off event in - * milliseconds. Note that on most systems, the - * best resolution you can expect are 10 ms. - */ + // Time between note on and note off event in + // milliseconds. Note that on most systems, the + // best resolution you can expect are 10 ms. int nDuration = 0; int nArgumentIndexOffset = 0; String strDeviceName = null; @@ -126,122 +126,102 @@ public static void main(String[] args) { if (strDeviceName != null) { MidiDevice.Info info = getMidiDeviceInfo(strDeviceName, true); if (info == null) { - out("no device info found for name " + strDeviceName); + logger.log(Level.DEBUG, "no device info found for name " + strDeviceName); System.exit(1); } try { outputDevice = MidiSystem.getMidiDevice(info); outputDevice.open(); } catch (MidiUnavailableException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e.getMessage(), e); } if (outputDevice == null) { - out("wasn't able to retrieve MidiDevice"); + logger.log(Level.DEBUG, "wasn't able to retrieve MidiDevice"); System.exit(1); } try { receiver = outputDevice.getReceiver(); } catch (MidiUnavailableException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e.getMessage(), e); } } else { - /* We retrieve a Receiver for the default - MidiDevice. - */ + // We retrieve a Receiver for the default + // MidiDevice. try { receiver = MidiSystem.getReceiver(); } catch (MidiUnavailableException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e.getMessage(), e); } } if (receiver == null) { - out("wasn't able to retrieve Receiver"); + logger.log(Level.DEBUG, "wasn't able to retrieve Receiver"); System.exit(1); } - /* Here, we prepare the MIDI messages to send. - Obviously, one is for turning the key on and - one for turning it off. - */ - MidiMessage onMessage = null; - MidiMessage offMessage = null; + // Here, we prepare the MIDI messages to send. + // Obviously, one is for turning the key on and + // one for turning it off. + ShortMessage onMessage = null; + ShortMessage offMessage = null; try { onMessage = new ShortMessage(); offMessage = new ShortMessage(); - ((ShortMessage) onMessage).setMessage(ShortMessage.NOTE_ON, - nChannel, nKey, nVelocity); - ((ShortMessage) offMessage).setMessage(ShortMessage.NOTE_OFF, - nChannel, nKey); + onMessage.setMessage(ShortMessage.NOTE_ON, + nChannel, nKey, nVelocity); + offMessage.setMessage(ShortMessage.NOTE_OFF, + nChannel, nKey); - /* test for SysEx messages */ + // test for SysEx messages - //byte[] data = { (byte) 0xF0, (byte) 0xF7, (byte) 0x99, 0x40, 0x7F, 0x40, 0x00 }; - //onMessage = new SysexMessage(); - //offMessage = new SysexMessage(); - //onMessage.setMessage(data, data.length); - //offMessage = (SysexMessage) onMessage.clone(); +// byte[] data = {(byte) 0xF0, (byte) 0xF7, (byte) 0x99, 0x40, 0x7F, 0x40, 0x00}; +// onMessage = new SysexMessage(); +// offMessage = new SysexMessage(); +// onMessage.setMessage(data, data.length); +// offMessage = (SysexMessage) onMessage.clone(); } catch (InvalidMidiDataException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e.getMessage(), e); } - /* - * Turn the note on - */ + // Turn the note on receiver.send(onMessage, -1); - /* - * Wait for the specified amount of time - * (the duration of the note). - */ + // Wait for the specified amount of time + // (the duration of the note). try { Thread.sleep(nDuration); } catch (InterruptedException e) { - if (DEBUG) { - out(e); - } + logger.log(Level.DEBUG, e.getMessage(), e); } - /* - * Turn the note off. - */ + // Turn the note off. receiver.send(offMessage, -1); - /* - * Clean up. - */ + // Clean up. receiver.close(); if (outputDevice != null) { outputDevice.close(); } } catch (Throwable t) { - out(t); + logger.log(Level.DEBUG, t); } System.exit(0); } private static void printUsageAndExit() { - out("MidiNote: usage:"); - out(" java MidiNote [] "); - out(" \toutput to named device"); - out(" -D\tenables debugging output"); + logger.log(Level.DEBUG, "MidiNote: usage:"); + logger.log(Level.DEBUG, " java MidiNote [] "); + logger.log(Level.DEBUG, " \toutput to named device"); + logger.log(Level.DEBUG, " -D\tenables debugging output"); System.exit(1); } private static void listDevicesAndExit(boolean forInput, boolean forOutput) { if (forInput && !forOutput) { - out("Available MIDI IN Devices:"); + logger.log(Level.DEBUG, "Available MIDI IN Devices:"); } else if (!forInput && forOutput) { - out("Available MIDI OUT Devices:"); + logger.log(Level.DEBUG, "Available MIDI OUT Devices:"); } else { - out("Available MIDI Devices:"); + logger.log(Level.DEBUG, "Available MIDI Devices:"); } MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); @@ -251,41 +231,40 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsInput && forInput) || (bAllowsOutput && forOutput)) { - out("" + i + " " + (bAllowsInput ? "IN " : " ") + - (bAllowsOutput ? "OUT " : " ") + - aInfos[i].getName() + ", " + aInfos[i].getVendor() + - ", " + aInfos[i].getVersion() + ", " + - aInfos[i].getDescription()); + logger.log(Level.DEBUG, i + " " + (bAllowsInput ? "IN " : " ") + + (bAllowsOutput ? "OUT " : " ") + + aInfos[i].getName() + ", " + aInfos[i].getVendor() + + ", " + aInfos[i].getVersion() + ", " + + aInfos[i].getDescription()); } } catch (MidiUnavailableException e) { // device is obviously not available... } } if (aInfos.length == 0) { - out("[No devices available]"); + logger.log(Level.DEBUG, "[No devices available]"); } System.exit(0); } - /* - * This method tries to return a MidiDevice.Info whose name - * matches the passed name. If no matching MidiDevice.Info is - * found, null is returned. - * If forOutput is true, then only output devices are searched, - * otherwise only input devices. + /** + * This method tries to return a MidiDevice.Info whose name + * matches the passed name. If no matching MidiDevice.Info is + * found, null is returned. + * If forOutput is true, then only output devices are searched, + * otherwise only input devices. */ - private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, - boolean forOutput) { + private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean forOutput) { MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strDeviceName)) { + for (MidiDevice.Info aInfo : aInfos) { + if (aInfo.getName().equals(strDeviceName)) { try { - MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]); + MidiDevice device = MidiSystem.getMidiDevice(aInfo); boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsOutput && forOutput) || - (bAllowsInput && !forOutput)) { - return aInfos[i]; + (bAllowsInput && !forOutput)) { + return aInfo; } } catch (MidiUnavailableException mue) { } @@ -293,12 +272,4 @@ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, } return null; } - - private static void out(String strMessage) { - System.out.println(strMessage); - } - - private static void out(Throwable t) { - t.printStackTrace(); - } } diff --git a/src/samples/java/jse/MidiPlayer.java b/src/samples/java/jse/MidiPlayer.java index 208367d..44d9560 100644 --- a/src/samples/java/jse/MidiPlayer.java +++ b/src/samples/java/jse/MidiPlayer.java @@ -19,28 +19,28 @@ package jse; -import gnu.getopt.Getopt; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import javax.sound.midi.ControllerEventListener; import javax.sound.midi.InvalidMidiDataException; -import javax.sound.midi.MetaEventListener; -import javax.sound.midi.MetaMessage; import javax.sound.midi.MidiDevice; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Receiver; import javax.sound.midi.Sequencer; -import javax.sound.midi.ShortMessage; import javax.sound.midi.Synthesizer; import javax.sound.midi.Transmitter; +import gnu.getopt.Getopt; + +import static java.lang.System.getLogger; + /* * +DocBookXML Playing a MIDI file (advanced) @@ -100,10 +100,8 @@ * This file is part of the Java Sound Examples. */ public class MidiPlayer { - /** - * If true, some messages are dumped to the console during operation. - */ - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(MidiPlayer.class.getName()); private static Sequencer sm_sequencer = null; @@ -159,55 +157,44 @@ public static void main(String[] args) { int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 'l': - listDevicesAndExit(false, true); - case 's': - bUseSynthesizer = true; - break; - case 'm': - bUseMidiPort = true; - break; - case 'd': - bUseDevice = true; - strDeviceName = g.getOptarg(); - if (DEBUG) { - System.out.println("MidiPlayer.main(): device name: " + strDeviceName); - } - break; - case 'c': - bUseConsoleDump = true; - break; - case 'S': - strSequencerName = g.getOptarg(); - if (DEBUG) { - System.out.println("MidiPlayer.main(): sequencer name: " + strSequencerName); - } - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - System.out.println("getopt() returned " + c); - break; + case 'h': + printUsageAndExit(); + case 'l': + listDevicesAndExit(false, true); + case 's': + bUseSynthesizer = true; + break; + case 'm': + bUseMidiPort = true; + break; + case 'd': + bUseDevice = true; + strDeviceName = g.getOptarg(); + logger.log(Level.DEBUG, "MidiPlayer.main(): device name: " + strDeviceName); + break; + case 'c': + bUseConsoleDump = true; + break; + case 'S': + strSequencerName = g.getOptarg(); + logger.log(Level.DEBUG, "MidiPlayer.main(): sequencer name: " + strSequencerName); + break; + case '?': + printUsageAndExit(); + default: + System.out.println("getopt() returned " + c); + break; } } - /* - * If no destination option is choosen at all, we default to playing on - * the internal synthesizer. - */ + // If no destination option is choosen at all, we default to playing on + // the internal synthesizer. if (!(bUseSynthesizer | bUseMidiPort | bUseDevice | bUseConsoleDump)) { bUseSynthesizer = true; } - /* - * We make shure that there is only one more argument, which we take as - * the filename of the MIDI file we want to play. - */ + // We make shure that there is only one more argument, which we take as + // the filename of the MIDI file we want to play. String strFilename = null; for (int i = g.getOptind(); i < args.length; i++) { if (strFilename == null) { @@ -246,7 +233,7 @@ public static void main(String[] args) { * In case of an exception, we dump the exception including the * stack trace to the console output. Then, we exit the program. */ - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -267,7 +254,7 @@ public static void main(String[] args) { sm_sequencer = MidiSystem.getSequencer(); } } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } if (sm_sequencer == null) { @@ -283,44 +270,32 @@ public static void main(String[] args) { * * Thanks to Espen Riskedal for finding this trick. */ - sm_sequencer.addMetaEventListener(new MetaEventListener() { - public void meta(MetaMessage event) { - if (event.getType() == 47) { - if (DEBUG) { - out("MidiPlayer.<...>.meta(): end of track message received, closing sequencer and attached MidiDevices..."); - } - sm_sequencer.close(); + sm_sequencer.addMetaEventListener(event -> { + if (event.getType() == 47) { + logger.log(Level.DEBUG, "MidiPlayer.<...>.meta(): end of track message received, closing sequencer and attached MidiDevices..."); + sm_sequencer.close(); - Iterator iterator = sm_openedMidiDeviceList.iterator(); - while (iterator.hasNext()) { - MidiDevice device = iterator.next(); - device.close(); - } - if (DEBUG) { - out("MidiPlayer.<...>.meta(): ...closed, now exiting"); - } - System.exit(0); + for (MidiDevice device : sm_openedMidiDeviceList) { + device.close(); } + logger.log(Level.DEBUG, "MidiPlayer.<...>.meta(): ...closed, now exiting"); + System.exit(0); } }); // If we are in debug mode, we set additional listeners to produce // interesting (?) debugging output. - if (DEBUG) { - sm_sequencer.addMetaEventListener(new MetaEventListener() { - public void meta(MetaMessage message) { - System.out.println("%%% MetaMessage: " + message); - System.out.println("%%% MetaMessage type: " + message.getType()); - System.out.println("%%% MetaMessage length: " + message.getLength()); - } + if (logger.isLoggable(Level.DEBUG)) { + sm_sequencer.addMetaEventListener(message -> { + logger.log(Level.DEBUG, "%%% MetaMessage: " + message); + logger.log(Level.DEBUG, "%%% MetaMessage type: " + message.getType()); + logger.log(Level.DEBUG, "%%% MetaMessage length: " + message.getLength()); }); - sm_sequencer.addControllerEventListener(new ControllerEventListener() { - public void controlChange(ShortMessage message) { - System.out.println("%%% ShortMessage: " + message); - System.out.println("%%% ShortMessage controller: " + message.getData1()); - System.out.println("%%% ShortMessage value: " + message.getData2()); - } + sm_sequencer.addControllerEventListener(message -> { + logger.log(Level.DEBUG, "%%% ShortMessage: " + message); + logger.log(Level.DEBUG, "%%% ShortMessage controller: " + message.getData1()); + logger.log(Level.DEBUG, "%%% ShortMessage value: " + message.getData2()); }, null); } @@ -332,7 +307,7 @@ public void controlChange(ShortMessage message) { try { sm_sequencer.open(); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -342,11 +317,8 @@ public void controlChange(ShortMessage message) { */ try { sm_sequencer.setSequence(sequenceStream); - } catch (InvalidMidiDataException e) { - e.printStackTrace(); - System.exit(1); - } catch (IOException e) { - e.printStackTrace(); + } catch (InvalidMidiDataException | IOException e) { + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -366,7 +338,7 @@ public void controlChange(ShortMessage message) { Transmitter seqTransmitter = sm_sequencer.getTransmitter(); seqTransmitter.setReceiver(synthReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -380,7 +352,7 @@ public void controlChange(ShortMessage message) { Transmitter midiTransmitter = sm_sequencer.getTransmitter(); midiTransmitter.setReceiver(midiReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -403,7 +375,7 @@ public void controlChange(ShortMessage message) { Transmitter midiTransmitter = sm_sequencer.getTransmitter(); midiTransmitter.setReceiver(midiReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -414,24 +386,20 @@ public void controlChange(ShortMessage message) { * linked to a sequencer's Transmitter. */ try { - Receiver dumpReceiver = new DumpReceiver(System.out); + Receiver dumpReceiver = new DumpReceiver(); Transmitter dumpTransmitter = sm_sequencer.getTransmitter(); dumpTransmitter.setReceiver(dumpReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } /* * Now, we can start over. */ - if (DEBUG) { - out("MidiPlayer.main(): starting sequencer..."); - } + logger.log(Level.DEBUG, "MidiPlayer.main(): starting sequencer..."); sm_sequencer.start(); - if (DEBUG) { - out("MidiPlayer.main(): ...started"); - } + logger.log(Level.DEBUG, "MidiPlayer.main(): ...started"); } private static void printUsageAndExit() { @@ -454,11 +422,11 @@ private static void printUsageAndExit() { private static void listDevicesAndExit(boolean forInput, boolean forOutput) { if (forInput && !forOutput) { - out("Available MIDI IN Devices:"); + logger.log(Level.DEBUG, "Available MIDI IN Devices:"); } else if (!forInput && forOutput) { - out("Available MIDI OUT Devices:"); + logger.log(Level.DEBUG, "Available MIDI OUT Devices:"); } else { - out("Available MIDI Devices:"); + logger.log(Level.DEBUG, "Available MIDI Devices:"); } MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); @@ -468,7 +436,7 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsInput && forInput) || (bAllowsOutput && forOutput)) { - out("" + i + " " + (bAllowsInput ? "IN " : " ") + (bAllowsOutput ? "OUT " : " ") + new String(aInfos[i].getName().getBytes("ISO8859-1")) + ", " + aInfos[i].getVendor() + ", " + aInfos[i].getVersion() + ", " + aInfos[i].getDescription()); + logger.log(Level.DEBUG, i + " " + (bAllowsInput ? "IN " : " ") + (bAllowsOutput ? "OUT " : " ") + new String(aInfos[i].getName().getBytes("ISO8859-1")) + ", " + aInfos[i].getVendor() + ", " + aInfos[i].getVersion() + ", " + aInfos[i].getDescription()); } } catch (MidiUnavailableException e) { // device is obviously not available... @@ -479,12 +447,12 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { } } if (aInfos.length == 0) { - out("[No devices available]"); + logger.log(Level.DEBUG, "[No devices available]"); } System.exit(0); } - /* + /** * This method tries to return a MidiDevice.Info whose name matches the * passed name. If no matching MidiDevice.Info is found, null is returned. * If forOutput is true, then only output devices are searched, otherwise @@ -492,15 +460,15 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { */ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean forOutput) { MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); - for (int i = 0; i < aInfos.length; i++) { + for (MidiDevice.Info aInfo : aInfos) { try { - if (new String(aInfos[i].getName().getBytes("ISO8859-1")).equals(strDeviceName)) { + if (new String(aInfo.getName().getBytes("ISO8859-1")).equals(strDeviceName)) { try { - MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]); + MidiDevice device = MidiSystem.getMidiDevice(aInfo); boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsOutput && forOutput) || (bAllowsInput && !forOutput)) { - return aInfos[i]; + return aInfo; } } catch (MidiUnavailableException mue) { } @@ -510,8 +478,4 @@ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean f } return null; } - - private static void out(String strMessage) { - System.out.println(strMessage); - } } diff --git a/src/samples/java/jse/MidiPlayerApplication.java b/src/samples/java/jse/MidiPlayerApplication.java index 9f4e6cc..6e4066d 100644 --- a/src/samples/java/jse/MidiPlayerApplication.java +++ b/src/samples/java/jse/MidiPlayerApplication.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiPlayerApplication.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,9 +17,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedInputStream; @@ -33,38 +28,47 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; +import static java.lang.System.getLogger; + +/** + * MidiPlayerApplication.java + *

    + * This file is part of the Java Sound Examples. + */ public class MidiPlayerApplication extends JFrame { - private JButton m_loadButton; - private JLabel m_sequenceLabel; + + private static final Logger logger = getLogger(MidiPlayerApplication.class.getName()); + + private final JButton m_loadButton; + private final JLabel m_sequenceLabel; private JFileChooser m_fileChooser; - private MidiPlayerPanel m_midiPlayerPanel; + private final MidiPlayerPanel m_midiPlayerPanel; public MidiPlayerApplication() { super("MidiPlayerApplication"); this.addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent we) { - if (m_midiPlayerPanel != null) { - m_midiPlayerPanel.closeSequencer(); - } - System.exit(0); + @Override + public void windowClosing(WindowEvent we) { + if (m_midiPlayerPanel != null) { + m_midiPlayerPanel.closeSequencer(); } - }); + System.exit(0); + } + }); JPanel sequencePanel = new JPanel(); sequencePanel.setLayout(new FlowLayout()); m_loadButton = new JButton("Load..."); - m_loadButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - loadSequence(); - } - }); + m_loadButton.addActionListener(ae -> loadSequence()); sequencePanel.add(m_loadButton); m_sequenceLabel = new JLabel("no sequence loaded"); sequencePanel.add(m_sequenceLabel); @@ -74,50 +78,40 @@ public void actionPerformed(ActionEvent ae) { } private void loadSequence() { - /* - * We try to create a file chooser only once. - */ + // We try to create a file chooser only once. if (m_fileChooser == null) { m_fileChooser = new JFileChooser(); } - /* - * Now display it. - */ + // Now display it. int nOption = m_fileChooser.showOpenDialog(this); if (nOption != JFileChooser.APPROVE_OPTION) { return; } - /* - * We get the selected file from the file chooser. Then, - * we create an input stream from it. - */ + // We get the selected file from the file chooser. Then, + // we create an input stream from it. File midiFile = m_fileChooser.getSelectedFile(); InputStream sequenceStream = null; try { sequenceStream = new FileInputStream(midiFile); sequenceStream = new BufferedInputStream(sequenceStream, 1024); } catch (IOException e) { - /* - * In case of an exception, we dump the exception - * including the stack trace to the console - * output. Then, we exit the program. - */ - e.printStackTrace(); + // In case of an exception, we dump the exception + // including the stack trace to the console + // output. Then, we exit the program. + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * We tell the main component about the new sequence - * and display the name of it. - */ + // We tell the main component about the new sequence + // and display the name of it. m_midiPlayerPanel.setSequence(sequenceStream); m_sequenceLabel.setText(midiFile.getName()); } - /* - * The starting point is here. + /** + * The starting point is here. */ public static void main(String[] args) { MidiPlayerApplication mpa = new MidiPlayerApplication(); diff --git a/src/samples/java/jse/MidiPlayerPanel.java b/src/samples/java/jse/MidiPlayerPanel.java index 89b5a23..db6062a 100644 --- a/src/samples/java/jse/MidiPlayerPanel.java +++ b/src/samples/java/jse/MidiPlayerPanel.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiPlayerPanel.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,15 +17,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.awt.BorderLayout; import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.io.IOException; import java.io.InputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.InvalidMidiDataException; -import javax.sound.midi.MetaEventListener; -import javax.sound.midi.MetaMessage; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Sequencer; @@ -41,20 +36,28 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSlider; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; +import static java.lang.System.getLogger; + +/** + * MidiPlayerPanel.java + *

    + * This file is part of the Java Sound Examples. + */ public class MidiPlayerPanel extends JPanel { + + private static final Logger logger = getLogger(MidiPlayerPanel.class.getName()); + private JSlider m_positionSlider; - private JButton m_startButton; - private JButton m_stopButton; - private JButton m_pauseButton; - private JButton m_resumeButton; - private JSlider m_tempoSlider; + private final JButton m_startButton; + private final JButton m_stopButton; + private final JButton m_pauseButton; + private final JButton m_resumeButton; + private final JSlider m_tempoSlider; private Sequencer m_sequencer; - private JList m_destinationList; - private MidiDestinationListModel m_destinationListModel; + private final JList m_destinationList; + private final MidiDestinationListModel m_destinationListModel; public MidiPlayerPanel(JPanel northPanel) { super(); @@ -68,19 +71,12 @@ public MidiPlayerPanel(JPanel northPanel) { add(positionPanel, BorderLayout.CENTER); // positionPanel.add(new JLabel("Position")); -/* - m_positionSlider = new JSlider(JSlider.HORIZONTAL, 0, 1000, 0); - m_positionSlider.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent ce) - { - // changeTempoFactor(); - } - }); - positionPanel.add(m_positionSlider); -*/ +// m_positionSlider = new JSlider(JSlider.HORIZONTAL, 0, 1000, 0); +// m_positionSlider.addChangeListener(this::changeTempoFactor); +// positionPanel.add(m_positionSlider); + m_destinationListModel = new MidiDestinationListModel(m_sequencer); - m_destinationList = new JList(m_destinationListModel); + m_destinationList = new JList<>(m_destinationListModel); JScrollPane scrollPane = new JScrollPane(m_destinationList); positionPanel.add(scrollPane); @@ -89,36 +85,22 @@ public void stateChanged(ChangeEvent ce) controlPanel.setLayout(new FlowLayout()); add(controlPanel, BorderLayout.SOUTH); m_startButton = new JButton("Start"); - m_startButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - // TODO: hacky; should fade - m_destinationListModel.commitDestinations(m_destinationList.getSelectionModel()); - - // end hacky - startSequencer(); - } - }); + m_startButton.addActionListener(ae -> { + // TODO: hacky; should fade + m_destinationListModel.commitDestinations(m_destinationList.getSelectionModel()); + + // end hacky + startSequencer(); + }); controlPanel.add(m_startButton); m_stopButton = new JButton("Stop"); - m_stopButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - stopSequencer(); - } - }); + m_stopButton.addActionListener(ae -> stopSequencer()); controlPanel.add(m_stopButton); m_pauseButton = new JButton("Pause"); - m_pauseButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - pauseSequencer(); - } - }); + m_pauseButton.addActionListener(ae -> pauseSequencer()); controlPanel.add(m_pauseButton); m_resumeButton = new JButton("Resume"); - m_resumeButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent ae) { - resumeSequencer(); - } - }); + m_resumeButton.addActionListener(ae -> resumeSequencer()); controlPanel.add(m_resumeButton); m_startButton.setEnabled(false); m_stopButton.setEnabled(false); @@ -126,20 +108,14 @@ public void actionPerformed(ActionEvent ae) { m_resumeButton.setEnabled(false); controlPanel.add(new JLabel("Tempo")); m_tempoSlider = new JSlider(JSlider.HORIZONTAL, -100, 100, 0); - m_tempoSlider.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent ce) { - changeTempoFactor(); - } - }); + m_tempoSlider.addChangeListener(ce -> changeTempoFactor()); controlPanel.add(m_tempoSlider); } private void initSequencer() { - /* - * Now, we need a Sequencer to play the Sequence. - * By means of passing null to getSequence(), we request - * the default sequencer. - */ + // Now, we need a Sequencer to play the Sequence. + // By means of passing null to getSequence(), we request + // the default sequencer. m_sequencer = null; try { m_sequencer = MidiSystem.getSequencer(); @@ -151,23 +127,19 @@ private void initSequencer() { System.exit(1); } - m_sequencer.addMetaEventListener(new MetaEventListener() { - public void meta(MetaMessage event) { - if (event.getType() == 47) { - stopSequencer(); - } - } - }); - - /* - * The Sequencer is still a dead object. - * We have to open() it to become live. - */ + m_sequencer.addMetaEventListener(event -> { + if (event.getType() == 47) { + stopSequencer(); + } + }); + + // The Sequencer is still a dead object. + // We have to open() it to become live. try { m_sequencer.open(); } catch (MidiUnavailableException e) { // TODO: gui message - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } } @@ -179,16 +151,11 @@ public void setSequence(InputStream inputStream) { m_stopButton.setEnabled(false); m_pauseButton.setEnabled(false); m_resumeButton.setEnabled(false); - } catch (IOException e) { - // TODO: gui message - e.printStackTrace(); - - // System.exit(1); - } catch (InvalidMidiDataException e) { + } catch (IOException | InvalidMidiDataException e) { // TODO: gui message - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); - // System.exit(1); +// System.exit(1); } } diff --git a/src/samples/java/jse/MidiRecorder.java b/src/samples/java/jse/MidiRecorder.java index f80e0bd..65b918a 100644 --- a/src/samples/java/jse/MidiRecorder.java +++ b/src/samples/java/jse/MidiRecorder.java @@ -1,11 +1,3 @@ - -package jse; - -/* - * MidiRecorder.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -25,28 +17,31 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -import gnu.getopt.Getopt; + +package jse; + import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import javax.sound.midi.ControllerEventListener; import javax.sound.midi.InvalidMidiDataException; -import javax.sound.midi.MetaEventListener; -import javax.sound.midi.MetaMessage; import javax.sound.midi.MidiDevice; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Receiver; import javax.sound.midi.Sequencer; -import javax.sound.midi.ShortMessage; import javax.sound.midi.Synthesizer; import javax.sound.midi.Transmitter; +import gnu.getopt.Getopt; + +import static java.lang.System.getLogger; + /* * +DocBookXML Plays a single MIDI or RMF file @@ -90,12 +85,15 @@ * * -DocBookXML */ + +/** + * MidiRecorder.java + *

    + * This file is part of the Java Sound Examples. + */ public class MidiRecorder { - /** - * Flag for debugging messages. If true, some messages are dumped to the - * console during operation. - */ - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(MidiRecorder.class.getName()); private static Sequencer sm_sequencer = null; @@ -107,16 +105,12 @@ public class MidiRecorder { private static List sm_openedMidiDeviceList; public static void main(String[] args) { - /* - * Set when the sequence should be played on the default internal - * synthesizer. - */ + // Set when the sequence should be played on the default internal + // synthesizer. boolean bUseSynthesizer = false; - /* - * Set when the sequence should be played on the default external MIDI - * port. - */ + // Set when the sequence should be played on the default external MIDI + // port. boolean bUseMidiPort = false; /* @@ -151,40 +145,33 @@ public static void main(String[] args) { int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 'l': - listDevicesAndExit(true, false); - case 's': - bUseSynthesizer = true; - break; - case 'm': - bUseMidiPort = true; - break; - case 'd': - bUseDevice = true; - strDeviceName = g.getOptarg(); - if (DEBUG) { - System.out.println("MidiRecorder.main(): device name: " + strDeviceName); - } - break; - case 'c': - bUseConsoleDump = true; - break; - case 'S': - strSequencerName = g.getOptarg(); - if (DEBUG) { - System.out.println("MidiRecorder.main(): sequencer name: " + strSequencerName); - } - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - System.out.println("getopt() returned " + c); - break; + case 'h': + printUsageAndExit(); + case 'l': + listDevicesAndExit(true, false); + case 's': + bUseSynthesizer = true; + break; + case 'm': + bUseMidiPort = true; + break; + case 'd': + bUseDevice = true; + strDeviceName = g.getOptarg(); + logger.log(Level.DEBUG, "MidiRecorder.main(): device name: " + strDeviceName); + break; + case 'c': + bUseConsoleDump = true; + break; + case 'S': + strSequencerName = g.getOptarg(); + logger.log(Level.DEBUG, "MidiRecorder.main(): sequencer name: " + strSequencerName); + break; + case '?': + printUsageAndExit(); + default: + System.out.println("getopt() returned " + c); + break; } } @@ -238,7 +225,7 @@ public static void main(String[] args) { * In case of an exception, we dump the exception including the * stack trace to the console output. Then, we exit the program. */ - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -259,7 +246,7 @@ public static void main(String[] args) { sm_sequencer = MidiSystem.getSequencer(); } } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } if (sm_sequencer == null) { @@ -275,24 +262,16 @@ public static void main(String[] args) { * * Thanks to Espen Riskedal for finding this trick. */ - sm_sequencer.addMetaEventListener(new MetaEventListener() { - public void meta(MetaMessage event) { - if (event.getType() == 47) { - if (DEBUG) { - out("MidiRecorder.<...>.meta(): end of track message received, closing sequencer and attached MidiDevices..."); - } - sm_sequencer.close(); + sm_sequencer.addMetaEventListener(event -> { + if (event.getType() == 47) { + logger.log(Level.DEBUG, "MidiRecorder.<...>.meta(): end of track message received, closing sequencer and attached MidiDevices..."); + sm_sequencer.close(); - Iterator iterator = sm_openedMidiDeviceList.iterator(); - while (iterator.hasNext()) { - MidiDevice device = iterator.next(); - device.close(); - } - if (DEBUG) { - out("MidiRecorder.<...>.meta(): ...closed, now exiting"); - } - System.exit(0); + for (MidiDevice device : sm_openedMidiDeviceList) { + device.close(); } + logger.log(Level.DEBUG, "MidiRecorder.<...>.meta(): ...closed, now exiting"); + System.exit(0); } }); @@ -300,21 +279,17 @@ public void meta(MetaMessage event) { * If we are in debug mode, we set additional listeners to produce * interesting (?) debugging output. */ - if (DEBUG) { - sm_sequencer.addMetaEventListener(new MetaEventListener() { - public void meta(MetaMessage message) { - System.out.println("%%% MetaMessage: " + message); - System.out.println("%%% MetaMessage type: " + message.getType()); - System.out.println("%%% MetaMessage length: " + message.getLength()); - } + if (logger.isLoggable(Level.DEBUG)) { + sm_sequencer.addMetaEventListener(message -> { + logger.log(Level.DEBUG, "%%% MetaMessage: " + message); + logger.log(Level.DEBUG, "%%% MetaMessage type: " + message.getType()); + logger.log(Level.DEBUG, "%%% MetaMessage length: " + message.getLength()); }); - sm_sequencer.addControllerEventListener(new ControllerEventListener() { - public void controlChange(ShortMessage message) { - System.out.println("%%% ShortMessage: " + message); - System.out.println("%%% ShortMessage controller: " + message.getData1()); - System.out.println("%%% ShortMessage value: " + message.getData2()); - } + sm_sequencer.addControllerEventListener(message -> { + logger.log(Level.DEBUG, "%%% ShortMessage: " + message); + logger.log(Level.DEBUG, "%%% ShortMessage controller: " + message.getData1()); + logger.log(Level.DEBUG, "%%% ShortMessage value: " + message.getData2()); }, null); } @@ -326,7 +301,7 @@ public void controlChange(ShortMessage message) { try { sm_sequencer.open(); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -336,11 +311,8 @@ public void controlChange(ShortMessage message) { */ try { sm_sequencer.setSequence(sequenceStream); - } catch (InvalidMidiDataException e) { - e.printStackTrace(); - System.exit(1); - } catch (IOException e) { - e.printStackTrace(); + } catch (InvalidMidiDataException | IOException e) { + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } @@ -362,7 +334,7 @@ public void controlChange(ShortMessage message) { Transmitter seqTransmitter = sm_sequencer.getTransmitter(); seqTransmitter.setReceiver(synthReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -377,7 +349,7 @@ public void controlChange(ShortMessage message) { Transmitter midiTransmitter = sm_sequencer.getTransmitter(); midiTransmitter.setReceiver(midiReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -390,7 +362,7 @@ public void controlChange(ShortMessage message) { // MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); MidiDevice.Info info = getMidiDeviceInfo(strDeviceName, false); if (info == null) { - System.out.println("Cannot find device " + strDeviceName); + logger.log(Level.DEBUG, "Cannot find device " + strDeviceName); } try { MidiDevice midiDevice = MidiSystem.getMidiDevice(info); @@ -401,7 +373,7 @@ public void controlChange(ShortMessage message) { Transmitter midiTransmitter = sm_sequencer.getTransmitter(); midiTransmitter.setReceiver(midiReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -412,24 +384,20 @@ public void controlChange(ShortMessage message) { * linked to a sequencer's Transmitter. */ try { - Receiver dumpReceiver = new DumpReceiver(System.out); + Receiver dumpReceiver = new DumpReceiver(); Transmitter dumpTransmitter = sm_sequencer.getTransmitter(); dumpTransmitter.setReceiver(dumpReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } /* * Now, we can start over. */ - if (DEBUG) { - out("MidiRecorder.main(): starting sequencer..."); - } + logger.log(Level.DEBUG, "MidiRecorder.main(): starting sequencer..."); sm_sequencer.start(); - if (DEBUG) { - out("MidiRecorder.main(): ...started"); - } + logger.log(Level.DEBUG, "MidiRecorder.main(): ...started"); } private static void printUsageAndExit() { @@ -452,11 +420,11 @@ private static void printUsageAndExit() { private static void listDevicesAndExit(boolean forInput, boolean forOutput) { if (forInput && !forOutput) { - out("Available MIDI IN Devices:"); + logger.log(Level.DEBUG, "Available MIDI IN Devices:"); } else if (!forInput && forOutput) { - out("Available MIDI OUT Devices:"); + logger.log(Level.DEBUG, "Available MIDI OUT Devices:"); } else { - out("Available MIDI Devices:"); + logger.log(Level.DEBUG, "Available MIDI Devices:"); } MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); @@ -466,14 +434,14 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsInput && forInput) || (bAllowsOutput && forOutput)) { - out("" + i + " " + (bAllowsInput ? "IN " : " ") + (bAllowsOutput ? "OUT " : " ") + aInfos[i].getName() + ", " + aInfos[i].getVendor() + ", " + aInfos[i].getVersion() + ", " + aInfos[i].getDescription()); + logger.log(Level.DEBUG, i + " " + (bAllowsInput ? "IN " : " ") + (bAllowsOutput ? "OUT " : " ") + aInfos[i].getName() + ", " + aInfos[i].getVendor() + ", " + aInfos[i].getVersion() + ", " + aInfos[i].getDescription()); } } catch (MidiUnavailableException e) { // device is obviously not available... } } if (aInfos.length == 0) { - out("[No devices available]"); + logger.log(Level.DEBUG, "[No devices available]"); } System.exit(0); } @@ -486,14 +454,14 @@ private static void listDevicesAndExit(boolean forInput, boolean forOutput) { */ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean forOutput) { MidiDevice.Info[] aInfos = MidiSystem.getMidiDeviceInfo(); - for (int i = 0; i < aInfos.length; i++) { - if (aInfos[i].getName().equals(strDeviceName)) { + for (MidiDevice.Info aInfo : aInfos) { + if (aInfo.getName().equals(strDeviceName)) { try { - MidiDevice device = MidiSystem.getMidiDevice(aInfos[i]); + MidiDevice device = MidiSystem.getMidiDevice(aInfo); boolean bAllowsInput = (device.getMaxTransmitters() != 0); boolean bAllowsOutput = (device.getMaxReceivers() != 0); if ((bAllowsOutput && forOutput) || (bAllowsInput && !forOutput)) { - return aInfos[i]; + return aInfo; } } catch (MidiUnavailableException mue) { } @@ -501,8 +469,4 @@ private static MidiDevice.Info getMidiDeviceInfo(String strDeviceName, boolean f } return null; } - - private static void out(String strMessage) { - System.out.println(strMessage); - } } diff --git a/src/samples/java/jse/MidiRouter.java b/src/samples/java/jse/MidiRouter.java index 671dff9..befa0ba 100644 --- a/src/samples/java/jse/MidiRouter.java +++ b/src/samples/java/jse/MidiRouter.java @@ -1,9 +1,3 @@ -package jse; -/* - * MidiRouter.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999, 2000 by Matthias Pfisterer * @@ -23,12 +17,19 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Receiver; import javax.sound.midi.Synthesizer; import javax.sound.midi.Transmitter; +import static java.lang.System.getLogger; + /* +DocBookXML OBSOLETE: Plays a single MIDI or RMF file @@ -80,64 +81,64 @@ -DocBookXML */ + +/** + * MidiRouter.java + *

    + * This file is part of the Java Sound Examples. + */ public class MidiRouter { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = true; - // private static Sequencer sm_sequencer = null; + private static final Logger logger = getLogger(MidiRouter.class.getName()); + +// private static Sequencer sm_sequencer = null; + public static void main(String[] args) { - /* - * We check if there is no command-line argument at all - * or the first one is '-h'. - * If so, we display the usage message and - * exit. - */ -/* - if (args.length < 1 || args[0].equals("-h")) - { - printUsageAndExit(); - } -*/ + // We check if there is no command-line argument at all + // or the first one is '-h'. + // If so, we display the usage message and + // exit. + +// if (args.length < 1 || args[0].equals("-h")) { +// printUsageAndExit(); +// } + boolean bUseSynthesizer = false; boolean bUseMidiPort = false; boolean bUseConsoleDump = false; int nArgumentIndex; +label: for (nArgumentIndex = 0; nArgumentIndex < args.length; nArgumentIndex++) { String strArgument = args[nArgumentIndex]; - if (strArgument.equals("-s")) { - bUseSynthesizer = true; - } else if (strArgument.equals("-m")) { - bUseMidiPort = true; - } else if (strArgument.equals("-d")) { - bUseConsoleDump = true; - } else { - break; + switch (strArgument) { + case "-s": + bUseSynthesizer = true; + break; + case "-m": + bUseMidiPort = true; + break; + case "-d": + bUseConsoleDump = true; + break; + default: + break label; } } - /* - * If no destination option is choosen at all, - * we default to playing on the internal synthesizer. - */ + // If no destination option is choosen at all, + // we default to playing on the internal synthesizer. if (!(bUseSynthesizer | bUseMidiPort | bUseConsoleDump)) { bUseSynthesizer = true; } - /* - * Now, we set up the destinations the Sequence should be - * played on. - */ + // Now, we set up the destinations the Sequence should be + // played on. if (bUseSynthesizer) { - /* - * We try to get the default synthesizer, open() - * it and chain it to the sequencer with a - * Transmitter-Receiver pair. - */ + // We try to get the default synthesizer, open() + // it and chain it to the sequencer with a + // Transmitter-Receiver pair. try { Synthesizer synth = MidiSystem.getSynthesizer(); synth.open(); @@ -146,48 +147,42 @@ public static void main(String[] args) { Transmitter seqTransmitter = MidiSystem.getTransmitter(); seqTransmitter.setReceiver(synthReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } if (bUseMidiPort) { - /* - * We try to get a Receiver which is already - * associated with the default MIDI port. - * It is then linked to a sequencer's - * Transmitter. - */ + // We try to get a Receiver which is already + // associated with the default MIDI port. + // It is then linked to a sequencer's + // Transmitter. try { Receiver midiReceiver = MidiSystem.getReceiver(); Transmitter midiTransmitter = MidiSystem.getTransmitter(); midiTransmitter.setReceiver(midiReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } if (bUseConsoleDump) { - /* - * We allocate a DumpReceiver object. Its job - * is to print information on all received events - * to the console. - * It is then linked to a sequencer's - * Transmitter. - */ + // We allocate a DumpReceiver object. Its job + // is to print information on all received events + // to the console. + // It is then linked to a sequencer's + // Transmitter. try { - Receiver dumpReceiver = new DumpReceiver(System.out); + Receiver dumpReceiver = new DumpReceiver(); Transmitter dumpTransmitter = MidiSystem.getTransmitter(); dumpTransmitter.setReceiver(dumpReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } System.out.println("If you are done with this programm, terminate it by pressing ctrl-C"); - /* - * Now, we wait forever. - */ + // Now, we wait forever. while (true) { try { Thread.sleep(10000); diff --git a/src/samples/java/jse/MixingAudioInputStream.java b/src/samples/java/jse/MixingAudioInputStream.java index 651acf0..993085a 100644 --- a/src/samples/java/jse/MixingAudioInputStream.java +++ b/src/samples/java/jse/MixingAudioInputStream.java @@ -21,17 +21,21 @@ import java.io.ByteArrayInputStream; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; - import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import org.tritonus.share.sampled.TConversionTool; +import static java.lang.System.getLogger; + /* * MixingAudioInputStream.java @@ -39,58 +43,48 @@ * This file is part of the Java Sound Examples. * * This code follows an idea of Paul Sorenson. - */ -/** + * * Mixing of multiple AudioInputStreams to one AudioInputStream. This class * takes a collection of AudioInputStreams and mixes them together. Being a * subclass of AudioInputStream itself, reading from instances of this class * behaves as if the mixdown result of the input streams is read. - * + * * @author Matthias Pfisterer */ public class MixingAudioInputStream extends AudioInputStream { - private static final boolean DEBUG = false; - private List m_audioInputStreamList; + private static final Logger logger = getLogger(MixingAudioInputStream.class.getName()); + + private final List m_audioInputStreamList; public MixingAudioInputStream(AudioFormat audioFormat, Collection audioInputStreams) { super(new ByteArrayInputStream(new byte[0]), audioFormat, AudioSystem.NOT_SPECIFIED); - if (DEBUG) { - System.out.println("MixingAudioInputStream.(): begin"); - } + logger.log(Level.TRACE, "MixingAudioInputStream.(): begin"); m_audioInputStreamList = new ArrayList<>(audioInputStreams); - if (DEBUG) { - System.out.println("MixingAudioInputStream.(): stream list:"); - for (int i = 0; i < m_audioInputStreamList.size(); i++) { - System.out.println(" " + m_audioInputStreamList.get(i)); + if (logger.isLoggable(Level.DEBUG)) { + logger.log(Level.DEBUG, "MixingAudioInputStream.(): stream list:"); + for (AudioInputStream audioInputStream : m_audioInputStreamList) { + logger.log(Level.DEBUG, " " + audioInputStream); } } - if (DEBUG) { - System.out.println("MixingAudioInputStream.(): end"); - } + logger.log(Level.TRACE, "MixingAudioInputStream.(): end"); } // TODO remove private boolean addAudioInputStream(AudioInputStream audioStream) { - if (DEBUG) { - System.out.println("MixingAudioInputStream.addAudioInputStream(): called."); - } + logger.log(Level.TRACE, "MixingAudioInputStream.addAudioInputStream(): called."); // Contract.check(audioStream != null); if (!getFormat().matches(audioStream.getFormat())) { - if (DEBUG) { - System.out.println("MixingAudioInputStream.addAudioInputStream(): audio formats do not match, trying to convert."); - } + logger.log(Level.DEBUG, "MixingAudioInputStream.addAudioInputStream(): audio formats do not match, trying to convert."); AudioInputStream asold = audioStream; audioStream = AudioSystem.getAudioInputStream(getFormat(), asold); if (audioStream == null) { - System.out.println("### MixingAudioInputStream.addAudioInputStream(): could not convert."); + logger.log(Level.DEBUG, "### MixingAudioInputStream.addAudioInputStream(): could not convert."); return false; } - if (DEBUG) { - System.out.println(" converted"); - } + logger.log(Level.DEBUG, " converted"); } // Contract.check(audioStream != null); @@ -98,9 +92,7 @@ private boolean addAudioInputStream(AudioInputStream audioStream) { m_audioInputStreamList.add(audioStream); m_audioInputStreamList.notifyAll(); } - if (DEBUG) { - System.out.println("MixingAudioInputStream.addAudioInputStream(): enqueued " + audioStream); - } + logger.log(Level.DEBUG, "MixingAudioInputStream.addAudioInputStream(): enqueued " + audioStream); return true; } @@ -109,11 +101,10 @@ private boolean addAudioInputStream(AudioInputStream audioStream) { * returned. If at least one of the input streams has length * AudioInputStream.NOT_SPECIFIED, this value is returned. */ + @Override public long getFrameLength() { long lLengthInFrames = 0; - Iterator streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { long lLength = stream.getFrameLength(); if (lLength == AudioSystem.NOT_SPECIFIED) { return AudioSystem.NOT_SPECIFIED; @@ -124,10 +115,9 @@ public long getFrameLength() { return lLengthInFrames; } + @Override public int read() throws IOException { - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(): begin"); - } + logger.log(Level.TRACE, "MixingAudioInputStream.read(): begin"); int nSample = 0; Iterator streamIterator = m_audioInputStreamList.iterator(); @@ -135,79 +125,56 @@ public int read() throws IOException { AudioInputStream stream = streamIterator.next(); int nByte = stream.read(); if (nByte == -1) { - /* - * The end of this stream has been signaled. We remove the - * stream from our list. - */ + // The end of this stream has been signaled. We remove the + // stream from our list. streamIterator.remove(); continue; } else { - /* - * what about signed/unsigned? - */ + // what about signed/unsigned? nSample += nByte; } } - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(): end"); - } + logger.log(Level.TRACE, "MixingAudioInputStream.read(): end"); return (byte) nSample; } + @Override public int read(byte[] abData, int nOffset, int nLength) throws IOException { - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): begin"); - System.out.println("MixingAudioInputStream.read(byte[], int, int): requested length: " + nLength); - } + logger.log(Level.TRACE, "MixingAudioInputStream.read(byte[], int, int): begin"); + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): requested length: " + nLength); int nChannels = getFormat().getChannels(); int nFrameSize = getFormat().getFrameSize(); - /* - * This value is in bytes. Note that it is the storage size. It may be - * four bytes for 24 bit samples. - */ + // This value is in bytes. Note that it is the storage size. It may be + // four bytes for 24 bit samples. int nSampleSize = nFrameSize / nChannels; boolean bBigEndian = getFormat().isBigEndian(); AudioFormat.Encoding encoding = getFormat().getEncoding(); - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): channels: " + nChannels); - System.out.println("MixingAudioInputStream.read(byte[], int, int): frame size: " + nFrameSize); - System.out.println("MixingAudioInputStream.read(byte[], int, int): sample size (bytes, storage size): " + nSampleSize); - System.out.println("MixingAudioInputStream.read(byte[], int, int): big endian: " + bBigEndian); - System.out.println("MixingAudioInputStream.read(byte[], int, int): encoding: " + encoding); - } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): channels: " + nChannels); + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): frame size: " + nFrameSize); + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): sample size (bytes, storage size): " + nSampleSize); + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): big endian: " + bBigEndian); + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): encoding: " + encoding); byte[] abBuffer = new byte[nFrameSize]; int[] anMixedSamples = new int[nChannels]; for (int nFrameBoundry = 0; nFrameBoundry < nLength; nFrameBoundry += nFrameSize) { - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): frame boundry: " + nFrameBoundry); - } - for (int i = 0; i < nChannels; i++) { - anMixedSamples[i] = 0; - } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): frame boundary: " + nFrameBoundry); + Arrays.fill(anMixedSamples, 0); Iterator streamIterator = m_audioInputStreamList.iterator(); while (streamIterator.hasNext()) { AudioInputStream stream = streamIterator.next(); - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): AudioInputStream: " + stream); - } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): AudioInputStream: " + stream); int nBytesRead = stream.read(abBuffer, 0, nFrameSize); - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): bytes read: " + nBytesRead); - } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): bytes read: " + nBytesRead); - /* - * TODO: we have to handle incomplete reads. - */ + // TODO: we have to handle incomplete reads. if (nBytesRead == -1) { - /* - * The end of the current stream has been signaled. We - * remove it from the list of streams. - */ + // The end of the current stream has been signaled. We + // remove it from the list of streams. streamIterator.remove(); continue; } @@ -215,20 +182,13 @@ public int read(byte[] abData, int nOffset, int nLength) throws IOException { int nBufferOffset = nChannel * nSampleSize; int nSampleToAdd = 0; if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) { - switch (nSampleSize) { - case 1: - nSampleToAdd = abBuffer[nBufferOffset]; - break; - case 2: - nSampleToAdd = TConversionTool.bytesToInt16(abBuffer, nBufferOffset, bBigEndian); - break; - case 3: - nSampleToAdd = TConversionTool.bytesToInt24(abBuffer, nBufferOffset, bBigEndian); - break; - case 4: - nSampleToAdd = TConversionTool.bytesToInt32(abBuffer, nBufferOffset, bBigEndian); - break; - } + nSampleToAdd = switch (nSampleSize) { + case 1 -> abBuffer[nBufferOffset]; + case 2 -> TConversionTool.bytesToInt16(abBuffer, nBufferOffset, bBigEndian); + case 3 -> TConversionTool.bytesToInt24(abBuffer, nBufferOffset, bBigEndian); + case 4 -> TConversionTool.bytesToInt32(abBuffer, nBufferOffset, bBigEndian); + default -> nSampleToAdd; + }; } // TODO: pcm unsigned else if (encoding.equals(AudioFormat.Encoding.ALAW)) { @@ -237,34 +197,28 @@ else if (encoding.equals(AudioFormat.Encoding.ALAW)) { nSampleToAdd = TConversionTool.ulaw2linear(abBuffer[nBufferOffset]); } anMixedSamples[nChannel] += nSampleToAdd; - } // loop over channels - } // loop over streams - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): starting to write to buffer passed by caller"); + } } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): starting to write to buffer passed by caller"); for (int nChannel = 0; nChannel < nChannels; nChannel++) { - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): channel: " + nChannel); - } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): channel: " + nChannel); - int nBufferOffset = nOffset + nFrameBoundry /* * nFrameSize */+ (nChannel * nSampleSize); - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): buffer offset: " + nBufferOffset); - } + int nBufferOffset = nOffset + nFrameBoundry /* * nFrameSize */ + (nChannel * nSampleSize); + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): buffer offset: " + nBufferOffset); if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) { switch (nSampleSize) { - case 1: - abData[nBufferOffset] = (byte) anMixedSamples[nChannel]; - break; - case 2: - TConversionTool.intToBytes16(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian); - break; - case 3: - TConversionTool.intToBytes24(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian); - break; - case 4: - TConversionTool.intToBytes32(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian); - break; + case 1: + abData[nBufferOffset] = (byte) anMixedSamples[nChannel]; + break; + case 2: + TConversionTool.intToBytes16(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian); + break; + case 3: + TConversionTool.intToBytes24(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian); + break; + case 4: + TConversionTool.intToBytes32(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian); + break; } } // TODO: pcm unsigned @@ -273,11 +227,9 @@ else if (encoding.equals(AudioFormat.Encoding.ALAW)) { } else if (encoding.equals(AudioFormat.Encoding.ULAW)) { abData[nBufferOffset] = TConversionTool.linear2ulaw(anMixedSamples[nChannel]); } - } // (final) loop over channels - } // loop over frames - if (DEBUG) { - System.out.println("MixingAudioInputStream.read(byte[], int, int): end"); + } } + logger.log(Level.DEBUG, "MixingAudioInputStream.read(byte[], int, int): end"); // TODO: return a useful value return nLength; @@ -289,11 +241,10 @@ else if (encoding.equals(AudioFormat.Encoding.ALAW)) { * that, this method always returns the passed value. In other words: the * return value is useless (better ideas appreciated). */ + @Override public long skip(long lLength) throws IOException { // int nAvailable = 0; - Iterator streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { stream.skip(lLength); } return lLength; @@ -303,49 +254,37 @@ public long skip(long lLength) throws IOException { * The minimum of available() of all input stream is calculated and * returned. */ + @Override public int available() throws IOException { int nAvailable = 0; - Iterator streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { nAvailable = Math.min(nAvailable, stream.available()); } return nAvailable; } + @Override public void close() throws IOException { // TODO: should we close all streams in the list? } - /** - * Calls mark() on all input streams. - */ + @Override public void mark(int nReadLimit) { - Iterator streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { stream.mark(nReadLimit); } } - /** - * Calls reset() on all input streams. - */ + @Override public void reset() throws IOException { - Iterator streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { stream.reset(); } } - /** - * returns true if all input stream return true for markSupported(). - */ + @Override public boolean markSupported() { - Iterator streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { if (!stream.markSupported()) { return false; } diff --git a/src/samples/java/jse/Mp3Encoder.java b/src/samples/java/jse/Mp3Encoder.java index b4717e2..7e5ec2b 100644 --- a/src/samples/java/jse/Mp3Encoder.java +++ b/src/samples/java/jse/Mp3Encoder.java @@ -21,13 +21,18 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; + import org.tritonus.share.sampled.AudioFileTypes; import org.tritonus.share.sampled.Encodings; +import static java.lang.System.getLogger; + /* +DocBookXML Encoding an audio file to mp3 @@ -125,11 +130,12 @@ The output file(s) will be named after the input file(s) /** * Mp3Encoder.java - * + *

    * This file is part of the Java Sound Examples. */ public class Mp3Encoder { - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(Mp3Encoder.class.getName()); private static boolean dumpExceptions = false; @@ -149,7 +155,7 @@ private static AudioInputStream getInStream(String filename) throws IOException ais = AudioSystem.getAudioInputStream(file); } catch (Exception e) { if (dumpExceptions) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } else if (!quiet) { System.out.println("Error: " + e.getMessage()); } @@ -180,18 +186,23 @@ public static AudioInputStream getConvertedStream2(AudioInputStream sourceStream } // build the output format - AudioFormat targetFormat = new AudioFormat(targetEncoding, sourceFormat.getSampleRate(), AudioSystem.NOT_SPECIFIED, sourceFormat.getChannels(), AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false); // endianness doesn't matter + AudioFormat targetFormat = new AudioFormat(targetEncoding, sourceFormat.getSampleRate(), + AudioSystem.NOT_SPECIFIED, sourceFormat.getChannels(), AudioSystem.NOT_SPECIFIED, + AudioSystem.NOT_SPECIFIED, false); // endianness doesn't matter // construct a converted stream AudioInputStream targetStream = null; if (!AudioSystem.isConversionSupported(targetFormat, sourceFormat)) { - if (DEBUG && !quiet) { - System.out.println("Direct conversion not possible."); - System.out.println("Trying with intermediate PCM format."); + if (!quiet) { + logger.log(Level.DEBUG, "Direct conversion not possible."); + logger.log(Level.DEBUG, "Trying with intermediate PCM format."); } - AudioFormat intermediateFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, sourceFormat.getSampleRate(), 16, sourceFormat.getChannels(), 2 * sourceFormat.getChannels(), // frameSize - sourceFormat.getSampleRate(), false); + AudioFormat intermediateFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, + sourceFormat.getSampleRate(), 16, + sourceFormat.getChannels(), + 2 * sourceFormat.getChannels(), // frameSize + sourceFormat.getSampleRate(), false); if (AudioSystem.isConversionSupported(intermediateFormat, sourceFormat)) { // intermediate conversion is supported sourceStream = AudioSystem.getAudioInputStream(intermediateFormat, sourceStream); @@ -202,10 +213,8 @@ public static AudioInputStream getConvertedStream2(AudioInputStream sourceStream throw new Exception("conversion not supported"); } if (!quiet) { - if (DEBUG) { - System.out.println("Got converted AudioInputStream: " + targetStream.getClass().getName()); - } - System.out.println("Output format: " + targetStream.getFormat()); + logger.log(Level.DEBUG, "Got converted AudioInputStream: " + targetStream.getClass().getName()); + logger.log(Level.DEBUG, "Output format: " + targetStream.getFormat()); } return targetStream; } @@ -213,19 +222,21 @@ public static AudioInputStream getConvertedStream2(AudioInputStream sourceStream public static AudioInputStream getConvertedStream(AudioInputStream sourceStream, AudioFormat.Encoding targetEncoding) throws Exception { AudioFormat sourceFormat = sourceStream.getFormat(); if (!quiet) { - System.out.println("Input format: " + sourceFormat); + logger.log(Level.DEBUG, "Input format: " + sourceFormat); } // construct a converted stream AudioInputStream targetStream = null; if (!AudioSystem.isConversionSupported(targetEncoding, sourceFormat)) { - if (DEBUG && !quiet) { - System.out.println("Direct conversion not possible."); - System.out.println("Trying with intermediate PCM format."); + if (!quiet) { + logger.log(Level.DEBUG, "Direct conversion not possible."); + logger.log(Level.DEBUG, "Trying with intermediate PCM format."); } - AudioFormat intermediateFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, sourceFormat.getSampleRate(), 16, sourceFormat.getChannels(), 2 * sourceFormat.getChannels(), // frameSize - sourceFormat.getSampleRate(), false); + AudioFormat intermediateFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, + sourceFormat.getSampleRate(), 16, sourceFormat.getChannels(), + 2 * sourceFormat.getChannels(), // frameSize + sourceFormat.getSampleRate(), false); if (AudioSystem.isConversionSupported(intermediateFormat, sourceFormat)) { // intermediate conversion is supported sourceStream = AudioSystem.getAudioInputStream(intermediateFormat, sourceStream); @@ -236,10 +247,8 @@ public static AudioInputStream getConvertedStream(AudioInputStream sourceStream, throw new Exception("conversion not supported"); } if (!quiet) { - if (DEBUG) { - System.out.println("Got converted AudioInputStream: " + targetStream.getClass().getName()); - } - System.out.println("Output format: " + targetStream.getFormat()); + logger.log(Level.DEBUG, "Got converted AudioInputStream: " + targetStream.getClass().getName()); + logger.log(Level.DEBUG, "Output format: " + targetStream.getFormat()); } return targetStream; } @@ -256,22 +265,22 @@ public static int writeFile(String inFilename) { // write the file if (!quiet) { - System.out.println("Writing " + outFilename + "..."); + logger.log(Level.DEBUG, "Writing " + outFilename + "..."); } writtenBytes = AudioSystem.write(ais, targetType, new File(outFilename)); - if (DEBUG && !quiet) { - System.out.println("Effective parameters of output file:"); + if (!quiet) { + logger.log(Level.DEBUG, "Effective parameters of output file:"); try { String version = System.getProperty("tritonus.lame.encoder.version", ""); - if (version != "") { - System.out.println(" Version = " + version); + if (!version.isEmpty()) { + logger.log(Level.DEBUG, " Version = " + version); } - System.out.println(" Quality = " + System.getProperty("tritonus.lame.effective.quality", "")); - System.out.println(" Bitrate = " + System.getProperty("tritonus.lame.effective.bitrate", "")); - System.out.println(" Channel Mode = " + System.getProperty("tritonus.lame.effective.chmode", "")); - System.out.println(" VBR mode = " + System.getProperty("tritonus.lame.effective.vbr", "")); - System.out.println(" Sample rate = " + System.getProperty("tritonus.lame.effective.samplerate", "")); - System.out.println(" Encoding = " + System.getProperty("tritonus.lame.effective.encoding", "")); + logger.log(Level.DEBUG, " Quality = " + System.getProperty("tritonus.lame.effective.quality", "")); + logger.log(Level.DEBUG, " Bitrate = " + System.getProperty("tritonus.lame.effective.bitrate", "")); + logger.log(Level.DEBUG, " Channel Mode = " + System.getProperty("tritonus.lame.effective.chmode", "")); + logger.log(Level.DEBUG, " VBR mode = " + System.getProperty("tritonus.lame.effective.vbr", "")); + logger.log(Level.DEBUG, " Sample rate = " + System.getProperty("tritonus.lame.effective.samplerate", "")); + logger.log(Level.DEBUG, " Encoding = " + System.getProperty("tritonus.lame.effective.encoding", "")); } catch (Throwable t1) { } } @@ -279,7 +288,7 @@ public static int writeFile(String inFilename) { if (dumpExceptions) { t.printStackTrace(); } else if (!quiet) { - System.out.println("Error: " + t.getMessage()); + logger.log(Level.DEBUG, "Error: " + t.getMessage()); } } return writtenBytes; @@ -305,15 +314,9 @@ public static int parseArgs(String[] args) { char cArg = arg.charAt(1); // options without parameter - if (cArg == 'v') { - DEBUG = true; - continue; - } else if (cArg == 'e') { + if (cArg == 'e') { dumpExceptions = true; continue; - } else if (cArg == 't') { - org.tritonus.share.TDebug.TraceAudioConverter = true; - continue; } else if (cArg == 's') { quiet = true; continue; @@ -335,20 +338,20 @@ public static int parseArgs(String[] args) { String param = args[i + 1]; i++; switch (cArg) { - case 'q': - try { - System.setProperty("tritonus.lame.quality", param); - } catch (Throwable t2) { - } - break; - case 'b': - try { - System.setProperty("tritonus.lame.bitrate", param); - } catch (Throwable t3) { - } - break; - default: - throw new Exception("Unrecognized option " + arg + "."); + case 'q': + try { + System.setProperty("tritonus.lame.quality", param); + } catch (Throwable t2) { + } + break; + case 'b': + try { + System.setProperty("tritonus.lame.bitrate", param); + } catch (Throwable t3) { + } + break; + default: + throw new Exception("Unrecognized option " + arg + "."); } } throw new Exception("No input file(s) are given."); @@ -361,7 +364,7 @@ public static int parseArgs(String[] args) { public static void main(String[] args) { //try { - // System.out.println("Librarypath=" + System.getProperty("java.library.path", "")); + // logger.log(Level.DEBUG, "Librarypath=" + System.getProperty("java.library.path", "")); //} catch (Throwable t) {} int firstFileIndex = parseArgs(args); int inputFiles = 0; @@ -377,28 +380,29 @@ public static void main(String[] args) { success++; } if (!quiet) { - System.out.println("Wrote " + bytes + " bytes in " + (time / 60000) + "m " + ((time / 1000) % 60) + "s " + (time % 1000) + "ms (" + (time / 1000) + "s)."); + logger.log(Level.DEBUG, "Wrote " + bytes + " bytes in " + (time / 60000) + "m " + ((time / 1000) % 60) + "s " + (time % 1000) + "ms (" + (time / 1000) + "s)."); } } } totalTime = System.currentTimeMillis() - totalTime; - if ((DEBUG && quiet) || !quiet) { + if (!quiet) { // this IS displayed in silent DEBUG mode - System.out.println("From " + inputFiles + " input file" + ((inputFiles == 1) ? "" : "s") + ", " + success + " file" + ((success == 1) ? " was" : "s were") + " converted successfully in " + (totalTime / 60000) + "m " + ((totalTime / 1000) % 60) + "s (" + (totalTime / 1000) + "s)."); + logger.log(Level.DEBUG, "From " + inputFiles + " input file" + ((inputFiles == 1) ? "" : "s") + ", " + success + " file" + ((success == 1) ? " was" : "s were") + " converted successfully in " + (totalTime / 60000) + "m " + ((totalTime / 1000) % 60) + "s (" + (totalTime / 1000) + "s)."); } System.exit(0); } - /** Display a message of how to call this program. + /** + * Display a message of how to call this program. */ public static void usage() { System.out.println("Mp3Encoder - convert audio files to mp3 (layer III of MPEG 1, MPEG 2 or MPEG 2.5"); System.out.println("java Mp3Encoder [...]"); System.out.println("The output file(s) will be named like the source file(s) but"); System.out.println("with mp3 file extension."); - System.out.println(""); + System.out.println(); System.out.println("You need LAME 3.88 or later. Get it from http://sourceforge.net/projects/lame/"); - System.out.println(""); + System.out.println(); System.out.println(" may be a combination of the following:"); System.out.println("-q Quality of output mp3 file. In VBR mode, this affects"); System.out.println(" the size of the mp3 file. (Default middle)"); diff --git a/src/samples/java/jse/MultiAudioStreamPlayer.java b/src/samples/java/jse/MultiAudioStreamPlayer.java index 1feecbc..5115d34 100644 --- a/src/samples/java/jse/MultiAudioStreamPlayer.java +++ b/src/samples/java/jse/MultiAudioStreamPlayer.java @@ -1,11 +1,3 @@ - -package jse; - -/* - * MultiAudioStreamPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 by Matthias Pfisterer * @@ -25,13 +17,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; +import static java.lang.System.getLogger; -// import AudioStream; /* * +DocBookXML Playing multiple audio files concurrently @@ -61,7 +58,16 @@ * * -DocBookXML */ + +/** + * MultiAudioStreamPlayer.java + *

    + * This file is part of the Java Sound Examples. + */ public class MultiAudioStreamPlayer { + + private static final Logger logger = getLogger(MultiAudioStreamPlayer.class.getName()); + public static void main(String[] args) { /* * We check that there is at least one command-line argument. If not, we @@ -77,8 +83,7 @@ public static void main(String[] args) { * Now, that we're shure there is at least one argument, we take each * argument as the filename of the soundfile we want to play. */ - for (int i = 0; i < args.length; i++) { - String strFilename = args[i]; + for (String strFilename : args) { File soundFile = new File(strFilename); /* @@ -94,16 +99,10 @@ public static void main(String[] args) { * In case of an exception, we dump the exception including the * stack trace to the console output. Then, we exit the program. */ - e.printStackTrace(); - System.exit(1); - } catch (UnsupportedAudioFileException e) { - e.printStackTrace(); - System.exit(1); - } catch (IllegalArgumentException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); - } catch (IOException e) { - e.printStackTrace(); + } catch (UnsupportedAudioFileException | IOException | IllegalArgumentException e) { + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } diff --git a/src/samples/java/jse/Oscillator.java b/src/samples/java/jse/Oscillator.java index c81b70e..f7e76fe 100644 --- a/src/samples/java/jse/Oscillator.java +++ b/src/samples/java/jse/Oscillator.java @@ -1,9 +1,3 @@ -package jse; -/* - * Oscillator.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -21,72 +15,79 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +package jse; + import java.io.ByteArrayInputStream; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + +/** + * Oscillator.java + *

    + * This file is part of the Java Sound Examples. + */ public class Oscillator extends AudioInputStream { - private static final boolean DEBUG = false; + + private static final Logger logger = getLogger(Oscillator.class.getName()); + public static final int WAVEFORM_SINE = 0; public static final int WAVEFORM_SQUARE = 1; public static final int WAVEFORM_TRIANGLE = 2; public static final int WAVEFORM_SAWTOOTH = 3; - private byte[] m_abData; + private final byte[] m_abData; private int m_nBufferPosition; private long m_lRemainingFrames; public Oscillator(int nWaveformType, float fSignalFrequency, float fAmplitude, AudioFormat audioFormat, long lLength) { - super(new ByteArrayInputStream(new byte[0]), - new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - audioFormat.getSampleRate(), 16, 2, 4, - audioFormat.getFrameRate(), - audioFormat.isBigEndian()), lLength); - if (DEBUG) { - System.out.println("Oscillator.(): begin"); - } + super(new ByteArrayInputStream(new byte[0]), new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, + audioFormat.getSampleRate(), 16, 2, 4, + audioFormat.getFrameRate(), + audioFormat.isBigEndian()), lLength); + logger.log(Level.DEBUG, "Oscillator.(): begin"); m_lRemainingFrames = lLength; - fAmplitude = (float) (fAmplitude * Math.pow(2, - getFormat() - .getSampleSizeInBits() - - 1)); + fAmplitude = (float) (fAmplitude * Math.pow(2, getFormat().getSampleSizeInBits() - 1)); // length of one period in frames int nPeriodLengthInFrames = Math.round(getFormat().getFrameRate() / fSignalFrequency); int nBufferLength = nPeriodLengthInFrames * getFormat().getFrameSize(); m_abData = new byte[nBufferLength]; for (int nFrame = 0; nFrame < nPeriodLengthInFrames; nFrame++) { - /** The relative position inside the period - of the waveform. 0.0 = beginning, 1.0 = end - */ + // The relative position inside the period + // of the waveform. 0.0 = beginning, 1.0 = end float fPeriodPosition = (float) nFrame / (float) nPeriodLengthInFrames; float fValue = 0; switch (nWaveformType) { - case WAVEFORM_SINE: - fValue = (float) Math.sin(fPeriodPosition * 2.0 * Math.PI); - break; - case WAVEFORM_SQUARE: - fValue = (fPeriodPosition < 0.5F) ? 1.0F : (-1.0F); - break; - case WAVEFORM_TRIANGLE: - if (fPeriodPosition < 0.25F) { - fValue = 4.0F * fPeriodPosition; - } else if (fPeriodPosition < 0.75F) { - fValue = -4.0F * (fPeriodPosition - 0.5F); - } else { - fValue = 4.0F * (fPeriodPosition - 1.0F); - } - break; - case WAVEFORM_SAWTOOTH: - if (fPeriodPosition < 0.5F) { - fValue = 2.0F * fPeriodPosition; - } else { - fValue = 2.0F * (fPeriodPosition - 1.0F); - } - break; + case WAVEFORM_SINE: + fValue = (float) Math.sin(fPeriodPosition * 2.0 * Math.PI); + break; + case WAVEFORM_SQUARE: + fValue = (fPeriodPosition < 0.5F) ? 1.0F : (-1.0F); + break; + case WAVEFORM_TRIANGLE: + if (fPeriodPosition < 0.25F) { + fValue = 4.0F * fPeriodPosition; + } else if (fPeriodPosition < 0.75F) { + fValue = -4.0F * (fPeriodPosition - 0.5F); + } else { + fValue = 4.0F * (fPeriodPosition - 1.0F); + } + break; + case WAVEFORM_SAWTOOTH: + if (fPeriodPosition < 0.5F) { + fValue = 2.0F * fPeriodPosition; + } else { + fValue = 2.0F * (fPeriodPosition - 1.0F); + } + break; } int nValue = Math.round(fValue * fAmplitude); @@ -99,49 +100,44 @@ public Oscillator(int nWaveformType, float fSignalFrequency, m_abData[nBaseAddr + 3] = (byte) ((nValue >>> 8) & 0xFF); } m_nBufferPosition = 0; - if (DEBUG) { - System.out.println("Oscillator.(): end"); - } + logger.log(Level.DEBUG, "Oscillator.(): end"); } - /** Returns the number of bytes that can be read without blocking. - Since there is no blocking possible here, we simply try to - return the number of bytes available at all. In case the - length of the stream is indefinite, we return the highest - number that can be represented in an integer. If the length - if finite, this length is returned, clipped by the maximum - that can be represented. - */ + /** + * Returns the number of bytes that can be read without blocking. + * Since there is no blocking possible here, we simply try to + * return the number of bytes available at all. In case the + * length of the stream is indefinite, we return the highest + * number that can be represented in an integer. If the length + * if finite, this length is returned, clipped by the maximum + * that can be represented. + */ + @Override public int available() { int nAvailable = 0; if (m_lRemainingFrames == AudioSystem.NOT_SPECIFIED) { nAvailable = Integer.MAX_VALUE; } else { - long lBytesAvailable = m_lRemainingFrames * getFormat() - .getFrameSize(); - nAvailable = (int) Math.min(lBytesAvailable, - Integer.MAX_VALUE); + long lBytesAvailable = m_lRemainingFrames * getFormat().getFrameSize(); + nAvailable = (int) Math.min(lBytesAvailable, Integer.MAX_VALUE); } return nAvailable; } - /* - this method should throw an IOException if the frame size is not 1. - Since we currently always use 16 bit samples, the frame size is - always greater than 1. So we always throw an exception. - */ + /** + * this method should throw an IOException if the frame size is not 1. + * Since we currently always use 16 bit samples, the frame size is + * always greater than 1. So we always throw an exception. + */ + @Override public int read() throws IOException { - if (DEBUG) { - System.out.println("Oscillator.read(): begin"); - } + logger.log(Level.DEBUG, "Oscillator.read(): begin"); throw new IOException("cannot use this method currently"); } - public int read(byte[] abData, int nOffset, int nLength) - throws IOException { - if (DEBUG) { - System.out.println("Oscillator.read(): begin"); - } + @Override + public int read(byte[] abData, int nOffset, int nLength) throws IOException { + logger.log(Level.DEBUG, "Oscillator.read(): begin"); if ((nLength % getFormat().getFrameSize()) != 0) { throw new IOException("length must be an integer multiple of frame size"); } @@ -151,8 +147,7 @@ public int read(byte[] abData, int nOffset, int nLength) while (nRemainingLength > 0) { int nNumBytesToCopyNow = m_abData.length - m_nBufferPosition; nNumBytesToCopyNow = Math.min(nNumBytesToCopyNow, nRemainingLength); - System.arraycopy(m_abData, m_nBufferPosition, abData, nOffset, - nNumBytesToCopyNow); + System.arraycopy(m_abData, m_nBufferPosition, abData, nOffset, nNumBytesToCopyNow); nRemainingLength -= nNumBytesToCopyNow; nOffset += nNumBytesToCopyNow; m_nBufferPosition = (m_nBufferPosition + nNumBytesToCopyNow) % m_abData.length; @@ -167,9 +162,7 @@ public int read(byte[] abData, int nOffset, int nLength) if (m_lRemainingFrames == 0) { nReturn = -1; } - if (DEBUG) { - System.out.println("Oscillator.read(): end"); - } + logger.log(Level.DEBUG, "Oscillator.read(): end"); return nReturn; } } diff --git a/src/samples/java/jse/OscillatorFile.java b/src/samples/java/jse/OscillatorFile.java index a94b547..eaeaa4a 100644 --- a/src/samples/java/jse/OscillatorFile.java +++ b/src/samples/java/jse/OscillatorFile.java @@ -1,9 +1,3 @@ -package jse; -/* - * OscillatorFile.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 -2001 by Matthias Pfisterer * @@ -22,14 +16,22 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -import gnu.getopt.Getopt; + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import gnu.getopt.Getopt; + +import static java.lang.System.getLogger; + /* +DocBookXML Saving waveform data to a file (standard version) @@ -99,9 +101,17 @@ Generates waveform data (sine, square, ...) and saves them -DocBookXML */ + +/** + * OscillatorFile.java + *

    + * This file is part of the Java Sound Examples. + */ public class OscillatorFile { -// private static final int BUFFER_SIZE = 128000; - private static boolean DEBUG = false; + + private static final Logger logger = getLogger(OscillatorFile.class.getName()); + +// private static final int BUFFER_SIZE = 128000; public static void main(String[] args) throws IOException { // byte[] abData; @@ -112,53 +122,45 @@ public static void main(String[] args) throws IOException { float fAmplitude = 0.7F; AudioFileFormat.Type targetType = AudioFileFormat.Type.AU; - /** The desired duration of the file in seconds. - This can be set by the '-d' command line switch. - Default is 10 seconds. - */ + // The desired duration of the file in seconds. + // This can be set by the '-d' command line switch. + // Default is 10 seconds. int nDuration = 10; /* - * Parsing of command-line options takes place... + * Parsing of command-line options takes place... */ Getopt g = new Getopt("AudioPlayer", args, "ht:r:f:a:d:D"); int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 't': - nWaveformType = getWaveformType(g.getOptarg()); - break; - case 'r': - fSampleRate = Float.parseFloat(g.getOptarg()); - break; - case 'f': - fSignalFrequency = Float.parseFloat(g.getOptarg()); - break; - case 'a': - fAmplitude = Float.parseFloat(g.getOptarg()); - break; - case 'd': - nDuration = Integer.parseInt(g.getOptarg()); - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - if (DEBUG) { - out("getopt() returned " + c); - } - break; + case 'h': + printUsageAndExit(); + case 't': + nWaveformType = getWaveformType(g.getOptarg()); + break; + case 'r': + fSampleRate = Float.parseFloat(g.getOptarg()); + break; + case 'f': + fSignalFrequency = Float.parseFloat(g.getOptarg()); + break; + case 'a': + fAmplitude = Float.parseFloat(g.getOptarg()); + break; + case 'd': + nDuration = Integer.parseInt(g.getOptarg()); + break; + case '?': + printUsageAndExit(); + default: + logger.log(Level.DEBUG, "getopt() returned " + c); + break; } } - /* - We make shure that there is only one more argument, - which we take as the filename of the soundfile to store to. - */ + // We make shure that there is only one more argument, + // which we take as the filename of the soundfile to store to. String strFilename = null; for (int i = g.getOptind(); i < args.length; i++) { if (strFilename == null) { @@ -174,13 +176,11 @@ public static void main(String[] args) throws IOException { File outputFile = new File(strFilename); audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - fSampleRate, 16, 2, 4, fSampleRate, false); + fSampleRate, 16, 2, 4, fSampleRate, false); int nLengthInFrames = Math.round(nDuration * fSampleRate); AudioInputStream oscillator = new Oscillator(nWaveformType, - fSignalFrequency, - fAmplitude, audioFormat, - nLengthInFrames); + fSignalFrequency, fAmplitude, audioFormat, nLengthInFrames); AudioSystem.write(oscillator, targetType, outputFile); } @@ -188,25 +188,19 @@ public static void main(String[] args) throws IOException { private static int getWaveformType(String strWaveformType) { int nWaveformType = Oscillator.WAVEFORM_SINE; strWaveformType = strWaveformType.trim().toLowerCase(); - if (strWaveformType.equals("sine")) { - nWaveformType = Oscillator.WAVEFORM_SINE; - } else if (strWaveformType.equals("square")) { - nWaveformType = Oscillator.WAVEFORM_SQUARE; - } else if (strWaveformType.equals("triangle")) { - nWaveformType = Oscillator.WAVEFORM_TRIANGLE; - } else if (strWaveformType.equals("sawtooth")) { - nWaveformType = Oscillator.WAVEFORM_SAWTOOTH; - } + nWaveformType = switch (strWaveformType) { + case "sine" -> Oscillator.WAVEFORM_SINE; + case "square" -> Oscillator.WAVEFORM_SQUARE; + case "triangle" -> Oscillator.WAVEFORM_TRIANGLE; + case "sawtooth" -> Oscillator.WAVEFORM_SAWTOOTH; + default -> nWaveformType; + }; return nWaveformType; } private static void printUsageAndExit() { - out("OscillatorFile: usage:"); - out("\tjava OscillatorFile [-t ] [-f ] [-r ] [-d ] "); + logger.log(Level.DEBUG, "OscillatorFile: usage:"); + logger.log(Level.DEBUG, "\tjava OscillatorFile [-t ] [-f ] [-r ] [-d ] "); System.exit(1); } - - private static void out(String strMessage) { - System.out.println(strMessage); - } } diff --git a/src/samples/java/jse/OscillatorFileAOS.java b/src/samples/java/jse/OscillatorFileAOS.java index d4db3e9..e196c50 100644 --- a/src/samples/java/jse/OscillatorFileAOS.java +++ b/src/samples/java/jse/OscillatorFileAOS.java @@ -21,6 +21,8 @@ import gnu.getopt.Getopt; import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -29,8 +31,10 @@ import org.tritonus.share.sampled.file.AudioOutputStream; import org.tritonus.share.sampled.file.TDataOutputStream; +import static java.lang.System.getLogger; -/** + +/* * +DocBookXML Saving waveform data to a file (<classname>AudioOutputStream</classname> * version) * @@ -76,10 +80,15 @@ * * -DocBookXML */ + +/** + * OscillatorFileAOS + */ public class OscillatorFileAOS { - private static final int BUFFER_SIZE = 128000; - private static boolean DEBUG = false; + private static final Logger logger = getLogger(OscillatorFileAOS.class.getName()); + + private static final int BUFFER_SIZE = 128000; public static void main(String[] args) throws IOException { AudioFormat audioFormat; @@ -89,15 +98,11 @@ public static void main(String[] args) throws IOException { float fAmplitude = 0.7F; AudioFileFormat.Type targetType = AudioFileFormat.Type.AU; - /** - * The desired duration of the file in seconds. This can be set by the - * '-d' command line switch. Default is 10 seconds. - */ + // The desired duration of the file in seconds. This can be set by the + // '-d' command line switch. Default is 10 seconds. int nDuration = 10; - /* - * Parsing of command-line options takes place... - */ + // Parsing of command-line options takes place... Getopt g = new Getopt("AudioPlayer", args, "ht:r:f:a:d:D"); int c; while ((c = g.getopt()) != -1) { @@ -119,15 +124,10 @@ public static void main(String[] args) throws IOException { case 'd': nDuration = Integer.parseInt(g.getOptarg()); break; - case 'D': - DEBUG = true; - break; case '?': printUsageAndExit(); default: - if (DEBUG) { - System.out.println("getopt() returned " + c); - } + logger.log(Level.DEBUG, "getopt() returned " + c); break; } } @@ -157,10 +157,10 @@ public static void main(String[] args) throws IOException { TDataOutputStream dataOutputStream = null; try { - // dataOutputStream = new TSeekableDataOutputStream(targetFile); +// dataOutputStream = new TSeekableDataOutputStream(targetFile); dataOutputStream = AudioSystemShadow.getDataOutputStream(outputFile); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } AudioOutputStream audioOutputStream = null; @@ -187,18 +187,12 @@ public static void main(String[] args) throws IOException { int nBytesRead = 0; byte[] abData = new byte[BUFFER_SIZE]; while (nBytesRead != -1) { - if (DEBUG) { - System.out.println("OscillatorFileAOS.main(): trying to read (bytes): " + abData.length); - } + logger.log(Level.DEBUG, "OscillatorFileAOS.main(): trying to read (bytes): " + abData.length); nBytesRead = oscillator.read(abData, 0, abData.length); - if (DEBUG) { - System.out.println("OscillatorFileAOS.main(): read (bytes): " + nBytesRead); - } + logger.log(Level.DEBUG, "OscillatorFileAOS.main(): read (bytes): " + nBytesRead); if (nBytesRead >= 0) { int nBytesWritten = audioOutputStream.write(abData, 0, nBytesRead); - if (DEBUG) { - System.out.println("OscillatorFileAOS.main(): written: " + nBytesWritten); - } + logger.log(Level.DEBUG, "OscillatorFileAOS.main(): written: " + nBytesWritten); } } @@ -212,15 +206,13 @@ public static void main(String[] args) throws IOException { private static int getWaveformType(String strWaveformType) { int nWaveformType = Oscillator.WAVEFORM_SINE; strWaveformType = strWaveformType.trim().toLowerCase(); - if (strWaveformType.equals("sine")) { - nWaveformType = Oscillator.WAVEFORM_SINE; - } else if (strWaveformType.equals("square")) { - nWaveformType = Oscillator.WAVEFORM_SQUARE; - } else if (strWaveformType.equals("triangle")) { - nWaveformType = Oscillator.WAVEFORM_TRIANGLE; - } else if (strWaveformType.equals("sawtooth")) { - nWaveformType = Oscillator.WAVEFORM_SAWTOOTH; - } + nWaveformType = switch (strWaveformType) { + case "sine" -> Oscillator.WAVEFORM_SINE; + case "square" -> Oscillator.WAVEFORM_SQUARE; + case "triangle" -> Oscillator.WAVEFORM_TRIANGLE; + case "sawtooth" -> Oscillator.WAVEFORM_SAWTOOTH; + default -> nWaveformType; + }; return nWaveformType; } diff --git a/src/samples/java/jse/OscillatorPlayer.java b/src/samples/java/jse/OscillatorPlayer.java index b6ce024..2ad1c21 100644 --- a/src/samples/java/jse/OscillatorPlayer.java +++ b/src/samples/java/jse/OscillatorPlayer.java @@ -1,9 +1,3 @@ -package jse; -/* - * OscillatorPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 -2001 by Matthias Pfisterer * @@ -22,19 +16,22 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; -/* If the compilation fails because this class is not available, - get gnu.getopt from the URL given in the comment below. -*/ import gnu.getopt.Getopt; +import static java.lang.System.getLogger; + /* +DocBookXML Playing waveforms @@ -95,9 +92,17 @@ Plays waveforms (sine, square, ...). -DocBookXML */ + +/** + * OscillatorPlayer.java + *

    + * This file is part of the Java Sound Examples. + */ public class OscillatorPlayer { + + private static final Logger logger = getLogger(OscillatorPlayer.class.getName()); + private static final int BUFFER_SIZE = 128000; - private static boolean DEBUG = false; public static void main(String[] args) throws IOException { byte[] abData; @@ -107,100 +112,76 @@ public static void main(String[] args) throws IOException { float fSignalFrequency = 1000.0F; float fAmplitude = 0.7F; - /* - * Parsing of command-line options takes place... - */ + // Parsing of command-line options takes place... Getopt g = new Getopt("AudioPlayer", args, "ht:r:f:a:D"); int c; while ((c = g.getopt()) != -1) { switch (c) { - case 'h': - printUsageAndExit(); - case 't': - nWaveformType = getWaveformType(g.getOptarg()); - break; - case 'r': - fSampleRate = Float.parseFloat(g.getOptarg()); - break; - case 'f': - fSignalFrequency = Float.parseFloat(g.getOptarg()); - break; - case 'a': - fAmplitude = Float.parseFloat(g.getOptarg()); - break; - case 'D': - DEBUG = true; - break; - case '?': - printUsageAndExit(); - default: - if (DEBUG) { - out("getopt() returned " + c); - } - break; + case 'h': + printUsageAndExit(); + case 't': + nWaveformType = getWaveformType(g.getOptarg()); + break; + case 'r': + fSampleRate = Float.parseFloat(g.getOptarg()); + break; + case 'f': + fSignalFrequency = Float.parseFloat(g.getOptarg()); + break; + case 'a': + fAmplitude = Float.parseFloat(g.getOptarg()); + break; + case '?': + printUsageAndExit(); + default: + logger.log(Level.DEBUG, "getopt() returned " + c); + break; } } audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - fSampleRate, 16, 2, 4, fSampleRate, false); + fSampleRate, 16, 2, 4, fSampleRate, false); AudioInputStream oscillator = new Oscillator(nWaveformType, - fSignalFrequency, - fAmplitude, audioFormat, - AudioSystem.NOT_SPECIFIED); + fSignalFrequency, fAmplitude, audioFormat, AudioSystem.NOT_SPECIFIED); SourceDataLine line = null; DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat); try { line = (SourceDataLine) AudioSystem.getLine(info); line.open(audioFormat); - } catch (LineUnavailableException e) { - e.printStackTrace(); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } line.start(); abData = new byte[BUFFER_SIZE]; while (true) { - if (DEBUG) { - out("OscillatorPlayer.main(): trying to read (bytes): " + - abData.length); - } + logger.log(Level.DEBUG, "OscillatorPlayer.main(): trying to read (bytes): " + abData.length); int nRead = oscillator.read(abData); - if (DEBUG) { - out("OscillatorPlayer.main(): in loop, read (bytes): " + nRead); - } + logger.log(Level.DEBUG, "OscillatorPlayer.main(): in loop, read (bytes): " + nRead); int nWritten = line.write(abData, 0, nRead); - if (DEBUG) { - out("OscillatorPlayer.main(): written: " + nWritten); - } + logger.log(Level.DEBUG, "OscillatorPlayer.main(): written: " + nWritten); } } private static int getWaveformType(String strWaveformType) { int nWaveformType = Oscillator.WAVEFORM_SINE; strWaveformType = strWaveformType.trim().toLowerCase(); - if (strWaveformType.equals("sine")) { - nWaveformType = Oscillator.WAVEFORM_SINE; - } else if (strWaveformType.equals("square")) { - nWaveformType = Oscillator.WAVEFORM_SQUARE; - } else if (strWaveformType.equals("triangle")) { - nWaveformType = Oscillator.WAVEFORM_TRIANGLE; - } else if (strWaveformType.equals("sawtooth")) { - nWaveformType = Oscillator.WAVEFORM_SAWTOOTH; - } + nWaveformType = switch (strWaveformType) { + case "sine" -> Oscillator.WAVEFORM_SINE; + case "square" -> Oscillator.WAVEFORM_SQUARE; + case "triangle" -> Oscillator.WAVEFORM_TRIANGLE; + case "sawtooth" -> Oscillator.WAVEFORM_SAWTOOTH; + default -> nWaveformType; + }; return nWaveformType; } private static void printUsageAndExit() { - out("OscillatorPlayer: usage:"); - out("\tjava OscillatorPlayer [-t ] [-f ] [-r ]"); + logger.log(Level.DEBUG, "OscillatorPlayer: usage:"); + logger.log(Level.DEBUG, "\tjava OscillatorPlayer [-t ] [-f ] [-r ]"); System.exit(1); } - - private static void out(String strMessage) { - System.out.println(strMessage); - } } diff --git a/src/samples/java/jse/SequenceAudioInputStream.java b/src/samples/java/jse/SequenceAudioInputStream.java index 747e67c..d832a56 100644 --- a/src/samples/java/jse/SequenceAudioInputStream.java +++ b/src/samples/java/jse/SequenceAudioInputStream.java @@ -27,19 +27,23 @@ */ import java.io.ByteArrayInputStream; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; import java.util.List; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + public class SequenceAudioInputStream extends AudioInputStream { - private static final boolean DEBUG = true; - private List m_audioInputStreamList; + private static final Logger logger = getLogger(SequenceAudioInputStream.class.getName()); + + private final List m_audioInputStreamList; private int m_nCurrentStream; @@ -51,15 +55,11 @@ public SequenceAudioInputStream(AudioFormat audioFormat, Collection streamIterator = m_audioInputStreamList.iterator(); - while (streamIterator.hasNext()) { - AudioInputStream stream = streamIterator.next(); + for (AudioInputStream stream : m_audioInputStreamList) { long lLength = stream.getFrameLength(); if (lLength == AudioSystem.NOT_SPECIFIED) { return AudioSystem.NOT_SPECIFIED; @@ -109,84 +104,76 @@ public long getFrameLength() { return lLengthInFrames; } + @Override public int read() throws IOException { AudioInputStream stream = getCurrentStream(); int nByte = stream.read(); if (nByte == -1) { - /* - * The end of the current stream has been signaled. We try to - * advance to the next stream. - */ + // The end of the current stream has been signaled. We try to + // advance to the next stream. boolean bAnotherStreamAvailable = advanceStream(); if (bAnotherStreamAvailable) { - /* - * There is another stream. We recurse into this method to read - * from it. - */ + // There is another stream. We recurse into this method to read + // from it. return read(); } else { - /* - * No more data. We signal EOF. - */ + // No more data. We signal EOF. return -1; } } else { - /* - * The most common case: We return the byte. - */ + // The most common case: We return the byte. return nByte; } } + @Override public int read(byte[] abData, int nOffset, int nLength) throws IOException { AudioInputStream stream = getCurrentStream(); int nBytesRead = stream.read(abData, nOffset, nLength); if (nBytesRead == -1) { - /* - * The end of the current stream has been signaled. We try to - * advance to the next stream. - */ + // The end of the current stream has been signaled. We try to + // advance to the next stream. boolean bAnotherStreamAvailable = advanceStream(); if (bAnotherStreamAvailable) { - /* - * There is another stream. We recurse into this method to read - * from it. - */ + // There is another stream. We recurse into this method to read + // from it. return read(abData, nOffset, nLength); } else { - /* - * No more data. We signal EOF. - */ + // No more data. We signal EOF. return -1; } } else { - /* - * The most common case: We return the length. - */ + // The most common case: We return the length. return nBytesRead; } } + @Override public long skip(long lLength) throws IOException { throw new IOException("skip() is not implemented in class SequenceInputStream. Mail if you need this feature."); } + @Override public int available() throws IOException { return getCurrentStream().available(); } + @Override public void close() throws IOException { // TODO: should we close all streams in the list? } + @Override public void mark(int nReadLimit) { throw new RuntimeException("mark() is not implemented in class SequenceInputStream. Mail if you need this feature."); } + @Override public void reset() throws IOException { throw new IOException("reset() is not implemented in class SequenceInputStream. Mail if you need this feature."); } + @Override public boolean markSupported() { return false; } diff --git a/src/samples/java/jse/SimpleAudioPlayer.java b/src/samples/java/jse/SimpleAudioPlayer.java index 318441c..b84bff5 100644 --- a/src/samples/java/jse/SimpleAudioPlayer.java +++ b/src/samples/java/jse/SimpleAudioPlayer.java @@ -1,9 +1,3 @@ -package jse; -/* - * SimpleAudioPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -23,15 +17,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; +import static java.lang.System.getLogger; + /* +DocBookXML Playing an audio file (easy) @@ -73,147 +73,130 @@ Playing an audio file (easy) -DocBookXML */ + +/** + * SimpleAudioPlayer.java + *

    + * This file is part of the Java Sound Examples. + */ public class SimpleAudioPlayer { + + private static final Logger logger = getLogger(SimpleAudioPlayer.class.getName()); + private static final int EXTERNAL_BUFFER_SIZE = 128000; public static void main(String[] args) { - /* - We check that there is exactely one command-line - argument. - If not, we display the usage message and exit. - */ + // We check that there is exactely one command-line + // argument. + // If not, we display the usage message and exit. if (args.length != 1) { System.out.println("SimpleAudioPlayer: usage:"); System.out.println("\tjava SimpleAudioPlayer "); System.exit(1); } - /* - Now, that we're shure there is an argument, we - take it as the filename of the soundfile - we want to play. - */ + // Now, that we're shure there is an argument, we + // take it as the filename of the soundfile + // we want to play. String strFilename = args[0]; File soundFile = new File(strFilename); - /* - We have to read in the sound file. - */ + // We have to read in the sound file. AudioInputStream audioInputStream = null; try { audioInputStream = AudioSystem.getAudioInputStream(soundFile); } catch (Exception e) { - /* - In case of an exception, we dump the exception - including the stack trace to the console output. - Then, we exit the program. - */ - e.printStackTrace(); + // In case of an exception, we dump the exception + // including the stack trace to the console output. + // Then, we exit the program. + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - From the AudioInputStream, i.e. from the sound file, - we fetch information about the format of the - audio data. - These information include the sampling frequency, - the number of - channels and the size of the samples. - These information - are needed to ask Java Sound for a suitable output line - for this audio file. - */ + // From the AudioInputStream, i.e. from the sound file, + // we fetch information about the format of the + // audio data. + // These information include the sampling frequency, + // the number of + // channels and the size of the samples. + // These information + // are needed to ask Java Sound for a suitable output line + // for this audio file. + AudioFormat audioFormat = audioInputStream.getFormat(); - /* - Asking for a line is a rather tricky thing. - We have to construct an Info object that specifies - the desired properties for the line. - First, we have to say which kind of line we want. The - possibilities are: SourceDataLine (for playback), Clip - (for repeated playback) and TargetDataLine (for - recording). - Here, we want to do normal playback, so we ask for - a SourceDataLine. - Then, we have to pass an AudioFormat object, so that - the Line knows which format the data passed to it - will have. - Furthermore, we can give Java Sound a hint about how - big the internal buffer for the line should be. This - isn't used here, signaling that we - don't care about the exact size. Java Sound will use - some default value for the buffer size. - */ + // Asking for a line is a rather tricky thing. + // We have to construct an Info object that specifies + // the desired properties for the line. + // First, we have to say which kind of line we want. The + // possibilities are: SourceDataLine (for playback), Clip + // (for repeated playback) and TargetDataLine (for + // recording). + // Here, we want to do normal playback, so we ask for + // a SourceDataLine. + // Then, we have to pass an AudioFormat object, so that + // the Line knows which format the data passed to it + // will have. + // Furthermore, we can give Java Sound a hint about how + // big the internal buffer for the line should be. This + // isn't used here, signaling that we + // don't care about the exact size. Java Sound will use + // some default value for the buffer size. SourceDataLine line = null; DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat); try { line = (SourceDataLine) AudioSystem.getLine(info); - /* - The line is there, but it is not yet ready to - receive audio data. We have to open the line. - */ + // The line is there, but it is not yet ready to + // receive audio data. We have to open the line. line.open(audioFormat); - } catch (LineUnavailableException e) { - e.printStackTrace(); - System.exit(1); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - Still not enough. The line now can receive data, - but will not pass them on to the audio output device - (which means to your sound card). This has to be - activated. - */ + // Still not enough. The line now can receive data, + // but will not pass them on to the audio output device + // (which means to your sound card). This has to be + // activated. line.start(); - /* - Ok, finally the line is prepared. Now comes the real - job: we have to write data to the line. We do this - in a loop. First, we read data from the - AudioInputStream to a buffer. Then, we write from - this buffer to the Line. This is done until the end - of the file is reached, which is detected by a - return value of -1 from the read method of the - AudioInputStream. - */ + // Ok, finally the line is prepared. Now comes the real + // job: we have to write data to the line. We do this + // in a loop. First, we read data from the + // AudioInputStream to a buffer. Then, we write from + // this buffer to the Line. This is done until the end + // of the file is reached, which is detected by a + // return value of -1 from the read method of the + // AudioInputStream. int nBytesRead = 0; byte[] abData = new byte[EXTERNAL_BUFFER_SIZE]; while (nBytesRead != -1) { try { nBytesRead = audioInputStream.read(abData, 0, abData.length); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (nBytesRead >= 0) { int nBytesWritten = line.write(abData, 0, nBytesRead); } } - /* - Wait until all data are played. - This is only necessary because of the bug noted below. - (If we do not wait, we would interrupt the playback by - prematurely closing the line and exiting the VM.) - - Thanks to Margie Fitch for bringing me on the right - path to this solution. - */ + // Wait until all data are played. + // This is only necessary because of the bug noted below. + // (If we do not wait, we would interrupt the playback by + // prematurely closing the line and exiting the VM.) + // + // Thanks to Margie Fitch for bringing me on the right + // path to this solution. line.drain(); - /* - All data are played. We can close the shop. - */ + // All data are played. We can close the shop. line.close(); - /* - There is a bug in the jdk1.3. - It prevents correct termination of the VM. - So we have to exit ourselves. - */ + // There is a bug in the jdk1.3. + // It prevents correct termination of the VM. + // So we have to exit ourselves. System.exit(0); } } diff --git a/src/samples/java/jse/SimpleAudioRecorder.java b/src/samples/java/jse/SimpleAudioRecorder.java index b20e525..afaf7bd 100644 --- a/src/samples/java/jse/SimpleAudioRecorder.java +++ b/src/samples/java/jse/SimpleAudioRecorder.java @@ -1,9 +1,3 @@ -package jse; -/* - * SimpleAudioRecorder.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -23,15 +17,22 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -import java.io.IOException; + +package jse; + import java.io.File; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.TargetDataLine; +import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; +import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.TargetDataLine; + +import static java.lang.System.getLogger; /* +DocBookXML @@ -80,25 +81,35 @@ recorded in CD quality (44.1 kHz, 16 bit linear, stereo) and -DocBookXML */ + +/** + * SimpleAudioRecorder.java + *

    + * This file is part of the Java Sound Examples. + */ public class SimpleAudioRecorder extends Thread { - private TargetDataLine m_line; - private AudioFileFormat.Type m_targetType; - private AudioInputStream m_audioInputStream; - private File m_outputFile; + + private static final Logger logger = getLogger(SimpleAudioRecorder.class.getName()); + + private final TargetDataLine m_line; + private final AudioFileFormat.Type m_targetType; + private final AudioInputStream m_audioInputStream; + private final File m_outputFile; private boolean m_bRecording; - public SimpleAudioRecorder(TargetDataLine line, - AudioFileFormat.Type targetType, File file) { + public SimpleAudioRecorder(TargetDataLine line, AudioFileFormat.Type targetType, File file) { m_line = line; m_audioInputStream = new AudioInputStream(line); m_targetType = targetType; m_outputFile = file; } - /** Starts the recording. - * To accomplish this, (i) the line is started and (ii) the - * thread is started. + /** + * Starts the recording. + * To accomplish this, (i) the line is started and (ii) the + * thread is started. */ + @Override public void start() { m_line.start(); super.start(); @@ -110,12 +121,13 @@ public void stopRecording() { m_bRecording = false; } + @Override public void run() { try { AudioSystem.write(m_audioInputStream, m_targetType, m_outputFile); System.out.println("after write()"); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } @@ -124,10 +136,8 @@ public static void main(String[] args) { printUsageAndExit(); } - /* - * We make shure that there is only one more argument, which - * we take as the filename of the soundfile to store to. - */ + // We make shure that there is only one more argument, which + // we take as the filename of the soundfile to store to. String strFilename = args[0]; File outputFile = new File(strFilename); @@ -137,7 +147,7 @@ public static void main(String[] args) { // audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000.0F, 8, 1, 1, 8000.0F, true); // 44.1 kHz, 16 bit, stereo audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - 44100.0F, 16, 2, 4, 44100.0F, false); + 44100.0F, 16, 2, 4, 44100.0F, false); DataLine.Info info = new DataLine.Info(TargetDataLine.class, audioFormat); TargetDataLine targetDataLine = null; @@ -146,20 +156,19 @@ public static void main(String[] args) { targetDataLine.open(audioFormat); } catch (LineUnavailableException e) { System.out.println("unable to get a recording line"); - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } AudioFileFormat.Type targetType = AudioFileFormat.Type.AU; SimpleAudioRecorder recorder = null; - recorder = new SimpleAudioRecorder(targetDataLine, targetType, - outputFile); + recorder = new SimpleAudioRecorder(targetDataLine, targetType, outputFile); System.out.println("Press ENTER to start the recording."); try { - // System.in.read(); +// System.in.read(); System.in.read(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } recorder.start(); System.out.println("Recording..."); @@ -167,12 +176,12 @@ public static void main(String[] args) { try { System.in.read(); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } recorder.stopRecording(); System.out.println("Recording stopped."); - // System.exit(0); +// System.exit(0); } private static void printUsageAndExit() { diff --git a/src/samples/java/jse/SimpleAudioStream.java b/src/samples/java/jse/SimpleAudioStream.java index 5bfa926..0129ebf 100644 --- a/src/samples/java/jse/SimpleAudioStream.java +++ b/src/samples/java/jse/SimpleAudioStream.java @@ -23,6 +23,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + import java.io.File; import java.io.IOException; import java.net.URL; @@ -32,137 +33,91 @@ public class SimpleAudioStream extends BaseAudioStream { - /** Flag for debugging messages. - * If true, some messages are dumped to the console - * during operation. - */ - private static boolean DEBUG = true; - // private static final int EXTERNAL_BUFFER_SIZE = 16384; +// private static final int EXTERNAL_BUFFER_SIZE = 16384; /** - * This variable is used to distinguish stopped state from - * paused state. In case of paused state, m_bRunning is still - * true. In case of stopped state, it is set to false. Doing so - * will terminate the thread. + * This variable is used to distinguish stopped state from + * paused state. In case of paused state, m_bRunning is still + * true. In case of stopped state, it is set to false. Doing so + * will terminate the thread. */ private boolean m_bRunning; public SimpleAudioStream() { super(); - // m_dataSource = null; +// m_dataSource = null; } public SimpleAudioStream(File file) - throws UnsupportedAudioFileException, LineUnavailableException, - IOException { + throws UnsupportedAudioFileException, LineUnavailableException, IOException { this(); setDataSource(file); initLine(); } public SimpleAudioStream(URL url) - throws UnsupportedAudioFileException, LineUnavailableException, - IOException { + throws UnsupportedAudioFileException, LineUnavailableException, IOException { this(); setDataSource(url); initLine(); } + @Override public AudioFormat getFormat() { // TODO: have to check that AudioInputStream (or Line?) is initialized return super.getFormat(); } -/* - public void start() - { - if (DEBUG) - { - System.out.println("start() called"); - } - m_thread = new Thread(this); - m_thread.start(); - if (DEBUG) - { - System.out.println("additional thread started"); - } - m_line.start(); - if (DEBUG) - { - System.out.println("started line"); - } - } - - - - public void stop() - { - m_line.stop(); - m_line.flush(); - m_bRunning = false; - } - - - - public void pause() - { - m_line.stop(); - } - - - - public void resume() - { - m_line.start(); - } -*/ -/* - public void run() - { - if (DEBUG) - { - System.out.println("thread start"); - } - int nBytesRead = 0; - m_bRunning = true; - byte[] abData = new byte[EXTERNAL_BUFFER_SIZE]; - int nFrameSize = m_line.getFormat().getFrameSize(); - while (nBytesRead != -1 && m_bRunning) - { - try - { - nBytesRead = m_audioInputStream.read(abData, 0, abData.length); - } - catch (IOException e) - { - e.printStackTrace(); - } - if (nBytesRead >= 0) - { - int nRemainingBytes = nBytesRead; - // while (nRemainingBytes > 0) - //{ - if (DEBUG) - { - System.out.println("Line status (active): " + m_line.isActive()); - System.out.println("Line status (running): " + m_line.isRunning()); - System.out.println("Trying to write (bytes): " + nBytesRead); - } - int nBytesWritten = m_line.write(abData, 0, nBytesRead); - if (DEBUG) - { - System.out.println("Written (bytes): " + nBytesWritten); - } - nRemainingBytes -= nBytesWritten; - //} - } - } - if (DEBUG) - { - System.out.println("after main loop"); - } - } -*/ +// public void start() { +// logger.log(Level.TRACE, "start() called"); +// m_thread = new Thread(this); +// m_thread.start(); +// logger.log(Level.TRACE, "additional thread started"); +// m_line.start(); +// logger.log(Level.TRACE, "started line"); +// } +// +// public void stop() { +// m_line.stop(); +// m_line.flush(); +// m_bRunning = false; +// } +// +// public void pause() { +// m_line.stop(); +// } +// +// public void resume() { +// m_line.start(); +// } +// +// public void run() { +// logger.log(Level.TRACE, "thread start"); +// int nBytesRead = 0; +// m_bRunning = true; +// byte[] abData = new byte[EXTERNAL_BUFFER_SIZE]; +// int nFrameSize = m_line.getFormat().getFrameSize(); +// while (nBytesRead != -1 && m_bRunning) { +// try { +// nBytesRead = m_audioInputStream.read(abData, 0, abData.length); +// } catch (IOException e) { +// logger.log(Level.ERROR, e.getMessage(), e); +// } +// if (nBytesRead >= 0) { +// int nRemainingBytes = nBytesRead; +//// while (nRemainingBytes > 0) +//// { +// logger.log(Level.ERROR, "Line status (active): " + m_line.isActive()); +// logger.log(Level.ERROR, "Line status (running): " + m_line.isRunning()); +// logger.log(Level.ERROR, "Trying to write (bytes): " + nBytesRead); +// int nBytesWritten = m_line.write(abData, 0, nBytesRead); +// logger.log(Level.ERROR, "Written (bytes): " + nBytesWritten); +// nRemainingBytes -= nBytesWritten; +//// } +// } +// } +// logger.log(Level.TRACE, "after main loop"); +// } } diff --git a/src/samples/java/jse/SimpleMidiPlayer.java b/src/samples/java/jse/SimpleMidiPlayer.java index 1ed36cc..f793fc4 100644 --- a/src/samples/java/jse/SimpleMidiPlayer.java +++ b/src/samples/java/jse/SimpleMidiPlayer.java @@ -1,9 +1,3 @@ -package jse; -/* - * SimpleMidiPlayer.java - * - * This file is part of the Java Sound Examples. - */ /* * Copyright (c) 1999 - 2001 by Matthias Pfisterer * @@ -23,11 +17,14 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ + +package jse; + import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.InvalidMidiDataException; -import javax.sound.midi.MetaEventListener; -import javax.sound.midi.MetaMessage; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Receiver; @@ -36,6 +33,8 @@ import javax.sound.midi.Synthesizer; import javax.sound.midi.Transmitter; +import static java.lang.System.getLogger; + /* +DocBookXML Playing a MIDI file (easy) @@ -80,36 +79,43 @@ Playing a MIDI file (easy) -DocBookXML */ + +/** + * SimpleMidiPlayer.java + *

    + * This file is part of the Java Sound Examples. + */ public class SimpleMidiPlayer { - /* - These variables are not really intended to be static in a - meaning of (good) design. They are used by inner classes, so they - can't just be automatic variables. There were three possibilities: - - a) make them instance variables and instantiate the object they - belong to. This is clean (and is how you should do it in a real - application), but would have made the example more complex. - - b) make them automatic final variables inside main(). Design-wise, - this is better than static, but automatic final is something that - is still like some black magic to me. - - c) make them static variables, as it is done here. This is quite bad - design, because if you have global variables, you can't easily do - the thing they are used for two times in concurrency without risking - indeterministic behaviour. However, it makes the example easy to - read. + + private static final Logger logger = getLogger(SimpleMidiPlayer.class.getName()); + + /** + * These variables are not really intended to be static in a + * meaning of (good) design. They are used by inner classes, so they + * can't just be automatic variables. There were three possibilities: + *

    + * a) make them instance variables and instantiate the object they + * belong to. This is clean (and is how you should do it in a real + * application), but would have made the example more complex. + *

    + * b) make them automatic final variables inside main(). Design-wise, + * this is better than static, but automatic final is something that + * is still like some black magic to me. + *

    + * c) make them static variables, as it is done here. This is quite bad + * design, because if you have global variables, you can't easily do + * the thing they are used for two times in concurrency without risking + * indeterministic behaviour. However, it makes the example easy to + * read. */ private static Sequencer sm_sequencer = null; private static Synthesizer sm_synthesizer = null; public static void main(String[] args) { - /* - * We check if there is no command-line argument at all - * or the first one is '-h'. - * If so, we display the usage message and - * exit. - */ + // We check if there is no command-line argument at all + // or the first one is '-h'. + // If so, we display the usage message and + // exit. if ((args.length == 0) || args[0].equals("-h")) { printUsageAndExit(); } @@ -117,39 +123,25 @@ public static void main(String[] args) { String strFilename = args[0]; File midiFile = new File(strFilename); - /* - * We read in the MIDI file to a Sequence object. - * This object is set at the Sequencer later. - */ + // We read in the MIDI file to a Sequence object. + // This object is set at the Sequencer later. Sequence sequence = null; try { sequence = MidiSystem.getSequence(midiFile); - } catch (InvalidMidiDataException e) { - /* - * In case of an exception, we dump the exception - * including the stack trace to the console. - * Then, we exit the program. - */ - e.printStackTrace(); - System.exit(1); - } catch (IOException e) { - /* - * In case of an exception, we dump the exception - * including the stack trace to the console. - * Then, we exit the program. - */ - e.printStackTrace(); + } catch (InvalidMidiDataException | IOException e) { + // In case of an exception, we dump the exception + // including the stack trace to the console. + // Then, we exit the program. + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * Now, we need a Sequencer to play the sequence. - * Here, we simply request the default sequencer. - */ + // Now, we need a Sequencer to play the sequence. + // Here, we simply request the default sequencer. try { sm_sequencer = MidiSystem.getSequencer(); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } if (sm_sequencer == null) { @@ -157,78 +149,66 @@ public static void main(String[] args) { System.exit(1); } - /* - * There is a bug in the Sun jdk1.3. - * It prevents correct termination of the VM. - * So we have to exit ourselves. - * To accomplish this, we register a Listener to the Sequencer. - * It is called when there are "meta" events. Meta event - * 47 is end of track. - * - * Thanks to Espen Riskedal for finding this trick. - */ - sm_sequencer.addMetaEventListener(new MetaEventListener() { - public void meta(MetaMessage event) { - if (event.getType() == 47) { - sm_sequencer.close(); - if (sm_synthesizer != null) { - sm_synthesizer.close(); - } - System.exit(0); - } + // There is a bug in the Sun jdk1.3. + // It prevents correct termination of the VM. + // So we have to exit ourselves. + // To accomplish this, we register a Listener to the Sequencer. + // It is called when there are "meta" events. Meta event + // 47 is end of track. + // + // Thanks to Espen Riskedal for finding this trick. + sm_sequencer.addMetaEventListener(event -> { + if (event.getType() == 47) { + sm_sequencer.close(); + if (sm_synthesizer != null) { + sm_synthesizer.close(); } - }); - - /* - * The Sequencer is still a dead object. - * We have to open() it to become live. - * This is necessary to allocate some ressources in - * the native part. - */ + System.exit(0); + } + }); + + // The Sequencer is still a dead object. + // We have to open() it to become live. + // This is necessary to allocate some ressources in + // the native part. try { sm_sequencer.open(); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * Next step is to tell the Sequencer which - * Sequence it has to play. In this case, we - * set it as the Sequence object created above. - */ + // Next step is to tell the Sequencer which + // Sequence it has to play. In this case, we + // set it as the Sequence object created above. try { sm_sequencer.setSequence(sequence); } catch (InvalidMidiDataException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * Now, we set up the destinations the Sequence should be - * played on. Here, we try to use the default - * synthesizer. With some Java Sound implementations - * (Sun jdk1.3 and others derived from this codebase), - * the default sequencer and the default synthesizer - * are combined in one object. We test for this - * condition, and if it's true, nothing more has to - * be done. With other implementations (namely Tritonus), - * sequencers and synthesizers are always seperate - * objects. In this case, we have to set up a link - * between the two objects manually. - * - * By the way, you should never rely on sequencers - * being synthesizers, too; this is a highly non- - * portable programming style. You should be able to - * rely on the other case working. Alas, it is only - * partly true for the Sun jdk1.3. - */ + // Now, we set up the destinations the Sequence should be + // played on. Here, we try to use the default + // synthesizer. With some Java Sound implementations + // (Sun jdk1.3 and others derived from this codebase), + // the default sequencer and the default synthesizer + // are combined in one object. We test for this + // condition, and if it's true, nothing more has to + // be done. With other implementations (namely Tritonus), + // sequencers and synthesizers are always seperate + // objects. In this case, we have to set up a link + // between the two objects manually. + // + // By the way, you should never rely on sequencers + // being synthesizers, too; this is a highly non- + // portable programming style. You should be able to + // rely on the other case working. Alas, it is only + // partly true for the Sun jdk1.3. if (!(sm_sequencer instanceof Synthesizer)) { - /* - * We try to get the default synthesizer, open() - * it and chain it to the sequencer with a - * Transmitter-Receiver pair. - */ + // We try to get the default synthesizer, open() + // it and chain it to the sequencer with a + // Transmitter-Receiver pair. try { sm_synthesizer = MidiSystem.getSynthesizer(); sm_synthesizer.open(); @@ -237,13 +217,11 @@ public void meta(MetaMessage event) { Transmitter seqTransmitter = sm_sequencer.getTransmitter(); seqTransmitter.setReceiver(synthReceiver); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } - /* - * Now, we can start over. - */ + // Now, we can start over. sm_sequencer.start(); } diff --git a/src/samples/java/jse/SynthNote.java b/src/samples/java/jse/SynthNote.java index 8511f79..d051b55 100644 --- a/src/samples/java/jse/SynthNote.java +++ b/src/samples/java/jse/SynthNote.java @@ -20,11 +20,15 @@ package jse; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.midi.MidiChannel; import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.Synthesizer; +import static java.lang.System.getLogger; + /* +DocBookXML Playing a note on the synthesizer @@ -81,21 +85,23 @@ -DocBookXML */ -/* - * SynthNote.java - * - * This file is part of the Java Sound Examples. + +/** + * SynthNote.java + *

    + * This file is part of the Java Sound Examples. */ public class SynthNote { + + private static final Logger logger = getLogger(SynthNote.class.getName()); + public static void main(String[] args) { int nNoteNumber = 0; // MIDI key number int nVelocity = 0; - /* - * Time between note on and note off event in - * milliseconds. Note that on most systems, the - * best resolution you can expect are 10 ms. - */ + // Time between note on and note off event in + // milliseconds. Note that on most systems, the + // best resolution you can expect are 10 ms. int nDuration = 0; if (args.length == 3) { nNoteNumber = Integer.parseInt(args[0]); @@ -110,47 +116,37 @@ public static void main(String[] args) { System.exit(1); } - /* - * We need a synthesizer to play the note on. - * Here, we simply request the default - * synthesizer. - */ + // We need a synthesizer to play the note on. + // Here, we simply request the default + // synthesizer. Synthesizer synth = null; try { synth = MidiSystem.getSynthesizer(); } catch (MidiUnavailableException e) { } - /* - * Of course, we have to open the synthesizer to - * produce any sound for us. - */ + // Of course, we have to open the synthesizer to + // produce any sound for us. try { synth.open(); } catch (MidiUnavailableException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); System.exit(1); } - /* - * Turn the note on on MIDI channel 1. - * (Index zero means MIDI channel 1) - */ + // Turn the note on on MIDI channel 1. + // (Index zero means MIDI channel 1) MidiChannel[] channels = synth.getChannels(); channels[0].noteOn(nNoteNumber, nVelocity); - /* - * Wait for the specified amount of time - * (the duration of the note). - */ + // Wait for the specified amount of time + // (the duration of the note). try { Thread.sleep(nDuration); } catch (InterruptedException e) { } - /* - * Turn the note off. - */ + // Turn the note off. channels[0].noteOff(nNoteNumber); } } diff --git a/src/samples/java/jse/UlawEncoder.java b/src/samples/java/jse/UlawEncoder.java index e68d5d9..56c9472 100644 --- a/src/samples/java/jse/UlawEncoder.java +++ b/src/samples/java/jse/UlawEncoder.java @@ -22,11 +22,16 @@ import java.io.File; import java.io.IOException; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import static java.lang.System.getLogger; + + /* * +DocBookXML * Encoding an audio file to μ-law @@ -82,6 +87,9 @@ * This file is part of the Java Sound Examples. */ public class UlawEncoder { + + private static final Logger logger = getLogger(UlawEncoder.class.getName()); + public static void main(String[] args) { if (args.length != 2) { printUsageAndExit(); @@ -93,7 +101,7 @@ public static void main(String[] args) { try { ais = AudioSystem.getAudioInputStream(pcmFile); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } if (ais == null) { System.out.println("cannot open audio file"); @@ -107,7 +115,7 @@ public static void main(String[] args) { try { nWrittenFrames = AudioSystem.write(ulawAudioInputStreamAIS, fileType, ulawFile); } catch (IOException e) { - e.printStackTrace(); + logger.log(Level.ERROR, e.getMessage(), e); } } diff --git a/src/samples/java/jse/readme.md b/src/samples/java/jse/readme.md index da53512..38102d7 100644 --- a/src/samples/java/jse/readme.md +++ b/src/samples/java/jse/readme.md @@ -1,6 +1,8 @@ +# Java Sound Resources: Examples + ## License - * [Java Sound Example](http://www.jsresources.org/) + * [Java Sound Example](https://jsresources.sourceforge.net/) > ``` > /* diff --git a/src/test/resources/vavi/sound/ldcelp/f17.ldcelp b/src/samples/resources/.gitkeep similarity index 100% rename from src/test/resources/vavi/sound/ldcelp/f17.ldcelp rename to src/samples/resources/.gitkeep diff --git a/src/test/java/LineTest2.java b/src/test/java/LineTest2.java index 5afd061..bd7667e 100644 --- a/src/test/java/LineTest2.java +++ b/src/test/java/LineTest2.java @@ -17,7 +17,6 @@ import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineEvent; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; import javax.sound.sampled.spi.AudioFileReader; diff --git a/src/test/java/vavi/sound/ilbc/IlbcTest.java b/src/test/java/vavi/sound/ilbc/IlbcTest.java index fcd9920..bf3b45f 100644 --- a/src/test/java/vavi/sound/ilbc/IlbcTest.java +++ b/src/test/java/vavi/sound/ilbc/IlbcTest.java @@ -6,14 +6,27 @@ package vavi.sound.ilbc; +import java.io.DataInputStream; +import java.io.DataOutputStream; import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; +import javax.sound.sampled.SourceDataLine; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; +import vavi.util.Debug; +import vavi.util.properties.annotation.Property; +import vavi.util.properties.annotation.PropsEntity; +import vavix.util.Checksum; import static org.junit.jupiter.api.Assertions.assertEquals; - -import vavix.util.Checksum; +import static vavi.sound.SoundUtil.volume; /** @@ -22,29 +35,100 @@ * @author Naohide Sano (umjammer) * @version 0.00 2017/12/01 umjammer initial version
    */ -@Disabled("not implemented yet") +@PropsEntity(url = "file:local.properties") class IlbcTest { - String inFile = "src/test/resources/test.wav"; - String bitFile = "tmp/test.bit"; - String outFile = "tmp/test.outnpf"; - String correctFile = "src/test/resources/vavi/sound/ldcelp/f17.outnpf"; + static boolean localPropertiesExists() { + return Files.exists(Paths.get("local.properties")); + } + + @Property(name = "ilbc") + String ilbc = "src/test/resources/ilbc/sample-30.ilbc"; + + @Property(name = "pcm") + String pcm = "src/test/resources/ilbc/sample_16k.pcm"; + + @BeforeEach + void setup() throws Exception { + if (localPropertiesExists()) { + PropsEntity.Util.bind(this); + } + } + + static double volume = Double.parseDouble(System.getProperty("vavi.test.volume", "0.2")); + + // ---- + + String encFile = "tmp/vavi-out-30.ilbc"; + String outFile = "tmp/vavi-out-ilbc-30.pcm"; + String correctFile = "src/test/resources/ilbc/sample-ilbc-30-out.pcm"; @Test void test1() throws Exception { - Ilbc.main(new String[] { "30", inFile, bitFile, outFile }); + Ilbc.main(new String[] {"30", pcm, encFile, outFile}); assertEquals(Checksum.getChecksum(new File(correctFile)), Checksum.getChecksum(new File(outFile))); } - String outFile2 = "tmp/f17.vavi.outpf"; - String correctFile2 = "src/test/resources/vavi/sound/ldcelp/f17.outpf"; - @Test + @EnabledIfSystemProperty(named = "vavi.test", matches = "ide") void test2() throws Exception { - Ilbc.main(new String[] { "-dp", inFile, outFile2 }); + Path in = Path.of(ilbc); + DataInputStream dis = new DataInputStream(Files.newInputStream(in)); + long size = Files.size(in); +Debug.println(size); + Path out = Path.of(outFile); + if (!Files.exists(out.getParent())) Files.createDirectory(out.getParent()); + DataOutputStream dos = new DataOutputStream(Files.newOutputStream(out)); - assertEquals(Checksum.getChecksum(new File(correctFile2)), Checksum.getChecksum(new File(outFile2))); - } + Decoder decoder = new Decoder(30, 1); + AudioFormat format = new AudioFormat( + AudioFormat.Encoding.PCM_SIGNED, + 8000, + 16, + 1, + 2, + 8000, + false); + Debug.println(format); + + DataLine.Info info = new DataLine.Info(SourceDataLine.class, format); + SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info); + line.open(format); + volume(line, volume); + line.start(); + + byte[] decoded = new byte[decoder.getDecodedLength()]; + byte[] buf = new byte[decoder.getEncodedLength()]; + + int l = 0; + while (true) { + int r = dis.read(buf, 0, buf.length); + if (r < 0) break; + + decoder.decode(buf, decoded); +//Debug.println("\n" + StringUtil.getDump(decoded, 32)); + + line.write(decoded, 0, decoded.length); + + dos.write(decoded, 0, decoded.length); + + l += r; +//Debug.println(l + "/" + size); + } + + line.drain(); + line.stop(); + line.close(); + + dos.flush(); + dos.close(); + + dis.close(); + + Path expected = Path.of("src/test/resources/ilbc/sample-ilbc-30-out.pcm"); // TODO different from test1 +Debug.println("expected: " + Files.size(expected)); + assertEquals(Checksum.getChecksum(expected), Checksum.getChecksum(out)); + } } diff --git a/src/test/java/vavi/sound/ldcelp/LdCelpInputStreamTest.java b/src/test/java/vavi/sound/ldcelp/LdCelpInputStreamTest.java deleted file mode 100644 index 1ec012a..0000000 --- a/src/test/java/vavi/sound/ldcelp/LdCelpInputStreamTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2006 by Naohide Sano, All rights reserved. - * - * Programmed by Naohide Sano - */ - -package vavi.sound.ldcelp; - -import java.io.File; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import vavix.util.Checksum; - -import static org.junit.jupiter.api.Assertions.assertEquals; - - -/** - * LdCelpInputStreamTest. - * - * @author Naohide Sano (nsano) - * @version 0.00 060219 nsano initial version
    - */ -@Disabled("not implemented yet") -class LdCelpInputStreamTest { - - String inFile = "src/test/resources/vavi/sound/ldcelp/f17.bit"; - String outFile = "tmp/f17.vavi.outnpf"; - String correctFile = "src/test/resources/vavi/sound/ldcelp/f17.outnpf"; - - @Test - void test1() throws Exception { - LdCelp.main(new String[] { "-d", inFile, outFile }); - - assertEquals(Checksum.getChecksum(new File(correctFile)), Checksum.getChecksum(new File(outFile))); - } - - String outFile2 = "tmp/f17.vavi.outpf"; - String correctFile2 = "src/test/resources/vavi/sound/ldcelp/f17.outpf"; - - @Test - void test2() throws Exception { - LdCelp.main(new String[] { "-dp", inFile, outFile2 }); - - assertEquals(Checksum.getChecksum(new File(correctFile2)), Checksum.getChecksum(new File(outFile2))); - } -} diff --git a/src/test/java/vavi/sound/ldcelp/LdCelpTest.java b/src/test/java/vavi/sound/ldcelp/LdCelpTest.java new file mode 100644 index 0000000..58f5548 --- /dev/null +++ b/src/test/java/vavi/sound/ldcelp/LdCelpTest.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2006 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.ldcelp; + +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.ShortBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; +import javax.sound.sampled.SourceDataLine; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; +import vavi.io.LittleEndianDataInputStream; +import vavi.util.Debug; +import vavi.util.properties.annotation.Property; +import vavi.util.properties.annotation.PropsEntity; +import vavix.util.Checksum; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static vavi.sound.SoundUtil.volume; + + +/** + * LdCelpTest. + * + * @author Naohide Sano (nsano) + * @version 0.00 060219 nsano initial version
    + */ +@PropsEntity(url = "file:local.properties") +class LdCelpTest { + + static boolean localPropertiesExists() { + return Files.exists(Paths.get("local.properties")); + } + + @Property(name = "g728") + String g728 = "src/test/resources/ldcelp/sample.g728"; + + @Property(name = "pcm") + String pcm = "src/test/resources/ldcelp/sample_16k.pcm"; + + @BeforeEach + void setup() throws Exception { + if (localPropertiesExists()) { + PropsEntity.Util.bind(this); + } + } + + static double volume = Double.parseDouble(System.getProperty("vavi.test.volume", "0.2")); + + String outFile = "tmp/ldcelp-vavi-out.pcm"; + String correctFile = "src/test/resources/ldcelp/sample-expected.pcm"; + + @Test + @DisplayName("non post-filtered") + void test1() throws Exception { +Debug.println(g728); + LdCelp.main(new String[] {"-d", g728, outFile}); + + assertEquals(Checksum.getChecksum(new File(correctFile)), Checksum.getChecksum(new File(outFile))); + } + + String outFile2 = "tmp/ldcelp-vavi-out-pf.pcm"; + String correctFile2 = "src/test/resources/ldcelp/sample-pf-expected.pcm"; + + @Test + @DisplayName("post-filtered") + void test2() throws Exception { + LdCelp.main(new String[] {"-dp", g728, outFile2}); + + assertEquals(Checksum.getChecksum(new File(correctFile2)), Checksum.getChecksum(new File(outFile2))); + } + + String outFileE = "tmp/ldcelp-vavi-out.ldcelp"; + String correctFileE = "src/test/resources/ldcelp/f17.bit"; + + @Test + @Disabled("not confirmed") + @DisplayName("encode") + void test4() throws Exception { + LdCelp.main(new String[] {"-e", pcm, outFileE}); + + assertEquals(Checksum.getChecksum(new File(correctFileE)), Checksum.getChecksum(new File(outFileE))); + } + + @Test + void testX() throws Exception { + int a = 6, b = 5; + a = b = 10; + Debug.println(a + ", " + b); + assertEquals(10, a); + assertEquals(10, b); + } + + @Test + @EnabledIfSystemProperty(named = "vavi.test", matches = "ide") + void test3() throws Exception { + Path in = Path.of(g728); + LittleEndianDataInputStream dis = new LittleEndianDataInputStream(Files.newInputStream(in)); + long size = Files.size(in); +Debug.println(size); + Path out = Path.of("tmp/g728-pf-out.pcm"); + if (!Files.exists(out.getParent())) Files.createDirectory(out.getParent()); + DataOutputStream dos = new DataOutputStream(Files.newOutputStream(out)); + + Decoder decoder = new Decoder(true); + + AudioFormat format = new AudioFormat( + AudioFormat.Encoding.PCM_SIGNED, + 16000, + 16, + 1, + 2, + 16000, + false); +Debug.println(format); + + DataLine.Info info = new DataLine.Info(SourceDataLine.class, format); + SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info); + line.open(format); + volume(line, volume); + line.start(); + + short[] inDataS = new short[1]; + short[] outDataS = new short[5]; + byte[] obuf = new byte[outDataS.length * Short.BYTES]; + ShortBuffer sb = ByteBuffer.wrap(obuf).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer(); + + int l = 0; + while (true) { + try { + inDataS[0] = dis.readShort(); + } catch (IOException e) { + break; + } + + decoder.decode(inDataS, outDataS); + sb.put(outDataS); + sb.flip(); + + line.write(obuf, 0, obuf.length); + + dos.write(obuf, 0, obuf.length); + + l += 1; +//System.err.println(l + "/" + size / Short.BYTES); + } + + line.drain(); + line.stop(); + line.close(); + + dos.flush(); + dos.close(); + + dis.close(); + } +} diff --git a/src/test/java/vavi/sound/mfi/ittake/IttakeMidiConverterTest.java b/src/test/java/vavi/sound/mfi/ittake/IttakeMidiConverterTest.java index 688498b..aeb0a41 100644 --- a/src/test/java/vavi/sound/mfi/ittake/IttakeMidiConverterTest.java +++ b/src/test/java/vavi/sound/mfi/ittake/IttakeMidiConverterTest.java @@ -46,7 +46,5 @@ public static void main(String[] args) throws Exception { file = new File(args[1]); int r = MfiSystem.write(mfiSequence, VaviMfiFileFormat.FILE_TYPE, file); Debug.println("write: " + r); - - System.exit(0); } } diff --git a/src/test/java/vavi/sound/midi/mocha/MochaMidiDeviceProvider.java b/src/test/java/vavi/sound/midi/mocha/MochaMidiDeviceProvider.java index a7fae63..115b813 100644 --- a/src/test/java/vavi/sound/midi/mocha/MochaMidiDeviceProvider.java +++ b/src/test/java/vavi/sound/midi/mocha/MochaMidiDeviceProvider.java @@ -6,11 +6,9 @@ package vavi.sound.midi.mocha; -import java.io.IOException; import java.util.logging.Level; import javax.sound.midi.MidiDevice; -import javax.sound.midi.MidiUnavailableException; import javax.sound.midi.spi.MidiDeviceProvider; import vavi.util.Debug; @@ -30,7 +28,6 @@ public class MochaMidiDeviceProvider extends MidiDeviceProvider { /** */ private static final MidiDevice.Info[] infos = new MidiDevice.Info[] { MochaSynthesizer.info }; - /* */ @Override public MidiDevice.Info[] getDeviceInfo() { return infos; diff --git a/src/test/java/vavi/sound/midi/mocha/MochaOscillator.java b/src/test/java/vavi/sound/midi/mocha/MochaOscillator.java index acf2f99..fe7fc02 100644 --- a/src/test/java/vavi/sound/midi/mocha/MochaOscillator.java +++ b/src/test/java/vavi/sound/midi/mocha/MochaOscillator.java @@ -33,7 +33,7 @@ public class MochaOscillator extends ModelAbstractOscillator { /** */ public class MochaInstrument extends SimpleInstrument { - Instrumental data; + final Instrumental data; protected MochaInstrument(int bank, int program, boolean isPercussion, String name, Instrumental data) { setName(MochaOscillator.this.getName()); add(getPerformer()); @@ -53,7 +53,7 @@ public Object getData() { } /** */ - Instrument[] instruments; + final Instrument[] instruments; { instruments = new Instrument[4]; diff --git a/src/test/java/vavi/sound/midi/mocha/MochaSoundbank.java b/src/test/java/vavi/sound/midi/mocha/MochaSoundbank.java index 119d45f..2ac6bc5 100644 --- a/src/test/java/vavi/sound/midi/mocha/MochaSoundbank.java +++ b/src/test/java/vavi/sound/midi/mocha/MochaSoundbank.java @@ -76,7 +76,7 @@ public Instrument getInstrument(Patch patch) { /** */ public static class MochaInstrument extends Instrument { - Instrumental data; + final Instrumental data; protected MochaInstrument(MochaSoundbank sounBbank, int bank, int program, String name, Instrumental data) { super(sounBbank, new Patch(bank, program), name, Instrumental.class); this.data = data; diff --git a/src/test/java/vavi/sound/midi/mocha/MochaSynthesizer.java b/src/test/java/vavi/sound/midi/mocha/MochaSynthesizer.java index 2d648dc..fb33235 100644 --- a/src/test/java/vavi/sound/midi/mocha/MochaSynthesizer.java +++ b/src/test/java/vavi/sound/midi/mocha/MochaSynthesizer.java @@ -98,7 +98,7 @@ public class MochaSynthesizer implements Synthesizer { final MochaAudioInpuStream mocha; - TimeLine timeline = new TimeLine(); + final TimeLine timeline = new TimeLine(); // ---- @@ -501,49 +501,53 @@ public void send(MidiMessage message, long timeStamp) { throw new IllegalStateException("receiver is not open"); } - if (message instanceof ShortMessage shortMessage) { - int channel = shortMessage.getChannel(); - int command = shortMessage.getCommand(); - int data1 = shortMessage.getData1(); - int data2 = shortMessage.getData2(); - switch (command) { - case ShortMessage.NOTE_OFF: - channels[channel].noteOff(data1, data2); - break; - case ShortMessage.NOTE_ON: - channels[channel].noteOn(data1, data2); - break; - case ShortMessage.POLY_PRESSURE: - channels[channel].setPolyPressure(data1, data2); - break; - case ShortMessage.CONTROL_CHANGE: - channels[channel].controlChange(data1, data2); - break; - case ShortMessage.PROGRAM_CHANGE: - channels[channel].programChange(data1); - break; - case ShortMessage.CHANNEL_PRESSURE: - channels[channel].setChannelPressure(data1); - break; - case ShortMessage.PITCH_BEND: - channels[channel].setPitchBend(data1 | (data2 << 7)); - break; - default: -Debug.printf("unhandled short: %02X\n", command); + switch (message) { + case ShortMessage shortMessage -> { + int channel = shortMessage.getChannel(); + int command = shortMessage.getCommand(); + int data1 = shortMessage.getData1(); + int data2 = shortMessage.getData2(); + switch (command) { + case ShortMessage.NOTE_OFF: + channels[channel].noteOff(data1, data2); + break; + case ShortMessage.NOTE_ON: + channels[channel].noteOn(data1, data2); + break; + case ShortMessage.POLY_PRESSURE: + channels[channel].setPolyPressure(data1, data2); + break; + case ShortMessage.CONTROL_CHANGE: + channels[channel].controlChange(data1, data2); + break; + case ShortMessage.PROGRAM_CHANGE: + channels[channel].programChange(data1); + break; + case ShortMessage.CHANNEL_PRESSURE: + channels[channel].setChannelPressure(data1); + break; + case ShortMessage.PITCH_BEND: + channels[channel].setPitchBend(data1 | (data2 << 7)); + break; + default: + Debug.printf("unhandled short: %02X\n", command); + } } - } else if (message instanceof SysexMessage sysexMessage) { - byte[] data = sysexMessage.getData(); + case SysexMessage sysexMessage -> { + byte[] data = sysexMessage.getData(); //Debug.print("sysex:\n" + StringUtil.getDump(data)); -Debug.printf(Level.FINE, "sysex: %02x %02x %02x", data[1], data[2], data[3]); - - } else if (message instanceof MetaMessage metaMessage) { - Debug.printf("meta: %02x", metaMessage.getType()); - switch (metaMessage.getType()) { - case 0x2f: - break; + Debug.printf(Level.FINE, "sysex: %02x %02x %02x", data[1], data[2], data[3]); + } + case MetaMessage metaMessage -> { + Debug.printf("meta: %02x", metaMessage.getType()); + switch (metaMessage.getType()) { + case 0x2f: + break; + } + } + case null, default -> { + assert false; } - } else { - assert false; } } diff --git a/src/test/java/vavi/sound/midi/opl3/Opl3SynthesizerTest.java b/src/test/java/vavi/sound/midi/opl3/Opl3SynthesizerTest.java index 47ca9cb..e86f885 100644 --- a/src/test/java/vavi/sound/midi/opl3/Opl3SynthesizerTest.java +++ b/src/test/java/vavi/sound/midi/opl3/Opl3SynthesizerTest.java @@ -13,13 +13,11 @@ import java.util.Random; import java.util.concurrent.CountDownLatch; import javax.sound.midi.MetaEventListener; -import javax.sound.midi.MidiMessage; import javax.sound.midi.MidiSystem; import javax.sound.midi.Receiver; import javax.sound.midi.Sequence; import javax.sound.midi.Sequencer; import javax.sound.midi.Synthesizer; -import javax.sound.midi.SysexMessage; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; diff --git a/src/test/java/vavi/sound/pcm/equalizing/NormalizerTest.java b/src/test/java/vavi/sound/pcm/equalizing/NormalizerTest.java index 79e4750..9d3ff87 100644 --- a/src/test/java/vavi/sound/pcm/equalizing/NormalizerTest.java +++ b/src/test/java/vavi/sound/pcm/equalizing/NormalizerTest.java @@ -82,6 +82,6 @@ public static void main(String[] argv) throws Exception { outname = null; } - new Normalizer().normalize(inname, outname); + Normalizer.normalize(inname, outname); } } diff --git a/src/test/java/vavi/sound/pcm/equalizing/sse/Test2.java b/src/test/java/vavi/sound/pcm/equalizing/sse/Test2.java index bd304da..c427353 100644 --- a/src/test/java/vavi/sound/pcm/equalizing/sse/Test2.java +++ b/src/test/java/vavi/sound/pcm/equalizing/sse/Test2.java @@ -146,11 +146,13 @@ static class Model { /** */ class View { /** */ - Model model; + final Model model; /** */ - JSlider[] lgains, rgains; + final JSlider[] lgains; + final JSlider[] rgains; /** */ - JSlider lpremain, rpremain; + final JSlider lpremain; + final JSlider rpremain; /** */ View(Model model) { this.model = model; @@ -222,14 +224,14 @@ class View { frame.setVisible(true); } - MouseInputListener mouseInputListener = new MouseInputAdapter() { + final MouseInputListener mouseInputListener = new MouseInputAdapter() { @Override public void mouseReleased(MouseEvent event) { doEqualize(); } }; - ChangeListener changeListener = new ChangeListener() { + final ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent event) { String name = ((Component) event.getSource()).getName(); @@ -259,7 +261,7 @@ public void stateChanged(ChangeEvent event) { } }; - ActionListener actionListener = event -> { + final ActionListener actionListener = event -> { try { doEqualize(); } catch (Exception e) { @@ -299,7 +301,7 @@ void doEqualize() { } /** */ - Runnable player = new Runnable() { + final Runnable player = new Runnable() { @Override public void run() { while (true) { diff --git a/src/test/java/vavi/sound/sampled/ilbc/IlbcFormatConversionProviderTest.java b/src/test/java/vavi/sound/sampled/ilbc/IlbcFormatConversionProviderTest.java new file mode 100644 index 0000000..f02f3d2 --- /dev/null +++ b/src/test/java/vavi/sound/sampled/ilbc/IlbcFormatConversionProviderTest.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ilbc; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.CountDownLatch; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.LineEvent.Type; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; +import vavi.util.Debug; +import vavi.util.properties.annotation.Property; +import vavi.util.properties.annotation.PropsEntity; + +import static javax.sound.sampled.AudioSystem.NOT_SPECIFIED; +import static vavi.sound.SoundUtil.volume; + + +@PropsEntity(url = "file:local.properties") +class IlbcFormatConversionProviderTest { + + static boolean localPropertiesExists() { + return Files.exists(Paths.get("local.properties")); + } + + @Property(name = "ilbc") + String ilbc = "src/test/resources/ilbc/sample-30.ilbc"; + + @BeforeEach + void setup() throws Exception { + if (localPropertiesExists()) { + PropsEntity.Util.bind(this); + } + } + + static double volume = Double.parseDouble(System.getProperty("vavi.test.volume", "0.2")); + + @Test + @EnabledIfSystemProperty(named = "vavi.test", matches = "ide") + void test1() throws Exception { + Path in = Path.of(ilbc); +Debug.println(in); + + AudioFormat inFormat = new AudioFormat( + IlbcEncoding.iLBC, + 8000, + 16, + 1, + 2, + 8000, + false); + + AudioFormat linFormat = new AudioFormat( + AudioFormat.Encoding.PCM_SIGNED, + 8000, + 16, + 1, + 2, + 8000, + false); +Debug.println(linFormat); + + var ais = new AudioInputStream(Files.newInputStream(in), inFormat, NOT_SPECIFIED); + Clip clip = AudioSystem.getClip(); + CountDownLatch cdl = new CountDownLatch(1); + clip.addLineListener(e -> { Debug.println(e.getType()); if (e.getType().equals(Type.STOP)) cdl.countDown(); }); + clip.open(AudioSystem.getAudioInputStream(linFormat, ais)); + volume(clip, volume); + clip.start(); + cdl.await(); + clip.drain(); + clip.close(); + } +} \ No newline at end of file diff --git a/src/test/java/vavi/sound/sampled/ldclep/LdCelpFormatConversionProviderTest.java b/src/test/java/vavi/sound/sampled/ldclep/LdCelpFormatConversionProviderTest.java new file mode 100644 index 0000000..fda0550 --- /dev/null +++ b/src/test/java/vavi/sound/sampled/ldclep/LdCelpFormatConversionProviderTest.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.sampled.ldclep; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.CountDownLatch; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.LineEvent.Type; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; +import vavi.util.Debug; +import vavi.util.properties.annotation.Property; +import vavi.util.properties.annotation.PropsEntity; + +import static javax.sound.sampled.AudioSystem.NOT_SPECIFIED; +import static vavi.sound.SoundUtil.volume; + + +@PropsEntity(url = "file:local.properties") +class LdCelpFormatConversionProviderTest { + + static boolean localPropertiesExists() { + return Files.exists(Paths.get("local.properties")); + } + + @Property(name = "g728") + String g728 = "src/test/resources/ldcelp/sample.g728"; + + @BeforeEach + void setup() throws Exception { + if (localPropertiesExists()) { + PropsEntity.Util.bind(this); + } + } + + static double volume = Double.parseDouble(System.getProperty("vavi.test.volume", "0.2")); + + @Test + @EnabledIfSystemProperty(named = "vavi.test", matches = "ide") + void test1() throws Exception { + Path in = Path.of(g728); +Debug.println(in); + + AudioFormat inFormat = new AudioFormat( + LdCelpEncoding.G728, + 16000, + 16, + 1, + 2, + 16000, + false); + + AudioFormat linFormat = new AudioFormat( + AudioFormat.Encoding.PCM_SIGNED, + 16000, + 16, + 1, + 2, + 16000, + false); +Debug.println(linFormat); + + var ais = new AudioInputStream(Files.newInputStream(in), inFormat, NOT_SPECIFIED); + Clip clip = AudioSystem.getClip(); + CountDownLatch cdl = new CountDownLatch(1); + clip.addLineListener(e -> { Debug.println(e.getType()); if (e.getType().equals(Type.STOP)) cdl.countDown(); }); + clip.open(AudioSystem.getAudioInputStream(linFormat, ais)); + volume(clip, volume); + clip.start(); + cdl.await(); + clip.drain(); + clip.close(); + } +} \ No newline at end of file diff --git a/src/test/java/vavi/sound/sampled/opl3/Opl3AudioFileReaderTest.java b/src/test/java/vavi/sound/sampled/opl3/Opl3AudioFileReaderTest.java index c75e860..73ae1ed 100644 --- a/src/test/java/vavi/sound/sampled/opl3/Opl3AudioFileReaderTest.java +++ b/src/test/java/vavi/sound/sampled/opl3/Opl3AudioFileReaderTest.java @@ -18,13 +18,19 @@ import javax.sound.sampled.Clip; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineEvent; +import javax.sound.sampled.SourceDataLine; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import vavi.util.Debug; import static vavi.sound.SoundUtil.volume; +import static vavix.util.DelayedWorker.later; /** @@ -35,12 +41,21 @@ */ class Opl3AudioFileReaderTest { - static { - System.setProperty("vavi.sound.opl3.MidiFile", "false"); - } + static long time = System.getProperty("vavi.test", "").equals("ide") ? 1000 * 1000 : 10 * 1000; static double volume = Double.parseDouble(System.getProperty("vavi.test.volume", "0.2")); + @BeforeAll + static void setup() { + System.setProperty("vavi.sound.opl3.MidiFile", "true"); +Debug.println("volume: " + volume); + } + + @AfterAll + static void teardown() { + System.setProperty("vavi.sound.opl3.MidiFile", "false"); + } + @ParameterizedTest @ValueSource(strings = { "/opl3/ice_thnk.sci", @@ -50,6 +65,8 @@ class Opl3AudioFileReaderTest { "/opl3/2.cmf", "/opl3/dro_v2.dro", }) + @DisplayName("direct, clip") + @Disabled("slow, bec play after load all") void test0(String filename) throws Exception { Debug.println("------------------------------------------ " + filename + " ------------------------------------------------"); Path path = Paths.get(Opl3AudioFileReaderTest.class.getResource(filename).toURI()); @@ -83,7 +100,7 @@ void test0(String filename) throws Exception { } clip.start(); if (!System.getProperty("vavi.test", "").equals("ide")) { - Thread.sleep(10 * 1000); + Thread.sleep(time); clip.stop(); Debug.println("not on ide"); } else { @@ -101,6 +118,8 @@ void test0(String filename) throws Exception { "/opl3/mi2.laa", "/opl3/2.cmf", }) + @DisplayName("spi, clip") + @Disabled("slow, bec play after load all") void test1(String filename) throws Exception { Debug.println("------------------------------------------ " + filename + " ------------------------------------------------"); Path path = Paths.get(Opl3AudioFileReaderTest.class.getResource(filename).toURI()); @@ -134,7 +153,7 @@ void test1(String filename) throws Exception { } clip.start(); if (!System.getProperty("vavi.test", "").equals("ide")) { - Thread.sleep(10 * 1000); + Thread.sleep(time); clip.stop(); Debug.println("not on ide"); } else { @@ -143,11 +162,11 @@ void test1(String filename) throws Exception { clip.close(); } - // TODO both uses MIDPlayer ??? i forgot the purpose @ParameterizedTest @ValueSource(strings = { "true", "false" }) + @DisplayName("use opl3 midi player or not") void test3(String flag) throws Exception { Debug.println("------------------------------------------ " + flag + " ------------------------------------------------"); System.setProperty("vavi.sound.opl3.MidiFile", flag); @@ -163,31 +182,69 @@ void test3(String flag) throws Exception { false); Debug.println(targetAudioFormat); AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(targetAudioFormat, originalAudioInputStream); - AudioFormat audioFormat = audioInputStream.getFormat(); - DataLine.Info info = new DataLine.Info(Clip.class, audioFormat, AudioSystem.NOT_SPECIFIED); - CountDownLatch countDownLatch = new CountDownLatch(1); - Clip clip = (Clip) AudioSystem.getLine(info); -Debug.println(clip.getClass().getName()); - clip.addLineListener(event -> { -Debug.println("LINE: " + event.getType()); - if (event.getType().equals(LineEvent.Type.STOP)) { - countDownLatch.countDown(); + DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioInputStream.getFormat()); + SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info); + line.open(audioInputStream.getFormat()); + line.addLineListener(ev -> Debug.println(ev.getType())); + line.start(); + + volume(line, volume); + + byte[] buf = new byte[1024]; + while (!later(time).come()) { + int r = audioInputStream.read(buf, 0, 1024); + if (r < 0) { + break; } - }); - clip.open(audioInputStream); -try { - volume(clip, volume); -} catch (Exception e) { - Debug.println("volume: " + e); -} - clip.start(); -if (!System.getProperty("vavi.test", "").equals("ide")) { - Thread.sleep(10 * 1000); - clip.stop(); - Debug.println("not on ide"); -} else { - countDownLatch.await(); -} - clip.close(); + line.write(buf, 0, r); + } + line.drain(); + line.stop(); + line.close(); + } + + @ParameterizedTest + @ValueSource(strings = { +// "/opl3/dro_v2.dro", +// "/opl3/samurai.dro", +// "/opl3/ice_thnk.sci", +// "/opl3/michaeld.cmf", +// "/opl3/mi2.laa", + "/opl3/2.cmf", + }) + @DisplayName("spi, stream") + void test4(String filename) throws Exception { +Debug.println("------------------------------------------ " + filename + " ------------------------------------------------"); + Path path = Paths.get(Opl3AudioFileReaderTest.class.getResource(filename).toURI()); + AudioInputStream originalAudioInputStream = AudioSystem.getAudioInputStream(new BufferedInputStream(Files.newInputStream(path))); + AudioFormat originalAudioFormat = originalAudioInputStream.getFormat(); +Debug.println(originalAudioFormat); + AudioFormat targetAudioFormat = new AudioFormat( + originalAudioFormat.getSampleRate(), + 16, + originalAudioFormat.getChannels(), + true, + false); +Debug.println(targetAudioFormat); + AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(targetAudioFormat, originalAudioInputStream); + DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioInputStream.getFormat()); + SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info); + line.open(audioInputStream.getFormat()); + line.addLineListener(ev -> Debug.println(ev.getType())); + line.start(); + + volume(line, volume); + + byte[] buf = new byte[1024]; + while (!later(time).come()) { + int r = audioInputStream.read(buf, 0, 1024); + if (r < 0) { + break; + } + line.write(buf, 0, r); + } + line.drain(); + line.stop(); + line.close(); } } diff --git a/src/test/java/vavi/sound/sampled/opus/OpusFormatConversionProviderTest.java b/src/test/java/vavi/sound/sampled/opus/OpusFormatConversionProviderTest.java index c664627..b9f72cf 100644 --- a/src/test/java/vavi/sound/sampled/opus/OpusFormatConversionProviderTest.java +++ b/src/test/java/vavi/sound/sampled/opus/OpusFormatConversionProviderTest.java @@ -8,7 +8,6 @@ import java.io.BufferedInputStream; import java.io.File; -import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.file.Files; diff --git a/src/test/java/vavi/sound/sampled/opus/OpusTest.java b/src/test/java/vavi/sound/sampled/opus/OpusTest.java index 47603cb..b4f65e6 100644 --- a/src/test/java/vavi/sound/sampled/opus/OpusTest.java +++ b/src/test/java/vavi/sound/sampled/opus/OpusTest.java @@ -77,7 +77,7 @@ public static void main(String[] args) throws Exception { } static final String inFile = "src/test/resources/opus.raw"; - static final String outFile = "tmp/opus.pcm"; + static final String outFile = "tmp/opus-vavi-out.pcm"; @BeforeAll static void setup() throws IOException { diff --git a/src/test/java/vavi/sound/sampled/rococoa/RococoaFormatConversionProviderTest.java b/src/test/java/vavi/sound/sampled/rococoa/RococoaFormatConversionProviderTest.java index f6ab749..fafe769 100644 --- a/src/test/java/vavi/sound/sampled/rococoa/RococoaFormatConversionProviderTest.java +++ b/src/test/java/vavi/sound/sampled/rococoa/RococoaFormatConversionProviderTest.java @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; -import vavi.sound.sampled.adpcm.ms.MsEncoding; import vavi.util.Debug; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/vavi/sound/twinvq/TwinVQTest.java b/src/test/java/vavi/sound/twinvq/TwinVQTest.java index 87415d1..bdf1891 100644 --- a/src/test/java/vavi/sound/twinvq/TwinVQTest.java +++ b/src/test/java/vavi/sound/twinvq/TwinVQTest.java @@ -8,87 +8,173 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; +import java.io.DataInputStream; +import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteOrder; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.CountDownLatch; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioFormat.Encoding; import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.DataLine; -import javax.sound.sampled.LineEvent; +import javax.sound.sampled.DataLine.Info; import javax.sound.sampled.SourceDataLine; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; +import vavi.sound.twinvq.LibAV.AVCodecContext; +import vavi.sound.twinvq.LibAV.AVFormatContext; +import vavi.sound.twinvq.LibAV.AVFrame; +import vavi.sound.twinvq.LibAV.AVInputFormat; +import vavi.sound.twinvq.LibAV.AVPacket; +import vavi.sound.twinvq.TwinVQDec.TwinVQContext; import vavi.sound.twinvq.obsolate.TwinVQInputStream; import vavi.util.Debug; +import vavi.util.properties.annotation.Property; +import vavi.util.properties.annotation.PropsEntity; +import vavi.util.properties.annotation.PropsEntity.Util; +import static javax.sound.sampled.LineEvent.Type.STOP; import static vavi.sound.SoundUtil.volume; +@PropsEntity(url = "file:local.properties") class TwinVQTest { - /** - * Play TwinVQ. - * - * @param args 0:ima wave, 1:output pcm, 2:test or not, use "test" - */ - public static void main(String[] args) throws Exception { + static boolean localPropertiesExists() { + return Files.exists(Paths.get("local.properties")); + } + + @Property(name = "twinvq") + String twinvq = "src/test/resources/test.vqf"; + + @BeforeEach + void setup() throws Exception { + if (localPropertiesExists()) { + Util.bind(this); + } + } + + static double volume = Double.parseDouble(System.getProperty("vavi.test.volume", "0.2")); + + // ---- + + int somefun(int x) throws IOException { return 0; } + + @FunctionalInterface + interface ThrowingFunction { + R apply(T t) throws E; + } + + ThrowingFunction fun; + + @Test + void testF() { + fun = this::somefun; + } + + // ---- + + @Test + void test1() throws Exception { + TwinVQData d = new TwinVQData(); +// IntStream.range(0, d.cb0808l0.length).map(i -> d.cb0808l0[i]).forEach(System.err::println); + } - boolean isTest = args[2].equals("test"); - InputStream in = new BufferedInputStream(new FileInputStream(args[0])); + String out = "tmp/twinvq-vavi-out.pcm"; - //---- + @Test + @EnabledIfEnvironmentVariable(named = "vavi.test", matches = "ide") + void test2() throws Exception { + + InputStream in = new BufferedInputStream(Files.newInputStream(Path.of(twinvq))); int sampleRate = 44100; ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN; AudioFormat audioFormat = new AudioFormat( - AudioFormat.Encoding.PCM_SIGNED, + Encoding.PCM_SIGNED, sampleRate, 16, 1, 2, sampleRate, byteOrder.equals(ByteOrder.BIG_ENDIAN)); - System.err.println(audioFormat); +System.err.println(audioFormat); InputStream is = new TwinVQInputStream(in, 4, 2, 4, byteOrder); - OutputStream os = - new BufferedOutputStream(new FileOutputStream(args[1])); + + OutputStream os = new BufferedOutputStream(Files.newOutputStream(Path.of(out))); int bufferSize = 2048; - DataLine.Info info = - new DataLine.Info(SourceDataLine.class, audioFormat); - SourceDataLine line = - (SourceDataLine) AudioSystem.getLine(info); + Info info = new Info(SourceDataLine.class, audioFormat); + SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info); line.open(audioFormat); - line.addLineListener(ev -> { - Debug.println(ev.getType()); - if (LineEvent.Type.STOP == ev.getType()) { - if (!isTest) { - System.exit(0); - } - } - }); + CountDownLatch cdl = new CountDownLatch(1); + line.addLineListener(e -> { Debug.println(e.getType()); if (STOP == e.getType()) { cdl.countDown(); }}); line.start(); + volume(line, volume); + byte[] buf = new byte[bufferSize]; int l = 0; - volume(line, .2d); - while (is.available() > 0) { l = is.read(buf, 0, bufferSize); line.write(buf, 0, l); os.write(buf, 0, l); } + + cdl.await(); + line.drain(); - line.stop(); line.close(); os.close(); is.close(); } + + @Test + @EnabledIfEnvironmentVariable(named = "vavi.test", matches = "ide") + void testFF() throws Exception { + + AVInputFormat inputFormat = VFQ.ff_vqf_demuxer; + + // probe + DataInputStream dis = new DataInputStream(new BufferedInputStream(Files.newInputStream(Path.of(twinvq)))); + dis.mark(12); + byte[] probe = new byte[12]; + dis.readFully(probe); + dis.reset(); + if (inputFormat.read_probe.apply(probe) == 0) { + throw new IllegalArgumentException("not vfq"); + } + + // header + AVFormatContext formatContext = new AVFormatContext(); + formatContext.pb = dis; + inputFormat.read_header.apply(formatContext); + + // decoder + AVCodecContext codecContext = formatContext.streams[0].codecpar; + codecContext.priv_data = new TwinVQContext(); + TwinVQDec.twinvq_decode_init(codecContext); + + AVFrame frame = new AVFrame(); + int[] got_frame_ptr = new int[1]; + while (true) { + AVPacket packet = inputFormat.read_packet.apply(formatContext); + int r = TwinVQ.ff_twinvq_decode_frame(codecContext, frame, got_frame_ptr, packet); + if (r == 0) break; + } + + TwinVQ.ff_twinvq_decode_close(codecContext); + } } \ No newline at end of file diff --git a/src/test/java/vavi/sound/twinvq/obsolate/TestCase.java b/src/test/java/vavi/sound/twinvq/obsolate/TestCase.java new file mode 100644 index 0000000..25f6180 --- /dev/null +++ b/src/test/java/vavi/sound/twinvq/obsolate/TestCase.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.sound.twinvq.obsolate; + +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import vavi.sound.twinvq.obsolate.TwinVQ.ConfInfo; +import vavi.sound.twinvq.obsolate.TwinVQ.ConfInfoSubBlock; +import vavi.sound.twinvq.obsolate.TwinVQ.HeaderInfo; +import vavi.sound.twinvq.obsolate.TwinVQ.Index; +import vavi.util.properties.annotation.Property; +import vavi.util.properties.annotation.PropsEntity; + + +/** + * TestCase. + * + * @author Naohide Sano (nsano) + * @version 0.00 2024-07-04 nsano initial version
    + */ +@PropsEntity(url = "file:local.properties") +public class TestCase { + + static boolean localPropertiesExists() { + return Files.exists(Paths.get("local.properties")); + } + + @Property(name = "twinvq") + String twinvq = "src/test/resources/test.vqf"; + + @BeforeEach + void setup() throws Exception { + if (localPropertiesExists()) { + PropsEntity.Util.bind(this); + } + } + + @Test + void test1() throws Exception { + Player player = new Player(twinvq); + } + + @Test + @Disabled("jna method maker") + void fields() throws Exception { + Class[] classes = new Class[] { + Index.class, + ConfInfoSubBlock.class, + ConfInfo.class, + HeaderInfo.class, + + }; + for (Class c : classes) { + System.out.println(c.getName()); + Arrays.stream(c.getDeclaredFields()).forEach(f -> { + System.out.print("\"" + f.getName() + "\", "); + }); + System.out.println(); + } + } +} diff --git a/src/test/java/vavix/rococoa/ituneslibrary/iTunes2.java b/src/test/java/vavix/rococoa/ituneslibrary/iTunes2.java index c6d50f0..6161e22 100644 --- a/src/test/java/vavix/rococoa/ituneslibrary/iTunes2.java +++ b/src/test/java/vavix/rococoa/ituneslibrary/iTunes2.java @@ -38,8 +38,8 @@ */ public class iTunes2 { - private SeleniumUtil seleniumUtil = new SeleniumUtil(); - private WebDriver driver = seleniumUtil.getWebDriver(); + private final SeleniumUtil seleniumUtil = new SeleniumUtil(); + private final WebDriver driver = seleniumUtil.getWebDriver(); private iTunes2() { // authentication? @@ -115,11 +115,10 @@ public static class TitleUrl { @Target(value = "//TABLE//TR/TD[4]/A/@href") String url; public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(artist)); - sb.append(", "); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(title)); - return sb.toString(); + String sb = CharNormalizerJa.ToHalfAns2.normalize(artist) + + ", " + + CharNormalizerJa.ToHalfAns2.normalize(title); + return sb; } } @@ -149,11 +148,10 @@ public static class Composer { @Target(value = "//TABLE[4]//TR/TD[3]/DIV/text()") String type; public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(type); - sb.append(", "); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(name)); - return sb.toString(); + String sb = type + + ", " + + CharNormalizerJa.ToHalfAns2.normalize(name); + return sb; } } @@ -222,11 +220,10 @@ public static class TitleUrl3 { @Target(value = "//TABLE//TR/TD[3]/A/@href") String url; public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(artist)); - sb.append(", "); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(title)); - return sb.toString(); + String sb = CharNormalizerJa.ToHalfAns2.normalize(artist) + + ", " + + CharNormalizerJa.ToHalfAns2.normalize(title); + return sb; } } @@ -292,17 +289,16 @@ public static class TitleUrl4 { @Target(value = "//TABLE//TR/TD[4]/A/@href") String url; public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(artist)); - sb.append(", "); - sb.append(CharNormalizerJa.ToHalfAns2.normalize(title)); - return sb.toString(); + String sb = CharNormalizerJa.ToHalfAns2.normalize(artist) + + ", " + + CharNormalizerJa.ToHalfAns2.normalize(title); + return sb; } } /** Sort by artist name */ static class MyComparator3 implements Comparator { - String artist; + final String artist; MyComparator3(String artist) { this.artist = artist.toUpperCase(); } @@ -314,7 +310,7 @@ static class MyComparator3 implements Comparator { /** Sort by title of work */ static class MyComparator4 implements Comparator { - String name; + final String name; MyComparator4(String name) { this.name = name.toUpperCase(); } @@ -432,10 +428,10 @@ public static class Result { enum Probability { RESULT, RESULTa, RESULTn, RESULTp, MAYBEa, MAYBEn, NONE } - Probability probability; - String artist; - String title; - String composer; + final Probability probability; + final String artist; + final String title; + final String composer; Result(String artist, String title, String composer, Probability probability) { this.artist = artist; this.title = title; @@ -448,9 +444,9 @@ public String toString() { } static class Result2 extends Result { - String artist2; - String title2; - int index; + final String artist2; + final String title2; + final int index; Result2(String artist, String title, String composer, Probability probability, int index, String artist2, String title2) { super(artist, title, composer, probability); this.artist2 = artist2; @@ -473,7 +469,7 @@ public List getComposerFromJasrac(String artist, String title, String al List urls = WebScraper.Util.scrape(TitleUrl.class, artist, title); if (!urls.isEmpty()) { sleep(); - result.add(new Result(artist, title, getComposer(urls.get(0).url), Result.Probability.RESULT)); + result.add(new Result(artist, title, getComposer(urls.getFirst().url), Result.Probability.RESULT)); return result; } @@ -485,7 +481,7 @@ public List getComposerFromJasrac(String artist, String title, String al List urls2 = WebScraper.Util.scrape(TitleUrl.class, normalizedArtist, title); if (!urls2.isEmpty()) { sleep(); - result.add(new Result(artist, title, getComposer(urls2.get(0).url), Result.Probability.RESULTa)); + result.add(new Result(artist, title, getComposer(urls2.getFirst().url), Result.Probability.RESULTa)); return result; } } @@ -505,7 +501,7 @@ public List getComposerFromJasrac(String artist, String title, String al List urls3 = WebScraper.Util.scrape(TitleUrl.class, normalizedArtist, normalizedName); if (!urls3.isEmpty()) { sleep(); - result.add(new Result(artist, title, getComposer(urls3.get(0).url), Result.Probability.RESULTn)); + result.add(new Result(artist, title, getComposer(urls3.getFirst().url), Result.Probability.RESULTn)); return result; } diff --git a/src/test/resources/ilbc/sample-20.ilbc b/src/test/resources/ilbc/sample-20.ilbc new file mode 100644 index 0000000..4199c9d Binary files /dev/null and b/src/test/resources/ilbc/sample-20.ilbc differ diff --git a/src/test/resources/ilbc/sample-30.ilbc b/src/test/resources/ilbc/sample-30.ilbc new file mode 100644 index 0000000..f98f128 Binary files /dev/null and b/src/test/resources/ilbc/sample-30.ilbc differ diff --git a/src/test/resources/ilbc/sample-ilbc-20-out.pcm b/src/test/resources/ilbc/sample-ilbc-20-out.pcm new file mode 100644 index 0000000..178a10e Binary files /dev/null and b/src/test/resources/ilbc/sample-ilbc-20-out.pcm differ diff --git a/src/test/resources/ilbc/sample-ilbc-30-out.pcm b/src/test/resources/ilbc/sample-ilbc-30-out.pcm new file mode 100644 index 0000000..c2834a0 Binary files /dev/null and b/src/test/resources/ilbc/sample-ilbc-30-out.pcm differ diff --git a/src/test/resources/ilbc/sample_16k.pcm b/src/test/resources/ilbc/sample_16k.pcm new file mode 100644 index 0000000..93c4828 Binary files /dev/null and b/src/test/resources/ilbc/sample_16k.pcm differ diff --git a/src/test/resources/ldcelp/sample-expected.pcm b/src/test/resources/ldcelp/sample-expected.pcm new file mode 100644 index 0000000..f7e262b Binary files /dev/null and b/src/test/resources/ldcelp/sample-expected.pcm differ diff --git a/src/test/resources/ldcelp/sample-pf-expected.pcm b/src/test/resources/ldcelp/sample-pf-expected.pcm new file mode 100644 index 0000000..e93f481 Binary files /dev/null and b/src/test/resources/ldcelp/sample-pf-expected.pcm differ diff --git a/src/test/resources/ldcelp/sample.g728 b/src/test/resources/ldcelp/sample.g728 new file mode 100644 index 0000000..73af026 Binary files /dev/null and b/src/test/resources/ldcelp/sample.g728 differ diff --git a/src/test/resources/logging.properties b/src/test/resources/logging.properties index bcd9bc8..6ae460b 100644 --- a/src/test/resources/logging.properties +++ b/src/test/resources/logging.properties @@ -6,5 +6,12 @@ java.util.logging.ConsoleHandler.formatter=vavi.util.logging.VaviFormatter #org.uva.emulation.level=WARNING #org.rococoa.level=INFO org.rococoa.foundation.level=OFF -vavi.util.level=FINER +#vavi.util.level=FINER #org.tritonus.TraceAudioFileReader.level=INFO +vavi.sound.ldcelp.level=FINE +vavi.sound.twinvq.level=ALL + +vavi.sound.opl3.level=FINE +vavi.sound.sampled.opl3.level=FINE +vavi.sound.midi.opl3.level=FINE +vavi.util.win32.level=INFO diff --git a/src/test/resources/test.vqf b/src/test/resources/test.vqf new file mode 100644 index 0000000..919f2ae Binary files /dev/null and b/src/test/resources/test.vqf differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.bit b/src/test/resources/vavi/sound/ldcelp/f17.bit deleted file mode 100644 index 710b2b5..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.bit and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.coded b/src/test/resources/vavi/sound/ldcelp/f17.coded deleted file mode 100644 index 6459c29..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.coded and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.in b/src/test/resources/vavi/sound/ldcelp/f17.in deleted file mode 100644 index eb4555e..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.in and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.out b/src/test/resources/vavi/sound/ldcelp/f17.out deleted file mode 100644 index d162aec..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.out and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.outnpf b/src/test/resources/vavi/sound/ldcelp/f17.outnpf deleted file mode 100644 index 6e8ae2e..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.outnpf and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.outpf b/src/test/resources/vavi/sound/ldcelp/f17.outpf deleted file mode 100644 index 4d9580f..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.outpf and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.vavi.outnpf b/src/test/resources/vavi/sound/ldcelp/f17.vavi.outnpf deleted file mode 100644 index 123b28e..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.vavi.outnpf and /dev/null differ diff --git a/src/test/resources/vavi/sound/ldcelp/f17.vavi.outpf b/src/test/resources/vavi/sound/ldcelp/f17.vavi.outpf deleted file mode 100644 index 123b28e..0000000 Binary files a/src/test/resources/vavi/sound/ldcelp/f17.vavi.outpf and /dev/null differ