Polyphony refers to two or more simultaneous but independent melodies and rhythms. This contrasts with monophony, which consists of just one voice, and homophony, which is one dominant melody accompanied by chords. Polyphony differs from counterpoint in that while the latter consists basically of two or more simultaneous melodies which largely or entirely retain their separate identities, in the former the melodies are specifically designed to harmonize with each other. Polyphonic music was popular during the Middle Ages and Renaissance, and one of its most notable composers was Johann Sebastian Bach.