In Freundschaft is a composition by Karlheinz Stockhausen, number 46 in his catalogue of works, which is playable on a wide variety of solo instruments.
From Wikipedia
The four parameters of pitch, duration, dynamics, and timbre in In Freundschaft
are all determined from the construction of a musical formula, the basic
form of which is presented at the outset of the work (Zelinsky and Smeyers
1985, 412). This basic form consists of five segments, containing 1, 3,
2, 5, and 8 notes—therefore 19 notes in all—occupying durational units of
approximately 1, 2, 3, 5, and 8 quarter-notes' duration, though the ending
is altered in the introductory statement—a "reduced formula" ending with
a slow oscillation between two notes a semitone apart (Zelinsky and Smeyers
1985, 413; Stockhausen 1989b, 672 and 674–75). This formula is then presented
in two registrally separated and permuted alternating statements, similar
to the arrangement in Stockhausen’s Mantra, so that the work may be said
to be monothematic (Conen 1991, 54). Initially, the separation of the two
layers is emphasized through the dynamics: the higher level is consistently
pp, the lower one ff (Conen 1991, 243).
Each layer consists of five segments, and the rests separating the segments in the upper layer correspond to the lengths of the sounding segments in the lower one. Measured in sixteenth-notes (and therefore on average a quarter the lengths of the upper-layer segments), these are: 4, 7, 2, 11, and 0 (= grace note) (Conen 1991, 242; Stockhausen 1989b, 672). The segment statements are separated by a middle-register semitone trill (A to B♭ in the clarinet version), which first emerges out of a gradual acceleration of the last interval of the fifth segment in the introduction (Stockhausen 1989a, 137; Zelinsky and Smeyers 1985, 413).
After the initial presentation, the opposing characters of the two layers is gradually evened out, in a process of development over seven cyclical statements of the formula, until the two layers are merged into a single melody (Frisius 2008, 328). This is accomplished by progressively transposing the upper level downward by one semitone per cycle, and the lower level upward by the same degree. In this way, the entirely separate ranges in the first cycle (F♯5–F6 and F♯4–F5 are brought into the single octave C5–B5 in the seventh (Zelinsky and Smeyers 1985, 418).
The overall form is interrupted by two cadenzas, the first between the third and fourth cycles, the second at the point of union between the two layers, beginning near the end of the sixth cycle and leading to the seventh (Conen 1991, 251–52; Zelinsky and Smeyers 1985, 415).