Skip to content

Commit

Permalink
Slight modifications to README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrachten committed Sep 29, 2019
1 parent 582c754 commit 32a9a7c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ supports loading from and exporting to *MusicXML* and *MIDI* files.
Quickstart
==========

The following code loads the contents of an example MusicXML file included in the package
and shows its contents:
The following code loads the contents of an example MusicXML file included in
the package:

>>> import partitura
>>> mxml_file = partitura.EXAMPLE_MUSICXML
>>> part = partitura.load_musicxml(mxml_file)
>>> my_xml_file = partitura.EXAMPLE_MUSICXML
>>> part = partitura.load_musicxml(my_xml_file)

The following shows the contents of the part:

>>> print(part.pretty())
Part id="P1" name="Piano"
Expand Down Expand Up @@ -51,11 +54,9 @@ Part id="P1" name="Piano"
The notes in this part can be accessed through the property
:attr:`part.notes <partitura.score.Part.notes>`:

.. doctest::

>>> part.notes # doctest: +NORMALIZE_WHITESPACE
[<partitura.score.Note object at 0x...>, <partitura.score.Note object at 0x...>,
<partitura.score.Note object at 0x...>]
>>> part.notes
[<partitura.score.Note object at 0x...>, <partitura.score.Note object at 0x...>,
<partitura.score.Note object at 0x...>]

To create a piano roll extract from the part as a numpy array you would do
the following:
Expand Down

0 comments on commit 32a9a7c

Please sign in to comment.