export type WaveformType = 'sine' | 'square' | 'sawtooth' | 'triangle' | 'noise' | 'pulse';
export interface OscillatorConfig {
    waveform: WaveformType;
    frequency: number;
    amplitude: number;
    phase: number;
    detune: number;
    pulseWidth?: number;
}
export interface EnvelopeADSR {
    attack: number;
    decay: number;
    sustain: number;
    release: number;
}
export declare const DEFAULT_ADSR: EnvelopeADSR;
export interface SynthPatch {
    name: string;
    oscillators: OscillatorConfig[];
    envelope: EnvelopeADSR;
    filterType: 'lowpass' | 'highpass' | 'bandpass' | 'notch' | 'none';
    filterFrequency: number;
    filterResonance: number;
    filterEnvelope?: EnvelopeADSR;
    filterEnvAmount: number;
    lfo?: LFOConfig;
    gain: number;
    pan: number;
}
export interface LFOConfig {
    waveform: WaveformType;
    frequency: number;
    amplitude: number;
    target: 'frequency' | 'amplitude' | 'filter' | 'pan';
}
/** Generate a single sample from an oscillator (for procedural audio). */
export declare function oscillatorSample(config: OscillatorConfig, time: number): number;
/** Compute ADSR envelope value at a given time. */
export declare function adsrValue(env: EnvelopeADSR, time: number, noteOffTime: number | null): number;
/** Preset synth patches. */
export declare const SYNTH_PRESETS: Record<string, SynthPatch>;
export type EffectType = 'reverb' | 'delay' | 'distortion' | 'chorus' | 'flanger' | 'phaser' | 'compressor' | 'equalizer' | 'tremolo' | 'bitcrusher' | 'limiter';
export interface AudioEffect {
    type: EffectType;
    enabled: boolean;
    wet: number;
    params: Record<string, number>;
}
export interface ReverbParams {
    roomSize: number;
    damping: number;
    preDelay: number;
}
export interface DelayParams {
    time: number;
    feedback: number;
    pingPong: boolean;
}
export interface DistortionParams {
    amount: number;
    tone: number;
}
export interface ChorusParams {
    rate: number;
    depth: number;
    delay: number;
}
export interface CompressorParams {
    threshold: number;
    ratio: number;
    attack: number;
    release: number;
    knee: number;
}
export interface EQBand {
    frequency: number;
    gain: number;
    q: number;
    type: 'lowshelf' | 'highshelf' | 'peaking';
}
export declare function createReverb(roomSize?: number, damping?: number, wet?: number): AudioEffect;
export declare function createDelay(time?: number, feedback?: number, wet?: number): AudioEffect;
export declare function createDistortion(amount?: number, tone?: number, wet?: number): AudioEffect;
export declare function createCompressor(threshold?: number, ratio?: number, attack?: number, release?: number): AudioEffect;
export interface AudioEffectsChain {
    effects: AudioEffect[];
    masterGain: number;
    masterPan: number;
}
export declare function createEffectsChain(effects?: AudioEffect[]): AudioEffectsChain;
export type MusicLayerState = 'playing' | 'fading-in' | 'fading-out' | 'stopped';
export interface MusicLayer {
    id: string;
    trackId: string;
    volume: number;
    loop: boolean;
    syncToBar: boolean;
    state: MusicLayerState;
    fadeTime: number;
    conditions: MusicCondition[];
}
export interface MusicCondition {
    parameter: string;
    operator: '=' | '!=' | '<' | '>' | '<=' | '>=';
    value: number | string;
}
export interface MusicTransition {
    fromState: string;
    toState: string;
    type: 'crossfade' | 'cut' | 'stinger' | 'musical';
    duration: number;
    stingerTrackId?: string;
    syncPoint: 'immediate' | 'next-beat' | 'next-bar' | 'next-section';
}
export interface AdaptiveMusicConfig {
    bpm: number;
    beatsPerBar: number;
    states: MusicState[];
    transitions: MusicTransition[];
    parameters: Map<string, number>;
    currentState: string;
}
export interface MusicState {
    name: string;
    layers: MusicLayer[];
    intensity: number;
}
export declare function evaluateMusicConditions(conditions: MusicCondition[], params: Map<string, number>): boolean;
export declare function findNextMusicState(config: AdaptiveMusicConfig): string | null;
/** Beat/bar timing helpers. */
export declare function beatDuration(bpm: number): number;
export declare function barDuration(bpm: number, beatsPerBar: number): number;
export declare function currentBeat(time: number, bpm: number): number;
export declare function nextBarTime(time: number, bpm: number, beatsPerBar: number): number;
export interface AudioAnalysisConfig {
    fftSize: 256 | 512 | 1024 | 2048 | 4096;
    smoothingTimeConstant: number;
    minDecibels: number;
    maxDecibels: number;
}
export declare const DEFAULT_ANALYSIS_CONFIG: AudioAnalysisConfig;
export interface AudioBands {
    sub: number;
    bass: number;
    lowMid: number;
    mid: number;
    highMid: number;
    presence: number;
    brilliance: number;
    overall: number;
}
export declare function extractBands(frequencyData: Uint8Array, sampleRate: number): AudioBands;
export interface AudioReactiveBinding {
    band: keyof AudioBands;
    target: string;
    min: number;
    max: number;
    smoothing: number;
    sensitivity: number;
}
export interface VoiceChatConfig {
    codec: 'opus' | 'pcm';
    sampleRate: 16000 | 24000 | 48000;
    bitrate: number;
    channelCount: 1 | 2;
    echoCancellation: boolean;
    noiseSuppression: boolean;
    autoGainControl: boolean;
    vadEnabled: boolean;
    vadThreshold: number;
    spatialAudio: boolean;
    maxDistance: number;
    pushToTalk: boolean;
    pushToTalkKey: string;
    muteOnDeafen: boolean;
}
export declare const DEFAULT_VOICE_CONFIG: VoiceChatConfig;
export interface VoiceParticipant {
    peerId: string;
    displayName: string;
    isMuted: boolean;
    isDeafened: boolean;
    isSpeaking: boolean;
    volume: number;
    position?: {
        x: number;
        y: number;
        z: number;
    };
}
