Code quality checks

This commit is contained in:
2025-10-06 03:03:38 +02:00
parent 5cc10dec0c
commit ef50cc9918
17 changed files with 62 additions and 88 deletions

View File

@ -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) {

View File

@ -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
}
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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()
}
}

View File

@ -90,8 +90,8 @@ export class ParameterRegistry {
getModulatableParamsByCategory(category: 'engine' | 'effect'): string[] {
return Array.from(this.metadata.entries())
.filter(([_, meta]) => meta.category === category)
.map(([id, _]) => id)
.filter(([, meta]) => meta.category === category)
.map(([id]) => id)
}
clampValue(paramId: string, value: number): number {