ABBA icon indicating copy to clipboard operation
ABBA copied to clipboard

Quantize function does not work as stated in the paper

Open clementw168 opened this issue 1 year ago • 0 comments

Hello, I am reimplementing all of the code and I just found that the quantize function does not work as it is supposed to be according to the paper.

def quantize(self, pieces):
       if len(pieces) == 1:
           pieces[0,0] = round(pieces[0,0])
       else:
           for p in range(len(pieces)-1):
               corr = round(pieces[p,0]) - pieces[p,0]
               pieces[p,0] = round(pieces[p,0] + corr)
               pieces[p+1,0] = pieces[p+1,0] - corr
               if pieces[p,0] == 0:
                   pieces[p,0] = 1
                   pieces[p+1,0] -= 1
           pieces[-1,0] = round(pieces[-1,0])
       return pieces

The paper states that $len_1$ should become $\text{round}(len_1)$ which is not the case here.

clementw168 avatar Dec 03 '23 10:12 clementw168