Skip to content

Commit

Permalink
v. 2.0.10 -- musicxml + durationtuples
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert committed Sep 11, 2015
1 parent 18c7ee8 commit 2e008e0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
5 changes: 3 additions & 2 deletions dist/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
4. run test/testSingleCoreAll.py
(normally not necessary, because it's slower and mostly duplicates multiprocessTest,
but should be done before making a release). Done automatically by Travis-CI on GitHub commit
5. then test/testDocumentation
5. then python3 test/testDocumentation.py # only designed for Python 3...
6. then test/testSerialization
7. run documentation/make.py clean
8. run documentation/make.py [*]
Expand All @@ -32,7 +32,8 @@
10. And finally this file ON PYTHON 2.7
11. COMMIT to Github at this point, then don't change anything until the next step is done.
11. COMMIT to Github at this point w/ commit comment of the new version,
then don't change anything until the next step is done.
(.gitignore SHOULD avoid uploading the large files created here...)
12. Create a new release on GitHub and upload the FIVE files created here. Use tag v2.0.1 (etc.).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,15 +987,17 @@
"source": [
"Music21 can also deal with other `quarterLengths` such as 0.8,\n",
"which is 4/5ths of a quarter note, or 1/3 which is an eighth note triplet.\n",
"\n",
"Just be careful when creating triplets, because of a weird Python 2 quirk\n",
"that makes it so that if you divide two integers you always get back just\n",
"that makes it so that if you divide two integers with \"/\" you always get back just\n",
"the integer part of the number, so 8/3 is 2, since 8/3 is 2.66666... and\n",
"the integer part is 2:"
"the integer part is 2. I will use \"//\" in this example, since \"//\" appears\n",
"in both Python 2 and Python 3 and is equivalent to Python 2's \"/\""
]
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 1,
"metadata": {
"collapsed": false
},
Expand All @@ -1006,18 +1008,18 @@
"2"
]
},
"execution_count": 33,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"8/3"
"8//3"
]
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand All @@ -1028,13 +1030,13 @@
"0"
]
},
"execution_count": 34,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1/3"
"1//3"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,15 +987,17 @@
"source": [
"Music21 can also deal with other `quarterLengths` such as 0.8,\n",
"which is 4/5ths of a quarter note, or 1/3 which is an eighth note triplet.\n",
"\n",
"Just be careful when creating triplets, because of a weird Python 2 quirk\n",
"that makes it so that if you divide two integers you always get back just\n",
"that makes it so that if you divide two integers with \"/\" you always get back just\n",
"the integer part of the number, so 8/3 is 2, since 8/3 is 2.66666... and\n",
"the integer part is 2:"
"the integer part is 2. I will use \"//\" in this example, since \"//\" appears\n",
"in both Python 2 and Python 3 and is equivalent to Python 2's \"/\""
]
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 1,
"metadata": {
"collapsed": false
},
Expand All @@ -1006,18 +1008,18 @@
"2"
]
},
"execution_count": 33,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"8/3"
"8//3"
]
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand All @@ -1028,13 +1030,13 @@
"0"
]
},
"execution_count": 34,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1/3"
"1//3"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions music21/musicxml/xmlToM21.py
Original file line number Diff line number Diff line change
Expand Up @@ -1923,8 +1923,8 @@ def xmlToDuration(self, mxNote, inputM21=None):
durRaw.quarterLength = qLen
try:
d.components = durRaw.components
except duration.DurationException:
qLenRounded = 2.0**round(math.log2(qLen))
except duration.DurationException: # TODO: Test
qLenRounded = 2.0**round(math.log(qLen, 2)) # math.log2 appears in py3.3
environLocal.printDebug(['mxToDuration',
'rounding duration to {0} as type is not'.format(qLenRounded) +
'defined and raw quarterlength ({0}) is not a computable duration'.format(qLen)])
Expand Down

0 comments on commit 2e008e0

Please sign in to comment.