mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-11-08 08:54:34 +05:30
bytebeat-render.js: correct incorrect samples
This commit is contained in:
parent
a4f2974468
commit
5c1a4bfa08
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user