0

Is there a possibility to generate more complex music using LSTM, instead of only piano notes (all the tutorials are about piano music, and I can't find more complex stuff)?

I'm thinking about training the model with different instrumentals, but I don't know how to convert a normal music file (.mp3 or .wav) to network input or how to extract instruments from music file. My model is adaptation from this post

Do you have any idea?

model = Sequential()
model.add(LSTM(128,input_shape=(network_input.shape[1], 
network_input.shape[2]), return_sequences=True))
model.add(Dropout(0.3))
model.add(LSTM(64, return_sequences=True))
model.add(Dropout(0.3))
model.add(LSTM(32))
model.add(Dense(32))
model.add(Dropout(0.3))
model.add(Dense(n_vocab))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
demo
  • 421
  • 5
  • 22
  • 2
    Thats a huge project :)) -- You could study wavenets (they work with sound waves) -- Now, extracting instruments from wave files is quite complex. (Don't know if there is any public model around) – Daniel Möller Jan 22 '19 at 13:21
  • Thank you for refering the wavenets. But the problem is that they don't explain how to process the music files in order to train the model. Maybe it's the most difficult, so it's not public info. But thanks you! – demo Jan 22 '19 at 13:30
  • Hmmm... I think I have some old attempts at home... I was using pydub to read the files. (Needs codecs installed if you want to read directly from mp3) -- There are other options here: https://stackoverflow.com/questions/9458480/read-mp3-in-python-3 – Daniel Möller Jan 22 '19 at 13:55
  • I'll check it. Thanks you very much! – demo Jan 22 '19 at 15:03

0 Answers0