Following up on my previous sound post (thanks @richard for helping with that), I’ve started poking at the sound engine to see how hard it would be to implement some waveforms similar to the 8-bit Atari’s POKEY pseudorandom square waves, and while I found a few likely-looking code locations where I added experiments, I’m getting a bit stuck trying to test them.
For example, I found
squareWaveTone in pxt-common-packages/libs/mixer/melody.cpp, which I’d guess is used on actual devices, and a separate JS implementation in pxt/pxtsim/simlib.ts which is presumably for the simulator.
However, if I modify these files and run a local server, it’s not picking up the changes in the emulator. I seem to be getting redirected to
https://trg-arcade.userpxt.io/---simulator, and I see a reference in pxt-arcade’s package.json to an optional pxt-arcade-sim package to which I don’t have access. (I did do the pxt linking from
../pxt-common-packages.) I’m not sure how to activate the localWebConfig setting in pxt/pxtlib/main.ts, and the redirect still happened after I hardcoded a local sim/simulator.html URL in
(I can’t test on actual hardware yet, my Adafruit PyGamer is still in transit.)
By the way, I’m really enjoying experimenting with MakeCode Arcade, and this isn’t very urgent, but I got caught up in the fun of trying to figure out how it works behind the scenes