{"id":28444574,"url":"https://github.com/brokenbyteofcode/rhythmengine","last_synced_at":"2025-07-18T10:32:57.054Z","repository":{"id":274170937,"uuid":"922127660","full_name":"BrokenByteOfCode/RhythmEngine","owner":"BrokenByteOfCode","description":"I'll try make a Rhythm engine for games obviously.","archived":false,"fork":false,"pushed_at":"2025-01-25T11:55:39.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T18:51:08.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrokenByteOfCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-25T11:47:53.000Z","updated_at":"2025-04-13T21:46:21.000Z","dependencies_parsed_at":"2025-01-25T12:36:57.610Z","dependency_job_id":null,"html_url":"https://github.com/BrokenByteOfCode/RhythmEngine","commit_stats":null,"previous_names":["andriy8800555355/rhythmengine","behindthatteam/rhythmengine","brokenbyteofcode/rhythmengine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BrokenByteOfCode/RhythmEngine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokenByteOfCode%2FRhythmEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokenByteOfCode%2FRhythmEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokenByteOfCode%2FRhythmEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokenByteOfCode%2FRhythmEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrokenByteOfCode","download_url":"https://codeload.github.com/BrokenByteOfCode/RhythmEngine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrokenByteOfCode%2FRhythmEngine/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265742613,"owners_count":23820869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T09:09:46.251Z","updated_at":"2025-07-18T10:32:57.024Z","avatar_url":"https://github.com/BrokenByteOfCode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RhythmEngine 🎵\n\nA Python library for audio rhythm analysis and click track generation. Detect beats in audio files and generate synchronized click tracks with dynamic volume levels.\n\n## Features\n\n- **Beat Detection**: Multi-processed analysis for accurate beat tracking\n- **Click Track Generation**: Create dynamic click sounds that sync with detected beats\n- **Audio Export**: Save processed audio with click tracks in standard formats\n- **Customizable Parameters**: Adjust click sounds and analysis parameters\n\n## Installation\n\n### Requirements\n- Python 3.8+\n- FFmpeg (for audio file support)\n\n### Dependencies\n```bash\npip install librosa numpy pydub\n```\n\n### Recommended Installation\n```bash\n# Clone repository\ngit clone https://github.com/andriy8800555355/RhythmEngine.git\ncd RhythmEngine\n\n# Install requirements\npip install -r requirements.txt\n```\n\n## Usage\n\n### Basic Example\n```python\nfrom RhythmEngine import RhythmEngine\n\n# Initialize with audio file\nengine = RhythmEngine(\"input_song.mp3\")\n\n# Generate click track\nmixed_audio = engine.generate_click_track()\n\n# Save output\nengine.save_mixed_audio(\"output_with_clicks.wav\")\n\n# Get detected beats\nbeat_times = engine.get_beat_times()\nprint(f\"Detected beats at: {beat_times}\")\n```\n\n### Advanced Usage\n```python\n# Custom click sound parameters\nengine.generate_click_track(\n    click_duration=0.1,  # Click duration in seconds\n    freq1=1000,          # Primary frequency (Hz)\n    freq2=1500           # Secondary frequency (Hz)\n)\n\n# Access raw audio data\noriginal_audio = engine.y          # Raw audio waveform\nsample_rate = engine.sr            # Sampling rate\nmixed_audio = engine.mixed_audio   # Processed audio with clicks\n```\n\n## API Documentation\n\n### `RhythmEngine(audio_path: str)`\nMain class for rhythm processing\n\n**Parameters**:\n- `audio_path`: Path to audio file (supports most common formats)\n\n### Methods\n#### `generate_click_track(click_duration=0.07, freq1=880, freq2=1320)`\nGenerate click track synchronized with detected beats\n\n**Parameters**:\n- `click_duration`: Duration of click sound in seconds (default: 0.07)\n- `freq1`: Primary frequency component in Hz (default: 880)\n- `freq2`: Secondary frequency component in Hz (default: 1320)\n\n**Returns**:\n- `np.ndarray`: Mixed audio waveform with click track\n\n#### `save_mixed_audio(output_path: str)`\nSave processed audio to file\n\n**Parameters**:\n- `output_path`: Output file path (format determined by extension)\n\n#### `get_beat_times()`\nGet detected beat times\n\n**Returns**:\n- `List[float]`: List of beat times in seconds\n\n## Implementation Details\n\n- **Multi-processing**: Uses parallel processing for faster beat detection\n- **Dynamic Volume**: Click volume adapts to onset strength of original audio\n- **Normalization**: Automatic peak normalization prevents clipping\n- **Tempo Estimation**: Combines global tempo estimation with local beat tracking\n\n## Supported Formats\nInput: MP3, WAV, FLAC, OGG, AAC (any format supported by FFmpeg)  \nOutput: WAV (other formats supported via Pydub)\n\n## Acknowledgments\n- Uses [librosa](https://librosa.org/) for audio analysis\n- Audio processing with [pydub](https://github.com/jiaaro/pydub)\n- Built with NumPy for efficient array operations\n\n---\n\n**Contributions welcome!** Please open an issue or PR for suggestions/bug reports.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrokenbyteofcode%2Frhythmengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrokenbyteofcode%2Frhythmengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrokenbyteofcode%2Frhythmengine/lists"}