Medieval or not, Bach still didn't have the education nor the tools to formally understand the math which may underlie his beautiful music. Under different circumstances, he might have been a brilliant mathematician, no doubt.
I see............sort of like you have no 'formal' understanding about Bach.