Giter Club home page Giter Club logo

deepjazz's People

Contributors

jisungk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepjazz's Issues

ValueError: need more than 0 values to unpack

Traceback (most recent call last):
File "generator.py", line 193, in
main(sys.argv)
File "generator.py", line 188, in main
generate(data_fn, out_fn, N_epochs)
File "generator.py", line 107, in generate
chords, abstract_grammars = get_musical_data(data_fn)
File "/media/aram/Mordigan/How-to-Generate-Music-Demo-master/preprocess.py", line 130, in get_musical_data
measures, chords = __parse_midi(data_fn)
File "/media/aram/Mordigan/How-to-Generate-Music-Demo-master/preprocess.py", line 25, in __parse_midi
melody1, melody2 = melody_stream.getElementsByClass(stream.Voice)
ValueError: need more than 0 values to unpack

and what do I do now?

Does anyone face the same issue?

def __sample(a, temperature=1.0):
a = np.log(a) / temperature
a = np.exp(a) / np.sum(np.exp(a))
return np.argmax(np.random.multinomial(1, a, 1))

It shows up multinomial has an error
np.argmax(np.random.multinomial(1, a, 1))
File "mtrand.pyx", line 4593, in mtrand.RandomState.multinomial (numpy\random\mtrand\mtrand.c:37541)
ValueError: sum(pvals[:-1]) > 1.0

[feature request] make the preprocessing more generic

I'm trying this great work to generate music from other midi files but there is some kinda "magic" parts in the preprocess.py file for me.

some code parts use magic numbers like

melody_stream = midi_data[5]
partIndices = [..]

other require strong knowledge of the example midi file & music21 library.

I manage to achieve the __parse_midi function to return values without exception but got an error later in __get_abstract_grammars (return empty list)

after change I changed 4 more thing and finally the training started but got a value error in __generate_grammar after a few iterations.

Basically I would like to make the generator to work with a preprocessed midi file with single channel .

cannot import name 'izip_longest'

I use python3.5, but when I run generator.py , it appears ''cannot import name 'izip_longest' ''. What's wrong with it? I have installed all the required packages.

TypeError: __init__() got an unexpected keyword argument 'mode'

Try to run the script but failed. Any pointer?

Using Theano backend.
Traceback (most recent call last):
  File "generator.py", line 193, in <module>
    main(sys.argv)
  File "generator.py", line 188, in main
    generate(data_fn, out_fn, N_epochs)
  File "generator.py", line 107, in generate
    chords, abstract_grammars = get_musical_data(data_fn)
  File "/Users/grant/project/deepjazz/preprocess.py", line 130, in get_musical_data
    measures, chords = __parse_midi(data_fn)
  File "/Users/grant/project/deepjazz/preprocess.py", line 37, in __parse_midi
    melody_voice.insert(0, key.KeySignature(sharps=1, mode='major'))
TypeError: __init__() got an unexpected keyword argument 'mode'

Could not convert string to float

Traceback (most recent call last):
File "generator.py", line 200, in
main(sys.argv)
File "generator.py", line 195, in main
generate(data_fn, out_fn, N_epochs)
File "generator.py", line 141, in generate
diversity=diversity)
File "generator.py", line 93, in __generate_grammar
length = float(next_val.split(',')[1])
ValueError: could not convert string to float:

VERSION#'s

What was the original version # of the keras and theanos used?

songbird.ai is not loading

At the the top of README it says "Note: deepjazz has been succeeded by songbird.ai and is no longer being actively developed." But songbird.ai is not loading.
Is there a new website? Or is https://deepjazz.io/ the latest website? If so please update README. Thx.

Train the Model with Other Midi Music

I tried to train the model with other music, but it failed. I think the problems come from this two lines:

melody_stream = midi_data[5]     # For Metheny piece, Melody is Part #5.
melody1, melody2 = melody_stream.getElementsByClass(stream.Voice)

Prevent overfitting

Hi,
I train your model on one midi file and I split data into test and valid. Next I plot test/valid and I see that model is overfit. Did you known how to prevent this?

# build a 2 stacked LSTM
  model = Sequential()
  model.add(LSTM(128, return_sequences=True, input_shape=(max_len, N_values)))
  model.add(Dropout(0.2))
  model.add(LSTM(128, return_sequences=False))
  model.add(Dropout(0.2))
  model.add(Dense(N_values))
  model.add(Activation('softmax'))

  model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])

  history = model.fit(X, y, batch_size=128, nb_epoch=N_epochs, validation_split=0.22)

  print(history.history.keys())

  # acc history
  plt.plot(history.history['acc'])
  plt.plot(history.history['val_acc'])
  plt.title('model accuracy')
  plt.ylabel('accuracy')
  plt.xlabel('epoch')
  plt.legend(['train', 'test'], loc='upper left')
  plt.savefig("acc_history.png")
  plt.close()

  plt.plot(history.history['loss'])
  plt.plot(history.history['val_loss'])
  plt.title('model loss')
  plt.ylabel('loss')
  plt.xlabel('epoch')
  plt.legend(['train', 'test'], loc='upper left')
  plt.savefig("history_loss.png")


  return history

acc_history
history_loss

How to locate Melody Piece index? (melody_stream = midi_data[5])

I've been trying to run this program but I've run into an error. On line 24 of preprocess.py (

melody_stream = midi_data[5] # For Metheny piece, Melody is Part #5.
) the melody is at index 5. Does anyone know how he found this? Was it guess and check? Is there a way to easily know where the melody is? Either way, if there is a method or it's guess and check does anyone know how to find it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.