Closed giamic closed 1 year ago
Thanks @giamic !
When music21 parses rntxt ...
roman.RomanNumeral
objects on a stream.Part
....recurse().getElementsByClass(roman.RomanNumeral)
...So the way to get changes to either is if this_object.attribute != prev_object.attribute
. (This can be by keeping a record go the previous state, or there's actually music21 .previous()
functionality for this now.) Debatable whether to do this for chord as it's feasible that an exact repeat would be wanted, but definitely for key changes.
Obviously the key signatures on the part are not it at all.
Happy to chat.
i.e. / e.g.
from music21 import corpus
analysis = corpus.parse("bach/choraleAnalyses/riemenschneider005.rntxt")
rns = analysis.recurse().getElementsByClass(roman.RomanNumeral)
previous_key = "FAKE!"
for rn in rns:
if rn.key != previous_key:
previous_key = rn.key
print(rn.measureNumber, previous_key)
Nice! Thanks for letting me know. Then we should already have everything we need. I will update this PR maybe this Wednesday with the full solution!
I have implemented the change you suggested and it seems to work. I have updated the reference dezrann file to the new one, which has the following differences:
Db
but D- major
, following music21's conventionLet me know if it all looks good to you!
Hi @giamic, thanks for this! Some good progress here. I've added a few small/obvious edits and added a quick, direct rn to dez conversion for discussion (no score required).
As I see it, here is the current status:
tab
state = DONE by you, thanks 👍 Wrt 2./3. the new rn2dez
shows how we could get the offsets directly from the analysis, and even directly from the RNs without recourse to the measure (which dez doesn't use anyway). I argue that we should do this because it helps:
.currentHierarchyOffset
iterator on one class is especially fast/light).What do you think? It could stand alone (apart from the Tab logic here) or else be integrated?
Introduce a new converter from Rn directly to Dez. Add a couple of tests
NB: This breaks the tonality because I don't remember how to read all the different tonalities from a score in music21. Let's talk about it.