From 46c93bf04a5a6a2ad24be9bcf47581dd75a9232e Mon Sep 17 00:00:00 2001 From: RubbaBoy Date: Tue, 7 Jul 2020 01:13:11 -0400 Subject: Downgraded to Java 8 Includes a minor logging fix --- build.gradle | 4 ++-- .../src/main/java/com/jsyn/examples/AudioPassThrough.java | 3 ++- .../src/main/java/com/jsyn/examples/PlayFunction.java | 7 ++++--- examples/src/main/java/com/jsyn/examples/PlayNotes.java | 7 ++++--- examples/src/main/java/com/jsyn/examples/PlayTone.java | 7 ++++--- examples/src/main/resources/log4j.xml | 6 +++--- src/main/resources/log4j.xml | 15 --------------- src/test/java/com/jsyn/engine/TestWaveFileReadWrite.java | 2 +- src/test/java/com/jsyn/ports/TestSequentialData.java | 4 ++-- .../java/com/jsyn/unitgen/TestEnvelopeAttackDecay.java | 8 ++++---- src/test/resources/log4j.xml | 15 +++++++++++++++ 11 files changed, 41 insertions(+), 37 deletions(-) delete mode 100644 src/main/resources/log4j.xml create mode 100644 src/test/resources/log4j.xml diff --git a/build.gradle b/build.gradle index 047aba8..863f7ce 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { group = 'com.jsyn' version = '17.0.0-SNAPSHOT' -sourceCompatibility = '11' +sourceCompatibility = '1.8' mainClassName = 'com.jsyn.apps.AboutJSyn' repositories { @@ -17,9 +17,9 @@ repositories { dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' + testImplementation 'org.slf4j:slf4j-log4j12:1.7.25' implementation 'org.slf4j:slf4j-api:1.7.25' - implementation 'org.slf4j:slf4j-log4j12:1.7.25' implementation fileTree(dir: 'libs', include: '*.jar') } diff --git a/examples/src/main/java/com/jsyn/examples/AudioPassThrough.java b/examples/src/main/java/com/jsyn/examples/AudioPassThrough.java index 383dba4..ad0133d 100644 --- a/examples/src/main/java/com/jsyn/examples/AudioPassThrough.java +++ b/examples/src/main/java/com/jsyn/examples/AudioPassThrough.java @@ -17,6 +17,7 @@ package com.jsyn.examples; import com.jsyn.JSyn; +import com.jsyn.Synthesizer; import com.jsyn.devices.AudioDeviceManager; import com.jsyn.unitgen.LineIn; import com.jsyn.unitgen.LineOut; @@ -37,7 +38,7 @@ public class AudioPassThrough { LineOut lineOut; // Create a context for the synthesizer. - var synth = JSyn.createSynthesizer(); + Synthesizer synth = JSyn.createSynthesizer(); // Add an audio input. synth.add(lineIn = new LineIn()); // Add an audio output. diff --git a/examples/src/main/java/com/jsyn/examples/PlayFunction.java b/examples/src/main/java/com/jsyn/examples/PlayFunction.java index 9c389c9..6051454 100644 --- a/examples/src/main/java/com/jsyn/examples/PlayFunction.java +++ b/examples/src/main/java/com/jsyn/examples/PlayFunction.java @@ -17,6 +17,7 @@ package com.jsyn.examples; import com.jsyn.JSyn; +import com.jsyn.Synthesizer; import com.jsyn.data.Function; import com.jsyn.unitgen.FunctionOscillator; import com.jsyn.unitgen.LineOut; @@ -34,13 +35,13 @@ public class PlayFunction { private void test() { // Create a context for the synthesizer. - var synth = JSyn.createSynthesizer(); + Synthesizer synth = JSyn.createSynthesizer(); // Start synthesizer using default stereo output at 44100 Hz. synth.start(); // Add a FunctionOscillator - var oscillator = new FunctionOscillator(); + FunctionOscillator oscillator = new FunctionOscillator(); synth.add(oscillator); // Define a function that gives the shape of the waveform. @@ -53,7 +54,7 @@ public class PlayFunction { oscillator.function.set(func); // Add a stereo audio output unit. - var lineOut = new LineOut(); + LineOut lineOut = new LineOut(); synth.add(lineOut); // Connect the oscillator to both channels of the output. diff --git a/examples/src/main/java/com/jsyn/examples/PlayNotes.java b/examples/src/main/java/com/jsyn/examples/PlayNotes.java index 636dc1b..d920f41 100644 --- a/examples/src/main/java/com/jsyn/examples/PlayNotes.java +++ b/examples/src/main/java/com/jsyn/examples/PlayNotes.java @@ -17,6 +17,7 @@ package com.jsyn.examples; import com.jsyn.JSyn; +import com.jsyn.Synthesizer; import com.jsyn.unitgen.LineOut; import com.jsyn.unitgen.SawtoothOscillator; import com.softsynth.shared.time.TimeStamp; @@ -35,17 +36,17 @@ public class PlayNotes { private void test() { // Create a context for the synthesizer. - var synth = JSyn.createSynthesizer(); + Synthesizer synth = JSyn.createSynthesizer(); // Set output latency to 123 msec because this is not an interactive app. synth.getAudioDeviceManager().setSuggestedOutputLatency(0.123); // Add a tone generator. - var voice = new SawtoothOscillator(); + SawtoothOscillator voice = new SawtoothOscillator(); synth.add(voice); // synth.add( ugen = new SineOscillator() ); // synth.add( ugen = new SubtractiveSynthVoice() ); // Add an output mixer. - var lineOut = new LineOut(); + LineOut lineOut = new LineOut(); synth.add(lineOut); // Connect the oscillator to the left and right audio output. diff --git a/examples/src/main/java/com/jsyn/examples/PlayTone.java b/examples/src/main/java/com/jsyn/examples/PlayTone.java index e514dba..94d1240 100644 --- a/examples/src/main/java/com/jsyn/examples/PlayTone.java +++ b/examples/src/main/java/com/jsyn/examples/PlayTone.java @@ -17,6 +17,7 @@ package com.jsyn.examples; import com.jsyn.JSyn; +import com.jsyn.Synthesizer; import com.jsyn.unitgen.LineOut; import com.jsyn.unitgen.SineOscillator; import org.slf4j.Logger; @@ -34,16 +35,16 @@ public class PlayTone { private void test() { // Create a context for the synthesizer. - var synth = JSyn.createSynthesizer(); + Synthesizer synth = JSyn.createSynthesizer(); // Start synthesizer using default stereo output at 44100 Hz. synth.start(); // Add a tone generator. - var oscillator = new SineOscillator(); + SineOscillator oscillator = new SineOscillator(); synth.add(oscillator); // Add a stereo audio output unit. - var lineOut = new LineOut(); + LineOut lineOut = new LineOut(); synth.add(lineOut); // Connect the oscillator to both channels of the output. diff --git a/examples/src/main/resources/log4j.xml b/examples/src/main/resources/log4j.xml index cc107b1..43fb2e0 100644 --- a/examples/src/main/resources/log4j.xml +++ b/examples/src/main/resources/log4j.xml @@ -1,5 +1,5 @@ - - + + @@ -9,7 +9,7 @@ - + diff --git a/src/main/resources/log4j.xml b/src/main/resources/log4j.xml deleted file mode 100644 index cc107b1..0000000 --- a/src/main/resources/log4j.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/test/java/com/jsyn/engine/TestWaveFileReadWrite.java b/src/test/java/com/jsyn/engine/TestWaveFileReadWrite.java index b5051e6..a027d0b 100644 --- a/src/test/java/com/jsyn/engine/TestWaveFileReadWrite.java +++ b/src/test/java/com/jsyn/engine/TestWaveFileReadWrite.java @@ -43,7 +43,7 @@ public class TestWaveFileReadWrite { writer.setSamplesPerFrame(numChannels); writer.setBitsPerSample(16); - for (var datum : data) { + for (float datum : data) { writer.write(datum); } writer.close(); diff --git a/src/test/java/com/jsyn/ports/TestSequentialData.java b/src/test/java/com/jsyn/ports/TestSequentialData.java index 2f27ec2..f95ebcb 100644 --- a/src/test/java/com/jsyn/ports/TestSequentialData.java +++ b/src/test/java/com/jsyn/ports/TestSequentialData.java @@ -37,8 +37,8 @@ public class TestSequentialData { @Test public void testCrossfade() { - var sample1 = new FloatSample(data1); - var sample2 = new FloatSample(data2); + FloatSample sample1 = new FloatSample(data1); + FloatSample sample2 = new FloatSample(data2); SequentialDataCrossfade xfade = new SequentialDataCrossfade(); xfade.setup(sample1, 4, 3, sample2, 1, 6); diff --git a/src/test/java/com/jsyn/unitgen/TestEnvelopeAttackDecay.java b/src/test/java/com/jsyn/unitgen/TestEnvelopeAttackDecay.java index 8328bb7..b30d9f1 100644 --- a/src/test/java/com/jsyn/unitgen/TestEnvelopeAttackDecay.java +++ b/src/test/java/com/jsyn/unitgen/TestEnvelopeAttackDecay.java @@ -43,7 +43,7 @@ public class TestEnvelopeAttackDecay extends TestUnitGate { @Test public void testOnOff() throws InterruptedException { - var envelope = new EnvelopeAttackDecay(); + EnvelopeAttackDecay envelope = new EnvelopeAttackDecay(); synthesisEngine.add(envelope); envelope.attack.set(0.1); @@ -81,7 +81,7 @@ public class TestEnvelopeAttackDecay extends TestUnitGate { @Test public void testRetrigger() throws InterruptedException { - var envelope = new EnvelopeAttackDecay(); + EnvelopeAttackDecay envelope = new EnvelopeAttackDecay(); synthesisEngine.add(envelope); envelope.attack.set(0.1); @@ -117,9 +117,9 @@ public class TestEnvelopeAttackDecay extends TestUnitGate { @Test public void testAutoDisable() throws InterruptedException { - var ramp = new LinearRamp(); + LinearRamp ramp = new LinearRamp(); synthesisEngine.add(ramp); - var envelope = new EnvelopeAttackDecay(); + EnvelopeAttackDecay envelope = new EnvelopeAttackDecay(); envelope.attack.set(0.1); envelope.decay.set(0.1); synthesisEngine.add(envelope); diff --git a/src/test/resources/log4j.xml b/src/test/resources/log4j.xml new file mode 100644 index 0000000..43fb2e0 --- /dev/null +++ b/src/test/resources/log4j.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + -- cgit v1.2.3