From 3cb299036b8351872e7754d8cc0648da530aa688 Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Mon, 2 Nov 2026 17:49:56 -1000 Subject: [PATCH] Fix User's Guide 31 --- .../usersGuide/usersGuide_31_clefs.ipynb | 45 ++++--------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/documentation/source/usersGuide/usersGuide_31_clefs.ipynb b/documentation/source/usersGuide/usersGuide_31_clefs.ipynb index ebae13b2c6..7b4a482da4 100644 --- a/documentation/source/usersGuide/usersGuide_31_clefs.ipynb +++ b/documentation/source/usersGuide/usersGuide_31_clefs.ipynb @@ -1104,7 +1104,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Pitch objects generally do not have `.tie` attributes, and While we can assign an attribute to almost any object, `music21` looks for the `.tie` attribute on Notes or Chords, not Pitches. So to do this properly, we need to know that internally, Chords store not just pitch objects, but also Note objects, which you can access by iterating over the Chord:" + "Pitch objects generally do not have `.tie` attributes, and while we can assign an attribute to almost any object, `music21` looks for the `.tie` attribute on Notes or Chords, not Pitches. So to do this properly, we need to know that internally, Chords store not just pitch objects, but also Note objects, which you can access by iterating over the Chord:" ] }, { @@ -1167,7 +1167,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "And that works rather well. But maybe you don't want to bother remembering which note number in a chord refers to the particular note you want tied? You can also get Notes out of a chord by treating passing in the pitch name of the Note to the chord:" + "And that works rather well. But maybe you don't want to bother remembering which note number in a chord refers to the particular note you want tied? You can also get Notes out of a chord by passing in the pitch name of the Note to the chord:" ] }, { @@ -1194,7 +1194,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Note that this only works properly if the chord does not have any repeated pitches. We are safe here. We can also retrieve and specify information directly in the chord from the index:" + "Note that this only works properly if the chord does not have any repeated pitches. We are safe here. Since we get back the Note itself, we can read its tie directly:" ] }, { @@ -1214,34 +1214,7 @@ } ], "source": [ - "ch2['D4.tie']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Or alternatively (though note that this is a string):" - ] - }, - { - "cell_type": "code", - "execution_count": 45, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 45, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ch2['0.tie']" + "ch2['D4'].tie" ] }, { @@ -1257,7 +1230,7 @@ "metadata": {}, "outputs": [], "source": [ - "ch2['A4.tie'] = tie.Tie('start')" + "ch2['A4'].tie = tie.Tie('start')" ] }, { @@ -1289,8 +1262,8 @@ } ], "source": [ - "ch3['D4.tie'] = tie.Tie('start')\n", - "ch3['A4.tie'] = tie.Tie('start')\n", + "ch3['D4'].tie = tie.Tie('stop')\n", + "ch3['A4'].tie = tie.Tie('stop')\n", "\n", "s.show()" ] @@ -1326,7 +1299,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The chord returns information from the highest note. So if we delete the tie on D4, we get the same answer:" + "The chord returns the tie of the first note that has one, here D4. So if we delete the tie on D4, we get A4's tie, which is also a start:" ] }, { @@ -1346,7 +1319,7 @@ } ], "source": [ - "ch2['D4.tie'] = None\n", + "ch2['D4'].tie = None\n", "ch2.tie" ] },