Kodály's first wife was Emma Gruber (née Schlesinger, later Sándor), the dedicatee of Ernő Dohnányi's Waltz for piano with four hands, Op. 3, and Variations and Fugue on a theme by E.G., Op. 4 (1897). In November 1958, after 48 years of the most harmonious marriage Kodály's first wife Emma died. In December 1959, Kodály married Sarolta Péczely, his 19-year-old student at the Franz Liszt Academy of Music with whom he lived happily until his death in 1967 at the age of 84 in Budapest.
In 1905 he visited remote villages to collect songs, recording them on phonograph cylinders. In 1906 he wrote a thesis on Hungarian folk song, "Strophic Construction in Hungarian Folksong". At around this time Kodály met fellow Composer and compatriot Béla Bartók, whom he took under his wing and introduced to some of the methods involved in folk song collecting. The two became lifelong friends and champions of each other's music.
All these works show great originality of form and content, a very interesting blend of highly sophisticated mastery of the western European style of music, including classical, late-romantic, impressionistic and modernist traditions, and on the other hand a profound knowledge and respect for the folk music of Hungary and the Hungarian-inhabited areas of Slovakia and Romania. Partly because of the Great War and subsequent major geopolitical changes in the region, and partly because of a naturally rather diffident temperament in youth, Kodály had no major public success until 1923. This was the year when one of his best-known pieces, Psalmus Hungaricus, was given its first performance at a concert to celebrate the fiftieth anniversary of the union of Buda and Pest (Bartók's Dance Suite premiered on the same occasion.)
Throughout his adult life, Kodály was very interested in the problems of many types of music education, and he wrote a large amount of material on teaching methods as well as composing plenty of music intended for children's use. Beginning in 1935, along with his colleague Jenő Ádám (14 years his junior), he embarked on a long-term project to reform music teaching in Hungary's lower and middle schools. His work resulted in the publication of several highly influential books.
The Hungarian music education program that developed in the 1940s became the basis for what is called the "Kodály Method". While Kodály himself did not write down a comprehensive method, he did establish a set of principles to follow in music education, and these principles were widely taken up by pedagogues (above all in Hungary, but also in many other countries) after World War II. See also: Kodály Hand Signs.
In 1966, Kodály toured the United States and gave a special lecture at Stanford University, where some of his music was performed in his presence.