mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 19:48:31 +00:00
add zzfx sound + zzfx control to override params
This commit is contained in:
parent
388e7b3c2f
commit
4c744da3e2
@ -816,6 +816,7 @@ const generic_params = [
|
|||||||
['zcrush'], // like crush but scaled differently
|
['zcrush'], // like crush but scaled differently
|
||||||
['zdelay'],
|
['zdelay'],
|
||||||
['tremolo'],
|
['tremolo'],
|
||||||
|
['zzfx'],
|
||||||
];
|
];
|
||||||
// TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13
|
// TODO: slice / splice https://www.youtube.com/watch?v=hKhPdO0RKDQ&list=PL2lW1zNIIwj3bDkh-Y3LUGDuRcoUigoDs&index=13
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@ export const getZZFX = (value, t) => {
|
|||||||
zdelay = 0,
|
zdelay = 0,
|
||||||
tremolo = 0,
|
tremolo = 0,
|
||||||
duration = 0.2,
|
duration = 0.2,
|
||||||
|
zzfx,
|
||||||
} = value;
|
} = value;
|
||||||
const sustainTime = Math.max(duration - attack - decay, 0);
|
const sustainTime = Math.max(duration - attack - decay, 0);
|
||||||
if (typeof note === 'string') {
|
if (typeof note === 'string') {
|
||||||
@ -39,7 +40,7 @@ export const getZZFX = (value, t) => {
|
|||||||
const shape = ['sine', 'triangle', 'sawtooth', 'tan', 'noise'].indexOf(s) || 0;
|
const shape = ['sine', 'triangle', 'sawtooth', 'tan', 'noise'].indexOf(s) || 0;
|
||||||
curve = s === 'square' ? 0 : curve;
|
curve = s === 'square' ? 0 : curve;
|
||||||
|
|
||||||
const params = [
|
const params = zzfx || [
|
||||||
0.25, // volume
|
0.25, // volume
|
||||||
zrand,
|
zrand,
|
||||||
freq,
|
freq,
|
||||||
@ -76,7 +77,7 @@ export const getZZFX = (value, t) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function registerZZFXSounds() {
|
export function registerZZFXSounds() {
|
||||||
['z_sine', 'z_sawtooth', 'z_triangle', 'z_square', 'z_tan', 'z_noise'].forEach((wave) => {
|
['zzfx', 'z_sine', 'z_sawtooth', 'z_triangle', 'z_square', 'z_tan', 'z_noise'].forEach((wave) => {
|
||||||
registerSound(
|
registerSound(
|
||||||
wave,
|
wave,
|
||||||
(t, value, onended) => {
|
(t, value, onended) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user