Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewys committed Nov 30, 2022
2 parents c5df46f + 1f0c972 commit 06244dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ multi-GPU training. We recommend using a GPU with more than 24G of memory when t
size of 16. For a GPU with less memory, please consider using a smaller batch size and change the batch size
in `train_midi_ddsp.sh`.

***The MIDI-DDSP cannot be installed on M1 Macbook. There is a problem with pip install package involves TensorFlow.**

## Try to play with MIDI-DDSP yourself!

Please try out MIDI-DDSP
Expand Down
21 changes: 2 additions & 19 deletions midi_ddsp/colab/MIDI_DDSP_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"#@markdown Running this cell could take a while.\n",
"!pip install -q git+https://github.com/lukewys/qgrid.git\n",
"\n",
"!pip install -q midi-ddsp\n",
"!pip install -q git+https://github.com/magenta/midi-ddsp\n",
"!midi_ddsp_download_model_weights\n",
"\n",
"!git clone -q https://github.com/magenta/midi-ddsp.git\n",
Expand Down Expand Up @@ -149,28 +149,12 @@
" plt.savefig(save_path)\n",
" plt.close()\n",
"\n",
"CODE_EXPRESSION_KEY_TO_PAPER_NAME_DICT = {\n",
" 'amplitude_mean':'volume',\n",
" 'amplitude_std':'vol_fluc',\n",
" 'amplitudes_max_pos':'vol_peak_pos',\n",
" 'vibrato_extend':'vibrato',\n",
" 'brightness':'brightness',\n",
" 'attack_level':'attack',\n",
" 'pitch':'pitch',\n",
" 'note_length':'note_length',\n",
" 'onset':'onset',\n",
" 'offset':'offset',\n",
"}\n",
"\n",
"PAPER_NAME_TO_CODE_EXPRESSION_DICT = {v:k for k,v in CODE_EXPRESSION_KEY_TO_PAPER_NAME_DICT.items()}\n",
"\n",
"EDIT_DF_NAME_ORDER = ['volume', 'vol_fluc', 'vol_peak_pos', 'vibrato', 'brightness', 'attack', 'pitch', 'note_length']\n",
"\n",
"COND_DF_NAME_ORDER = ['amplitude_mean', 'amplitude_std', 'vibrato_extend', 'brightness', 'attack_level', 'amplitudes_max_pos', 'pitch', 'onset', 'offset', 'note_length']\n",
"COND_DF_NAME_ORDER = ['volume', 'vol_fluc', 'vibrato', 'brightness', 'attack', 'vol_peak_pos', 'pitch', 'onset', 'offset', 'note_length']\n",
"\n",
"def conditioning_df_to_edit_df(conditioning_df):\n",
" edit_df = conditioning_df.copy()\n",
" edit_df = edit_df.rename(columns=CODE_EXPRESSION_KEY_TO_PAPER_NAME_DICT)\n",
" return edit_df[EDIT_DF_NAME_ORDER]\n",
"\n",
"def edit_df_to_conditioning_df(edit_df):\n",
Expand All @@ -180,7 +164,6 @@
" onset = np.concatenate([[0],offset[:-1]])\n",
" conditioning_df['onset']=onset\n",
" conditioning_df['offset']=offset\n",
" conditioning_df = conditioning_df.rename(columns=PAPER_NAME_TO_CODE_EXPRESSION_DICT)\n",
" return conditioning_df[COND_DF_NAME_ORDER]\n",
"\n",
"GAIN_ADJUST_DB_DICT = { \n",
Expand Down

0 comments on commit 06244dc

Please sign in to comment.