I don’t believe texts in Ancient Greek are simultaneously music and sets of mathematical statements. This sounds like a nonsense.
Probably, it was a trick commonly used to impress the public — one can make music out of a random sequence of values (e.g. music of number π).
This resembles the Russian folk tale «Каша из топора» (Axe porridge). A soldier sought lodging for the night. An old pair let him stay at their house. The soldier had no food with him, but the hosts were stingy and refused to feed him. Then the soldier claimed that he can make a dinner for them all out of his axe. He called the dish axe porridge. He put the axe into a kettle. Then he asked hosts for some water and salt. Then he asked for some serials. Finally, when the serials were ready, he asked for some butter and bread. The hosts liked the axe porridge very much, thanked the soldier and believed the dinner felt to their lot for free (because the axe — the ‘main’ ingredient — was soldier’s).
In fact, all the edible ingredients belonged to the hosts, and the axe played no role in the dish (and it didn’t damage, the soldier took it back). It was the soldier who had a dinner for free.
The same is true for the π-music and many similar things. The number π (or the poem text) plays the role of the axe, while the harmony is added by the performers.
As for mathematical formulas encoded in the text, I suppose, it’s a kind of mathematical trick. For example, there exists so called ‘one-time pad encryption’ when an arbitrary sequence of symbols can be interpreted in an arbitrary way. Using such tricks some ‘professors’ claim they decrypted the Bible and found the killer of Kennedy there etc.