Skip to content
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

Transpose(P8) turns D#5 to E-6, e.g. in toSounding(piccoloPart)) #1744

Open
gregchapman-dev opened this issue Jan 22, 2025 · 5 comments
Open

Comments

@gregchapman-dev
Copy link
Contributor

gregchapman-dev commented Jan 22, 2025

music21 version

9.2.0b2

Problem summary
When I do toSounding(piccoloPart), a transpose(P8) happens, and everything looks good except that D#5 gets transposed to E-6 instead of to D#6.

Steps to reproduce
I can reproduce this easily, and I will be working on it myself. I'm just checking with you (@mscuthbert and @jacobtylerwalls) to see if this is something you already know about, and can point me in the right direction.

@gregchapman-dev gregchapman-dev changed the title Transpose(P8) turns E-5 to D#6, e.g. in toSounding(piccoloPart)) Transpose(P8) turns D#6 to E-6, e.g. in toSounding(piccoloPart)) Jan 22, 2025
@gregchapman-dev gregchapman-dev changed the title Transpose(P8) turns D#6 to E-6, e.g. in toSounding(piccoloPart)) Transpose(P8) turns D#5 to E-6, e.g. in toSounding(piccoloPart)) Jan 22, 2025
@gregchapman-dev
Copy link
Contributor Author

Edited because I had the to/from reversed.

@mscuthbert
Copy link
Member

So weird! What is the .transposition on the Piccolo Instrument object (is it an interval.Interval P8 or something like interval.ChromaticInterval 12)? How was the Piccolo instrument created?

The only two file formats whose music21 converters seem to have the possibility of creating incorrect transpositions that I can see are MEI and Noteworthy Composer -- is your file from one of them?

@gregchapman-dev
Copy link
Contributor Author

gregchapman-dev commented Jan 22, 2025

The piccolo inst.transposition is definitely P8 (not just 12 semitones). I don't think it's related to an importer (I parsed a MusicXML file and then called toSounding on the resulting score).

Bummer. I was hoping it was some edge case you knew about. Ok, I will just debug it through.

@mscuthbert
Copy link
Member

I think that the MusicXML file is likely corrupted in the instrument definition (or it's a problem in our XML parsing), because this works fine:

>>> s = stream.Stream()
>>> picc = instrument.Piccolo()
>>> picc.transposition
<music21.interval.Interval P8>
>>> s.atSoundingPitch = False
>>> s.insert(0, picc)
>>> n = note.Note('D#5')
>>> s.append(n)
>>> s.toSoundingPitch()[-1].nameWithOctave
'D#6'

@gregchapman-dev
Copy link
Contributor Author

Thanks! That helps me know where to look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants