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',
vib = 0,
vibmod = 1,
slide,
slide_speed = 1,
pitchJump,
pitchJumpSpeed = 1,
} = value;
let { n, note, freq } = value;
// with synths, n and note are the same thing
@ -63,8 +63,8 @@ export function registerSynthSounds() {
freq,
vib,
vibmod,
slide: slide * freq,
slide_speed: sustain / slide_speed,
pitchJump: pitchJump * freq,
pitchJumpSpeed: sustain / pitchJumpSpeed,
partials: n,
});
@ -150,7 +150,7 @@ export function waveformN(partials, type) {
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
if (vib > 0) {
var vibrato_oscillator = getAudioContext().createOscillator();
@ -168,7 +168,7 @@ export function getOscillator({ s, freq, t, vib, vibmod, slide, slide_speed, par
if (vib > 0) {
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();
// Vibmod is the amount of vibrato, in semitones
gain.gain.value = vibmod * freq;