TinyTapeout / vga-playground

Playground for VGA projects on Tiny Tapeout
https://tinytapeout.github.io/vga-playground/
GNU General Public License v3.0
56 stars 8 forks source link

look into audio simulation #8

Closed mattvenn closed 2 months ago

mattvenn commented 5 months ago

that would give an output similar to what you'd get with Mike's pmod

https://discord.com/channels/1009193568256135208/1255160614246944851/1256337836614095022

urish commented 4 months ago

Specs: PWM output on uio[7] Example project: https://github.com/MichaelBell/tt08-pwm-example/blob/main/src/sine.v (but see the note below)

@MichaelBell since the example above is linked from the competition, and anyone who also uses the VGA Pmod to use uio instead of uo for the audio Pmod, would you consider changing the example to output the audio on uio[7] instead of uo_out[7]?

MichaelBell commented 4 months ago

Yes that makes sense, I've pushed the change

urish commented 3 months ago

Started looking into this - there are two issues:

  1. The simulation doesn't run fast enough to simulate 25 MHz at real time (after the last performance update, we usually get between 25 and 40 fps on a modern machine, while real time would be 60 fps). This makes the sound come out very choppy. One workaround would be to save the sound to a buffer, and make it possible to download it into a .wav file.
  2. Adding sound currently further slows down the simulation by about 30%. I'm pretty sure we can work around this by rewriting some of the simulation code in a more efficient manner, but it's no longer a quick-win.

I can push the current prototype to a branch for people to play around with, if there are any takers.

urish commented 2 months ago

Done - see #13