mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 06:19:33 -04:00
WIP
This commit is contained in:
@@ -3536,3 +3536,21 @@ export const morph = (frompat, topat, bypat) => {
|
||||
bypat = reify(bypat);
|
||||
return frompat.innerBind((from) => topat.innerBind((to) => bypat.innerBind((by) => _morph(from, to, by))));
|
||||
};
|
||||
|
||||
/**
|
||||
* Wavefolding distortion
|
||||
*
|
||||
* @name fold
|
||||
* @param {number | Pattern} distortion
|
||||
*
|
||||
*/
|
||||
export const fold = register('fold', function (amt, vol = 1, pat) {
|
||||
return pat.withvValue((v) => {
|
||||
return {
|
||||
...v,
|
||||
distortion: amt,
|
||||
distortvol: vol,
|
||||
distorttype: 'fold',
|
||||
};
|
||||
}).innerJoin();
|
||||
});
|
||||
|
||||
@@ -475,6 +475,7 @@ export const getDistortionAlgorithm = (algo) => {
|
||||
};
|
||||
|
||||
export const getDistortion = (distort, postgain, algorithm) => {
|
||||
debugger;
|
||||
return getWorklet(getAudioContext(), 'distort-processor', { distort, postgain }, { processorOptions: { algorithm } });
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { noteToMidi, valueToMidi, getSoundIndex, getCommonSampleInfo } from './util.mjs';
|
||||
import { registerSound, registerWavetable } from './index.mjs';
|
||||
import { getCommonSampleInfo } from './util.mjs';
|
||||
import { registerSound, registerWaveTable } from './index.mjs';
|
||||
import { getAudioContext } from './audioContext.mjs';
|
||||
import { getADSRValues, getParamADSR, getPitchEnvelope, getVibratoOscillator } from './helpers.mjs';
|
||||
import { logger } from './logger.mjs';
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
destroyAudioWorkletNode,
|
||||
getADSRValues,
|
||||
getFrequencyFromValue,
|
||||
getLfo,
|
||||
getParamADSR,
|
||||
getPitchEnvelope,
|
||||
getVibratoOscillator,
|
||||
|
||||
Reference in New Issue
Block a user