Music is the oldest of all arts which have been in existence, even before man or animals. It is this sound which has been referred to as Anāhata Nāda. 
Sāma Vedādidam Geetham Sanjagrāha Pitāmaha

Brahma derived music from Sāma veda. The Melody of sāman is delightful to the ear and heart, and so Sāma veda can also be called Chandas meaning- to please. Sruthi affirms this: 
Swargo Vai Lōkaha Sāmavedaha

Sāma veda is verily the heavenly world. Heavenly melody lifts one to the highest divine experience in the opinion of Yagnavalkya. He who knows actual play of Veena, an expert in the Science of melody and time easily attains Brahman. Sri Krishna has declared – Among Vedas I am Sāma veda. This ascertains that Sāma veda earned a special recognition for its musical form.

Music has a divine origin and is named after celestial nymphs- deities of sound called Muses. According to Indian culture, music is also called Gandharva Vidya, as it was practiced by Celestial minstrels called Gandharvas.

An all pervading sound rang through space even before the creation of world. According to puranas, Brahma the creator, Vishnu the performer, and Maheshwara the destroyer were fond of music and were themselves musicians. Saraswathi the consort of Brahma is said to be well versed in playing Veena.

According to Hindu Mythology:

Vishnu holding the conch in one hand, while churning the ocean, was charmed with the vocal recital of Maheshwara, and began to melt. It is said that this gave birth to the sacred river Ganges. Lord Shiva was so much elated with joy after slaying the demon Tripura that he began to dance. Brahma prepared a drum out of the earth saturated with the demon’s blood, covering both the heads of the instrument with demon’s skin and asked Ganesha to keep time (laya) to the performance.

Brahma began to impart knowledge of music to his disciples. Of them Tumburu, the inventor of the stringed instrument cultivated and spread the knowledge of Vocal music. The celestial female dancer Rambha learnt and taught dancing. Narada the inventor of stringed instrument Mahati Veena and Bharata the father of Drama practiced theory of Music. Each of these musicians composed musical treatises. It is also said that the court of Indra had abundant celestial musicians who entertained him with songs, dance and drama.

Another version says:

Since Brahma is the eternal supreme power and also the creator of universe, the origin of music starts from him. He imparted this heavenly art to Shiva the god of eternal bliss, who bestowed it to Saraswati the goddess of knowledge and wisdom, who in turn taught this art to the heavenly musicians and dancers, namely Gandharvas, Apsaras and Kinnaras. These divinities are supposed to have taught this art to the great hermits like Narada, Hanuman, Bharata and others, who descended to earth, for imparting knowledge to the mortal beings.

When we casually mention the identity of a raga or a composition, we should remember that in each case it is the finished product of human experiences and experiments going back to thousands of years. The distinct characters of our music has been built up and enriched by the cumulative effort of ideas and experiments of our ancients. The object of studying history is to recapture all the important stages of the human efforts. Thus we can divide the whole range of history of Indian music into three broad periods under- Ancient, Medieval and Modern.