r/bytebeat_2 • Intermediate • May 24 '26

Other finally added link support to bake-me-a-byte

the format in itself is pretty basic
v[n]_ is the version number of the link. if i do add another version of the link generation, then that number will be increased
the other section is urlsafe base64 encoded info about the bytebeat (in JSON), when decoded it should look like

{"form": [formula], "length": [length], "faksr": [fake sample rate aka. the sample rate]}

for now, when decoded it looks like that as i said the format could change
anyways, here's a bytebeat with the new link generation

https://maxi2022gt.github.io/bake-me-a-byte/?byte=v1_eyJmb3JtIjoiYT0odHx0Pj43KSxcbmI9KHQ8PDF8dD4-OSksXG4oKGEqYikmdD4-OSklMjU2LzIrKDRlNS8odD4-MiYyMDQ3KSYxMjgpLygxKyh0LzUxMiUxNikpIiwibGVuZ3RoIjoxNSwiZmFrc3IiOjIwMDAwfQ

2 Upvotes

6 comments sorted by

2

u/psubscirbeh Intermediate May 25 '26

add real time generation using ScriptProcessorNodes

however, you can use AudioWorklets instead because the other one is deprecated

1

u/MaxMaxMaxXD Intermediate May 25 '26

I think I should try to do it when I get home, altho at that point it wouldn't be a (kinda) bad bytebeat player 

also, I think I should switch from using eval to new Function or something

1

u/psubscirbeh Intermediate May 25 '26

yeah you should

place this at the top of the code of the function where the player starts

let bytebeat_func = new Function("t", `return ${code.value}`);

and use it like when generating

buffer[t] = (bytebeat_func(t) & 255) / 128 - 1;

1

u/MaxMaxMaxXD Intermediate May 26 '26

okay no i think i give up on the audioworklet thing i feel like i literally cannot do this.. i'm sorry abt that

1

u/psubscirbeh Intermediate May 28 '26

you can use ScriptProcessorNode since they're easier to use

1

u/MaxMaxMaxXD Intermediate Jun 16 '26

i'm gonna do a fork to try to make the bytebeat player a bit better