Skip to content

Commit

Permalink
music21 v5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert committed Jun 9, 2019
1 parent 9e87914 commit 64b8224
Show file tree
Hide file tree
Showing 22 changed files with 636 additions and 710 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,5 @@ documentation/source/tutorials/MersenneDemo_files/_fig_05.png
.pytest_cache
.pytest_cache/**
music21/monkeytype.sqlite3
.pytest_cache/v/cache/nodeids
.pytest_cache/v/cache/lastfailed
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
global-include *.p.gz *.py *.txt *.xml *.krn *.mxl *.musicxml *.pdf *.html *.ipynb *.css *.js *.png *.tiff *.jpg *.xls *.mid *.abc *.json *.md *.rst *.zip *.rntxt *.command *.scl *nwc *.nwctxt *.wav *.mei LICENSE
global-exclude *ipynb_checkpoints* *-checkpoint.ipynb
prune dist
prune .mypy_cache
prune obsolete
prune documentation
2 changes: 1 addition & 1 deletion dist/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
9. ssh to MIT, cd music21/doc and rm -rf *
10. run documentation/upload.py [not via eclipse] or upload via ssh.
10. run documentation/upload.py or upload via ssh.
-- you will need an MIT username and password
11. zip up documentation/build/html and get ready to upload/delete it.
Expand Down
8 changes: 6 additions & 2 deletions documentation/source/_themes/m21/layout.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{% extends "basic/layout.html" %}

{% set script_files = script_files + ["_static/copybutton.js"] %}

{%- block doctype -%}
<!DOCTYPE html>
{%- endblock -%}
Expand All @@ -11,6 +9,12 @@
<script src='https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js'></script>
{%- endblock -%}

{%- block scripts %}
{{ super() }}
<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>
{%- endblock %}


{# put the sidebar before the body #}
{% block sidebar1 %}{{ sidebar() }}{% endblock %}
{% block sidebar2 %}{% endblock %}
Expand Down
410 changes: 204 additions & 206 deletions documentation/source/developerReference/musicxmlTest.ipynb

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions documentation/source/usersGuide/usersGuide_02_notes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from music21 import *"
Expand Down Expand Up @@ -196,9 +194,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import music21"
Expand Down Expand Up @@ -251,9 +247,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"f = note.Note(\"F5\")"
Expand Down Expand Up @@ -1524,7 +1518,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
"version": "3.7.2"
}
},
"nbformat": 4,
Expand Down
18 changes: 9 additions & 9 deletions documentation/source/usersGuide/usersGuide_09_chordify.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

64 changes: 28 additions & 36 deletions documentation/source/usersGuide/usersGuide_16_tinyNotation.ipynb

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions documentation/source/usersGuide/usersGuide_21_sorting.ipynb

Large diffs are not rendered by default.

98 changes: 50 additions & 48 deletions documentation/source/usersGuide/usersGuide_22_graphing.ipynb

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions documentation/source/usersGuide/usersGuide_26_iterators.ipynb

Large diffs are not rendered by default.

250 changes: 117 additions & 133 deletions documentation/source/usersGuide/usersGuide_31_clefs.ipynb

Large diffs are not rendered by default.

104 changes: 40 additions & 64 deletions documentation/source/usersGuide/usersGuide_43_searching1.ipynb

Large diffs are not rendered by default.

264 changes: 120 additions & 144 deletions documentation/source/usersGuide/usersGuide_44_advancedGraphing.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from music21 import converter, note, stream, meter"
Expand All @@ -35,9 +33,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"class SingleBeat(converter.subConverters.SubConverter):\n",
Expand Down Expand Up @@ -72,9 +68,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"converter.registerSubconverter(SingleBeat)"
Expand Down Expand Up @@ -119,7 +113,7 @@
" {2.6} <music21.note.Note E>\n",
" {2.8} <music21.note.Note D>\n",
" {3.0} <music21.note.Note C>\n",
" {4.0} <music21.bar.Barline style=final>\n"
" {4.0} <music21.bar.Barline type=final>\n"
]
}
],
Expand Down Expand Up @@ -176,7 +170,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/var/folders/1t/0_91h1r94kg21qt1jt20lxkc0000gn/T/music21/tmp7mvyek9z.sb\n"
"/var/folders/1t/0_91h1r94kg21qt1jt20lxkc0000gn/T/music21/tmpvkxam6ik.sb\n"
]
}
],
Expand Down Expand Up @@ -222,7 +216,7 @@
" {2.6} <music21.note.Note E>\n",
" {2.8} <music21.note.Note D>\n",
" {3.0} <music21.note.Note C>\n",
" {4.0} <music21.bar.Barline style=final>\n"
" {4.0} <music21.bar.Barline type=final>\n"
]
}
],
Expand All @@ -246,7 +240,7 @@
{
"data": {
"text/plain": [
"<music21.stream.Part 0x107c090b8>"
"<music21.stream.Part 0x119a786a0>"
]
},
"execution_count": 8,
Expand Down Expand Up @@ -297,9 +291,7 @@
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"converter.resetSubconverters()"
Expand Down Expand Up @@ -331,7 +323,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.7.2"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions documentation/testDocumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from music21.exceptions21 import Music21Exception
from music21.test import testRunner

import nbvalNotebook # @UnresolvedImport
import nbvalNotebook # @UnresolvedImport


ModTuple = namedtuple('ModTuple', 'module fullModulePath moduleNoExtension autoGen')
Expand Down Expand Up @@ -239,10 +239,10 @@ def main(runOne=False):


if __name__ == '__main__':
# import music21
# music21.mainTest()
# getDocumentationFromAutoGen(
# '/Users/cuthbert/git/music21base/music21/documentation/autogenerated/usersGuide/usersGuide_02_notes.rst')
main()
import sys
if len(sys.argv) == 1:
main()
else:
main(sys.argv[1])
# main('usersGuide_02_notes.rst')
# main('overviewPostTonal.rst')
7 changes: 4 additions & 3 deletions music21/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Even numbered Ys will be beta releases. Zero Ys 2.0, 3.0, etc. are development releases: they
CAN change functionality until 2.1, 3.1, etc. is released. This is against the semver standard,
but I don't want to have lots of 2.0.0-alpha2, etc., I'd rather call it 2.0.2, and tell users
to wait for 2.1.
to wait for 2.1. Even numbered first decimal releases (e.g. 5.4) are also beta.
Q: Why is this here and not in music21/__init__.py?
Expand All @@ -42,7 +42,7 @@
Changing this number invalidates old pickles -- do it if the old pickles create a problem.
'''

__version_info__ = (5, 6, 1, '')
__version_info__ = (5, 7, 0, '')

v = '.'.join(str(x) for x in __version_info__[0:3])
if len(__version_info__) > 3 and __version_info__[3]:
Expand All @@ -51,4 +51,5 @@
v += '.' + '.'.join(__version_info__[4:])

__version__ = v
del(v)

del v
2 changes: 1 addition & 1 deletion music21/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<class 'music21.base.Music21Object'>
>>> music21.VERSION_STR
'5.6.1'
'5.7.0'
Alternatively, after doing a complete import, these classes are available
under the module "base":
Expand Down
8 changes: 7 additions & 1 deletion music21/chord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def __deepcopy__(self, memo=None):
# as this inherits from NotRest, can use that __deepcopy__ as basis
# that looks only to _volume to see if it is not None; with a
# Chord, _volume will always be None
new = note.NotRest.__deepcopy__(self, memo=memo)
new = super().__deepcopy__(memo=memo)
# after copying, if a Volume exists, it is linked to the old object
# look at _volume so as not to create object if not already there
for d in new._notes:
Expand Down Expand Up @@ -5759,6 +5759,12 @@ def testInvertingSimple(self):
a.inversion(1)
self.assertEqual(repr(a), '<music21.chord.Chord B4 D5 F5 G5>')

def testDeepcopyChord(self):
ch = Chord('C4 E4 G4')
ch2 = copy.deepcopy(ch)
self.assertEqual(ch, ch2)


# ------------------------------------------------------------------------------


Expand Down
Binary file modified music21/corpus/_metadataCache/core.p.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions music21/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,8 @@ def testVolumeB(self):
self.assertEqual(n1Copy.volume.velocity, 100)
self.assertEqual(n1Copy.volume.client, n1Copy)

del Optional

# ------------------------------------------------------------------------------
# define presented order in documentation
_DOC_ORDER = [Note, Rest, SpacerRest, Unpitched, NotRest, GeneralNote, Lyric]
Expand Down

0 comments on commit 64b8224

Please sign in to comment.