- Daniel del Castillo de la Rosa
- José Daniel Escánez Expósito
- Nerea Rodríguez Hernández
Using Phrygian you can create music from some example melodies. Three steps are needed:
- Processing. MIDI files need to be processed. The result is stored in a file, so you don't need to repeat it with each training.
- Train. The training process uses the file produced by the first step and produces some weights for a neural network.
- Generation. You can now generate some music with the processed file from step 1 and a weigths file from step 2. Note: In step 3 you must use weights generated with the same processed MIDI file you are using.
Phrygian has been tested and has had good results using near 50 MIDI files. The quality of the results might vary depending of the number of MIDIS, their number of tracks and total notes.
- Python 3
- Packages:
- tensorflow
- music21
- keras
- numpy
- pyqt5
(Optional: Needed for the GUI)
- Packages:
- MuseScore 3
(Optional: Needed to visualize the generated music)
A pipfile
is provided so it is easy to install the dependencies using pipenv.
$ git clone https://github.com/alu0101215693/Phrygian.git
$ src/phrygian.py [-h|--help] process|train|generate
$ src/phrygian.py process [-h|--help] <midi files folder> <output file>
$ src/phrygian.py train <processed midis file> <neural network weights folder> <number of epochs>
$ src/phrygian.py generate <processed midis file> <neural networks weights> <output midi file>
Optional arguments should be added at the end
Initial pitch (Default A3): [(-p|--pitch) <pitch>]
Instrument (Default Piano): [(-i|--instrument) <instrument>]
Scale (Default Chromatic): [(-s|--scale) <scale>]
Number of notes (Default 100): [(-n|--notes) <number of notes>]
- See Appendix for available instruments and scales
$ src/phrygian_gui.py
- Available instruments:
Accordion, AcousticBass, AcousticGuitar, Agogo, Alto, AltoSaxophone, Bagpipes,
Banjo, Baritone, BaritoneSaxophone, Bass, BassClarinet, BassDrum, BassTrombone,
Bassoon, BongoDrums, BrassInstrument, Castanets, Celesta, Choir, ChurchBells,
Clarinet, Clavichord, Conductor, CongaDrum, Contrabass, Contrabassoon, Cowbell,
CrashCymbals, Cymbals, Dulcimer, ElectricBass, ElectricGuitar, ElectricOrgan,
ElectricPiano, EnglishHorn, FingerCymbals, Flute, FretlessBass, Glockenspiel,
Gong, Guitar, Handbells, Harmonica, Harp, Harpsichord, HiHatCymbal, Horn,
Kalimba, KeyboardInstrument, Koto, Lute, Mandolin, Maracas, Marimba,
MezzoSoprano, Oboe, Ocarina, Organ, PanFlute, Percussion, Piano, Piccolo,
PipeOrgan, PitchedPercussion, Ratchet, Recorder, ReedOrgan, RideCymbals,
Sampler, SandpaperBlocks, Saxophone, Shakuhachi, Shamisen, Shehnai, Siren,
Sitar, SizzleCymbal, SleighBells, SnareDrum, Soprano, SopranoSaxophone,
SplashCymbals, SteelDrum, StringInstrument, SuspendedCymbal, Taiko, TamTam,
Tambourine, TempleBlock, Tenor, TenorDrum, TenorSaxophone, Timbales, Timpani,
TomTom, Triangle, Trombone, Trumpet, Tuba, TubularBells, Ukulele,
UnpitchedPercussion, Vibraphone, Vibraslap, Viola, Violin, Violoncello,
Vocalist, Whip, Whistle, WindMachine, Woodblock, WoodwindInstrument, Xylophone
- Available scales:
Chromatic, Octatonic, Hexatonic-Whole-Tone, Hexatonic-Blues, Pentatonic,
Pentatonic-Blues, Neapolitan-Major, Neapolitan-Minor, Flamenco, Minor, Ionian,
Dorian, Phrygian, Lydian, Mixolydian, Aeolian, Locrian, Enigma