From 29d2dce3fc924c439011db549ea72db36f2c201f Mon Sep 17 00:00:00 2001 From: Flamefire Date: Thu, 17 Apr 2014 13:45:08 +0200 Subject: [PATCH] Move files to correct dir --- .../Record/PitchTracker/CPitchTrackerTest.cs | 2 +- .../Lib/Sound/Record/PitchTracker/CPtSharp.cs | 1 + .../Pitch/CircularBuffer.cs | 5 +--- .../{ => PitchTracker}/Pitch/Extensions.cs | 25 ++++++++----------- .../{ => PitchTracker}/Pitch/IIRFilter.cs | 5 +--- .../{ => PitchTracker}/Pitch/PitchDsp.cs | 6 +---- .../{ => PitchTracker}/Pitch/PitchTracker.cs | 3 +-- Vocaluxe/Vocaluxe.csproj | 10 ++++---- 8 files changed, 22 insertions(+), 35 deletions(-) rename Vocaluxe/Lib/Sound/Record/{ => PitchTracker}/Pitch/CircularBuffer.cs (98%) rename Vocaluxe/Lib/Sound/Record/{ => PitchTracker}/Pitch/Extensions.cs (83%) rename Vocaluxe/Lib/Sound/Record/{ => PitchTracker}/Pitch/IIRFilter.cs (99%) rename Vocaluxe/Lib/Sound/Record/{ => PitchTracker}/Pitch/PitchDsp.cs (99%) rename Vocaluxe/Lib/Sound/Record/{ => PitchTracker}/Pitch/PitchTracker.cs (99%) diff --git a/Vocaluxe/Lib/Sound/Record/PitchTracker/CPitchTrackerTest.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/CPitchTrackerTest.cs index 00670ad1..dc08cec7 100644 --- a/Vocaluxe/Lib/Sound/Record/PitchTracker/CPitchTrackerTest.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/CPitchTrackerTest.cs @@ -116,7 +116,7 @@ namespace Vocaluxe.Lib.Sound.Record.PitchTracker { Buffer.BlockCopy(data, 0, data2, 0, samplesPerBuffer * 2); analyzer.Input(data2); - analyzer.GetNote(out _MaxVolume, _Weights[j]); + analyzer.GetNote(out _MaxVolume, _Weights[i]); } sw.Stop(); _SamplesPerSec[i] = (int)Math.Round(samplesPerBuffer * repeats / (sw.ElapsedMilliseconds / 1000.0)); diff --git a/Vocaluxe/Lib/Sound/Record/PitchTracker/CPtSharp.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/CPtSharp.cs index af38e362..9f73b0f2 100644 --- a/Vocaluxe/Lib/Sound/Record/PitchTracker/CPtSharp.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/CPtSharp.cs @@ -4,6 +4,7 @@ namespace Vocaluxe.Lib.Sound.Record.PitchTracker { /// /// Pitchtracker (Pt) in C# that uses IIR filters for smoothing and an intelligent detection algorithm to reduce calculations + /// DO NOT USE in 32 Bit! Due to floating point errors the filter will raise all values to NAN (TODO: FIX it!) /// class CPtSharp : CPitchTracker { diff --git a/Vocaluxe/Lib/Sound/Record/Pitch/CircularBuffer.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/CircularBuffer.cs similarity index 98% rename from Vocaluxe/Lib/Sound/Record/Pitch/CircularBuffer.cs rename to Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/CircularBuffer.cs index d784e2df..07b6836b 100644 --- a/Vocaluxe/Lib/Sound/Record/Pitch/CircularBuffer.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/CircularBuffer.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; -using System.Text; -using System.Collections; -namespace Pitch +namespace Vocaluxe.Lib.Sound.Record.PitchTracker.Pitch { public class CircularBuffer : IDisposable { diff --git a/Vocaluxe/Lib/Sound/Record/Pitch/Extensions.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/Extensions.cs similarity index 83% rename from Vocaluxe/Lib/Sound/Record/Pitch/Extensions.cs rename to Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/Extensions.cs index 2487ea18..4cbd7c81 100644 --- a/Vocaluxe/Lib/Sound/Record/Pitch/Extensions.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/Extensions.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -namespace Pitch +namespace Vocaluxe.Lib.Sound.Record.PitchTracker.Pitch { public static class Extensions { @@ -12,7 +9,7 @@ namespace Pitch /// /// /// - static public void Clear(this float[] buffer) + public static void Clear(this float[] buffer) { Array.Clear(buffer, 0, buffer.Length); } @@ -22,7 +19,7 @@ namespace Pitch /// /// /// - static public void Clear(this double[] buffer) + public static void Clear(this double[] buffer) { Array.Clear(buffer, 0, buffer.Length); } @@ -35,15 +32,15 @@ namespace Pitch /// /// /// - static public void Copy(this float[] fromBuffer, float[] toBuffer, int fromStart, int toStart, int length) + public static void Copy(this float[] fromBuffer, float[] toBuffer, int fromStart, int toStart, int length) { if (toBuffer == null || fromBuffer.Length == 0 || toBuffer.Length == 0) return; - var fromBegIdx = fromStart; - var fromEndIdx = fromStart + length; - var toBegIdx = toStart; - var toEndIdx = toStart + length; + int fromBegIdx = fromStart; + int fromEndIdx = fromStart + length; + int toBegIdx = toStart; + int toEndIdx = toStart + length; if (fromBegIdx < 0) { @@ -88,7 +85,7 @@ namespace Pitch /// /// /// - static public void Clear(this float[] buffer, int startIdx, int endIdx) + public static void Clear(this float[] buffer, int startIdx, int endIdx) { Array.Clear(buffer, startIdx, endIdx - startIdx + 1); } @@ -99,10 +96,10 @@ namespace Pitch /// /// /// - static public void Fill(this double[] buffer, double value) + public static void Fill(this double[] buffer, double value) { for (int idx = 0; idx < buffer.Length; idx++) buffer[idx] = value; } } -} +} \ No newline at end of file diff --git a/Vocaluxe/Lib/Sound/Record/Pitch/IIRFilter.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/IIRFilter.cs similarity index 99% rename from Vocaluxe/Lib/Sound/Record/Pitch/IIRFilter.cs rename to Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/IIRFilter.cs index 8759c77e..e180ff72 100644 --- a/Vocaluxe/Lib/Sound/Record/Pitch/IIRFilter.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/IIRFilter.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -namespace Pitch +namespace Vocaluxe.Lib.Sound.Record.PitchTracker.Pitch { /// /// Infinite impulse response filter (old style analog filters) diff --git a/Vocaluxe/Lib/Sound/Record/Pitch/PitchDsp.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/PitchDsp.cs similarity index 99% rename from Vocaluxe/Lib/Sound/Record/Pitch/PitchDsp.cs rename to Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/PitchDsp.cs index 0eb79432..3fc22ee6 100644 --- a/Vocaluxe/Lib/Sound/Record/Pitch/PitchDsp.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/PitchDsp.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Collections; -namespace Pitch +namespace Vocaluxe.Lib.Sound.Record.PitchTracker.Pitch { /// /// Pitch related DSP diff --git a/Vocaluxe/Lib/Sound/Record/Pitch/PitchTracker.cs b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/PitchTracker.cs similarity index 99% rename from Vocaluxe/Lib/Sound/Record/Pitch/PitchTracker.cs rename to Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/PitchTracker.cs index 8e7e6776..59522197 100644 --- a/Vocaluxe/Lib/Sound/Record/Pitch/PitchTracker.cs +++ b/Vocaluxe/Lib/Sound/Record/PitchTracker/Pitch/PitchTracker.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; using System.Collections; -using Pitch; -namespace Vocaluxe.Lib.Sound.Record.Pitch +namespace Vocaluxe.Lib.Sound.Record.PitchTracker.Pitch { /// /// Tracks pitch diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index df259176..f43e6307 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -273,11 +273,11 @@ - - - - - + + + + +