# 光遇弹琴脚本 **Repository Path**: felikschen/sky_music ## Basic Information - **Project Name**: 光遇弹琴脚本 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-05 - **Last Updated**: 2026-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Sky Music Tool Convert a pure-melody audio file into a Sky 15-key chart, save the chart locally, and play a saved chart by sending keyboard input to the focused PC game window. This is designed for monophonic or clear lead-melody audio. Dense chords and full mixes need manual cleanup because the converter maps the dominant detected pitch to the nearest Sky note. ## Install ```powershell python -m venv .venv .\.venv\Scripts\Activate.ps1 pip install -r requirements.txt ``` If MP3 loading fails, install FFmpeg and make sure `ffmpeg.exe` is on `PATH`. ## Run the GUI ```powershell python sky_music_tool.py ``` ## Windows executable `SkyMusicTool.exe` in the `dist` folder runs without Python. On first launch it creates an adjacent `charts` folder for converted charts. Audio conversion runs in the background and displays its current progress. Full songs can take a little while to load, but the window remains usable. To rebuild the executable after a source change: ```powershell .\.venv\Scripts\python.exe -m PyInstaller --noconfirm --clean --onefile --windowed --name SkyMusicTool sky_music_tool.py ``` Default Sky key map: ```text Y U I O P H J K L ; N M , . / ``` ## Command Line Convert: ```powershell python sky_music_tool.py convert song.mp3 --bpm auto --quantize 1/16 ``` Play: ```powershell python sky_music_tool.py play .\charts\song.sky.json --countdown 5 ``` After starting playback, focus the Sky window before the countdown ends. Press `Esc` to stop playback. ## Output Format Charts are saved as `charts/*.sky.json`. Each event contains: - `key`: Sky key number, 1 through 15 - `note`: mapped note name - `start`: seconds from playback start - `duration`: detected note duration in seconds - `confidence`: pitch detector confidence The JSON also stores the key map so you can edit it if your PC layout differs.