1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-08 18:02:23 +05:30

bytebeat-render.js: correct incorrect samples

This commit is contained in:
Intel A80486DX2-66 2024-07-12 02:35:05 +03:00
parent a4f2974468
commit 5c1a4bfa08
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -61,7 +61,14 @@ const generateAudio = t => {
return t&t>>8
}
let lastCorrectSample = 127 // FIXME: guessed value
const constrainValue = sample => {
if (isNaN(sample) || sample < 0)
sample = lastCorrectSample
else
lastCorrectSample = sample
switch (SELECTED_TYPE) {
case TYPE_BYTEBEAT:
return sample & 255