Skip to main content

High-quality integration for https://tomusic.ai/

Project description

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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tomusic_ai-1767082.937.253.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tomusic_ai-1767082.937.253-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file tomusic_ai-1767082.937.253.tar.gz.

File metadata

  • Download URL: tomusic_ai-1767082.937.253.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tomusic_ai-1767082.937.253.tar.gz
Algorithm Hash digest
SHA256 949a335abad994b2d02473cc45f544955e47c8f2898a917f96c99842465e6785
MD5 2ea4e7dea95a00c69f18c5ea8739fe85
BLAKE2b-256 e22ec5066c28fa1a7bb08c27680b63467be9e4946009ca7482e5b300d5677a79

See more details on using hashes here.

File details

Details for the file tomusic_ai-1767082.937.253-py3-none-any.whl.

File metadata

File hashes

Hashes for tomusic_ai-1767082.937.253-py3-none-any.whl
Algorithm Hash digest
SHA256 dcf16b60fc799ba01059ef4ff92daa7617a3996b6bd542bf78aab7047b48092c
MD5 0186ae0ce96df21cad922d71a3a1c0ea
BLAKE2b-256 2e5d4e0be4a7267e4140745c749d634532cf0806a061b0dd5012788b9d084dba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page