Skip to content

Commit

Permalink
update doctests, links, and build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert committed Oct 29, 2024
1 parent 3150c49 commit 56e00b2
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 56 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
`Music21` welcomes contributions such as bug reports, new features, fixes, and
documentation improvements. The
[project repository](http://www.github.com/cuthbertLab/music21) is hosted at GitHub.
[project repository](https://github.com/cuthbertLab/music21) is hosted at GitHub.

Information that was formerly here is now in
[Developer Reference](https://web.mit.edu/music21/doc/developerReference/index.html)
[Developer Reference](https://www.music21.org/music21docs/developerReference/index.html)

## Resources ##

[Module Documentation and User's Guide](https://web.mit.edu/music21/doc/index.html)
[Module Documentation and User's Guide](https://www.music21.org/music21docs/)

[Mailing List](https://groups.google.com/forum/#!forum/music21list)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ See: https://groups.google.com/forum/#!forum/music21list

[Contributing Guide](CONTRIBUTING.md)

## Community Code of Conduct ##
## Community Code of Conduct<a name="community-code-of-conduct"></a> ##

`Music21` encourages contributions, discussions, and usage from all people interested in
music and computers. This encouragement extends to all people regardless of (among other aspects)
Expand Down
3 changes: 2 additions & 1 deletion dist/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
[*] you will need sphinx, Jupyter (pip or easy_install), markdown, and pandoc (.dmg) installed
10. move music21 docs to music21.org via Amazon S3 (contact MSAC for authentication if need be)
10. move music21 documentation/build/html to music21.org/music21docs/
via Amazon S3 (contact MSAC for authentication if need be)
11. zip up documentation/build/html and get ready to upload/delete it.
Rename to music21.v.7.1.0-docs.zip (skip for Alpha/Beta)
Expand Down
23 changes: 14 additions & 9 deletions documentation/source/about/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ the BSD license (see below).
About the Authors
-----------------------

**Michael Cuthbert**, the creator of `music21`, is Associate Professor of Music at M.I.T.
**Michael Cuthbert**, the creator of `music21`, is co-founder and chief music officer of
`Artusi`_ and former tenured professor of music at M.I.T. where he created the Mellon-Funded
Digital Humanities lab and taught computational music theory and musicology.
He received his A.B. *summa cum laude*, A.M. and Ph.D. degrees from Harvard University.
Cuthbert spent 2004-05 at the American Academy as a Rome Prize winner in Medieval Studies,
2009-10 as Fellow at Harvard's Villa I Tatti Center for Italian Renaissance Studies
in Florence, and 2012-13 at the Radcliffe Institute.

Prior to joining the M.I.T. faculty, Cuthbert was on the faculties of Smith
and Mount Holyoke Colleges. He has worked extensively on computer-aided musical analysis,
fourteenth-century music, and the music of the past forty years. He has published
on computer-aided treatment of fragments and palimpsests of the late Middle Ages and
on set analysis of Sub-Saharan African Rhythm and the music of John Zorn. In addition to
work on music21, Cuthbert is currently writing a book on sacred music in Italy during the
age of the Black Death and Great Papal Schism.
fourteenth-century music, and the music since 1960.

**Christopher Ariza** is Emeritus Lead Programmer of `music21` and was
Visiting Assistant Professor of Music
Expand All @@ -41,6 +39,8 @@ degree from Harvard University and his M.A. and Ph.D. degrees from New York Univ
Additional contributions by many MIT students and visitors and the
Open Source software community.

.. _Artusi: https://www.artusimusic.com/


Acknowledgements
----------------
Expand All @@ -52,7 +52,7 @@ Funding
from the **Seaver Institute** and
the **National Endowment for the Humanities**/Digging into Data research fund.

In addition, we acknowledge consistent support from `M.I.T.`_, the
In addition, we acknowledge previous support from `M.I.T.`_, the
`School of Humanities Arts and Social Sciences`_, and the
`Music and Theater Arts`_ section.

Expand Down Expand Up @@ -91,6 +91,10 @@ to this project. Their contributions and generosity are greatly appreciated.
support and for their contributions to the open source music notation projects,
including the Bach Goldberg Variations and the Handel Arias included.

* `Jacob Tylor Walls`_, contributed greatly to the type-safety, speed, and test coverage
of `music21`. If your music21 program "just works" without needing to guess what
any argument goes where, Jacob is to thank.

* `Donald Byrd`_, researcher on University of Indiana who created
a schema for computer-aided musicology (along with the source of all sorts of
examples of how music notation is difficult).
Expand Down Expand Up @@ -119,10 +123,10 @@ to this project. Their contributions and generosity are greatly appreciated.
* Walter B. Hewlett and Craig Sapp of Stanford's CCARH for support.

* `Justin London` compiled and maintained the list of Second-Viennese
row forms now available in serial.py.
row forms that form the original backbone of serial.py.

* `McGill University`_ ELVIS project for including the MEI parser. Special thanks to Julie
Cumming, Andrew Hankinson, and especially Christopher Antila for contributing.
Cumming, Andrew Hankinson, Ichiro Fujinaga, and especially Christopher Antila for contributing.

* `Manuel Op de Coul`_ has kindly gave permission to use the Scala
scale archive of nearly 4000 scales in music21.
Expand All @@ -138,6 +142,7 @@ to this project. Their contributions and generosity are greatly appreciated.
Haydn, and Mozart, in musicxml format which we have been able to include in music21.

.. _Donald Byrd: https://web.archive.org/web/20220610200930/https://homes.luddy.indiana.edu/donbyrd/CMNExtremes.htm
.. _Jacob Tylor Walls: https://jacobtylerwalls.com/
.. _Laura E. Conrad: http://www.serpentpublications.org/drupal7/
.. _MuseScore: https://musescore.com/
.. _Bryen Travis: http://www.bachcentral.com/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"\n",
"`Music21` welcomes contributions such as bug reports, new features, fixes, and\n",
"documentation improvements. The\n",
"[project repository](http://www.github.com/cuthbertLab/music21) is hosted at GitHub."
"[project repository](https://github.com/cuthbertLab/music21) is hosted at GitHub."
],
"metadata": {
"collapsed": false
Expand All @@ -20,7 +20,7 @@
"\n",
"Get to know this before contributing:\n",
"\n",
"[Module Documentation and User's Guide](https://web.mit.edu/music21/doc/index.html)\n",
"[Module Documentation and User's Guide](https://www.music21.org/music21docs/index.html)\n",
"\n",
"[Mailing List](https://groups.google.com/forum/#!forum/music21list)\n",
"\n",
Expand Down Expand Up @@ -186,7 +186,7 @@
" - `Music21` was originally designed without this principle in mind, so you will find\n",
" parts of the system that do not follow LSP and for backwards compatibility never will.\n",
" I (Myke) have personally apologized to Barbara Liskov for my past ignorance.\n",
" - Use [Sphinx formatting](https://web.mit.edu/music21/doc/developerReference/documenting.html#documenting-modules-and-classes)\n",
" - Use [Sphinx formatting](https://www.music21.org/music21docs/developerReference/documenting.html#documenting-modules-and-classes)\n",
" to link to classes and methods in docstrings\n",
" - Prefer methods that by default do not alter the object passed in and instead return a new one.\n",
" It is permitted and encouraged to have an `inPlace: bool = False` argument that allows for\n",
Expand Down Expand Up @@ -216,7 +216,7 @@
"\n",
"We write doctests and unit tests, and we strive for the total\n",
"test coverage of the project to increase with every pull request. See the\n",
"[developer docs](https://web.mit.edu/music21/doc/developerReference/index.html)\n",
"[developer docs](https://www.music21.org/music21docs/developerReference/index.html)\n",
"to dig in to specific topics like adjusting doctests to prevent\n",
"actions we don't want executed when running the general test suite (such as opening\n",
"browser windows or playing music).\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@
"\n",
"* 'alpha' sets transparency, from 0 (transparent) to 1 (opaque).\n",
"* 'color' gives a color to the data point -- specified like \"red\" or \"green\" or an HTML color like \"#ff0044\"\n",
"* 'marker' on a scatter plot will choose a shape for a marker as in [this diagram](https://matplotlib.org/api/markers_api.html)\n",
"* 'marker' on a scatter plot will choose a shape for a marker as in [this diagram](https://matplotlib.org/stable/api/markers_api.html)\n",
"* 'markersize' gives the size of the marker -- notice that we're using matplotlib names, so the \"s\" of size is lowercased (in `music21` almost everything is camelCase)\n",
"\n",
"Let's make a new axis class which returns the frequency of each pitch but also changes its marker according to whether it's in a certain key or not:"
Expand Down Expand Up @@ -1328,7 +1328,7 @@
"source": [
"## Graph Primitives\n",
"\n",
"Untill now, all our our examples have used Plot classes taken from :ref:`moduleGraphPlot` because they were acting on streams to get their data. If you wanted to make graphs of data not coming from a Stream you could use matplotlib directly -- they have a great tutorial on [using their `pyplot` interface](https://matplotlib.org/users/pyplot_tutorial.html), for instance. Or if you want to get some of the advantages of the `music21` Plot types without going all the way into matplotlib, there are Graph primitives in the :ref:`moduleGraphPrimitives` module. Here are some examples of how those work:"
"Untill now, all our our examples have used Plot classes taken from :ref:`moduleGraphPlot` because they were acting on streams to get their data. If you wanted to make graphs of data not coming from a Stream you could use matplotlib directly -- they have a great tutorial on [using their `pyplot` interface]( https://matplotlib.org/2.0.2/users/pyplot_tutorial.html), for instance. Or if you want to get some of the advantages of the `music21` Plot types without going all the way into matplotlib, there are Graph primitives in the :ref:`moduleGraphPrimitives` module. Here are some examples of how those work:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion music21/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'''
from __future__ import annotations

__version__ = '9.2.0b2'
__version__ = '9.3.0'

def get_version_tuple(vv):
v = vv.split('.')
Expand Down
4 changes: 2 additions & 2 deletions music21/audioSearch/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'''
modules for audio searching that directly record from the microphone.
Requires PyAudio and portaudio to be installed (http://www.portaudio.com/download.html)
Requires PyAudio and portaudio to be installed (https://www.portaudio.com/download.html)
To download pyaudio for windows 64-bit go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
Expand All @@ -37,7 +37,7 @@
# to download pyaudio for windows 64-bit go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
# users of 64-bit windows but 32-bit python should download the win32 port
# users of 64-bit windows and 64-bit python should download the amd64 port
# requires portaudio to be installed http://www.portaudio.com/download.html
# requires portaudio to be installed https://www.portaudio.com/download.html

default_recordChannels = 1
default_recordSampleRate = 44100
Expand Down
2 changes: 1 addition & 1 deletion music21/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<class 'music21.base.Music21Object'>
>>> music21.VERSION_STR
'9.2.0b2'
'9.3.0'
Alternatively, after doing a complete import, these classes are available
under the module "base":
Expand Down
2 changes: 1 addition & 1 deletion music21/braille/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
This module was made in consultation with the manual "Introduction to Braille
Music Transcription, Second Edition" by Mary Turner De Garmo, 2005. It is
available from the Library of Congress
`here <https://www.loc.gov/nls/braille-audio-reading-materials/music-materials/>`_,
`here <https://www.loc.gov/nls/services-and-resources/music-service-and-materials/>`_,
and will henceforth be referred to as BMTM.
'''
from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion music21/braille/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def example11_2():
# Examples follow the order in:
# Introduction to Braille Music Transcription, Second Edition (2005)
# Mary Turner De Garmo
# https://www.loc.gov/nls/music/
# https://www.loc.gov/nls/services-and-resources/music-service-and-materials/
# ------------------------------------------------------------------------------
class Test(unittest.TestCase):
'''
Expand Down
2 changes: 1 addition & 1 deletion music21/braille/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
This module was made in consultation with the manual "Introduction to Braille
Music Transcription, Second Edition" by Mary Turner De Garmo, 2005. It is
available from the Library of Congress
`here <https://www.loc.gov/nls/braille-audio-reading-materials/music-materials/>`_,
`here <https://www.loc.gov/nls/services-and-resources/music-service-and-materials/>`_,
and will henceforth be referred to as BMTM.
Expand Down
8 changes: 4 additions & 4 deletions music21/common/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,26 @@ def getMissingImportStr(modNameList):
>>> print(common.getMissingImportStr(['matplotlib']))
Certain music21 functions might need the optional package matplotlib;
if you run into errors, install it by following the instructions at
http://mit.edu/music21/doc/installing/installAdditional.html
https://www.music21.org/music21docs/installing/installAdditional.html
>>> print(common.getMissingImportStr(['matplotlib', 'numpy']))
Certain music21 functions might need these optional packages: matplotlib, numpy;
if you run into errors, install them by following the instructions at
http://mit.edu/music21/doc/installing/installAdditional.html
https://www.music21.org/music21docs/installing/installAdditional.html
'''
if not modNameList:
return None
elif len(modNameList) == 1:
m = modNameList[0]
return textwrap.dedent(f'''Certain music21 functions might need the optional package {m};
if you run into errors, install it by following the instructions at
http://mit.edu/music21/doc/installing/installAdditional.html''')
https://www.music21.org/music21docs/installing/installAdditional.html''')
else:
m = ', '.join(modNameList)
return textwrap.dedent(
f'''Certain music21 functions might need these optional packages: {m};
if you run into errors, install them by following the instructions at
http://mit.edu/music21/doc/installing/installAdditional.html''')
https://www.music21.org/music21docs/installing/installAdditional.html''')


def getPlatform() -> str:
Expand Down
11 changes: 5 additions & 6 deletions music21/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
reMuseScoreApp = re.compile(r'MuseScore.*\.app', IGNORECASE)
reMuseScoreExe = re.compile(r'Musescore.*\\bin\\MuseScore.*\.exe', IGNORECASE)

urlMusic21 = 'https://web.mit.edu/music21'
urlMuseScore = 'http://musescore.org'
urlGettingStarted = 'https://web.mit.edu/music21/doc/'
urlMusic21 = 'https://www.music21.org/music21docs/'
urlMuseScore = 'https://www.musescore.org'
urlGettingStarted = 'https://www.music21.org/music21docs/'
urlMusic21List = 'https://groups.google.com/g/music21list'

LINE_WIDTH = 78
Expand Down Expand Up @@ -707,8 +707,7 @@ class AskOpenInBrowser(YesOrNo):
'''
Ask the user if the want to open a URL in a browser.
>>> d = configure.AskOpenInBrowser('http://mit.edu/music21')
>>> d = configure.AskOpenInBrowser('https://www.music21.org/')
'''

def __init__(self, urlTarget, default=True, tryAgain=True,
Expand Down Expand Up @@ -1494,7 +1493,7 @@ def testSelectMusicXMLReaderDefault(self):

def testOpenInBrowser(self):
print()
d = AskOpenInBrowser('http://mit.edu/music21')
d = AskOpenInBrowser('https://www.music21.org/')
d.askUser()
print('getResult():', d.getResult())
d.performAction()
Expand Down
2 changes: 1 addition & 1 deletion music21/humdrum/spineParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ def hdStringToNote(contents):
double-dotted quarter not a double-dotted quarter-note triplet.
I believe that the latter definition, though used in
https://kern.ccarh.org/cgi-bin/ksdata?l=musedata/mozart/quartet&file=k421-01.krn&f=kern
https://kern.humdrum.org/cgi-bin/ksdata?l=musedata/mozart/quartet&file=k421-01.krn&f=kern
and the Josquin Research Project [JRP] is incorrect, seeing as it
contradicts the specification in
https://web.archive.org/web/20100203144730/http://www.music-cog.ohio-state.edu/Humdrum/representations/kern.html#N-Tuplets
Expand Down
10 changes: 5 additions & 5 deletions music21/lily/lilyObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,13 +1560,13 @@ def stringOutput(self):

class LyEventChord(LyObject):
r'''
takes all the parts as a list of up to three elements
takes all the parts as a list of up to three elements::
event_chord: simple_chord_elements post_events
| CHORD_REPETITION optional_notemode_duration post_events
| MULTI_MEASURE_REST optional_notemode_duration post_events
| command_element
|note_chord_element
| CHORD_REPETITION optional_notemode_duration post_events
| MULTI_MEASURE_REST optional_notemode_duration post_events
| command_element
| note_chord_element
simple_chord_elements can be a LySimpleElement object. Or it can be a
LyNewChord or LyFigureSpec + Duration
Expand Down
2 changes: 1 addition & 1 deletion music21/lily/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ def appendContextFromChord(self, chord):

def lySimpleMusicFromNoteOrRest(self, noteOrRest):
r'''
returns a lilyObjects.LySimpleMusic object for the generalNote containing this hierarchy
returns a lilyObjects.LySimpleMusic object for the generalNote containing this hierarchy::
LyEventChord containing
LySimpleChordElements containing
Expand Down
2 changes: 1 addition & 1 deletion music21/metadata/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class PropertyDescription:
isContributor=False),

# The following 'marcrel' property terms are MARC Relator terms,
# found at: http://www.loc.gov/loc.terms/relators/
# found at: https://id.loc.gov/vocabulary/relators.html

# adapter: a person or organization who 1) reworks a musical composition,
# usually for a different medium, or 2) rewrites novels or stories
Expand Down
7 changes: 5 additions & 2 deletions music21/midi/percussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PercussionMapper:
PercussionMapper provides tools to convert between 0-indexed MIDI pitches
and music21 instruments, based on the official General MIDI Level 1 Percussion Key Map.
This mapping is conventionally applied to MIDI channel 10;
see https://www.midi.org/specifications/item/gm-level-1-sound-set for more info.
see https://midi.org/general-midi-level-1 for more info.
Give me the instrument that corresponds to MIDI note 58!
Expand Down Expand Up @@ -90,7 +90,10 @@ class PercussionMapper:
81: i.Triangle, # Open Triangle
}

# MIDI percussion mappings from https://www.midi.org/specifications/item/gm-level-1-sound-set
# MIDI percussion mappings from https://midi.org/general-midi-level-1 download at
# https://drive.google.com/file/d/1TTM2HI2JAp_XiTJYEJ8gPNvuJpIjJiTP/view?pli=1
# formerly at:
# https://www.midi.org/specifications/item/gm-level-1-sound-set

def midiPitchToInstrument(self, midiPitch):
'''
Expand Down
2 changes: 1 addition & 1 deletion music21/romanText/tsvConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def prepStream(self) -> stream.Score:
# should be?
repeatBracket = spanner.RepeatBracket(number=entry.volta)
# According to the docs at
# https://web.mit.edu/music21/doc/moduleReference/moduleSpanner.html#spanner
# https://www.music21.org/music21docs/moduleReference/moduleSpanner.html#spanner
# "the convention is to put the spanner at the beginning
# of the innermost Stream that contains all the Spanners"
p.insert(0, repeatBracket)
Expand Down
Loading

0 comments on commit 56e00b2

Please sign in to comment.