def render(self):
        """Render a playable song out to a .wav file"""
        melopy_writer = wave.open(self.title + '.wav', 'w')
        melopy_writer.setparams((2, 2, 44100, 0, 'NONE', 'not compressed'))
        p = -1
        data_frames = []

        for i in range(len(self.data)):
            q = 100 * i / len(self.data)
            if p != q:
                sys.stdout.write((('='*int((float(i)/len(self.data)*50))+'>').ljust(50), 100 * i / len(self.data)) % "\r[%s] %d%%")
                sys.stdout.flush()
                p = q
            packed_val = struct.pack('h', int(self.data[i]))
            data_frames.append(packed_val)
            data_frames.append(packed_val)

        melopy_writer.writeframes(''.join(data_frames))

        sys.stdout.write("\r[%s] 100%%" % ('='*50))
        sys.stdout.flush()
        sys.stdout.write("\nDone\n")
        melopy_writer.close()
dataset/ETHPy150Open jdan/Melopy/melopy/melopy.py/Melopy.render/swapped operands of `%`