Given a melody determine the key of the melody. Key is the pair of the note and either major or minor, for example C major or e minor. Alternatively minor can include scale such as melodic, harmonic or natural.
Determine what major/minor scale is superset of the toneset. Possibly include harmonic and melodic. If there is none, try with removing some notes from the tonset.
If there is one candidate, determine if it's major or paralel minor by examining key notes.
If there are more candidates, there are 2x key candidates.
Given a melody determine the key of the melody. Key is the pair of the note and either major or minor, for example C major or e minor. Alternatively minor can include scale such as melodic, harmonic or natural.