musicscore's Issues
Does not build on Python3.11
Hi,
This is more of a heads-up than a bug. This module does not build on Python 3.11. It doesn't seem to be a problem with this module at all, but with the quicktions dependency, which does not appear to support 3.11 at this time.
Thanks,
Paul
Add: Chord.break_beam()
For example needed for melismata (see: LilyPondUnofficialXMLTestSuite/test_61h_Lyrics_BeamsMelismata.py)
musicscore.metronome.Metronome
Staff attribute not created during `part.add_chord()`
I was following the tutorial examples. Example 2 claims that the exact same XML is generated as Example 1. However, I noticed a difference when doing a diff between the two XMLs, being that the staff parent is not present on the note in Example 2's XML (see below the last diff line; the other diffs are expected e.g. HW1
vs. HW2
).
I looked at the expectation in https://github.com/alexgorji/musicscore/blob/master/musicscore/tests/test_part.py#L357 and just wanted to confirm that this is expected? If so, why would the staff attribute not be present on the note? If not expected, I am happy to help fix the issue.
Nested Tuplets
We need a bit more information in the Tuplet class to allow nested tuplet, such as tuplet type and an id number
as in:
<note>
<pitch>...</pitch>
<duration>...</duration>
<time-modification>
<actual-notes>3</actual-notes>
<normal-notes>2</normal-notes>
</time-modification>
<notations>
<tuplet type="start" number="1"/>
</notations>
</note>
<!-- Inner Tuplet Start -->
<note>
<pitch>...</pitch>
<duration>...</duration>
<time-modification>
<actual-notes>5</actual-notes>
<normal-notes>4</normal-notes>
</time-modification>
<notations>
<tuplet type="start" number="2"/>
</notations>
</note>
<!-- More notes of the inner tuplet -->
<note>
<!-- Note details -->
<notations>
<tuplet type="stop" number="2"/>
</notations>
</note>
<!-- Inner Tuplet End -->
<!-- More notes of the outer tuplet -->
<note>
<!-- Note details -->
<notations>
<tuplet type="stop" number="1"/>
</notations>
</note>
Allow for public cloning of the repo including submodules
Public cloning of the repo currently fails. Let's make this work :)
[vagrant@arch ~]$ git clone --recursive https://github.com/alexgorji/musicscore.git
Cloning into 'musicscore'...
remote: Enumerating objects: 5488, done.
remote: Counting objects: 100% (933/933), done.
remote: Compressing objects: 100% (329/329), done.
remote: Total 5488 (delta 755), reused 711 (delta 598), pack-reused 4555
Receiving objects: 100% (5488/5488), 15.06 MiB | 11.26 MiB/s, done.
Resolving deltas: 100% (4241/4241), done.
Submodule 'musicxml' ([email protected]:alexgorji/musicxml.git) registered for path 'musicxml'
Cloning into '/home/vagrant/musicscore/musicxml'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:alexgorji/musicxml.git' into submodule path '/home/vagrant/musicscore/musicxml' failed
Failed to clone 'musicxml'. Retry scheduled
Cloning into '/home/vagrant/musicscore/musicxml'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:alexgorji/musicxml.git' into submodule path '/home/vagrant/musicscore/musicxml' failed
Failed to clone 'musicxml' a second time, aborting
chord.__deepcopy__ in Part.add_chord(chord)
Adding chords to a part is at the moment a destructive operation. It is a problem when a list of chords which has been added to a part is needed afterwards.
Error during first use of library after installing with pip on python3.10
When I first tried to use this library after I installed it with pip I got the following error:
File "/lib/python3.10/site-packages/musicxml/xmlelement/xmlchildcontainer.py", line 399, in add_element
self.reset_frozen()
AttributeError: 'XMLChildContainer' object has no attribute 'reset_frozen'
I worked around it by commenting out line 399 in the specified python script.
It would be cool to fix this issue though, so there's no need to comment out the line every time after a fresh install of the library.
Part.id must be unique only within a Score
Score.add_child(Part) --> must check, if Part.id is unique among Score's childen
Part: does not need to check if ids are unique globaly
add_wedge vs. wedge_chords
add_slur vs. slur_chords etc.
`import musictree` fails with UnicodeDecodeError
I'm testing on Debian 11, pypy.
$ pypy --version
Python 3.7.10 (7.3.5+dfsg-2+deb11u2, Nov 01 2022, 20:16:36)
[PyPy 7.3.5 with GCC 10.2.1 20210110]
I installed pypy-dev, pypy3-dev (required to find Python.h) and after the installation I got this:
$ python
Python 3.7.10 (7.3.5+dfsg-2+deb11u2, Nov 01 2022, 20:16:36)
[PyPy 7.3.5 with GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import musictree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/maciej/src/pypy/site-packages/musictree/__init__.py", line 1, in <module>
from musictree.accidental import *
File "/home/maciej/src/pypy/site-packages/musictree/accidental.py", line 3, in <module>
from musicxml.xmlelement.xmlelement import XMLAccidental
File "/home/maciej/src/pypy/site-packages/musicxml/xmlelement/xmlelement.py", line 10, in <module>
from musicxml.generate_classes.utils import musicxml_xsd_et_root, ns
File "/home/maciej/src/pypy/site-packages/musicxml/generate_classes/utils.py", line 11, in <module>
musicxml_et_tree = ET.parse(file)
File "/usr/lib/pypy3/lib-python/3/xml/etree/ElementTree.py", line 1197, in parse
tree.parse(source, parser)
File "/usr/lib/pypy3/lib-python/3/xml/etree/ElementTree.py", line 601, in parse
data = source.read(65536)
File "/usr/lib/pypy3/lib-python/3/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 311: ordinal not in range(128)
I didn't do a deeper dive on this, just recording that there seems to be a problem.
add AlreadyFinalizedError to all appropriate methods
Some methods still try to change notes of chords after finalization. It is better to avoid this and consistently raise errors if after finalization changes are tried to make.
add_direction_type redundant because of add_x?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.