Skip to content

Commit

Permalink
Reformat readme with one line per paragraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
dubreuia committed Feb 21, 2020
1 parent be376c1 commit 65a1ac7
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 95 deletions.
14 changes: 3 additions & 11 deletions Chapter01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ This chapter will show you the basics of generative music and what already exist

## Code

This chapter doesn't have any code, since it serves as an introduction to the
book and as an installation procedure. You can check out the
[Jupyter Notebook](notebook.ipynb) to test your installation.
This chapter doesn't have any code, since it serves as an introduction to the book and as an installation procedure. You can check out the [Jupyter Notebook](notebook.ipynb) to test your installation.

## Installing Magenta

Installing Magenta using Conda is easier. First
[install Miniconda](https://conda.io/en/latest/miniconda.html), then:
Installing Magenta using Conda is easier. First [install Miniconda](https://conda.io/en/latest/miniconda.html), then:

```bash
# Create a new environment for Magenta with Python 3.6.x as interpreter
Expand All @@ -31,16 +28,11 @@ pip install magenta visual_midi
python -c "import magenta; print(magenta.__version__)"
```

## Installing Magenta GPU

TODO compatibility version grid

## Utility Scripts

### [Visual MIDI](https://github.com/dubreuia/visual_midi)

Transforms a MIDI file to a plot, most of the diagram in this book has been done
with this tool.
Transforms a MIDI file to a plot, most of the diagram in this book has been done with this tool.

### `wav2plot.py`

Expand Down
12 changes: 3 additions & 9 deletions Chapter02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ This chapter will show you what many consider the foundation of music—percussi

### [Example 1](chapter_02_example_01.py) or [notebook](notebook.ipynb)

This example shows a basic Drums RNN generation with a hard coded primer. For
the Python script, while in the Magenta environment (`conda activate magenta`):
This example shows a basic Drums RNN generation with a hard coded primer. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs a Drums RNN generation and shows the resulting plot in the browser
Expand All @@ -22,9 +21,7 @@ jupyter notebook notebook.ipynb

### [Example 2](chapter_09_example_02.py)

This example shows a basic Drums RNN generation with synthesizer playback. For
the Python script, you'll need to first install and configure a software
synthesizer, then while in the Magenta environment (`conda activate magenta`):
This example shows a basic Drums RNN generation with synthesizer playback. For the Python script, you'll need to first install and configure a software synthesizer, then while in the Magenta environment (`conda activate magenta`):

```bash
# Runs a Drums RNN generation, shosw the resulting plot in the browser, and
Expand All @@ -34,10 +31,7 @@ python chapter_02_example_02.py

### [Example 3](chapter_02_example_03.py)

This example shows a basic Drums RNN generation with a looping synthesizer
playback. For the Python script, you'll need to first install and configure a
software synthesizer, then while in the Magenta environment
(`conda activate magenta`):
This example shows a basic Drums RNN generation with a looping synthesizer playback. For the Python script, you'll need to first install and configure a software synthesizer, then while in the Magenta environment (`conda activate magenta`):

```bash
# Runs a Drums RNN generation, shosw the resulting plot in the browser, and
Expand Down
12 changes: 3 additions & 9 deletions Chapter03/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ This chapter will show the importance of Long Short-Term Memory (LSTM) networks

### [Example 1](chapter_03_example_01.py) or [notebook](notebook.ipynb)

This example shows a melody (monophonic) generation using the Melody RNN model
and 3 configurations: basic, lookback and attention. For
the Python script, while in the Magenta environment (`conda activate magenta`):
This example shows a melody (monophonic) generation using the Melody RNN model and 3 configurations: basic, lookback and attention. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs 3 melody rnn generation using the basic, lookback and attention config
Expand All @@ -23,9 +21,7 @@ jupyter notebook notebook.ipynb

### [Example 2](chapter_03_example_02.py)

This example shows polyphonic generations with the Polyphony RNN model. For
the Python script, while in the Magenta environment
(`conda activate magenta`):
This example shows polyphonic generations with the Polyphony RNN model. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs 4 polyphonic generations using polyphony rnn and
Expand All @@ -35,9 +31,7 @@ python chapter_03_example_02.py

### [Example 3](chapter_03_example_03.py)

This example shows polyphonic generations with the Performance RNN model. For
the Python script, while in the Magenta environment
(`conda activate magenta`):
This example shows polyphonic generations with the Performance RNN model. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs 3 polyphonic generations using performance rnn and
Expand Down
13 changes: 3 additions & 10 deletions Chapter04/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ This chapter will show the importance of continuous latent space of Variational

### [Example 1](chapter_04_example_01.py) or [notebook](notebook.ipynb)

This example shows how to sample, interpolate and humanize a drums sequence
using MusicVAE and various configurations. For the Python script,
while in the Magenta environment (`conda activate magenta`):
This example shows how to sample, interpolate and humanize a drums sequence using MusicVAE and various configurations. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs the example, the output files (plot, midi) will be in the "output" folder
Expand All @@ -23,9 +21,7 @@ jupyter notebook notebook.ipynb

### [Example 2](chapter_04_example_02.py)

This example shows how to sample and interpolate a melody sequence
using MusicVAE and various configurations. For the Python script,
while in the Magenta environment (`conda activate magenta`):
This example shows how to sample and interpolate a melody sequence using MusicVAE and various configurations. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs the example, the output files (plot, midi) will be in the "output" folder
Expand All @@ -34,10 +30,7 @@ python chapter_04_example_02.py

### [Example 3](chapter_04_example_03.py)

This example shows how to sample a trio (drums, melody, bass) sequence
using MusicVAE and various configurations. For the Python script,
while in the Magenta environment
(`conda activate magenta`):
This example shows how to sample a trio (drums, melody, bass) sequence using MusicVAE and various configurations. For the Python script, while in the Magenta environment (`conda activate magenta`):

```bash
# Runs the example, the output files (plot, midi) will be in the "output" folder
Expand Down
5 changes: 1 addition & 4 deletions Chapter05/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ This chapter will show audio generation. We'll first provide an overview of Wave

## Utils

There are some audio utilities in the [audio_utils.py](./audio_utils.py) file,
useful for saving and loading the encodings (`save_encoding` and
`load_encodings`), time stretching (`timestretch`) them and saving
spectrogram plots (`save_spectrogram_plot` and `save_rainbowgram_plot`).
There are some audio utilities in the [audio_utils.py](./audio_utils.py) file, useful for saving and loading the encodings (`save_encoding` and `load_encodings`), time stretching (`timestretch`) them and saving spectrogram plots (`save_spectrogram_plot` and `save_rainbowgram_plot`).

## Sounds and MIDI

Expand Down
24 changes: 6 additions & 18 deletions Chapter06/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ This chapter will show how training our own models is crucial since it allows us

## Utils

There are some utilities for processing the Lakh MIDI Dataset (LMD)
in the [lakh_utils.py](./lakh_utils.py) file and utilities for multiprocessing
in the [multiprocessing_utils.py](./multiprocessing_utils.py) file with example
usage.
There are some utilities for processing the Lakh MIDI Dataset (LMD) in the [lakh_utils.py](./lakh_utils.py) file and utilities for multiprocessing in the [multiprocessing_utils.py](./multiprocessing_utils.py) file with example usage.

There is a custom pipeline example for the Melody RNN model in the
[melody_rnn_pipeline_example.py](./melody_rnn_pipeline_example.py) file. Change
directory to the folder containing the Tensorflow records of NoteSequence and
call the pipeline using:
There is a custom pipeline example for the Melody RNN model in the [melody_rnn_pipeline_example.py](./melody_rnn_pipeline_example.py) file. Change directory to the folder containing the Tensorflow records of NoteSequence and call the pipeline using:

```bash
python /path/to/the/pipeline/melody_rnn_pipeline_example.py --config="attention_rnn" --input="notesequences.tfrecord" --output_dir="sequence_examples" --eval_ratio=0.10
Expand All @@ -38,17 +32,15 @@ python chapter_06_example_01.py --sample_size=1000 --pool_size=4 --path_dataset_

### [Example 2](chapter_06_example_02.py)

Lists most common genres from the Last.fm API using the LAKHs dataset
matched with the MSD dataset.
Lists most common genres from the Last.fm API using the LAKHs dataset matched with the MSD dataset.

```bash
python chapter_06_example_02.py --sample_size=1000 --pool_size=4 --path_dataset_dir=PATH_DATASET --path_match_scores_file=PATH_MATCH_SCORES --last_fm_api_key=LAST_FM_API_KEY
```

### [Example 3](chapter_06_example_03.py)

Filter on specific tags from the Last.fm API using the LAKHs dataset
matched with the MSD dataset.
Filter on specific tags from the Last.fm API using the LAKHs dataset matched with the MSD dataset.

```bash
python chapter_06_example_03.py --sample_size=1000 --pool_size=4 --path_dataset_dir=PATH_DATASET --path_match_scores_file=PATH_MATCH_SCORES --last_fm_api_key=LAST_FM_API_KEY --tags="['jazz', 'blues']"
Expand All @@ -64,19 +56,15 @@ python chapter_06_example_04.py --sample_size=1000 --pool_size=4 --path_dataset_

### [Example 5](chapter_06_example_05.py)

Extract drums MIDI files. Some drum tracks are split into multiple separate
drum instruments, in which case we try to merge them into a single instrument
and save only 1 MIDI file.
Extract drums MIDI files. Some drum tracks are split into multiple separate drum instruments, in which case we try to merge them into a single instrument and save only 1 MIDI file.

```bash
python chapter_06_example_05.py --sample_size=1000 --pool_size=4 --path_dataset_dir=PATH_DATASET --path_match_scores_file=PATH_MATCH_SCORES --path_output_dir=PATH_OUTPUT
```

### [Example 6](chapter_06_example_06.py)

Extract piano MIDI files. Some piano tracks are split into multiple separate
piano instruments, in which case we keep them split and merge them into
multiple MIDI files.
Extract piano MIDI files. Some piano tracks are split into multiple separate piano instruments, in which case we keep them split and merge them into multiple MIDI files.

```bash
python chapter_06_example_06.py --sample_size=1000 --pool_size=4 --path_dataset_dir=PATH_DATASET --path_match_scores_file=PATH_MATCH_SCORES --path_output_dir=PATH_OUTPUT
Expand Down
6 changes: 2 additions & 4 deletions Chapter07/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ This chapter doesn't contain a lot of code, refer to the book for the content.

### [Example 1](chapter_07_example_01.py)

Configuration for the MusicVAE model, using the MIDI bass programs. To
launch the training:
Configuration for the MusicVAE model, using the MIDI bass programs. To launch the training:

```bash
python chapter_07_example_01.py --config="cat-bass_2bar_small" --run_dir="..."
```

### [Example 3](chapter_07_example_02.py)

Tensor validator and note sequence splitter (training and evaluation datasets)
for the MusicVAE model.
Tensor validator and note sequence splitter (training and evaluation datasets) for the MusicVAE model.

```bash
python chapter_07_example_02.py --config="cat-drums_2bar_small" --input="notesequences.tfrecord" --output_dir="sequence_examples"
Expand Down
26 changes: 6 additions & 20 deletions Chapter08/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,31 @@ This chapter will show a JavaScript implementation of Magenta that gained popula

### [Example 1](chapter_08_example_01.html)

An example on how to use a converted model (from a previously trained model)
locally.
An example on how to use a converted model (from a previously trained model) locally.

### [Example 2](chapter_08_example_02.html)

An example of a Magenta.js web page using GANSynth. Press "Sample GANSynth note"
to sample a new note using GANSynth and play it immediately. You can layer as
many notes as you want, each note will loop each 4 seconds.
An example of a Magenta.js web page using GANSynth. Press "Sample GANSynth note" to sample a new note using GANSynth and play it immediately. You can layer as many notes as you want, each note will loop each 4 seconds.

### [Example 2 ES6](chapter_08_example_02_es6.html)

[Example 2](#example-2) using ES6 modules.

### [Example 3](chapter_08_example_03.html)

An example of a Magenta.js web page using MusicVAE. Press "Sample MusicVAE trio"
to sample a new sequence of a trio of instruments (drum kit, bass, lead) using
MusicVAE and play it immediately. The sequence will loop.
An example of a Magenta.js web page using MusicVAE. Press "Sample MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit, bass, lead) using MusicVAE and play it immediately. The sequence will loop.

### [Example 4](chapter_08_example_04.html)

An example of a Magenta.js web page using GANSynth and MusicVAE. Press "Sample
MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit,
bass, lead) using MusicVAE and play it immediately. The sequence will loop.
Press "Sample GANSynth note for the lead synth" to sample a new note using
GANSynth use it in the lead synth.
An example of a Magenta.js web page using GANSynth and MusicVAE. Press "Sample MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit, bass, lead) using MusicVAE and play it immediately. The sequence will loop. Press "Sample GANSynth note for the lead synth" to sample a new note using GANSynth use it in the lead synth.

### [Example 5](chapter_08_example_05.html)

An example of a Magenta.js web page using the Web Workers API. Press "Sample
MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit,
bass, lead) using MusicVAE in a Web Worker and play it immediately.
An example of a Magenta.js web page using the Web Workers API. Press "Sample MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit, bass, lead) using MusicVAE in a Web Worker and play it immediately.

### [Example 6](chapter_08_example_06.html)

An example of a Magenta.js web page using the Web MIDI API. Press "Sample
MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit,
bass, lead) using MusicVAE and send it to the given MIDI output. The sequence
will loop.
An example of a Magenta.js web page using the Web MIDI API. Press "Sample MusicVAE trio" to sample a new sequence of a trio of instruments (drum kit, bass, lead) using MusicVAE and send it to the given MIDI output. The sequence will loop.

### [Example 7](chapter_08_example_07.js)

Expand Down
14 changes: 4 additions & 10 deletions Chapter09/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,31 @@ python chapter_09_example_01.py

### [Example 2](chapter_09_example_02.py)

This example shows a basic Drums RNN generation with synthesizer playback,
using a MIDI hub to send the sequence to an external device.
This example shows a basic Drums RNN generation with synthesizer playback, using a MIDI hub to send the sequence to an external device.

```bash
python chapter_09_example_02.py --midi_port="midi_port_name"
```

### [Example 3](chapter_09_example_03.py)

This example shows a basic Drums RNN generation with a
looping synthesizer playback, using a MIDI hub to send the sequence
to an external device.
This example shows a basic Drums RNN generation with a looping synthesizer playback, using a MIDI hub to send the sequence to an external device.

```bash
python chapter_09_example_03.py --midi_port="midi_port_name"
```

### [Example 4](chapter_09_example_04.py)

This example shows how to synchronize a Magenta application with an external
device using MIDI clock and transport messages.
This example shows how to synchronize a Magenta application with an external device using MIDI clock and transport messages.

```bash
python chapter_09_example_04.py --midi_port="midi_port_name"
```

### [Example 5](chapter_09_example_05.py)

This example shows a basic Drums RNN generation with a
looping synthesizer playback, generating a new sequence at each loop,
using a MIDI hub to send the sequence to an external device.
This example shows a basic Drums RNN generation with a looping synthesizer playback, generating a new sequence at each loop, using a MIDI hub to send the sequence to an external device.

```bash
python chapter_09_example_05.py --midi_port="midi_port_name"
Expand Down

0 comments on commit 65a1ac7

Please sign in to comment.