-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sound support via POKE? #16
Comments
That code is creating a machine code routine at location 768 ( Supporting that would require a full 6502 emulator which is possible but not the goal of this project. You can take a look at some of the linked projects such as https://www.scullinsteel.com/apple//e which do emulate down to the CPU level and have sound support. (It's possible to manipulate the speaker from BASIC on an Apple with just a POKE but the language is so slow you can only make a dull buzz, not any useful tones. Machine code is required for actual music.) A plausible intermediate approach would be for the page to act as if such a routine was already loaded and implement support for just the |
Note to self: to perform the beep using Web Audio, this seems to do the trick: var ctx = new AudioContext();
var osc = new OscillatorNode(ctx);
var gain = ctx.createGain();
osc.type = 'square';
osc.frequency.value = 935;
gain.gain.value = 0.75;
osc.connect(gain).connect(ctx.destination);
osc.start();
osc.stop(0.1); |
An alternative would be to add support for a handful of "ampersand routines". Back in the olden days, Applesoft could be extended by There was no standard set of ampersand routines, but I'd be supportive of adding some starting with this one. |
Some of the historical code I've been working with uses POKE/CALL routines for sound effects. I see that the ASCII bell is simulated by playing an audio file so this feature may require significant development work. Take a look at the example code below. Is this within the scope of your plans for this project? I'm happy to take a shot at implementation if supporting this sort of feature seems feasible.
Thanks so much for creating such a useful tool.
The text was updated successfully, but these errors were encountered: