SOUND produces no sound
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
Using FMSLogo 8.3.2, Spanish install under Windows 10 Pro
When I issue the command
sound [2500 130]
it produces no sound. I haven't been able to make the SOUND command produce any sound.
However, MIDIMESSAGE does produce sounds, reliably.
The SOUND command has been erratic for me since I issued bug 527
For my purposes, I've now switched to using MIDIMESSAGE instead of SOUND.
Thank you for referencing bug #527.
I happen to now own a Toshiba Satellite M645 with a Realtek High Definition Audio sound device. After I upgraded the operating system to Windows 10, SOUND behaves worse than on Windows 7. For me SOUND still works, but there's a significant delay the first time it runs and the tone sequence in DEMO sounds very choppy. This laptop is from 2010 and I doubt it was powerful even in its day. I suspect that Microsoft did what they could to keep Beep working on machines that don't have a PC Speaker, but they never considered it would be used to make music. It can still be used for debugging--like a PRINT when you don't out any place to print.
In Bug #527, you wrote that SOUND worked after a reboot. Is that no longer true?
Related
Bugs:
#527I figured out what happened:
I remembered that I usually use the Windows Volume Mixer to lower the "System Sounds" lever to 0.
I noticed that when I issue the SOUND command, it is played by the "System Sound" channel which was totally muted.
But when I issue the MIDIMESSAGE sound, that sound is assigned to the FMSLogo channel in the Volume Mixer so it played audibly.
I increased the "System Sounds" lever and sure enough the SOUND command emmited sounds.
Sorry
Last edit: DanielAjoy 2024-04-13
At an implementation level, it makes sense that TONE and SOUND would appear as system sounds. As I mentioned before, they are implemented the win32 function Beep(), which historically went to the PC Speaker. In the Windows NT, this was implemented as a device driver. Later, when PC speakers became scare and sound cards integrated onto the main board became common, it was updated to go to the sound card. Later, a per application sound mixer for everything that writes to a sound device. With all this legacy, it makes sense that a device driver would appear in the mixer as a system sound, since a device driver does not belong to an application.
At a user level, it doesn't make sense that noise generated by FMSLogo is a "system sound".
I have prototyped something like using
sndPlaySoundas I had alluded to in Bug #527. This did not fix the choppiness I experience with durations < 500 ms. It does, however make SOUND/TONE mix as an FMSLogo sound.I have attached an executable of this prototype. I'd appreciated if you tested this to see if it fixes your problem. While you're at it, please run the following command on 8.3.2 and the prototype and let me know if the audio stutters for you
Related
Bugs:
#527it does. thanks!
Attached is the sound produced by FMSLogo and captured with Audacity.
Thanks, Daniel. I appreciate you doing that. The MP3 exhibits the same choppy/stuttering audio that I hear on my machines. Was that clip taken from 8.3.2 or from the prototype? If it was from the prototype, can you confirm that 8.3.2 also has similar choppy/stuttering audio?
The change I made replaces one line of code with about 150 lines of code, so it's considerably more complicated and it's doing a lot more to play a simple tone. Mostly, I want to make sure that all this extra code doesn't make things worse for people who are using SOUND or TONE.
The clip was from the prototype
Attached is a clip from version 8.3.2 and a comparison of wave forms.
It seems to me that the prototype version is less choppy (and plays in a shorter time).
Thanks again. The PNG is a good idea. I wish I had thought of doing that. I agree that it looks like the timing is more correct in the prototype. That is, 50 notes at 100ms each should be about 5 seconds. It also looks like I matched the amplitude correctly. I got that wrong at first; I had computed the wave form at full amplitude.
Part of the complexity of the new implementation is that it plays the sound differently if it's < 100 ms or >= 100 ms. If >= 100ms, a single wave is looped and the playback is interruptible. This means that you can click "Halt" if you accidentally run
TONE 200 600000or something. (I botched the implementation a bit and the next command throws a Stopping error, similar to the bug in WAIT. I think I know how to fix this, though.) I think you can even "Execute" a long-running command and extend a playing TONE's duration until the interrupting command finishes. I don't know if that's a bug or a feature.I tried on a more powerful machine (Dell XPS 8940) that runs Windows 11. Your command works fine:
But DEMO still sounds awful. It makes a few clicks at the low frequencies but never plays anything recognizable as a tone.
[r6043] fixes the problem that SOUND/TONE appear as "System Sounds". It will be available in FMSLogo 8.4.0.
Related
Commit: [r6043]