Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
modulatorDetune,
modulatorOscType,
modulatorRatio,
startTime,
stopTime,
}) => ({
0: gainNode(['masterPan'], {gain}),
1: oscillator(0, {
detune: carrierDetune,
frequency,
startTime,
stopTime,
type: carrierOscType,
}),
2: gainNode({destination: 'frequency', key: 1}, {gain: 1024}),
3: oscillator(2, {
detune: modulatorDetune,
frequency: frequency * modulatorRatio,
startTime,
stopTime,
type: modulatorOscType,
}),
masterGain: gainNode(['output'], {gain: masterGain}),
masterPan: stereoPanner(['masterGain'], {pan: masterPan}),
}))
const lfoNode = createNode(({frequency, gain, type}) => ({
0: gainNode('output', {gain}),
1: oscillator(0, {frequency, type}),
}))
const oscBank = createNode(({
carrierDetune,
carrierOscType,
gain,
frequency,
masterGain,
masterPan,
modulatorDetune,
modulatorOscType,
modulatorRatio,
startTime,
stopTime,
}) => ({
0: gainNode(['masterPan'], {gain}),
1: oscillator(0, {
detune: carrierDetune,
frequency,
startTime,
stopTime,
type: carrierOscType,
}),
2: gainNode({destination: 'frequency', key: 1}, {gain: 1024}),
3: oscillator(2, {
detune: modulatorDetune,
frequency: frequency * modulatorRatio,
startTime,
stopTime,
type: modulatorOscType,
}),
masterGain: gainNode(['output'], {gain: masterGain}),
masterPan: stereoPanner(['masterGain'], {pan: masterPan}),
const osc = createNode(({detune, frequency, gain, pan, pitch, startTime, stopTime, type}) => ({
0: gainNode('output', {gain}),
1: stereoPanner(0, {pan}),
2: oscillator(1, {
detune,
frequency: pitchToFrequency(frequencyToPitch(frequency) + pitch),
startTime,
stopTime,
type,
}),
}))