# 1. Chords¶

## 1.1. Making chords from a LilyPond input string¶

You can make chords from a LilyPond input string:

```>>> chord = abjad.Chord("<ef' f' cs''>4")
```

## 1.2. Making chords from numbers¶

You can also make chords from numbers:

```>>> chord = abjad.Chord([4, 6, 14], abjad.Duration(1, 4))
```

## 1.3. Understanding the interpreter representation of a chord¶

```>>> chord
Chord("<e' fs' d''>4")
```

`Chord` tells you the chord’s class.

`"<e' fs' d''>4"` tells you chord’s LilyPond input string.

## 1.4. Getting and setting the written duration of a chord¶

Get the written duration of a chord like this:

```>>> chord.written_duration
Duration(1, 4)
```

Set the written duration of a chord like this:

```>>> chord.written_duration = abjad.Duration(3, 16)
```

## 1.5. Getting and setting the written pitches of a chord¶

Get the written pitches of a chord like this:

```>>> chord.written_pitches
PitchSegment("e' fs' d''")
```

Set the written pitches of a chord like this:

```>>> chord.written_pitches = ("e'", "fs'", "gs'")
```

Get the note-heads of a chord like this:

```>>> for note_head in chord.note_heads: note_head
...
```

## 1.7. Appending note-heads to a chord¶

Use `append()` to add one note-head to a chord.

You can append with a pitch name:

```>>> chord = abjad.Chord("<f' g' ef''>4")
>>> show(chord)
```
```>>> chord.note_heads.append("a'")
```

Or with a pitch number:

```>>> chord.note_heads.append(10)
```

## 1.8. Extending chords¶

Use `extend()` to add multiple note-heads to a chord.

You can extend with pitch names:

```>>> chord = abjad.Chord("<fs' gs' e''>4")
```
```>>> chord.note_heads.extend(["a'", "b'"])
```

Or with pitch numbers:

```>>> chord.note_heads.extend([13, 14])
```

Delete chord note-heads with `del()`.

```>>> chord = abjad.Chord("<g' a' f''>4")
```
```>>> del(chord.note_heads[-1])
```

```>>> chord = abjad.Chord("<af' bf' gf''>4")
```
```>>> abjad.tweak(chord.note_heads[0]).color = 'red'
```

## 1.11. Working with empty chords¶

```>>> chord = abjad.Chord([], abjad.Duration(1, 4))
>>> chord
Chord('<>4')
```

Empty chords don’t constitute valid LilyPond input.

This means LilyPond will complain if you pass empty chords to `show()`.

You can add pitches back to an empty chord at any time:

```>>> chord.note_heads.extend([9, 11, 17])