This Python project is designed to convert audio files into musical notes and generate MIDI files. It consists of two main components: audioanalysis.py
and midotrans.py
.
-
Audio to Notes Conversion: The
audioanalysis.py
script extracts musical notes from an audio file. It utilizes advanced audio analysis techniques to identify the pitch and duration of each note in the song. -
Tempo Detection: This script also calculates the tempo (beats per minute) of the song, allowing you to precisely replicate the timing in the generated MIDI file.
-
MIDI File Generation: The
miditrans.py
script takes the musical notes obtained from the previous step and creates a MIDI file. MIDI is a versatile format that can be used in various music production and editing software.
You can install these packages using pip
:
pip install numpy pydub mido
pip install numpy librosa
pip install midi
- Clone the repository to your local machine:
git clone https://github.com/github/audio-to-midi-converter.git
- Navigate to the project directory:
cd song_conversion
- Run the
audioanalysis.py
script with the path to your audio file as an argument:
python audioanalysis.py path/to/your/audio/file.mp3
- After extracting notes and tempo, run the
miditrans.py
script to generate a MIDI file:
python miditrans.py
The resulting MIDI file will be saved in the project directory.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository on GitHub.
- Create a new branch with a descriptive name.
- Make your changes and commit them with clear messages.
- Push your branch to your fork.
- Create a pull request to the main repository.
We welcome contributions and improvements!
This project is licensed under the MIT License.
- Special thanks to the developers of the
numpy
,pydub
, andmido
libraries, which are essential to the functionality of this project.
For any questions or feedback, please contact Code Singer.
Enjoy converting audio to MIDI with this tool!
5f3a66d (Updated readme)