-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #6: Add Jupyter notebook support
- Loading branch information
Showing
7 changed files
with
136 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
# vim swap files | ||
# Vim swap files | ||
.gitignore.swp | ||
|
||
# idea files | ||
# JetBrains IDEA files | ||
.idea/* | ||
|
||
# python setuptools files | ||
# Python setuptools files | ||
build/ | ||
dist/ | ||
Visual_MIDI.egg-info/ | ||
__pycache__ | ||
|
||
# output plot files | ||
# Output plot files | ||
output | ||
|
||
# Jupyther notebook | ||
.ipynb_checkpoints/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# TODO | ||
|
||
- document with https://docs.python-guide.org/writing/documentation/#sphinx | ||
- add bokeh server | ||
- add docs and images | ||
- release script | ||
- add command line example `visual_midi --toolbar_location=None --plot_width=3840 --row_height=100 --title_text_font_size=65px --axis_label_text_font_size=55px --axis_x_major_tick_out=25 --axis_y_major_tick_out=100 --label_y_axis_offset_x=-85 --label_y_axis_offset_y=0.1 --axis_y_label_standoff=20 --label_text_font_size=60px --plot_pitch_range_start=68 --plot_pitch_range_stop=84 /home/alex/Project/hosting/magenta-resources/Chapter03/mono_beth_output/04/good/melody_rnn_attention_rnn_2019-08-15_164530.mid` | ||
|
||
- [ ] Document with https://docs.python-guide.org/writing/documentation/#sphinx | ||
- [ ] Add bokeh server | ||
- [ ] Add docs and images | ||
- [ ] Release script | ||
- [ ] Add command line example `visual_midi --toolbar_location=None --plot_width=3840 --row_height=100 --title_text_font_size=65px --axis_label_text_font_size=55px --axis_x_major_tick_out=25 --axis_y_major_tick_out=100 --label_y_axis_offset_x=-85 --label_y_axis_offset_y=0.1 --axis_y_label_standoff=20 --label_text_font_size=60px --plot_pitch_range_start=68 --plot_pitch_range_stop=84 /home/alex/Project/hosting/magenta-resources/Chapter03/mono_beth_output/04/good/melody_rnn_attention_rnn_2019-08-15_164530.mid` | ||
- [x] Make it work on Jupyer |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from visual_midi import Plotter\n", | ||
"from visual_midi import Preset\n", | ||
"from pretty_midi import PrettyMIDI" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"Use the `Preset` object to customize the appearance (height, width, colors, etc.) of the plot, and the `Plotter` object to change the render view (number of bars to show, pitch range, etc.). The resulting plot still has all its bars (in this example, 16 bars), but the plot is \"zoomed in\" to the desired number of bars (int this example, 8 bas). You can still drag and zoom the plot." | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"preset = Preset(plot_width=850)\n", | ||
"plotter = Plotter(preset, plot_max_length_bar=4)\n", | ||
"pm = PrettyMIDI(\"example-01.mid\")\n", | ||
"plotter.show_notebook(pm)" | ||
], | ||
"metadata": { | ||
"collapsed": false, | ||
"pycharm": { | ||
"name": "#%%\n" | ||
} | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 2 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters