def plot_multiple_notes(self, directory):
        """
            Plots notes using LilyPond library. The notes are on a left and righ
            hand staff (piano) and may be plotted as chords (multiple notes
            played simultaneously). The generated sheet notes are named after
            the music file.
        """

        lilypond_text = '\\version \"2.14.2\" \n'
        lilypond_text += '\\score { \n'
        lilypond_text += '  \\new PianoStaff { \n'
        lilypond_text += '    \\autochange { \n'

        numOfFiles = len(os.listdir(directory))
        #for file_path in sorted(os.listdir(directory)):
        for i in range(numOfFiles):
            file_path = 'note' + str(i) + '.wav'
            detector = MIDI_Detector(directory + '/' + file_path)
            midi_numbers = detector.detect_MIDI_notes()
            print 'File: ' + str(file_path) + ' MIDI: ' + str(midi_numbers)
            if len(midi_numbers) > 0:
                lilypond_text += ' < '
                for n in midi_numbers:
                    if self.number2note.keys() in n:
                        lilypond_text += self.number2note[n] + ' '
                lilypond_text += ' >'

        lilypond_text += '    \n}  \n}'
        lilypond_text += '\\layout { } \n \\midi { }  \n}'
        with open(self.output_file, 'w') as f:
            f.write(lilypond_text)
        command = "lilypond "
        command += self.output_file
        print command
        os.system(command)
dataset/ETHPy150Open Agerrr/Automated_Music_Transcription/plotNotes.py/NotePlotter.plot_multiple_notes/swapped operands of `in`