mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-05-31 08:31:41 +05:30
bytebeat-render.js: correct incorrect samples
This commit is contained in:
@@ -61,7 +61,14 @@ const generateAudio = t => {
|
|||||||
return t&t>>8
|
return t&t>>8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let lastCorrectSample = 127 // FIXME: guessed value
|
||||||
|
|
||||||
const constrainValue = sample => {
|
const constrainValue = sample => {
|
||||||
|
if (isNaN(sample) || sample < 0)
|
||||||
|
sample = lastCorrectSample
|
||||||
|
else
|
||||||
|
lastCorrectSample = sample
|
||||||
|
|
||||||
switch (SELECTED_TYPE) {
|
switch (SELECTED_TYPE) {
|
||||||
case TYPE_BYTEBEAT:
|
case TYPE_BYTEBEAT:
|
||||||
return sample & 255
|
return sample & 255
|
||||||
|
Reference in New Issue
Block a user