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
@@ -57,9 +59,6 @@ public sealed class Gen2NoteFinderDFT
57
59
58
60
publicfloatStartFrequency{get;privateinit;}
59
61
60
-
/// <summary> The number of DFT bins per octave. </summary>
61
-
publicuintBinsPerOctave=>BINS_PER_OCTAVE;
62
-
63
62
/// <summary> The total number of bins over all octaves. </summary>
64
63
publicreadonlyushortBinCount;
65
64
@@ -84,7 +83,7 @@ public sealed class Gen2NoteFinderDFT
84
83
privatereadonlyushort[]AudioBufferSubHeads;
85
84
86
85
/// <summary> How far forward in the sine table this bin should step with every added sample, such that one full sine wave (wrap back to 0) occurs after the number of steps corresponding to the bin frequency. Format is fixed-point 5b+11b. </summary>
87
-
/// <remarks> Indexed by [Bin], size is [<see cref="BINS_PER_OCTAVE"/>] </remarks>
86
+
/// <remarks> Indexed by [Bin], size is [<see cref="BinsPerOctave"/>] </remarks>
88
87
privatereadonlyDualU16[]SinTableStepSize;
89
88
90
89
/// <summary>
@@ -137,16 +136,24 @@ public sealed class Gen2NoteFinderDFT
137
136
138
137
privatefloatIIR_CONST=0.85F;// TODO: Scale dynamically, lower => more older data
139
138
140
-
publicGen2NoteFinderDFT(uintoctaveCount,uintsampleRate,floatstartFrequency,floatloudnessCorrection,TimingReceiverCallback?timingCallback)// TODO: Why are some properties while others not
139
+
/// <summary> Instantiates a Gen2DFT with the desired settings. </summary>
140
+
/// <param name="octaveCount"> The number of octaves to analyze </param>
141
+
/// <param name="binsPerOctave"> The number of output bins to calculate for each octave, must be a multiple of 4 </param>
142
+
/// <param name="sampleRate"> The sample rate of the input audio signal </param>
143
+
/// <param name="startFrequency"> The desired frequency of the lowest bin </param>
144
+
/// <param name="loudnessCorrection"> The amount of human ear-modelled loudness correction to apply to the output bin values, between 0.0 and 1.0 </param>
145
+
/// <param name="timingCallback"> A callback that will be dispatched at defined regular intervals during audio processing </param>
146
+
publicGen2NoteFinderDFT(uintoctaveCount,uintbinsPerOctave,uintsampleRate,floatstartFrequency,floatloudnessCorrection,TimingReceiverCallback?timingCallback)// TODO: Why are some properties while others not
//float IdealWindowSize = WindowSizeForBinWidth(TopOctaveNextBinFreq - TopOctaveBinFreq); // TODO: Add scale factor to shift this from no overlap to -3dB point
if(this.MergedDataAmplitude==0){return;}// This may have (and actually often does) happen if multiple outputs are present and operating on different threads.
/// <summary> Gets the current DFT output data. Make sure to call <see cref="CalculateOutput"/> before this. </summary>
52
-
/// <returns> The raw magnitudes of each DFT bin, array length is <see cref="GetBinCount"/>. This pointer will not change during runtime unless <see cref="Init(uint, uint, float, float)"/> is called again, so it is safe to reuse </returns>
56
+
/// <returns> The raw magnitudes of each DFT bin, array length is <see cref="GetBinCount"/>. This pointer will not change during runtime unless <see cref="Init(uint, uint, uint, float, float)"/> is called again, so it is safe to reuse </returns>
/// <summary> Gets the central response frequencies of each DFT bin. </summary>
57
-
/// <returns> The frequency of each DFT bin in Hz, array length is <see cref="GetBinCount"/>. This pointer will not change during runtime unless <see cref="Init(uint, uint, float, float)"/> is called again, so it is safe to reuse </returns>
61
+
/// <returns> The frequency of each DFT bin in Hz, array length is <see cref="GetBinCount"/>. This pointer will not change during runtime unless <see cref="Init(uint, uint, uint, float, float)"/> is called again, so it is safe to reuse </returns>
/// <summary> Gets the sensitivity range width of each bin, in number of bins. </summary>
62
66
/// <remarks> A value of 2 would mean that this bin stops responding to frequencies around the center of the bin above and below (this bin's range = 1, plus 0.5 bins on either side) </remarks>
63
-
/// <returns> The width of each bin in number of bins, array length is <see cref="GetBinCount"/>. This pointer will not change during runtime unless <see cref="Init(uint, uint, float, float)"/> is called again, so it is safe to reuse </returns>
67
+
/// <returns> The width of each bin in number of bins, array length is <see cref="GetBinCount"/>. This pointer will not change during runtime unless <see cref="Init(uint, uint, uint, float, float)"/> is called again, so it is safe to reuse </returns>
0 commit comments