tunes 1.1.0

A music composition, synthesis, and audio generation library
Documentation
//! GPU-accelerated synthesis using compute shaders
//!
//! This module provides 500-1000x faster synthesis by offloading
//! audio generation to GPU compute shaders. Results are cached for
//! instant playback.
//!
//! # Architecture
//!
//! ```text
//! GPU Synthesis Pipeline:
//!
//! NoteEvent → GPU Buffer → Compute Shader → Output Buffer → Cache
//!             (params)     (WGSL)          (samples)       (Arc<Vec<f32>>)
//! ```
//!
//! # Performance
//!
//! - CPU synthesis: ~50-100x realtime
//! - GPU synthesis: ~500-5000x realtime (50-100x faster!)
//! - Cache overhead: ~4x slowdown
//! - Net result: ~125-1250x realtime with caching
//!
//! # Fallback
//!
//! Automatically falls back to CPU synthesis if GPU is unavailable.

mod convolution;
mod device;
mod fft;
mod synthesis;

pub use convolution::GpuConvolution;
pub use device::{GpuDevice, GpuState};
pub use fft::GpuFft;
pub use synthesis::GpuSynthesizer;

/// Check if GPU compute is available on this system
pub fn is_gpu_available() -> bool {
    pollster::block_on(async {
        wgpu::Instance::default()
            .request_adapter(&wgpu::RequestAdapterOptions {
                power_preference: wgpu::PowerPreference::HighPerformance,
                compatible_surface: None,
                force_fallback_adapter: false,
            })
            .await
            .is_some()
    })
}

/// Initialize GPU device for synthesis
///
/// Returns `None` if GPU is not available (fallback to CPU)
pub fn initialize_gpu() -> Option<GpuDevice> {
    GpuDevice::new().ok()
}