Assuming you use virtualenvwrapper, which is very good.
mkvirtualenv synthesizer
pip install -r requirements.txt
Also assuming you use Ubuntu or Debian. Please look for equivalent packages for your distribution.
apt install libportaudio2
apt install python3-tk
Please see the included Synthesizer.ipynb, which will walk you through the process.
First activate the virtualenv.
workon synthesizer
Then run the cli_main.py
file. Your OS may want you to precise python3
instead of simply python
.
python cli_main.py
You can then activate your MIDI keyboard and play with the default settings.
To change your settings, simply copy the current_script.py
file and tinker with it! Look at all the available modules in the Modules and MIDI folders.
The class MidiToFreq
specifies how MIDI messages should be converted to Frequency-Amplitudes tuples. This would be a nice place to put e.g. an Arpeggiator, which we did. All the filters of this type are in the MIDI/filters
folder.
The class FreqToAudio
directly takes the output of the previous one, and converts it to actual Left/Right-Channel sound. All available modules/filters are in the Modules/filters
folder.
It is possible to tinker with the parameters.py
file, notably with the TEMPERAMENT
setting, which allows you to experience the automatic variable pitch algorithm. You can listen to your music in Just Intonation or even Pythagorean Tuning. Well, as close as possible to these tunings anyway. The algorithm will try to preserve the justness of important intervals, and so it may sometimes result in some dissonance. It's usually pretty good however.
When you're done, load the settings with :
python cli_main.py -s my_awesome_script.py
You can also let the program play a MIDI file by itself ! Simply use -m
:
python cli_main.py -s my_awesome_script.py -m my_awesome_midi.mid
That's all ! Thank you very much.