You can use sites like Samplab or MusicCreator.ai to extract MIDI data from audio.
I AM AN IAS ACADEMY