AI Prompt for Automatic Music Genre Classification

About Prompt

  • Prompt Type – Dynamic
  • Prompt Platform – ChatGPT, Grok, Deepseek, Gemini, Copilot, Midjourney, Meta AI and more
  • Niche – Audio Classification
  • Language – English
  • Category – Media Processing
  • Prompt Title – AI Prompt for Automatic Music Genre Classification

Prompt Details

## Dynamic AI Prompt for Automatic Music Genre Classification

This prompt is designed for dynamic music genre classification across various AI platforms specializing in audio classification for media processing. It aims to provide a flexible and comprehensive framework for analyzing audio files and classifying them into specific music genres. The prompt adapts to varying levels of user input, allowing for both simple and highly specific classification requests.

**Core Prompt:**

Classify the provided audio based on its musical genre.

**Dynamic Prompt Elements:**

The following elements can be added or modified to refine the classification process:

* **`audio_file` (Required):** Provide the path or URL to the audio file to be analyzed. Supported formats may vary depending on the platform, but common formats like MP3, WAV, and FLAC should be prioritized. Example: `audio_file: “path/to/audio.mp3″` or `audio_file: “url_to_audio.wav”`

* **`genre_list` (Optional):** Specify a list of target genres to restrict the classification scope. This is useful when you are only interested in specific genres or want to improve accuracy within a defined set. Example: `genre_list: [“Rock”, “Pop”, “Jazz”, “Classical”]`

* **`detail_level` (Optional):** Control the level of detail in the output. This can range from a simple genre label to a more comprehensive analysis including subgenres, mood, instrumentation, and other relevant musical characteristics. Use numerical values (1-5) or descriptive terms (e.g., “basic”, “detailed”, “comprehensive”). Example: `detail_level: 3` or `detail_level: “detailed”`

* **`feature_focus` (Optional):** Guide the classification process by emphasizing specific musical features. This can include rhythmic patterns, harmonic content, melodic structure, instrumentation, tempo, or vocal characteristics. Example: `feature_focus: “rhythmic complexity and harmonic progression”`

* **`time_constraints` (Optional):** Specify a specific time segment within the audio for analysis if you are only interested in classifying a portion of the track. This can be expressed in seconds or as a percentage of the total duration. Example: `time_constraints: “0:30-1:00″` or `time_constraints: “first 10%”`

* **`contextual_information` (Optional):** Provide additional contextual information that might be relevant to the classification process. This can include information about the artist, album, year of release, or any other relevant metadata. Example: `contextual_information: “artist: ‘John Doe’, album: ‘The Blue Album'”`

* **`output_format` (Optional):** Specify the desired output format. Options can include JSON, XML, CSV, or plain text. This ensures compatibility with downstream processing and analysis tools. Example: `output_format: “JSON”`

**Example Prompts:**

**Basic Classification:**

“`
Classify the provided audio based on its musical genre.
audio_file: “path/to/audio.mp3”
“`

**Detailed Classification with Specific Genres:**

“`
Classify the provided audio based on its musical genre.
audio_file: “url_to_audio.wav”
genre_list: [“Electronic”, “Hip Hop”, “R&B”]
detail_level: “detailed”
output_format: “JSON”
“`

**Focused Classification with Time Constraints:**

“`
Classify the provided audio based on its musical genre.
audio_file: “path/to/audio.flac”
feature_focus: “melodic structure and instrumentation”
time_constraints: “15-45 seconds”
“`

**Implementation Notes:**

* **Platform Adaptation:** This prompt is designed to be adaptable to various AI platforms. You may need to adjust the syntax and keywords based on the specific platform’s requirements.
* **Error Handling:** Implement robust error handling to address invalid input formats, unsupported file types, or other potential issues.
* **Feedback Loop:** Integrate a feedback mechanism to allow users to refine the classification results or provide corrections. This will improve the accuracy of the model over time.

This dynamic prompt provides a flexible and powerful approach to automatic music genre classification, allowing for customization and refinement to meet specific media processing needs. By leveraging these elements, developers can create robust and accurate genre classification systems for a wide range of applications.