mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-16 08:08:34 +00:00
pull out debugging fn
This commit is contained in:
parent
b991cfc493
commit
213b1a2dae
@ -56,31 +56,7 @@ export const getZZFX = (value, t, duration) => {
|
||||
decay,
|
||||
tremolo,
|
||||
];
|
||||
const paramOrder = [
|
||||
'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);
|
||||
// console.log(redableZZFX(params));
|
||||
|
||||
const samples = /* ZZFX. */ buildSamples(...params);
|
||||
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
|
||||
// changes: replaced this.volume with 1 + using sampleRate from getAudioContext()
|
||||
function buildSamples(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user