-
Notifications
You must be signed in to change notification settings - Fork 12
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
DCML conversion including anacruses #32
Comments
I am also running up against this issue in a number of the Beethoven quartet analyses. Sometimes they use
But at other times, no, like the example noted by @napulen above. In fact, the alignment between chord annotations and score seems to be off in all of the following pieces. I haven't manually inspected them yet but I will shortly.
I can write a little script to decrement the measure numbers by 1 in the relevant files. But is there any reason not to do that? (I know there are cases like 0p 57 no. 1, iii, where the piece actually begins with a full measure but the music [and the analysis] only begin later in the measure.) |
Nevermind, Op. 57 no. 1 iii does not begin with a rest, I misremembered, it does in fact begin with a pickup measure. |
OK I just flipped through the score of the Beethoven Quartets and double-checked all the analyses for movements that begin with pickups. It appears that these are the movements that begin with "m1" rather than "m0". Many (but not all of these movements) are also missing a beat annotation for the first roman numeral, like the case @napulen singled out above (this seems to be more common in the early quartets); I have put the beat annotation that should be there after the file directory (regardless of whether it is there or not). NB I found a few errors here as well.
I'm happy to make a pull request that:
|
Hi @malcolmsailor, Many thanks for this and Happy New Year! Let's 'resolve' to advance some of these issues in 2022! Please do contribute fixes for issues like these, but consider doing so as part of a wider update. I've held off new work on this corpus conversion partly because DCML are actively working on their own update of the ABC original (both corpus and syntax). I think some context may be useful here. I'll be as candid as I can in speaking about myself / WiR, though in discussing others' work in progress, I'm obviously not in a position to speak with authority. ABC (from DCML):
The analyses here:
So, in short, I think what's needed here is:
I hope that both helps clarify the situation and also accurately reflects everyone's plans! As I'm sure is abundantly clear, producing a meta-corpus of all the the harmonic analyses out there in all their different formats is a work in progress! Less WiR and more WIP! |
Maybe asking DCML folks about these specific issues and their status on the newer version of the syntax/encodings would also be helpful. I know @johentsch has been involved in the new syntax efforts. Pinging here just to take advantage of the already useful discussion. |
@malcolmsailor, we've had the scores corrected, they can be found on the ABC/v2 branch. The branch also follows the general folder structure that the other published DCML corpora will/do have and the same TSV format (created by the MuseScore parser ms3). Therefore, developing a new converter might be worth the effort and I would be happy to assist. |
Mark, what does an updated converter need precisely? Looking at one of the files, it seems that the order of the columns has changed in the new format, so that needs to be accounted for. And then the way that measures and onsets are represented has changed, so that needs to be taken into account. Is there anything else that needs to be changed? My inclination is to take most items directly from the regex (which is now in the "label" column), since that will be easy to update if the DCML standard changes again in the future. To do this we can just iterate over the named groups in the regex with groupdict(). On the other hand there are a few columns like "globalkey", "localkey", and "pedal" that can't be read directly from the regex. Since those are already present in the TSV, it seems most straightforward to just take those from the corresponding columns. Perhaps I am missing something? |
Thanks Malcolm, all. Sounds good! And yes. the converter update might well be a small job. Wrt the columns numbering, as you say, we could just update those numbers, or move over to reading from the regex. Alternatively, it's also perhaps worth considering a slightly flexible hybrid that reads the TSV, and expects certain column names but doesn't specify the column order in advance. E.g. reading in the sv file, then converting that data to a list of dicts with the original column names as keys:
Zooming out, it would be good for the converter to aim to capture everything that's directly shared between DCML and Romantext. It can't do much more than that. You mention pedals, for instance - that is supported in both, so that could be a new feature to add. |
OK I took a first stab at an updated converter, which is in a fork I made of music21: I used Mark's idea of reading the column names dynamically from each TSV file, since I think that could be readily extended to other tabular formats. It seemed simplest to make the mapping from indices to attribute names an attribute of the However, this means that conversion going the other way is going to need to know what the canonical list of column names are. I suppose we can just take these from any of the .tsv files in the ABC corpus. But I didn't do this yet. A number of columns have been renamed because they have new names in the tsv files:
Besides There are also some columns that have been deleted and don't appear to have equivalents. Namely, 'totbeat', 'altchord', 'no', 'op', 'mov', 'length'. For the most part I don't think these are important. I rewrote the code that used |
I forgot to say: it passes all the tests in the tsvConverter.py file now. I don't know how much coverage those tests have, or if there are relevant tests elsewhere that should be run. |
Great, thanks @malcolmsailor ! A couple of quick comment for now, in haste.
Thanks again! |
So which do we want to use, measure count or measure number? (Forgive me I am not up to speed on the intricacies here.) Or provide a kwarg to select one or the other? |
Number. (Count may still be useful in analysis-score alignment) |
OK presently doing the opposite so I'll change that. Is there an easy way to store arbitrary attributes in the music21 stream, like measure count in this case? So it could possibly be used downstream. |
I think In [1]: from music21 import stream
In [2]: s = stream.Stream()
In [3]: s.editorial.arbitrary = 1234 |
So I updated the code to simply store all columns in the input .tsv that are not in The only thing that it seems is now preventing conversion back to tsv from producing an appropriate result is that 'localkey' is a pitch name, rather than a roman numeral. Is there existing code somewhere in music21 that, given two pitch names (with case indicating major/minor), will express the latter as a roman numeral relative to the former? |
Maybe getScaleDegreeAndAccidentalFromPitch? |
|
A bit involved, but ... >>> p1 = 'C'
>>> p2 = 'e'
>>> p2_rn = roman.RomanNumeral('i' if p2.lower() == p2 else 'I', keyOrScale=key.Key(p2))
>>> p2_rn.pitches
(<music21.pitch.Pitch E4>, <music21.pitch.Pitch G4>, <music21.pitch.Pitch B4>)
>>> r = roman.romanNumeralFromChord(chord.Chord(p2_rn.pitches), keyObj=key.Key(p1))
>>> r
<music21.roman.RomanNumeral iii in C major> |
Alright, I cleaned up all my TODOs. (There is still one TODO in the tsvConverter.py that I believe originates with you, Mark.) However, conversion to DCML isn't necessarily perfectly functional because of 'vii' seems to be interpreted differently by music21 and DCML. So '#viio6/ii' in the DCML becomes 'viio6/ii' when written back out with |
Closing this as the discussion is now on cuthbertLab/music21#1267 and #42 |
The measure numbering in this piece seems off in the annotation. This is an anacrusic piece.
When-in-Rome/Corpus/Quartets/Beethoven,_Ludwig_van/Op18_No4/4/analysis.txt
Line 8 in 11dc7b0
The text was updated successfully, but these errors were encountered: