Notation plays a relatively minor role in the oral traditions of Indonesian gamelan but, in Java and Bali, several systems of gamelan notation were devised beginning at the end of the 19th century, initially for archival purposes.
The system was devised around 1900 at the Kepatihan (the Grand Vizier's compound) in Surakarta, and was based upon the Galin-Paris-Chevé system, imported in the nineteenth century by Christian missionaries to allow the notation of hymns. It superseded several other notation systems of Javanese origin devised around the same time.
To this day, the value of notation is disputed. As the kepatihan cipher system records primarily the skeletal melody line (or balungan), the wide range of improvisational techniques performed upon this line by the various instruments in gamelan are not represented. Whether they should be represented has been a matter of discussion in modern Indonesia.
The pitches of the seven-tone pélog tuning system are designated by the numbers 1, 2, 3, 4, 5, 6, and 7; while the five-tone slendro pitches are notated as 1, 2, 3, 5, and 6. The octaves are noted by dots above and below the numbers, as in Chinese jianpu, although of course the pitches do not correspond. A dot over a note indicates the octave above, and a dot below a note represents the octave below. Two dots over a note indicate a note two octaves higher than standard, and so on.
Depending on the tuning of the individual gamelan, it is often possible to hear the pitches 1, 2, 3, 5, and 6 of slendro as an anhemitonic pentatonic scale,do-re-mi-sol-la. However, in the pélog system pitches are simply numbered from low to high 1–7 and there is no question of interpreting these sounds diatonically. As the pélog scale is essentially a five-note scale, the notes 4 and 7 function similarly to 'accidentals' in Western terms: a 4 may serve as a 'sharp' or raised 3 (common in patet lima or nem) or as a 'flat' or lowered 5 (usual in patet barang). Similarly 7 functions as a 'flat' 1 in patet lima or nem; 1 in patet barang may function as a 'sharp' 7, but is more often interpreted as a temporary change of pathet.
By default, kepatihan notes are assumed all to have the same duration. Deviations from these regular rhythms are noted in two ways. Beams or lines (overscores) above notes indicate half the standard duration (although this is an area of notation that is often inaccurate in practice). A dot (pin) in the place of a note indicates the continuation of the previous note, not a rest. In vocal parts the figure 0 represents a rest, but rests are not written in instrumental parts, because the instruments normally play continuously and any rests are part of the basic playing style of the instrument. Additional symbols are needed for some instruments; for example, melismas and slurred bowing are noted by lines above or underneath the numbers. Strokes on colotomic instruments are indicated by diacritical marks over or around the kepatihan numbers. There are numerous sets of such marks in use; for example, one set (not an agreed standard) uses a circle for gong ageng, parentheses for gong suwukan, ^ for kenong, ? for kempul, + for ketuk, and – for kempyang. All or some of these marks may be omitted, as they can usually be determined from the form (bentuk).
Ordinarily the system only notates the balungan (the core melody as it is played by the sarons) and gerongan (choral parts). However, for pedagogical purposes, other patterns, such as the melodic formulas sekaran and cengkok used on the panerusan instruments may be notated.
The description above applies to central Javanese music. In the Sundanese music of West Java, the system works in reverse, with 1 representing the highest note instead of the lowest; also a dot over a note indicates the octave below, and a dot below a note represents the octave above.
In Yogyakarta a ladder-like vertical staff allowed notation of the balungan by dots and also included important drum strokes.
Kepatihan is widely used in ethnomusicological studies of the gamelan, sometimes accompanied by transcriptions into Western staff notation with approximate mapping of slendro and pelog tuning systems of gamelan onto the western staff, with and without various symbols for microtones. The relative merits of kepatihan and staff notation are sometimes debated, but staff notation is essentially incompatible with the 'end-weighted' nature of melodic structures in Indonesian music. In this respect, kepatihan is more suitable, although the usage of overscores (taken from the Galin-Paris-Chevé system) continues to cause practical difficulties.