This is my first post so please do not be harsh on me

I'm badly looking for an anime from the past, I've searched many places without any result, maybe you can help me. I'll try to list everything I remember.
1. It was some kind of mecha anime
2. Main protagonist was taken and locked in prison
3. In the same building there was huge mecha that some scientist tried to wake up but without success (mecha was sentient)
4. There was an attack during which this mecha woke up and recognized protagonist prisoner as his pilot
5. There were some infected people and infested planet
6. There were 2 animalistic mecha summoned with flute that helped main protagonist (flute ended in some antagonist hands and went hostile)
I've spent many years looking for this and I really appreciate for any help.
Have a great day!
Sunspray