pull out debugging fn
This commit is contained in:
parent
b991cfc493
commit
213b1a2dae
1 changed files with 28 additions and 25 deletions
|
|
@ -56,31 +56,7 @@ export const getZZFX = (value, t, duration) => {
|
||||||
decay,
|
decay,
|
||||||
tremolo,
|
tremolo,
|
||||||
];
|
];
|
||||||
const paramOrder = [
|
// console.log(redableZZFX(params));
|
||||||
'volume',
|
|
||||||
'randomness',
|
|
||||||
'frequency',
|
|
||||||
'attack',
|
|
||||||
'sustain',
|
|
||||||
'release',
|
|
||||||
'shape',
|
|
||||||
'shapeCurve',
|
|
||||||
'slide',
|
|
||||||
'deltaSlide',
|
|
||||||
'pitchJump',
|
|
||||||
'pitchJumpTime',
|
|
||||||
'repeatTime',
|
|
||||||
'noise',
|
|
||||||
'modulation',
|
|
||||||
'bitCrush',
|
|
||||||
'delay',
|
|
||||||
'sustainVolume',
|
|
||||||
'decay',
|
|
||||||
'tremolo',
|
|
||||||
];
|
|
||||||
|
|
||||||
const readableParams = Object.fromEntries(paramOrder.map((param, i) => [param, params[i]]));
|
|
||||||
console.log(readableParams);
|
|
||||||
|
|
||||||
const samples = /* ZZFX. */ buildSamples(...params);
|
const samples = /* ZZFX. */ buildSamples(...params);
|
||||||
const context = getAudioContext();
|
const context = getAudioContext();
|
||||||
|
|
@ -112,6 +88,33 @@ export function registerZZFXSounds() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// just for debugging
|
||||||
|
function redableZZFX(params) {
|
||||||
|
const paramOrder = [
|
||||||
|
'volume',
|
||||||
|
'randomness',
|
||||||
|
'frequency',
|
||||||
|
'attack',
|
||||||
|
'sustain',
|
||||||
|
'release',
|
||||||
|
'shape',
|
||||||
|
'shapeCurve',
|
||||||
|
'slide',
|
||||||
|
'deltaSlide',
|
||||||
|
'pitchJump',
|
||||||
|
'pitchJumpTime',
|
||||||
|
'repeatTime',
|
||||||
|
'noise',
|
||||||
|
'modulation',
|
||||||
|
'bitCrush',
|
||||||
|
'delay',
|
||||||
|
'sustainVolume',
|
||||||
|
'decay',
|
||||||
|
'tremolo',
|
||||||
|
];
|
||||||
|
return Object.fromEntries(paramOrder.map((param, i) => [param, params[i]]));
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/KilledByAPixel/ZzFX/blob/master/ZzFX.js#L85C5-L180C6
|
// https://github.com/KilledByAPixel/ZzFX/blob/master/ZzFX.js#L85C5-L180C6
|
||||||
// changes: replaced this.volume with 1 + using sampleRate from getAudioContext()
|
// changes: replaced this.volume with 1 + using sampleRate from getAudioContext()
|
||||||
function buildSamples(
|
function buildSamples(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue