When did J.S. Bach find time to pray?

Scholar Patrick Kavanaugh has heard oodles of baroque fugues and he swears that most of their composers were more interested in higher mathematics than in music.

The melodic lines spin out one on top of another, creating dizzying layers of notes, intervals and overtones. This is the musical equivalent of watching chess masters maneuver on a multi-level, three-dimensional board.

"There's an art to it, in terms of the logic and structure and the intricate patterns," said Kavanaugh, author of "The Spiritual Lives of the Great Composers." "But at some point you have to stop and say, 'Wait a minute. This is a piece of music. What does it sound like? What is it saying?' "

Then there is J.S. Bach, whose contrapuntal music continues to awe and intimidate performers, composers and scholars. This summer marks another Bach anniversary, with the 250th anniversary of his death in 1750. How big is Bach? Teldec is celebrating by releasing a complete set of his works -- a suitcase containing 1,200 compositions on 153 CDs. This is a body of music so complex that some of its mysteries weren't discovered until the computer age.

But Bach doesn't offer complexity for the sake of complexity, stressed Kavanaugh, who leads the Christian Performing Artists' Fellowship in Haymarket, Va.

"It sounds almost ridiculous to have to say it, but Bach didn't just write complex, difficult music. He wrote gloriously beautiful music, some of the most beautiful music ever composed by anyone. ... His music is cerebral, it's spiritual and it's gorgeous. He did it all."

Most scholars -- secular and religious -- would even agree on why Bach wrote what he wrote. From all indications, the composer was a devout Lutheran and frequently annotated his manuscripts with initials such as "J.J.", for "Jesu Juva (Help me, Jesus)," and ended them with "S.D.G.", for "Soli Deo Gloria (To God alone, the glory)." Many of his masterworks were based on scripture, hymns and classic Christian poetry.

But Bach also used an ancient technique called "gematria," in which letters of the alphabet are assigned numerical values. This allows the composer to use intervals and the number of notes in a melody to make symbolic references to specific biblical words and doctrines. Bach also inserted music references to his own name.

Some examples of numerology in Bach's work are obvious, such as the 10 repetitions of the melody in "These are the holy 10 commandments." But then there are musical elements centering on the number three, for the Trinity, and four, for the New Testament Gospels. Patterns of five represent the five wounds Jesus suffered on the cross and, thus, the crucifixion. The number 12 represented the apostles. The list goes on and on.

"Some of these patterns are so subtle that you have to be a Sherlock Holmes to find them," said Kavanaugh.

Some scholars believe Bach was driven to do this by sheer talent and the sense of order in his imagination. His mind, in other words, was just wired that way. Others say this was a mental game, used to escape the boredom of his crushing workload -- such as the task of writing one 30-minute church cantata a week.

Bach was astonishingly busy, especially when he was a civil servant charged with overseeing the music in four Leipzig churches. He was married twice, a widow once and had 20 children. He taught music lessons and Latin classes. He rehearsed and performed his own organ works and directed the local boys choirs. Yet the Bach-Gesellschaft company has published 65 volumes of music, even though experts believe at least half of Bach's works are missing.

Many scholars have asked: When did Bach find time to compose? But Kavanaugh is fascinated by another question: When did Bach find time to pray? Both questions may have the same answer.

"Perhaps all of these symbolic numbers and patterns were something Bach did as a kind of meditation," said Kavanaugh. "This may have been his own personal way of worshipping God. ... And in the end, it didn't matter if anyone else figured it all out. He was writing his music for a different audience. This was between him and the Lord."