Skip to content

Musical composition using recurrent neural networks

License

Notifications You must be signed in to change notification settings

CastilloDel/Phrygian

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phrygian - An Artificial Intelligence system for Music Composition

Table of Contents

Authors

  • Daniel del Castillo de la Rosa
  • José Daniel Escánez Expósito
  • Nerea Rodríguez Hernández

Guide

Using Phrygian you can create music from some example melodies. Three steps are needed:

  1. 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.
  2. Train. The training process uses the file produced by the first step and produces some weights for a neural network.
  3. 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.

Requirements

A pipfile is provided so it is easy to install the dependencies using pipenv.

Download

$ git clone https://github.com/alu0101215693/Phrygian.git

Execution

Phrygian CLI

Main program

$ src/phrygian.py [-h|--help] process|train|generate

Process midi files

$ src/phrygian.py process [-h|--help] <midi files folder> <output file>

Train neural network

$ src/phrygian.py train <processed midis file> <neural network weights folder> <number of epochs>

Generate music

$ 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

Phrygian GUI

Main program

$ src/phrygian_gui.py

Main program Image

Process midi files

Process midi files Image

Train neural network

Train neural network Image

Generate music

Generate music Image

Appendix

  • 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

About

Musical composition using recurrent neural networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%