Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

music generation example #28

Open
Jonathhhan opened this issue Aug 10, 2022 · 6 comments
Open

music generation example #28

Jonathhhan opened this issue Aug 10, 2022 · 6 comments

Comments

@Jonathhhan
Copy link
Contributor

Jonathhhan commented Aug 10, 2022

i tried to use this model for music generation: https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/audio/music_generation.ipynb#scrollTo=1mil8ZyJNe1w

its very rough yet, and not sure if everything works as expected.
maybe you can find something wrong...
especially my replacement for tf.random.categorical(pitch_logits, num_samples=1) could be wrong.
the model is very small, so it is included in the example...
https://github.com/Jonathhhan/ofxTensorFlow2/tree/music_generation_example/example_music_generation

@Jonathhhan
Copy link
Contributor Author

I guess it works now...

@danomatika
Copy link
Member

Without trying it, I would say we could connect it to a synth with ofxMidi or generate audio directly with ofxPd.

@Jonathhhan
Copy link
Contributor Author

Jonathhhan commented Aug 10, 2022

@danomatika yeah, I already connected it with midi out from ofxMidi. ofxPd would be nice, too. Often it sounds quite random, but I can also hear some musical structure. Have to play a bit with the training settings...

@danomatika
Copy link
Member

Looks like you need to track the duration for each pitch and send the noteoff individually. That might give you better rhythm and structure on the output.

@Jonathhhan
Copy link
Contributor Author

Jonathhhan commented Aug 11, 2022

It is interesting, that the output seems to get more structure after running for some time.
But maybe that is, because I choose a more or less random sequence for the beginning...

@Jonathhhan
Copy link
Contributor Author

Jonathhhan commented Aug 11, 2022

I added velocity to the model (and added the edited notebook to the example): https://github.com/Jonathhhan/ofxTensorFlow2/tree/music_generation_example/example_music_generation_2
And actually wonder, how to implement the music transformer: https://colab.research.google.com/notebooks/magenta/piano_transformer/piano_transformer.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants