-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 1.6.0 #398
base: main
Are you sure you want to change the base?
Version 1.6.0 #398
Changes from 140 commits
ba0266d
e0ed514
10ad1a5
eae4542
50d3343
cbc9f48
d366f60
693b2c4
30ffdc4
42423e0
1e80195
498995e
e06b975
75b7213
df54d0c
9d480d9
8dccc0a
f532be4
26d30c5
0a139f2
bedc78d
ffeb587
0e77947
d401dcb
ed0e8bb
35d56a7
699738e
ac9b64a
98e9086
fb64f4f
bb363d8
125e1d2
b68d120
c24062f
4eafa93
4ed8241
7c4a695
f8120dc
0eee6a8
f69b983
c0668c7
13e0ced
5a1a6a8
07eb9ed
5784c1c
c3e35ce
7ab8b3f
e51b3e3
3056e0a
1e76b64
e5d8938
de5cc0b
7db9f9b
4306340
3fdfd39
69f8945
6d24b6a
9754a90
2d96acf
cec10ff
cc8c25c
01c0ecf
726ff82
4ae870d
788e743
ace407d
435edc1
9c23a9e
c159bc9
14d2d77
824a39b
3520066
ca3ce79
00f6329
b61d8bf
91ee519
ee8dfd3
1ca009c
f424010
90ae765
7d2623e
b585213
b2a8f5d
446340c
a59cf1d
05e955b
340b6f9
e9d3845
d7c6008
1ddc259
682f668
307f09d
4c9679d
d3947ad
58e9b6a
acd8829
d81788c
c77e5db
b5abc4c
c85acf9
115d3a7
5f265a2
7ff737e
2a80fbc
3f88474
aaaa242
b2d4106
24dc6b5
ea79e9d
97f7930
fad521c
73a9620
55daed4
37cc068
187e594
9044296
c8d3bff
f0146a7
36b8423
1376edc
65ec4c5
faa6b52
3bed493
865ca57
dc424fa
8cfc020
733a926
8701d84
17a89c5
fc480bf
bf5355d
725861d
50c52ce
af0f1cb
07225bc
37811e0
f2a1698
c460088
88fcd5a
89ce10d
471e65f
94b0566
975d300
3309554
e5bf2e1
f72cf19
3f15113
46895d9
598af13
1c88e59
86117e8
03e062b
f4930b5
9b82412
bb1adac
9c31c5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,10 @@ def make_note_el(note, dur, voice, counter, n_of_staves): | |
if voice not in (None, 0): | ||
etree.SubElement(note_e, "voice").text = "{}".format(voice) | ||
|
||
if note.stem_direction is not None: | ||
stem_e = etree.SubElement(note_e, "stem") | ||
stem_e.text = note.stem_direction | ||
|
||
if note.fermata is not None: | ||
notations.append(etree.Element("fermata")) | ||
|
||
|
@@ -634,12 +638,20 @@ def merge_measure_contents(notes, other, measure_start): | |
merged[0] = [] | ||
cost[0] = 0 | ||
|
||
# CHANGE: disabled cost-based merging of non-note elements into stream | ||
# because this led to attributes not being in the beginning of the measure, | ||
# which in turn led to problems with musescore | ||
# fix: add atributes first, then the notes. | ||
# problem: unclear whether this cost-based merging will break anything or | ||
# was just cosmetic to avoid too many forwards and backwards. | ||
# related issue: https://github.com/CPJKU/partitura/issues/390 | ||
|
||
# get the voice for which merging notes and other has lowest cost | ||
merge_voice = sorted(cost.items(), key=itemgetter(1))[0][0] | ||
# merge_voice = sorted(cost.items(), key=itemgetter(1))[0][0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this might end up having some unintended effect down the line... In any case, I think this change is ok as long as it doesn't break anything on the tests. Would it be possible to have a documented list of scores/pieces that had an issue with the sorting (i.e., the piece(s) that prompted this issue)? This could be useful for further testing down the line |
||
result = [] | ||
pos = measure_start | ||
for i, voice in enumerate(sorted(notes.keys())): | ||
if voice == merge_voice: | ||
if i == 0: # voice == merge_voice: | ||
elements = merged[voice] | ||
|
||
else: | ||
|
@@ -658,7 +670,7 @@ def merge_measure_contents(notes, other, measure_start): | |
elif gap > 0: | ||
e = etree.Element("forward") | ||
ee = etree.SubElement(e, "duration") | ||
ee.text = "{:d}".format(gap) | ||
ee.text = "{:d}".format(int(gap)) | ||
result.append(e) | ||
|
||
result.extend([e for _, _, e in elements]) | ||
|
@@ -1053,8 +1065,8 @@ def handle_parents(part): | |
part_e.append(etree.Comment(MEASURE_SEP_COMMENT)) | ||
attrib = {} | ||
|
||
if measure.number is not None: | ||
attrib["number"] = str(measure.number) | ||
if measure.name is not None: | ||
attrib["number"] = str(measure.name) | ||
|
||
measure_e = etree.SubElement(part_e, "measure", **attrib) | ||
contents = linearize_measure_contents( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this file supposed to be edited?