示例#1
0
    def __setitem__(self, i, expr):
        '''Sets chord note head `i` to `expr`.

        Returns none.
        '''
        from abjad.tools.notetools.NoteHead import NoteHead
        if isinstance(i, slice) and expr == []:
            note_head = []
        elif isinstance(expr, NoteHead):
            note_head = expr
            note_head._client = self
        else:
            note_head = NoteHead(expr)
            note_head._client = self
        #note_head._client = self
        self._note_heads[i] = note_head
        self._note_heads.sort()
示例#2
0
    def append(self, note_head):
        r'''Appends `note_head` to chord.

        ..  container:: example

            **Example.**

            ::

                >>> chord = Chord("<e' cs'' f''>4")
                >>> show(chord) # doctest: +SKIP

            ::

                >>> chord.append("g''")
                >>> show(chord) # doctest: +SKIP

            ..  doctest::

                >>> f(chord)
                <e' cs'' f'' g''>4

        Set `note_head` to a pitch, pitch name, pitch number or note head.

        Sorts note heads automatically.

        Returns none.
        '''
        from abjad.tools.notetools.NoteHead import NoteHead
        if isinstance(note_head, NoteHead):
            note_head = note_head
        else:
            note_head = NoteHead(written_pitch=note_head)
        note_head._client = self
        self._note_heads.append(note_head)
        self._note_heads.sort()