Ghadjeres / DeepBach

code accompanying "DeepBach: a Steerable Model for Bach Chorales Generation" paper
MIT License
500 stars 131 forks source link

more parts for instruments? #16

Open DefinitlyEvil opened 7 years ago

DefinitlyEvil commented 7 years ago

hi I am a composer and a programmar(more like a composer, cuz I suck at math). TensorFlow backend somehow didn't work so I am moving to Theano and still debugging. Anyways, is it possible to make this model more general like it contains all instrument lines at the same time(eg. Violin I, Violin II, Oboe I, Oboe II, Violas, Cellos)? I thought if one composition didn't have one of the instruments we just leave it blank and embeds with blank?? will this possibly be working, cuz if so, it will be able to generate random orchestra compositions in no time lol.

DefinitlyEvil commented 7 years ago

GPU support isn't working... :(

Using Theano backend.
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
Namespace(batch_size_train=128, dataset='', ext='', length=50, midi_file=None, name='deepbach', num_dense=200, num_iterations=20000, num_units_lstm=[200, 200], num_val_samples=1280, output_file='', overwrite=False, parallel=1, reharmonization=None, samples_per_epoch=89600, timesteps=16, train=0)
X:\Python\lib\site-packages\keras-1.2.0-py3.5.egg\keras\engine\topology.py:368: UserWarning: The `regularizers` property of layers/models is deprecated. Regularization losses are now managed via the `losses` layer/model property.
  warnings.warn('The `regularizers` property of '
DefinitlyEvil commented 7 years ago

well I will just give up :( I will try to use Anaconda then

Ghadjeres commented 7 years ago

The issue is caused by your Theano installation. I always used Tensorflow during my experiments so I can't really help you for this. If you use Anaconda, make sure you have the appropriate Keras version (there has been recent changes) so the code is no longer compatible with the newest versions.

For more instruments, it is in principle possible to generalize this model. Nonetheless, each part must be monophonic. There is a NUM_VOICES constant to set. Take a look at the is_playing metadata (in metadata.py) which you should include when creating your dataset (look how the --dataset parameter is used in deepbach.py).

I tested this on Monteverdi madrigals (5 voices) and it works quite well. But if your dataset contains doubled parts, there might be some issues...

Good luck. I'm eager to see the results

DefinitlyEvil commented 7 years ago

@Ghadjeres hi, i used Theano and it quite works well on GPU. as for more instruments, I meant polyphony style like Bach's cantatas.