def METHOD_NAME(self):
    testFile = open(sys.argv[1],"r")
    inputEvents = testFile.readlines()
    testFile.close()
    random.seed()
    beatDiv = self.beatEdit.itemData(self.beatEdit.currentIndex())
    minSize=0 # fill in when we get the beat size value
    outputEvents=[]
    quantLen=0
    #get beat length to calculate minimum length of event
    for line in inputEvents:
        if line.startswith('BEATLEN'):
          tag,tick = line.split(' ')
          beatLen=int(tick)
          quantLen=int(tick)/beatDiv*4
          print ("quantLen=%d beatDiv=%d"%(quantLen, beatDiv))
        print (line.strip())
    #loop through events and quantize to the given beat
    eventList=[]
    for line in inputEvents:
        if line.startswith('NOTE'):
          tag,tick,pitch,length,velocity = line.split(' ')
          # over quantize
          lowerBound=(int(tick)/quantLen)*quantLen
          upperBound=lowerBound+quantLen
          lowDiff=int(tick)-lowerBound
          highDiff=upperBound - int(tick)
          if( lowDiff < highDiff):
            newTick=lowerBound
          else:
            newTick=upperBound
          # apply swing factor to every other 8 beat
          print ("float =%f int = %d"%((float(newTick+beatLen)) / beatLen/2,((newTick+beatLen))/beatLen/2))
          if  ((float(newTick+beatLen)) / beatLen/2 - ((newTick+beatLen))/beatLen/2) < 0.1:
              print ("adding swing to:",newTick)
              newTick=int(random.gauss(newTick,int(self.spreadEdit.text())))
              if (newTick < 0):
                newTick=0
          newLine="NOTE "+ str(newTick)+" " + pitch  + " "+ length + " " + velocity
          print ("newLine:",newLine.strip())
          outputEvents.append(newLine)
        else:
          outputEvents.append(line)
    testFile = open(sys.argv[1],"w")
    testFile.writelines(outputEvents)
    testFile.close()
    quit()