Featured
- Get link
- X
- Other Apps
How to create music
This blog is for someone interested in composing music automatically using python.
Python has a library 'Mido' which can handle Midi messages. Using Mido library, with input of basic structure of a song, such as key, scale and chord progression, a program make a music score.
Basic concept is as below,
1. Structure of music
Input basic structure of a music, such as key, scale and chord progression as python lists. Play whole or a part of chord progressions by python to review and refine.
e.g. 1st phrase. key is C major. chord progression is ["I", "VI", "V", "V7"]
2. Create melody
For each small part (e.g. 16 bar), melody is made by some rules. Some rules I tried are
- Pitch moves up or down mostly by one or two within a scale randomly.
- Use some Fourier series to develop pitch movements. Then fit to closest scale or chord pitches.
- Rhythm (length of notes) randomly selected.
3. Bass and Drum
Add some drum and bass patterns.
4. Set instruments within DAW
Output MIDI file of a score to DAW. Set some VST instruments and output audio file by DAW.
I'll show the details later.
- Get link
- X
- Other Apps
Popular Posts
Python programming 1 Basics of Mido for MIDI handling
- Get link
- X
- Other Apps
Python Programming 4 Piano Roll Animation of MIDI file by Matplotlib
- Get link
- X
- Other Apps
Comments
Post a Comment