You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is an AI-based music composer that generates unique pieces of music based on user preferences or specific genres. The script uses the `magenta` library, which provides pre-trained models for music generation.
4
+
5
+
## Table of Contents
6
+
-[Introduction](#introduction)
7
+
-[Features](#features)
8
+
-[Installation](#installation)
9
+
-[Usage](#usage)
10
+
-[User Input](#user-input)
11
+
-[Chord Progressions](#chord-progressions)
12
+
-[Drum Accompaniment](#drum-accompaniment)
13
+
-[Generated Music](#generated-music)
14
+
-[Contributing](#contributing)
15
+
16
+
## Introduction
17
+
18
+
Music is an integral part of human expression, and this project aims to create an AI-based music composer that can generate melodies in various genres. The generated music can be saved as MIDI files and can serve as a starting point for further music composition and creativity.
19
+
20
+
## Features
21
+
22
+
- Generates unique melodies based on pre-trained models.
23
+
- Allows user input for preferred genre and tempo.
24
+
- Adds chord progressions based on the chosen genre to create harmonic accompaniments.
25
+
- Includes a simple drum pattern for rhythmic accompaniment.
26
+
- Outputs generated music as MIDI files.
27
+
28
+
## Installation
29
+
30
+
1. Clone the repository to your local machine:
31
+
32
+
2. Install the required dependencies:
33
+
34
+
```bash
35
+
pip install magenta
36
+
```
37
+
38
+
## Usage
39
+
To generate music pieces using the AI-based music composer, run the following command:
40
+
41
+
```bash
42
+
python music_composer.py
43
+
```
44
+
The script will prompt you to enter your preferred genre and tempo (BPM) for music generation.
45
+
46
+
## User Input
47
+
The script allows you to input your preferred genre, which can be one of the following:
48
+
49
+
- Classical
50
+
- Jazz
51
+
- Rock
52
+
Additionally, you can specify the tempo (in BPM) for the generated music.
53
+
54
+
## Chord Progressions
55
+
The chosen genre determines the chord progression for the generated music. Currently, the supported chord progressions are:
56
+
57
+
- Classical: ["C", "Am", "F", "G"]
58
+
- Jazz: ["Cmaj7", "Dm7", "Em7", "A7"]
59
+
- Rock: ["C", "G", "Am", "F"]
60
+
You can modify or extend these chord progressions in the music_composer.py file.
61
+
62
+
## Drum Accompaniment
63
+
The music pieces include a basic drum pattern for rhythmic accompaniment. The drum pattern consists of a kick drum (36) and hi-hat (42). You can adjust the drum pattern in the music_composer.py file to create different rhythms.
64
+
65
+
## Generated Music
66
+
The generated music will be saved as MIDI files in the generated_music directory. Each music piece will have a unique file name, such as music_piece_1.mid, music_piece_2.mid, and so on.
67
+
68
+
## Contributing
69
+
If you have any ideas, improvements, or bug fixes, feel free to open an issue or submit a pull request. We appreciate your contributions!
0 commit comments