Create a Modal.com FastAPI script to create a landscape (or ...
Prompt
Create a Modal.com FastAPI script to create a landscape (or optionally vertical/mobile) music visualizer using GPU acceleration (L40S). The user can input an audio file, title, artist name, and OPTIONALLY album cover art (if they upload album cover art the color palette should be extracted and used for the video colors), resolution (720p, 1080p, or 4K), FPS (24, 30, or 60), and the codec they want to use (AV1 or H.264). Other than the title, artist name, and album cover art, it should display (in a layout of your choice) an oscilloscope (displays the raw, real-time electrical waveform shape of the audio signal to visualize sound waves directly), a waveform meter (shows a scrolling timeline of the audio's amplitude envelope, capturing dynamic transients and decay over time), a peak and LUFS meter (displays vertical level indicators alongside a real-time numerical loudness readout (-14.1 LU), measuring perceived volume for gain staging), a stereometer/goniometer/phase scope (the colorful, semi-circular fan display measures the stereo image, showing left/right channel balance, spatial width, and phase correlation), a waveform trace (provides a secondary single-cycle or zoomed timeline view of the signal's period), a spectrum analyzer (graphs volume level across the audible frequency spectrum), and a spectrogram (displays frequency intensity over time as a vertical color-coded heat map). When creating the Modal image, use Ubuntu (because of the recent archival of Debian dependency repositories).
A system prompt was added to support web rendering