Code quality checks
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { EffectsChain } from './effects/EffectsChain'
|
||||
import { BytebeatSourceEffect } from './effects/BytebeatSourceEffect'
|
||||
import { ModulationEngine } from '../modulation/ModulationEngine'
|
||||
import type { LFOWaveform } from '../modulation/LFO'
|
||||
import type { EffectValues } from '../../types/effects'
|
||||
|
||||
export interface AudioPlayerOptions {
|
||||
@ -129,10 +130,10 @@ export class AudioPlayer {
|
||||
)
|
||||
}
|
||||
|
||||
setLFOConfig(lfoIndex: number, config: { frequency: number; phase: number; waveform: string; mappings: Array<{ targetParam: string; depth: number }> }): void {
|
||||
setLFOConfig(lfoIndex: number, config: { frequency: number; phase: number; waveform: LFOWaveform; mappings: Array<{ targetParam: string; depth: number }> }): void {
|
||||
if (!this.modulationEngine) return
|
||||
|
||||
this.modulationEngine.updateLFO(lfoIndex, config.frequency, config.phase, config.waveform as any)
|
||||
this.modulationEngine.updateLFO(lfoIndex, config.frequency, config.phase, config.waveform)
|
||||
this.modulationEngine.clearMappings(lfoIndex)
|
||||
|
||||
for (const mapping of config.mappings) {
|
||||
|
||||
@ -22,7 +22,7 @@ export function generateSamples(
|
||||
const value = compiledFormula(t, a, b, c, d)
|
||||
const byteValue = value & 0xFF
|
||||
buffer[t] = (byteValue - 128) / 128
|
||||
} catch (error) {
|
||||
} catch {
|
||||
buffer[t] = 0
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ export function generateSamplesWithBitDepth(
|
||||
const value = compiledFormula(t, a, b, c, d)
|
||||
const clampedValue = value & maxValue
|
||||
buffer[t] = (clampedValue - midPoint) / midPoint
|
||||
} catch (error) {
|
||||
} catch {
|
||||
buffer[t] = 0
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,11 +25,11 @@ export class BytebeatSourceEffect implements Effect {
|
||||
return this.outputNode
|
||||
}
|
||||
|
||||
setBypass(_bypass: boolean): void {
|
||||
setBypass(): void {
|
||||
// Source node doesn't support bypass
|
||||
}
|
||||
|
||||
updateParams(_values: Record<string, number | string>): void {
|
||||
updateParams(): void {
|
||||
// Parameters handled via specific methods
|
||||
}
|
||||
|
||||
|
||||
@ -30,11 +30,11 @@ export class OutputLimiter implements Effect {
|
||||
return this.outputNode
|
||||
}
|
||||
|
||||
setBypass(_bypass: boolean): void {
|
||||
setBypass(): void {
|
||||
// Output limiter is always on
|
||||
}
|
||||
|
||||
updateParams(_values: Record<string, number | string>): void {
|
||||
updateParams(): void {
|
||||
// Uses default parameters from worklet
|
||||
}
|
||||
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
import type { Effect } from './Effect.interface'
|
||||
|
||||
export class PassThroughEffect implements Effect {
|
||||
readonly id: string
|
||||
private node: GainNode
|
||||
|
||||
constructor(audioContext: AudioContext, id: string) {
|
||||
this.id = id
|
||||
this.node = audioContext.createGain()
|
||||
this.node.gain.value = 1
|
||||
}
|
||||
|
||||
getInputNode(): AudioNode {
|
||||
return this.node
|
||||
}
|
||||
|
||||
getOutputNode(): AudioNode {
|
||||
return this.node
|
||||
}
|
||||
|
||||
setBypass(_bypass: boolean): void {
|
||||
}
|
||||
|
||||
updateParams(_values: Record<string, number | string>): void {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.node.disconnect()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user