yup loadStrings will create a string array of your text file initially from the different lines of text. Theres a little bit of legwork to get them to be broken down to single words. You can either set you your text file to have only 1 word on a line, or have processing manipulate the arrays for you. Something like this:
- String[] linesOfSong = loadString("song.txt");//load the lines of the song into a string array 1 array index per line of text
- String allWordsOfSong = join(linesOfSong, ' ');// join all the lines of the song and separate by the space character
- String[] songIntoSingleWords = split(allWordsOfSong, ' '); //split the words of a song from 1 string to an array of strings 1 array index per word
now you do this with all 4 of our songs so you have 4 versions of the songIntoSingleWords array
then comparing depends on what you want to know if its a word for word comparison or if you are looking for keywords, etc.