documenting vibrato and removing broken slide/pitchJump mechanism
This commit is contained in:
parent
3431803980
commit
74442b0d76
2 changed files with 7 additions and 9 deletions
|
|
@ -686,6 +686,7 @@ const generic_params = [
|
||||||
['rate'],
|
['rate'],
|
||||||
// TODO: slide param for certain synths
|
// TODO: slide param for certain synths
|
||||||
['slide'],
|
['slide'],
|
||||||
|
|
||||||
['slidespeed'],
|
['slidespeed'],
|
||||||
// TODO: detune? https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
|
// TODO: detune? https://tidalcycles.org/docs/patternlib/tutorials/synthesizers/#supersquare
|
||||||
['semitone'],
|
['semitone'],
|
||||||
|
|
@ -893,10 +894,13 @@ const generic_params = [
|
||||||
// ZZFX
|
// ZZFX
|
||||||
['zrand'],
|
['zrand'],
|
||||||
['curve'],
|
['curve'],
|
||||||
['slide'], // superdirt duplicate
|
|
||||||
['deltaSlide'],
|
|
||||||
['pitchJump'],
|
['pitchJump'],
|
||||||
['pitchJumpTime'],
|
['pitchJumpTime'],
|
||||||
|
['slide'], // superdirt duplicate
|
||||||
|
['deltaSlide'],
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
['lfo', 'repeatTime'],
|
['lfo', 'repeatTime'],
|
||||||
['noise'],
|
['noise'],
|
||||||
['zmod'],
|
['zmod'],
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,6 @@ export function registerSynthSounds() {
|
||||||
fmwave: fmWaveform = 'sine',
|
fmwave: fmWaveform = 'sine',
|
||||||
vib = 0,
|
vib = 0,
|
||||||
vibmod = 1,
|
vibmod = 1,
|
||||||
pitchJump,
|
|
||||||
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 +61,6 @@ export function registerSynthSounds() {
|
||||||
freq,
|
freq,
|
||||||
vib,
|
vib,
|
||||||
vibmod,
|
vibmod,
|
||||||
pitchJump: pitchJump * freq,
|
|
||||||
pitchJumpSpeed: sustain / pitchJumpSpeed,
|
|
||||||
partials: n,
|
partials: n,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -150,7 +146,7 @@ export function waveformN(partials, type) {
|
||||||
return osc;
|
return osc;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getOscillator({ s, freq, t, vib, vibmod, pitchJump, pitchJumpSpeed, partials }) {
|
export function getOscillator({ s, freq, t, vib, vibmod, 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 +164,6 @@ export function getOscillator({ s, freq, t, vib, vibmod, pitchJump, pitchJumpSpe
|
||||||
|
|
||||||
if (vib > 0) {
|
if (vib > 0) {
|
||||||
o.frequency.value = Number(freq);
|
o.frequency.value = Number(freq);
|
||||||
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;
|
||||||
|
|
@ -186,7 +181,6 @@ export function getOscillator({ s, freq, t, vib, vibmod, pitchJump, pitchJumpSpe
|
||||||
} else {
|
} else {
|
||||||
// Normal operation, without vibrato
|
// Normal operation, without vibrato
|
||||||
o.frequency.value = Number(freq);
|
o.frequency.value = Number(freq);
|
||||||
slide > 0 && o.frequency.linearRampToValueAtTime(freq + slide, t + slide_speed);
|
|
||||||
o.start(t);
|
o.start(t);
|
||||||
const stop = (time) => o.stop(time);
|
const stop = (time) => o.stop(time);
|
||||||
return { node: o, stop };
|
return { node: o, stop };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue