diff --git a/music21/pitch.py b/music21/pitch.py index 6e0782dec..740b032a8 100644 --- a/music21/pitch.py +++ b/music21/pitch.py @@ -4721,9 +4721,8 @@ def transpose( # set fundamental self.fundamental = p.fundamental self.spellingIsInferred = p.spellingIsInferred - # deepcopy _microtone if present (not thru microtone property to detect None) - if p._microtone is not None: - self._microtone = copy.deepcopy(p._microtone) + # deepcopy _microtone (not thru microtone property to detect None) + self._microtone = copy.deepcopy(p._microtone) return None # -------------------------------------------------------------------------- diff --git a/music21/test/test_pitch.py b/music21/test/test_pitch.py index 81d1e7fcb..006e6dc8e 100644 --- a/music21/test/test_pitch.py +++ b/music21/test/test_pitch.py @@ -19,6 +19,7 @@ from music21 import converter from music21 import corpus from music21 import editorial +from music21 import interval from music21 import key from music21 import note from music21 import pitch @@ -801,6 +802,12 @@ def testLowNotes(self): self.assertEqual(lowC.name, 'C') self.assertEqual(lowC.octave, -1) + def testTransposeInPlaceReplacesMicrotone(self): + p = Pitch('C4') + p.microtone = 50 + p.transpose(interval.ChromaticInterval(0.5), inPlace=True) + self.assertEqual(str(p), 'C#4') + def testQuarterToneA(self): p1 = Pitch('D#~') # environLocal.printDebug([p1, p1.accidental])