You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gen2NF now auto-scales bins to adapt to various volume levels. Gen2DFT had some cleanup and magic number formulas replaced by actual math I derived for the paper. The debug view scales bar intensity by value, which makes for nicer visualization.
/// subscribed to periodic events. Then, when a visualizer or other output mechanism wants to use the data, it will call <see cref="Gen2NoteFinder.UpdateOutputs"/>
18
18
/// which in turn will call <see cref="CalculateOutput"/>. This will merge together all of the data that has been received since the last output cycle,
19
19
/// apply loudness correction, and format it into <see cref="AllBinValues"/> and <see cref="OctaveBinValues"/> for feature extraction in <see cref="Gen2NoteFinder.UpdateOutputs"/>.
20
-
internalsealedclassGen2NoteFinderDFT
20
+
publicsealedclassGen2NoteFinderDFT
21
21
{
22
22
privateconstboolENABLE_SIMD=true;
23
23
privateconstintMIN_WINDOW_SIZE=16;// At 48KHz, scaled for other sample rates
24
24
privateconstuintMAX_WINDOW_SIZE=6144;// At 48KHz, scaled for other sample rates
25
25
privateconstuintABSOLUTE_MAX_WINDOW_SIZE=32768;// Cannot exceed this regardless of sample rate, otherwise the accumulators may overflow
@@ -127,7 +127,7 @@ internal sealed class Gen2NoteFinderDFT
127
127
128
128
/// <summary> The frequency in Hz of each raw bin. </summary>
129
129
/// <remarks> This isn't used in the main algorithm, only for pre-calculation of some data, and to present to the user. </remarks>
130
-
internalfloat[]RawBinFrequencies{get;init;}
130
+
publicfloat[]RawBinFrequencies{get;init;}
131
131
132
132
/// <summary> The range, in number of bins, of each bin's sensitivity to input signals. </summary>
133
133
/// <remarks> A bin width of 2 would imply that this bin stops detecting anything in approximately the middle of the directly adjacent bin in both directions (a range of this bin's middle +/- 1.0 bins). </remarks>
@@ -172,22 +172,11 @@ internal sealed class Gen2NoteFinderDFT
//float IdealWindowSize = WindowSizeForBinWidth(TopOctaveNextBinFreq - TopOctaveBinFreq); // TODO: Add scale factor to shift this from no overlap to -3dB point
//float IdealWindowSize = WindowSizeForBinWidth(TopOctaveNextBinFreq - TopOctaveBinFreq); // TODO: Add scale factor to shift this from no overlap to -3dB point
// These were determined through simulations and regressions, which can be found in the Simulations folder in the root of the ColorChord.NET repository. See Simulations/WindowSizeVsBinWidthWithSampleRate.m.
0 commit comments