This commit is contained in:
Jade (Rose) Rowland 2025-05-20 21:45:14 +01:00
parent b8d2d02466
commit 65f1760fad
3 changed files with 11 additions and 18 deletions

View file

@ -144,14 +144,13 @@ export function registerSynthSounds() {
{ prebake: true, type: 'synth' },
);
registerSound(
'bytebeat',
(begin, value, onended) => {
const ac = getAudioContext();
let { byteBeatExpression } = value;
let { duration} = value;
let { duration } = value;
const [attack, decay, sustain, release] = getADSRValues(
[value.attack, value.decay, value.sustain, value.release],
'linear',
@ -163,7 +162,6 @@ export function registerSynthSounds() {
ac,
'byte-beat-processor',
{
begin,
end,
},
@ -172,14 +170,13 @@ export function registerSynthSounds() {
},
);
o.port.postMessage(byteBeatExpression);
let envGain = gainNode(1);
envGain = o.connect(envGain);
getParamADSR(envGain.gain, attack, decay, sustain, release, 0, 1, begin, holdend, 'linear');
let timeoutNode = webAudioTimeout(
ac,
() => {