TONE plays a minimum frequency of 37 Hz
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
TONE plays a tone of a given frequency for a given
duration. However, if the programmer gives TONE a
frequency below 37 Hz, TONE uses 37 Hz. Based on the
code, this looks deliberate (perhaps George was afraid
of TONE playing sounds outside the range of human
hearing), but I consider it a bug because it masks the
physics of how sound works. If you request TONE of 0,
then you shouldn't hear anything, because that's what a
0 Hz tone sounds like.
How Reproducible:
Every Time
Steps to Reproduce:
TONE 0 1000
What happens:
You hear a low-pitch for a second.
Expected Result:
FMSLogo pauses for a second and you hear nothing during
that time.
Logged In: YES
user_id=109252
I think I understand the 37 Hz cut-off. It's a limitation
of the Beep() function upon which TONE is implemented. From
the MSDN description of Beep().
dwFreq [in] The frequency of the sound, in hertz. This
parameter must be in the range 37 through 32,767 (0x25
through 0x7FFF).
This is fixed by [r6072]. The fix will be available in FMSLogo 8.4.0. This fix necessitated changing SOUND to reject negative frequencies and durations (which it always should have done, since TONE does it).
To fix a different bug, I had rewritten TONE to generate its own sound wave and call sndPlaySound instead of using Beep(). Once that work was done, the lower bound which Beep() imposed was no longer a problem.
My hearing is not good enough to hear frequencies below 70 Hz. However, I expect that with good enough hearing, or good enough recording equipment, FMSLogo can now play tones below 37 Hz. Playing a tone of 0 Hz will interrupt any playing tone with silence.
Related
Commit: [r6072]