diff --git a/instrument-core/src/main/java/jomu/instrument/audio/ResynthAudioSynthesizer.java b/instrument-core/src/main/java/jomu/instrument/audio/ResynthAudioSynthesizer.java index df18486f..a3642e12 100644 --- a/instrument-core/src/main/java/jomu/instrument/audio/ResynthAudioSynthesizer.java +++ b/instrument-core/src/main/java/jomu/instrument/audio/ResynthAudioSynthesizer.java @@ -149,7 +149,7 @@ public void playFrameSequence(ToneTimeFrame toneTimeFrame, String streamId, int AudioFeatureFrame aff = afp.getAudioFeatureFrame(sequence); TreeMap features = aff.getResynthFeatures() .getFeatures(); - + AudioQueueMessage audioQueueMessage = new AudioQueueMessage(toneTimeFrame, features, sequence); audioStream.bq.add(audioQueueMessage); @@ -262,7 +262,7 @@ public AudioStream(String streamId) { generator = new AudioGenerator(ResynthAudioSynthesizer.this.getWindowSize(), 0); try { generator.addAudioProcessor(resynthProcessor); - generator.addAudioProcessor(new AudioPlayer(new AudioFormat(44100, 16, 1, true, true))); + generator.addAudioProcessor(new AudioPlayer(new AudioFormat(44100, 16, 1, true, false))); } catch (LineUnavailableException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/instrument-core/src/main/java/jomu/instrument/audio/TarsosAudioSynthesizer.java b/instrument-core/src/main/java/jomu/instrument/audio/TarsosAudioSynthesizer.java index c6571061..829f1910 100644 --- a/instrument-core/src/main/java/jomu/instrument/audio/TarsosAudioSynthesizer.java +++ b/instrument-core/src/main/java/jomu/instrument/audio/TarsosAudioSynthesizer.java @@ -427,14 +427,7 @@ public void run() { // if (audioEvent.getEndTimeStamp() == time) { this.audioStream.getGenerator() .process(); - if (count > 0) { - LOG.severe( - ">>Audio gen process COUNT: " + time + ", " + count + ", " + - audioEvent.getTimeStamp()); - } count++; - LOG.severe(">>Audio gen process: " + time + ", " + - audioEvent.getTimeStamp()); audioEvent = this.audioStream.getGenerator() .getAudioEvent(); } diff --git a/instrument-core/src/main/java/jomu/instrument/audio/features/PitchDetectorSource.java b/instrument-core/src/main/java/jomu/instrument/audio/features/PitchDetectorSource.java index 97d2e92e..5ab1e4e9 100644 --- a/instrument-core/src/main/java/jomu/instrument/audio/features/PitchDetectorSource.java +++ b/instrument-core/src/main/java/jomu/instrument/audio/features/PitchDetectorSource.java @@ -222,7 +222,7 @@ void initialise() { binWidth = windowSize / sampleRate; binHeight = 1200 / (float) binsPerOctave; - TarsosDSPAudioFormat tarsosDSPFormat = new TarsosDSPAudioFormat(sampleRate, 16, 1, true, true); + TarsosDSPAudioFormat tarsosDSPFormat = new TarsosDSPAudioFormat(sampleRate, 16, 1, true, false); DispatchJunctionProcessor djp = new DispatchJunctionProcessor(tarsosDSPFormat, windowSize, overlap); djp.setName("PD"); dispatcher.addAudioProcessor(djp); diff --git a/instrument-core/src/main/java/jomu/instrument/audio/features/ResynthSource.java b/instrument-core/src/main/java/jomu/instrument/audio/features/ResynthSource.java index b9728e35..57274500 100644 --- a/instrument-core/src/main/java/jomu/instrument/audio/features/ResynthSource.java +++ b/instrument-core/src/main/java/jomu/instrument/audio/features/ResynthSource.java @@ -69,7 +69,6 @@ public ResynthSource(AudioDispatcher dispatcher) { this.usePureSine = true; previousFrequencies = new double[5]; previousFrequencyIndex = 0; - LOG.finer(">>RS window: " + this.windowSize); } public ResynthSource(AudioDispatcher dispatcher, int bufferSize) { @@ -114,7 +113,7 @@ public float getSampleRate() { } void initialise() { - + LOG.severe(">>!!RS init: " + this.windowSize); PitchEstimationAlgorithm algo = PitchEstimationAlgorithm.FFT_YIN; binStartingPointsInCents = new float[windowSize]; @@ -128,7 +127,7 @@ void initialise() { binWidth = windowSize / sampleRate; binHeight = 1200 / (float) binsPerOctave; - TarsosDSPAudioFormat tarsosDSPFormat = new TarsosDSPAudioFormat(sampleRate, 16, 1, true, true); + TarsosDSPAudioFormat tarsosDSPFormat = new TarsosDSPAudioFormat(sampleRate, 16, 1, true, false); DispatchJunctionProcessor djp = new DispatchJunctionProcessor(tarsosDSPFormat, windowSize, overlap); djp.setName("RS"); dispatcher.addAudioProcessor(djp); @@ -141,6 +140,7 @@ public boolean process(AudioEvent audioEvent) { .clone(); ResynthInfo ri = new ResynthInfo(audioFloatBuffer, envelopeAudioBuffer); putFeature(audioEvent.getTimeStamp(), ri); + LOG.severe(">>!!RS process"); return true; } @@ -156,7 +156,7 @@ public void processingFinished() { @Override public void handlePitch(PitchDetectionResult pitchDetectionResult, AudioEvent audioEvent) { double frequency = pitchDetectionResult.getPitch(); - + LOG.severe(">>!!RS handlePitch: " + audioEvent.getTimeStamp()); if (frequency == -1) { frequency = prevFrequency; } else { @@ -180,6 +180,7 @@ public void handlePitch(PitchDetectionResult pitchDetectionResult, AudioEvent au envelopeAudioBuffer = audioEvent.getFloatBuffer() .clone(); // !!TODO CLONED float[] envelope = null; + LOG.severe(">>!!RS handlePitch ENVELOP: " + audioEvent.getTimeStamp()); if (followEnvelope) { envelope = envelopeAudioBuffer.clone(); envelopeFollower.calculateEnvelope(envelope);