Computer noises
🕑 Added 2025-03-01 03:05:00 +0000 UTCHere's a new video that shows the simplest way to get a computer to make noise—amplifying a square wave. I add a BEEP instruction to MSBASIC that lets you generate a beep at a particular frequency and use it to make some very rudimentary music.
As always, let me know if you see anything I should change before releasing it publicly. And thanks as always for your continued support!
Comments
Brady Burnsides
Hm, maybe you could use a couple bits in the peripheral ports as volume control. Just connect them to a R-2R DAC that outputs into the positive terminal of the amp.
George Harris
Should this have hit my Patreon account? Did anyone else not get charged?
Mikol Ryon
Ha! This is great. I had to have a go, mine sounds a bit crap but I'll sort that out later. https://youtu.be/9j5bpiAaKfM?feature=shared
Stéphane Dumont
Hi, maybe this is an answer https://circuitcellar.com/research-design-hub/a-digitally-controlled-voltage-source/ ?
Jim Kelly
So excited you finally started working with sound! Miss your videos Ben. Hopefully you will have time to put them out more frequently.
Brady Burnsides
How could we control the potentiometer from software, for software controlled volume output such as for envelopes and such? (or, what can we replace the pot with?)
Stéphane Dumont
I'd say a 555 is probably not that reliable for a "real-clock", is it?
NormalLuser
Another option would be a 555 timer connected to the NMI pin with a little routine to count each pulse. That way you can have a 'system clock' to use to keep time and for pause routines and leave timer 2 available for other things. Adjust the 555 to a useful clock like 60, 100 or 240 times a second.
NormalLuser
Awesome! I'd love to see more videos dealing with audio output. I made a version of Bad! Apple! using your kits with just PB7 output. I know I could do more impressive music with a couple more square channels and maybe a noise channel? Regardless I love the video and look forward to more!
David Latham
Another way to implement the delay is to use timer 2 on the via in one shot mode. That way the computer can respond to I interrupts and not be stuck in busy loops. I'm thinking here of the impact of adding music to a program that also drives the world's worst video card.
Rex McCarthy
Hey Ben love your content. Once minor suggestion, why not interleave the note and duration in the data statements and just use a single loop to play the song and read the note then the duration and then call BEEP. Don't need to store the data in arrays and use up precious RAM.
Euro Micelli
That’s correct. The placement of the DATA statements is irrelevant - it can be before or after the READ(s), or intermingled. And the values can be placed in as few or as many DATA statements as you want; whatever makes sense to the programmer. Values are just read in the order they are placed in DATA statements. The index can be reset with the RESTORE command if you need to start over reading values.
Stéphane Dumont
Hello Mr. Eater. As always tks so much for video quality and that new feature. I've got only two very small enhancements to propose. The assembly source file should named "beep.s" and the labels should be either all upper case or lower case but mixing is kind of weird.
Andrew Dungey
You NEED to make the final bit of music a rickroll. Great vid.
Kedarius
I would mention a quick estimate of how long the delay would be - like, calculate the number of clock cycles of the two loops and multiply them with 1us.
David
I don't know BASIC. So, READ takes one value from a (possibly much later) DATA directive? I guess there's some index that gets incremented on each READ.
Euro Micelli
I’m sure you checked the rest of the bits in the ACR and decided that writing zeroes to them instead of preserving existing values was fine. But I think you should describe that explicitly. It’s an important question to ask yourself.
readyplaygames
This is awesome. How do you determine what to add next?
Jeff Geerling
How long until we hit the Ben Eater crossover episode with LOOK MUM NO COMPUTER building handmade 6502s into midi sequencers??
Joel
Thanks!
Ben Eater
Weird. Here you go: https://youtu.be/B2wxMrczDK4
Joel
Mind sharing the yt link? For some reason the patreon app won't launch into the yt app on my phone.