mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 05:38:34 +00:00
lint
This commit is contained in:
parent
38908baccd
commit
38e4718826
@ -468,9 +468,7 @@ export const { channels, ch } = registerControl('channels', 'ch');
|
|||||||
* @example
|
* @example
|
||||||
* n(run(8)).scale("D:pentatonic").s("pulse").pw("0 .75 .5 1")
|
* n(run(8)).scale("D:pentatonic").s("pulse").pw("0 .75 .5 1")
|
||||||
*/
|
*/
|
||||||
export const { pw } = registerControl(
|
export const { pw } = registerControl(['pw', 'pwrate', 'pwsweep']);
|
||||||
['pw', 'pwrate', 'pwsweep'],
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* controls the lfo rate for the pulsewidth of the pulse oscillator
|
* controls the lfo rate for the pulsewidth of the pulse oscillator
|
||||||
@ -482,10 +480,7 @@ export const { pw } = registerControl(
|
|||||||
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export const { pwrate } = registerControl(
|
export const { pwrate } = registerControl('pwrate');
|
||||||
'pwrate'
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* controls the lfo sweep for the pulsewidth of the pulse oscillator
|
* controls the lfo sweep for the pulsewidth of the pulse oscillator
|
||||||
@ -496,10 +491,7 @@ export const { pwrate } = registerControl(
|
|||||||
* n(run(8)).scale("D:pentatonic").s("pulse").pw("0.5").pwrate("<5 .1 25>").pwsweep("<0.3 .8>")
|
* n(run(8)).scale("D:pentatonic").s("pulse").pw("0.5").pwrate("<5 .1 25>").pwsweep("<0.3 .8>")
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export const { pwsweep } = registerControl(
|
export const { pwsweep } = registerControl('pwsweep');
|
||||||
'pwsweep'
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Phaser audio effect that approximates popular guitar pedals.
|
* Phaser audio effect that approximates popular guitar pedals.
|
||||||
|
|||||||
@ -317,13 +317,13 @@ export function getLfo(audioContext, time, end, properties = {}) {
|
|||||||
end,
|
end,
|
||||||
shape: 1,
|
shape: 1,
|
||||||
dcoffset: -0.5,
|
dcoffset: -0.5,
|
||||||
...properties
|
...properties,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000, sweep = 2000) {
|
function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000, sweep = 2000) {
|
||||||
const ac = getAudioContext();
|
const ac = getAudioContext();
|
||||||
const lfoGain = getLfo(ac, time, end, { frequency, depth: sweep * 2 })
|
const lfoGain = getLfo(ac, time, end, { frequency, depth: sweep * 2 });
|
||||||
|
|
||||||
//filters
|
//filters
|
||||||
const numStages = 2; //num of filters in series
|
const numStages = 2; //num of filters in series
|
||||||
|
|||||||
@ -148,17 +148,17 @@ export function registerSynthSounds() {
|
|||||||
let { pwrate, pwsweep } = value;
|
let { pwrate, pwsweep } = value;
|
||||||
if (pwsweep == null) {
|
if (pwsweep == null) {
|
||||||
if (pwrate != null) {
|
if (pwrate != null) {
|
||||||
pwsweep = 0.3
|
pwsweep = 0.3;
|
||||||
} else {
|
} else {
|
||||||
pwsweep = 0
|
pwsweep = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (pwrate == null && pwsweep != null) {
|
|
||||||
pwrate = 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let { duration, pw: pulsewidth = value.n ?? 0.5, } = value;
|
if (pwrate == null && pwsweep != null) {
|
||||||
|
pwrate = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
let { duration, pw: pulsewidth = value.n ?? 0.5 } = value;
|
||||||
const frequency = getFrequencyFromValue(value);
|
const frequency = getFrequencyFromValue(value);
|
||||||
|
|
||||||
const [attack, decay, sustain, release] = getADSRValues(
|
const [attack, decay, sustain, release] = getADSRValues(
|
||||||
@ -190,10 +190,9 @@ export function registerSynthSounds() {
|
|||||||
|
|
||||||
getParamADSR(envGain.gain, attack, decay, sustain, release, 0, 1, begin, holdend, 'linear');
|
getParamADSR(envGain.gain, attack, decay, sustain, release, 0, 1, begin, holdend, 'linear');
|
||||||
|
|
||||||
|
|
||||||
if (pwsweep != 0) {
|
if (pwsweep != 0) {
|
||||||
let lfo = getLfo(ac, begin, end, { frequency: pwrate, depth: pwsweep, })
|
let lfo = getLfo(ac, begin, end, { frequency: pwrate, depth: pwsweep });
|
||||||
lfo.connect(o.parameters.get('pulsewidth'))
|
lfo.connect(o.parameters.get('pulsewidth'));
|
||||||
}
|
}
|
||||||
let timeoutNode = webAudioTimeout(
|
let timeoutNode = webAudioTimeout(
|
||||||
ac,
|
ac,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user