// This file is part of the 64k demo project. // It defines the procedural audio generation interface. // Shared between the offline spectool and the runtime demo. #pragma once #include struct NoteParams { float base_freq; float duration_sec; float amplitude; float attack_sec; float decay_sec; // Unused for now float vibrato_rate; float vibrato_depth; int num_harmonics; float harmonic_decay; float pitch_randomness; float amp_randomness; }; // Generates a single note into a new spectrogram buffer std::vector generate_note_spectrogram(const NoteParams ¶ms, int *out_num_frames); // Pastes a source spectrogram into a destination spectrogram at a given frame // offset Expands destination if necessary void paste_spectrogram(std::vector &dest_data, int *dest_num_frames, const std::vector &src_data, int src_num_frames, int frame_offset); // Post-processing effects void apply_spectral_noise(std::vector &data, int num_frames, float amount); void apply_spectral_lowpass(std::vector &data, int num_frames, float cutoff_ratio); void apply_spectral_comb(std::vector &data, int num_frames, float period_bins, float depth);