How in the world do bytebeat melodies actually work?!
BotB Academy n00b s0z
 
 
179555
Level 22 Chipist
SRB2er
 
 
 
post #179555 :: 2023.11.25 3:10pm
Title says most of what you need to know
I understand some stuff such as << can be used to increase octaves, but how do you play notes in a scale (C2, D#3, G2, etc)

like, (pow(2,24/12)*(t/4)&128) plays a square wave (on the note of C, I think, I don't have relative pitch (f)) but, when I change the 24 it kinda changes pitch (which is what I want) but also sounds like the square wave is changing its pulse width

I would go look at others people for refrence but..
they're bytebeats, they are not gonna be easy to read, anything but that really.

So yeah...
 
 
179568
Level 4 Playa
SArpnt
 
 
post #179568 :: 2023.11.25 8:27pm
i never really got it finished and probably won't anytime soon but i did start a decent amount of a tutorial for bytebeat: https://github.com/SArpnt/bytebeat-composer/blob/develop/info.md#create-a-bytebeat

about your square wave, the equation is actually right. your issue is probably that you're using 8000hz sample rate. most audio is around 48000hz and has much more fancy algorithms to handle interpolation and resampling and whatnot, while 8000hz runs the code so few times every second that you can hear artifacting.

8000hz is fine for the most simple bytebeats since they don't even use any fractional numbers, that's why they have similar pitches and simple melodies in most cases.

i recommend you just set the song to 48000hz.

if you get other artifacting from different waveforms in the future, that could also be because bytebeat only has 256 different output values that everything gets rounded to. you can make it sound better again by changing it to use floatbeat instead.
 
 

LOGIN or REGISTER to add your own comments!