mirror of
https://github.com/xdsopl/robot36.git
synced 2026-02-09 16:04:13 +01:00
do rounding to nearest in freq_marker
This commit is contained in:
parent
923baf5846
commit
55da5a9d77
|
|
@ -36,7 +36,7 @@ static inline uchar4 rainbow(float v)
|
|||
static void freq_marker(int freq)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue