tomusic.ai - Python Library
This package provides an automated interface to interact with and showcase the capabilities of tomusic.ai. It simplifies integration with the tomusic.ai platform through a Python-based API.
Installation
To install the tomusic.ai library, use pip:
bash
pip install tomusic.ai
Basic Usage
Here are a few examples demonstrating how to use the tomusic.ai library:
1. Generating a Simple Melody: python from tomusic import ai
Initialize the API client (replace with your actual API key)
client = ai.Client(api_key="YOUR_API_KEY")
Generate a melody with default parameters
melody = client.generate_melody()
Print the generated melody (format depends on the API)
print(melody)
2. Composing a Song with Specified Parameters: python from tomusic import ai
Initialize the API client (replace with your actual API key)
client = ai.Client(api_key="YOUR_API_KEY")
Define parameters for the song generation
params = { "genre": "Jazz", "tempo": 120, "key": "C Major", "duration": 60, # seconds }
Generate a song based on the specified parameters
song = client.generate_song(params)
Save the generated song to a file (format depends on the API - e.g., MIDI, MP3)
client.save_song(song, "jazz_song.mid")
3. Analyzing an Existing Piece of Music: python from tomusic import ai
Initialize the API client (replace with your actual API key)
client = ai.Client(api_key="YOUR_API_KEY")
Analyze a music file
analysis_result = client.analyze_music("path/to/your/music.mp3")
Print the analysis results (e.g., key, tempo, genre)
print(analysis_result)
4. Generating Variations of an Existing Melody: python from tomusic import ai
Initialize the API client (replace with your actual API key)
client = ai.Client(api_key="YOUR_API_KEY")
Load an existing melody (replace with your melody data)
original_melody = "C-D-E-F-G-A-B-C"
Generate variations of the melody
variations = client.generate_melody_variations(original_melody, num_variations=3)
Print the generated variations
for i, variation in enumerate(variations): print(f"Variation {i+1}: {variation}")
5. Generating Accompaniment for a Melody: python from tomusic import ai
Initialize the API client (replace with your actual API key)
client = ai.Client(api_key="YOUR_API_KEY")
Load an existing melody (replace with your melody data)
melody = "C-D-E-F-G-A-B-C"
Generate accompaniment for the melody
accompaniment = client.generate_accompaniment(melody, style="Piano")
Save the generated accompaniment (format depends on the API)
client.save_accompaniment(accompaniment, "piano_accompaniment.mid")
Features
- Melody Generation: Generate original melodies based on various parameters.
- Song Composition: Compose full songs with specified genres, tempos, and keys.
- Music Analysis: Analyze existing music files to extract key information.
- Melody Variations: Create variations of existing melodies.
- Accompaniment Generation: Generate accompaniment for melodies.
- Easy Integration: Seamlessly integrate with the tomusic.ai platform.
- Parameter Customization: Fine-tune music generation with customizable parameters.
- File Saving: Save generated music in various formats (e.g., MIDI, MP3).
License
MIT License
This project is a gateway to the tomusic.ai ecosystem. For advanced features and full capabilities, please visit: https://tomusic.ai/
Metadata
Release files for tomusic.ai 1767082.937.253
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tomusic_ai-1767082.937.253.tar.gz | 2.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tomusic_ai-1767082.937.253-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 kB
Release files / tomusic_ai-1767082.937.253.tar.gz
| Download URL | tomusic_ai-1767082.937.253.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
949a335abad994b2d02473cc45f544955e47c8f2898a917f96c99842465e6785
|
|
BLAKE2b-256 checksum How to use checksums |
e22ec5066c28fa1a7bb08c27680b63467be9e4946009ca7482e5b300d5677a79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / tomusic_ai-1767082.937.253-py3-none-any.whl
| Download URL | tomusic_ai-1767082.937.253-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcf16b60fc799ba01059ef4ff92daa7617a3996b6bd542bf78aab7047b48092c
|
|
BLAKE2b-256 checksum How to use checksums |
2e5d4e0be4a7267e4140745c749d634532cf0806a061b0dd5012788b9d084dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|