Mathematics is not reducible to any logic nor to any algorythmic thinking... It is at the end a creative intuitive ART.... Explaining why will ask for too much space here...
Music perception is not reducible to any acoustic theory and certainly not to the Fourier analysis , it is the reverse, it is acousticians who try to understand musical perception and musical phenomena with their tools ...
It is more true to describe mathemathics as music than the classical Pythagorean reverse claim that music is mathematical said the French mathematician genius Alain Connes... listen his many deep but hard to grasp , sorry, youtube courses begin with the "the music of shapes" ..
https://www.youtube.com/watch?v=Z52ZAPrRbqE&t=2s
And i recommend to anyone with a strong basis in maths and A.I. to read this Indian scientist, for whom all the cosmos is hierarchies of orchestrated musical time crystals based on the prime numbers distribution matrix ... Read Connes and link him and his work with Anirban vision...Anirban is no joke, he work with Penrose-Hameroff , developed his own ideas and the first proved that microtubules are quantum computers... He designed the first artificial brain...
His twitter with his book title which is revolutionary ( beware he spoke a worse english than me ) 😊 :
https://twitter.com/anirbanbandyo?lang=en