def performRecognition(self,contour): contour = contour.replace('A','u').replace('S','r').replace('D','d') songs = midiSong.findSong(contour) if songs == None: return songs elif (len(songs) == 50): self.failuretype = True return None else: print(len(songs)) if (self.sorttype == "occ"): quicksort.quicksort(songs) songs.reverse() else: stringSort.stringSort(songs, self.sorttype) return songs
def performRecognition(self, contour): contour = contour.replace('A', 'u').replace('S', 'r').replace('D', 'd') songs = midiSong.findSong(contour) if songs == None: return songs elif (len(songs) == 50): self.failuretype = True return None else: print(len(songs)) if (self.sorttype == "occ"): quicksort.quicksort(songs) songs.reverse() else: stringSort.stringSort(songs, self.sorttype) return songs
import midiSong ##searches the database for the following contours ##used songs that most people would know jayzHKLife = "rduduuurduuuu" blnk182WMAA = "drurrrrdrurrrrrr" billyJPianoM = "ddrrdrrurrdd" SmashMouthAllStar = "rrurdrdurrdurr" RHCPCalifornication = "rdurdrdurrrrdu" foundSongs = midiSong.findSong(RHCPCalifornication) if foundSongs == None: print("no songs found") else: for song in foundSongs: print(song.name, "\t", song.artist, "\t", song.occ) print(song.fileLocation)
import midiSong ##searches the database for the following contours ##used songs that most people would know jayzHKLife = "rduduuurduuuu" blnk182WMAA = "drurrrrdrurrrrrr" billyJPianoM = "ddrrdrrurrdd" SmashMouthAllStar = "rrurdrdurrdurr" RHCPCalifornication = "rdurdrdurrrrdu" foundSongs = midiSong.findSong(RHCPCalifornication) if foundSongs == None: print ("no songs found") else: for song in foundSongs: print(song.name, "\t", song.artist, "\t", song.occ) print (song.fileLocation)