Ottava brackets introduce an extra transposition of an octave for the staff:
a'2 b \ottava #1 a b \ottava #0 a b
The ottava function also takes -1 (for 8va bassa),
2 (for 15ma), and -2 (for 15ma bassa) as arguments.
Ottava text
Internally, \ottava sets the properties ottavation
(for example, to "8va" or "8vb") and
middleCPosition. To override the text of the bracket, set
ottavation after invoking \ottava.
{
\ottava #1
\set Staff.ottavation = #"8"
c''1
\ottava #0
c'1
\ottava #1
\set Staff.ottavation = #"Text"
c''1
}
Music Glossary: octavation.
Snippets: Pitches.
Internals Reference: Ottava_spanner_engraver, OttavaBracket, ottava-bracket-interface.