kopia lustrzana https://github.com/xdsopl/robot36
do rounding to nearest in freq_marker
rodzic
923baf5846
commit
55da5a9d77
|
@ -36,7 +36,7 @@ static inline uchar4 rainbow(float v)
|
||||||
static void freq_marker(int freq)
|
static void freq_marker(int freq)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < spectrum_height; ++j) {
|
for (int j = 0; j < spectrum_height; ++j) {
|
||||||
int i = (radix2_N * freq) / sample_rate;
|
int i = (radix2_N * freq + sample_rate / 2) / sample_rate;
|
||||||
spectrum_buffer[spectrum_width * j + i] = rgb(255, 255, 255);
|
spectrum_buffer[spectrum_width * j + i] = rgb(255, 255, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue