Give any number to this code and it will convert it into music.
For example the first 'n' digits of pi can be converted to music.
pysynth
To install download from this site
The first number defines the note.
The next number defines the duration of that note.
- Thanks YourMJK for the image(screenshot).
A scale is a dict which contains keys for each of the digits.c3
,d#
,etc. are musical notes. The second part in the dict is the duration of that note.Lower the number longer is the duration.
Change the number
in the script(your wish :p).
Choose the scale
which may be one of the given ones or you own scale.
If you want you can add one line in the loop where the scale is choosen randomly or in particular order in each iteration(Check MusicWithNumbers.py
for this randomness feature as it has not been updated in the notebook)
Give a name to the file and then run the function create_wav
- Will be glad to know if some scale creates a nice music!
- Reference:video