parameter renaming

This commit is contained in:
Raphael Forment 2023-09-05 11:27:42 +02:00
parent fc9525e7d8
commit 7605198774

View file

@ -42,8 +42,8 @@ export function registerSynthSounds() {
fmwave: fmWaveform = 'sine', fmwave: fmWaveform = 'sine',
vib = 0, vib = 0,
vibmod = 1, vibmod = 1,
slide, pitchJump,
slide_speed = 1, pitchJumpSpeed = 1,
} = value; } = value;
let { n, note, freq } = value; let { n, note, freq } = value;
// with synths, n and note are the same thing // with synths, n and note are the same thing
@ -63,8 +63,8 @@ export function registerSynthSounds() {
freq, freq,
vib, vib,
vibmod, vibmod,
slide: slide * freq, pitchJump: pitchJump * freq,
slide_speed: sustain / slide_speed, pitchJumpSpeed: sustain / pitchJumpSpeed,
partials: n, partials: n,
}); });
@ -150,7 +150,7 @@ export function waveformN(partials, type) {
return osc; return osc;
} }
export function getOscillator({ s, freq, t, vib, vibmod, slide, slide_speed, partials }) { export function getOscillator({ s, freq, t, vib, vibmod, pitchJump, pitchJumpSpeed, partials }) {
// Additional oscillator for vibrato effect // Additional oscillator for vibrato effect
if (vib > 0) { if (vib > 0) {
var vibrato_oscillator = getAudioContext().createOscillator(); var vibrato_oscillator = getAudioContext().createOscillator();
@ -168,7 +168,7 @@ export function getOscillator({ s, freq, t, vib, vibmod, slide, slide_speed, par
if (vib > 0) { if (vib > 0) {
o.frequency.value = Number(freq); o.frequency.value = Number(freq);
slide > 0 && o.frequency.linearRampToValueAtTime(freq + slide, t + slide_speed); slide > 0 && o.frequency.linearRampToValueAtTime(freq + pitchJump, t + pitchJumpSpeed);
var gain = getAudioContext().createGain(); var gain = getAudioContext().createGain();
// Vibmod is the amount of vibrato, in semitones // Vibmod is the amount of vibrato, in semitones
gain.gain.value = vibmod * freq; gain.gain.value = vibmod * freq;