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.
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).
The kepatihan cipher system records the two fixed elements of Javanese gamelan music: the melodic framework (or balungan (literally, skeleton)) represented by numbers, and the set of punctuating gongs that define the form, represented by circles and other symbols. All of the other parts are not notated, but realized by the players at the time of performance, based on their knowledge of the instrument, their training, and the context of the performance (e.g. dance, wayang, concert, wedding, etc.), with the exception of vocal music, which may have lyrics or special melodies that are notated and provided to the singers. In some contemporary compositions, if the classical techniques are not used, more parts might be notated, or just learned by rote in rehearsals. When instruments from other traditions are combined with gamelan (e.g. violin, erhu, tap dancer, bagpipes), notation may be given to those players only if they are accustomed to it.
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.
Computer Fonts for Gamelan Notation
The font Kepatihan was developed by Carter Scholz. The font KepatihanPro, now the most widely used computer font for gamelan notation, evolved in two stages: it was designed by Matthew Arciniega around 1994 taking inspiration from Scholz' work, and later spread as PostScript font to be used on the Mac. Around the year of 2000 Raymond Weisling regenerated it as TrueType font (working both on Apple- and Windows-computers), made some adjustments and renamed it to "KepatihanPro". At the time Apple computers were rare in Indonesia, but the adoption of Windows-based computers for word-processing was spreading rapidly. Therefore the availability of the font for Windows strongly boosted adoption. On 24 July 2020, the Kraton Yogyakarta announced a new font: Kridhamardawa; based on KepatihanPro, it has darker ciphers, a lot of typographical enhancements, and reduces the line-height required to display all diacritical symbols vertically significantly. The codepoints are still compatible with KepatihanPro and follow - like in Scholz' and Arciniega's fonts - a "keyboard-logic": the fonts should/can be used with a US-American keyboard-driver, and symbols are found at keys that make sense by the typical layout of keyboards. For example the "lower-octave"-ciphers with "dot-below" can be accessed by the keys q-w-e-r-t-y-u because those are the keys one line "below" the number-keys. During the early 2000s multiple simplified offsprings of the Kepatihan-font were widely used for cipher-notation of church hymns all over Indonesia, and reportedly even spread to China. Likely in an attempt to standardise these developments and switch to a Unicode- rather than keyboard-based logic of code-point assignment, SIL International published the font Doulos SIL Cipher  in 2014.
- Lindsay, Jennifer (1992). Javanese Gamelan, p.43-45. Oxford and New York: Oxford University Press. ISBN 0-19-588582-1.
- Gamelan: Cultural Interaction and Musical Development in Central Java (1995) by Sumarsam, ISBN 0-226-78010-4 (cloth) 0226780112 (paper)
- Mantle Hood, The Evolution of the Javanese Gamelan, Book II
- "Komposisi Baru": On Contemporary Composition in Indonesia
- Music in Central Java: Experiencing Music, Expressing Culture (2007) by Benjamin Brinner, Oxford University Press, New York, ISBN 0-19-514737-5 (paper), on the functions and risks of kepatihan usage in Java.
- A Gamelan Manual: A Player's Guide to the Central Javanese Gamelan (2005) by Richard Pickvance, Jaman Mas Books, London, ISBN 0-9550295-0-3, for further details of how kepatihan is used in practice.