import { HarmonicSliders } from './HarmonicSliders' import { SpectrumPlot } from './SpectrumPlot' import { WaveformPlot } from './WaveformPlot' import { degToRad, randomPhasesDeg, zeros } from '../synth' type Props = { name: 'A' | 'B' otherName: 'A' | 'B' color: string amplitudes: number[] phasesDeg: number[] setPhasesDeg: (p: number[]) => void onCopyFromOther: () => void onPlay: () => void playing: boolean yMax: number } /** Editor and plots for one tone. Amplitudes are shared; only phases are edited here. */ export function ToneColumn({ name, otherName, color, amplitudes, phasesDeg, setPhasesDeg, onCopyFromOther, onPlay, playing, yMax }: Props) { const n = amplitudes.length const phases = phasesDeg.map(degToRad) return (

Tone {name}

One period of the waveform

Phases

setPhasesDeg(phasesDeg.map((p, i) => (i === k ? v : p)))} />
) }