mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-12 06:08:34 +00:00
cleaning up
This commit is contained in:
parent
88e933ee25
commit
64c2e7c1e8
@ -71,7 +71,8 @@ export function waveformN(partials, type) {
|
||||
const real = new Float32Array(partials + 1);
|
||||
const imag = new Float32Array(partials + 1);
|
||||
const ac = getAudioContext();
|
||||
const osc = new OscillatorNode(ac, { channelCount: 1, channelCountMode: 'explicit' });
|
||||
const osc = ac.createOscillator();
|
||||
|
||||
const terms = {
|
||||
sawtooth: (n) => [0, -1 / n],
|
||||
square: (n) => [0, n % 2 === 0 ? 0 : 1 / n],
|
||||
@ -124,8 +125,7 @@ export function getOscillator(
|
||||
let o;
|
||||
// If no partials are given, use stock waveforms
|
||||
if (!partials || s === 'sine') {
|
||||
o = new OscillatorNode(ac, { channelCount: 1, channelCountMode: 'explicit' });
|
||||
console.log(o);
|
||||
o = getAudioContext().createOscillator();
|
||||
o.type = s || 'triangle';
|
||||
}
|
||||
// generate custom waveform if partials are given
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user