The foundation said Stockhausen, considered one of the most important composers of the past century, died on Wednesday and would be buried in a cemetery in the forest outside the small town.

Stockhausen’s earliest works were in the serialist style but he became known from the mid-1950s for his experiments with aleatoric technique, which leaves key elements during a musical performance to chance.

A true enfant terrible of contemporary music, he influenced everyone from the likes of Brian Eno to Bjork — and even appeared on the cover of the Beatles’ Sergeant Pepper album.

His foundation said he composed a total of 362 individually performable works.

Stockhausen was born in Moedrath, a small town near Cologne, on August 22, 1928 but was fond of saying in typically eccentric style: “I was educated on Sirius and want to return there, although I’m currently still living in Kuerten near Cologne.”

At an early age, Stockhausen received piano lessons from a local organist and later earned his pocket money as a pianist for the local dance school.

After failing the theoretical part of the entrance examination for Cologne’s Hochschule fuer Musik (university of music) at the age of 19, he secured a place to study German, philosophy and musicology at Cologne University in 1948, where he graduated with distinction in 1951.

In that same year, Stockhausen met Herbert Eimert, who was to become his patron and who helped set up Cologne’s electronic studio.

It was also Eimert who first took Stockhausen to the now-legendary “Internationale Ferienkurse fuer Neue Musik” in Darmstadt.

In their heyday in the 1950s and 1960s, the Darmstadt summer courses — still held today — became one of the most important forums for the musical avant-garde, establishing themselves as a laboratory for so-called serial music.

Serialism has its roots in Arnold Schoenberg’s 12-tone system or dodecaphony, but serialism developed that technique still further, applying it not only to pitch, but to other musical elements.

In 1951, Stockhausen composed his first important serially-influenced piece, “Kreuzspiel” (Crossplay), which caused a scandal at its Darmstadt premiere.

After studies with Olivier Messiaen and Darius Milhaud in Paris in 1952, during which he composed the first four of his seminal “Klavierstuecke” (Piano Pieces), Stockhausen completed his first fully serial piece “Kontrapunkte” (Counter-Points) in 1953.

A year later, he was already moving away from the absolute rigour of serialism and, in his “Klavierstuecke” V-VIII, began to experiment with aleatoric technique, which leaves key elements during a performance to chance.

Stockhausen met US experimental composer John Cage, a pioneer of aleatoric music, in 1954 and in the same year he also began to explore the spatial dimensions of music.

The works during this period, which used different aleatoric and spatial elements, include “Gruppen” (Groups) and “Gesang der Juenglinge” (Song of the Youths).

In 1963, Stockhausen took over from Herbert Eimert as head of the electronic studio in Cologne where his experiments led to works such as “Mixtur” (Mixture) and “Mikrophonie I – III” (Microphony).

In 1966, he came into contact with Far Eastern religions, studying their use of music for creating heightened physical states, and that same year created “Hymnen” (Anthems), one of his best-known pieces that uses all of the world’s national anthems.

In 1971, he was awarded a professorship for composition at the Hochschule fuer Musik in Cologne, and in 1977 Stockhausen embarked on the piece that would eventually occupy him for nearly 30 years, the seven-opera cycle, “Licht” (Light), in which each part is named after a day of the week.

The logistical demands of the 29-hour long work are staggering. For just one section alone, entitled “Helikopter-Streichquartett” (Helicopter String Quartet), a string quartet hovers in four different helicopters above the concert hall, with audio and video feeds relayed to the audience below.

Ridiculed by many in the musical establishment for his increasingly outlandish ideas and self-agrandissement (“my personality is a universal statement”), alternately dismissed as charlatan and revered as a genius, Stockhausen once compared the September 11, 2001 attacks on New York’s World Trade Centre to “a work of art”.