Text to Speech in JS, and a curious bug. Also, Safari desktop compatibility.
However, this stopped working and the bug rose its head of rare, but questionable beauty once again. It doesn’t happen on all browsers, but, for me, it happens at least in current versions of Firefox. Even more, it seems to be a real Heisenbug, since the script exits on an “out of memory” exception on varying points depending on the specific version of the code. In the minimized production version, the code makes it to several debug messages before the final exit, in the unminimized test version, however, it exits on a different point, which renders intercepting that specific error a somewhat impractical endeavor. Also, the exception dosen’t depend on the length of the utterances spoken (thus suggesting that the “out of memory” exception isn’t caused by memory allocation of the actual code, but the result of cascading failures internal to the JS engine), it just happens on each 80th call of the method “speak()”, which triggers a run of the internal eSpeak engine. Which, on the other hand, provides a suitable point of access to an otherwise somewhat cryptic and inaccessible failure mode, namely, simply keeping track of the number of calls and automatically restarting the engine on every 80th call. (Mind that this may cause a small delay, but it’s still better than the script stalling on an uncatchable exception.)
Shout-out to Trent Murgatroyd for reporting the fault and testing!
This had actually been addressed in version 2.0.6, as of a few days ago (2020-04-17), already. But there was another issue, which had passed my radar, namely, the Safari desktop browser muting Web Audio on default. This is now addressed similar to how mobile devices are handled, by attempting to unlock audio on the first mousedown event occuring in the window. (Unlocking requires a direct user interaction. Hence, meSpeak.js must listen for a global user event. However, it neither blocks or consumes the event in any way, nor does it extract any data.) Additionally to this, meSpeak.js now also attempts to resume the audio-context on every call of the method “speak()” prior to playing any audio, in case it’s found in suspended state. (Again, this will be of any effect only, if the call was issued from code triggered by a user event. On the other hand, it doesn’t hurt trying.)
Proudly announcing version 1.1 of the PET 2001 online emulator.
Version 1.1 of the PET 2001 online emulator features a totally revamped mounting and loading mechanism for files. For users this means full access to disk directories and LOADing programs from inside BASIC. For all the nerdy details and some hilarious insights into Commodore IEEE file loading (like, “Where on Earth — uhm, in memory — is the BASIC scondary device address?”) follow the link:
Proudly announcing version 1.0 of the PET 2001 online emulator.
Recently, I’ve been posting on Commodore BASIC and more specifically about the PET 2001 quite a bit. While not the sole reason, this was partly because I was adding a few features to the PET 2001 online emulator behind the scenes. I even endeavored into a major reorganization of some of the source code in order to facilitate this and future work. And, last but not least, there’s now even a suitable help file / documentation. — Reason enough to promote the emulator from its previous beta state to version 1.0!
mass:werk proudly presents: Running BASIC on a virtual PET 2001 from URL-data.
So you want to show your friends a little BASIC program or want to solve some problem with (retro) style? Despair no more, since help is near…
More specifically, just a click away, at www.masswerk.at/pet, where you find my enhanced version of Thomas Skibo’s in-browser PET 2001 emulation. What’s new is an additional mode, where the emulator loads (and runs) a program from data encoded in URL-parameters — as provided either in the query-string or in the URL-fragment (hash). And you may use this for immediate execution in direct mode, as well!
The Terminals Working Group proposed a new Unicode range earlier this month (Jan. 4, 2019) for the purpose of retrocomputing and emulation. As of version 1.1, the newly proposed glyphs are already included in the Char8.js library for generating 8-bit characters from Unicode.
Here’s a sample, rendering the new glyphs in double height using a 16 × 8 character matrix:
The proposed range incorporates glyphs from various legacy systems, including
It may be just the right season to remind of one of the first computer animations, “Snowflake” written in the 1960s for the DEC PDP-1. Despite various research efforts, the author of this amazing little program remains still unknown, which is quite a bity, since s/he deserves to be rembered along with the program.