waveform aliases: tri, sqr, saw, sin
This commit is contained in:
parent
ac6472a43a
commit
c33cfc78c5
1 changed files with 8 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { clamp, midiToFreq, noteToMidi } from './util.mjs';
|
||||
import { registerSound, getAudioContext } from './superdough.mjs';
|
||||
import { registerSound, getAudioContext, soundMap } from './superdough.mjs';
|
||||
import {
|
||||
applyFM,
|
||||
gainNode,
|
||||
|
|
@ -27,6 +27,12 @@ const getFrequencyFromValue = (value) => {
|
|||
};
|
||||
|
||||
const waveforms = ['triangle', 'square', 'sawtooth', 'sine'];
|
||||
const waveformAliases = [
|
||||
['tri', 'triangle'],
|
||||
['sqr', 'square'],
|
||||
['saw', 'sawtooth'],
|
||||
['sin', 'sine'],
|
||||
];
|
||||
const noises = ['pink', 'white', 'brown', 'crackle'];
|
||||
|
||||
export function registerSynthSounds() {
|
||||
|
|
@ -235,6 +241,7 @@ export function registerSynthSounds() {
|
|||
{ type: 'synth', prebake: true },
|
||||
);
|
||||
});
|
||||
waveformAliases.forEach(([alias, actual]) => soundMap.set({ ...soundMap.get(), [alias]: soundMap.get()[actual] }));
|
||||
}
|
||||
|
||||
export function waveformN(partials, type) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue