gpu-audio, the world's fastest bytebeat renderer
BotB Academy Bulletins
 
 
168622
Level 23 Mixist
Minerscale
 
 
 
post #168622 :: 2023.03.11 11:59pm :: edit 2023.03.12 12:06am
  
  Svipal, Luigi64, raphaelgoulart, puke7, Quirby64, Xaser, roz, kilowatt64, Lasertooth, algoziptunes, argarak, kleeder, sean, cudsys, now_its_dark and cabbage drop liēkd this
Hi everybody! I've gone and spent way too many hours creating the world's most stupidly fast bytebeat renderer which does the actual computation using Vulkan GPU compute.

Why the heck have you done this?

No idea, honestly. I thought it would be dope to be able to generate hundreds of megabytes of bytebeat per second. This program can do it.

How does it work?

GPU's are uniquely suited to doing one thing over and over and over again on the same data. Bytebeat is effectively just running a function on a variable t over and and over and over. Match made in heaven! This thing will spit out bytebeat blasingly fast (or, on the other hand, blazingly efficient!) On my laptop I'm getting something like 0.2% CPU usage while the CPU isn't boosting at all. It sips power hehe.

300 lines of rust just to output a sine wave?

Yes. Vulkan is just about the most horribly verbose thing I have ever seen.

Wow! I'm never going to use this, this is pointlessly difficult to use and it fixes a problem I never had in the first place. Where's the link?

Glad you asked. Here it is: https://github.com/minerscale/gpu-audio

In all seriousness I put way too much work into this and I'm weirdly proud of it. I have no idea if it will work well on other operating systems due to the way it plays audio to the speaker but we'll see. The actual bytebeat formula is in the shader.glsl file. If anyone can be bothered to actually get it working :p
 
 
168625
Level 22 Chipist
birdrun
 
 
 
post #168625 :: 2023.03.12 3:07am
  
  puke7 liēkd this
My GODS. This is simultaneously genius and utter daft insanity. You were so preoccupied with whether or not you could etc. etc. This is some next level mad scientist stuff. Yae verily I stand in awe.

Honesty pretty cool. Not something I would have ever thought to even attempt.
 
 
168626
Level 7 Playa
zlago
 
 
post #168626 :: 2023.03.12 3:44am
afaik microsoft doesnt want you to use the internal speaker, but you can do that just fine on linux or whatever?? someone please fact check this
 
 
168627
Level 23 Mixist
Minerscale
 
 
 
post #168627 :: 2023.03.12 3:45am :: edit 2023.03.12 3:50am
  
  birdrun liēkd this
Thanks birdrun, I'm going to take this comment and wear it as a badge of honour. Now it's time to make some music with it!

Oh, and Zlago, the internal speaker isn't used. I just mean I've used an audio library which *has* windows compatibility but I've just configured it in the most lazy way which is compatible with my system. I could make it more robust if I wanted to I just don't have any other machines to test on.
 
 
168637
Level 19 Grafxicist
Ahornberg
 
 
 
post #168637 :: 2023.03.12 11:19am
Interesting! Hoe do you send the audio out of the GPU and to the speakers?
 
 
168660
Level 23 Mixist
Minerscale
 
 
 
post #168660 :: 2023.03.12 6:40pm
Ahornberg, the GPU writes the audio to a buffer in system memory rather than video memory, and then that data is then written to another buffer which is played out of the speakers. I really tried to get it to only use the one buffer but it's really difficult to get the synchronisation to work.
 
 
168812
Level 29 Hostist
puke7
 
 
 
post #168812 :: 2023.03.15 3:44pm
  
  Minerscale liēkd this
this is so cool
makes me wish i actually understood GPUs instead of simply using SDL2 textures!
 
 

LOGIN or REGISTER to add your own comments!