Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. def convert(note, modifier):
  2.     notes = ["do","do#","re","re#","mi","fa","fa#","sol","sol#","la","la#","si"]
  3.     bonuslist = ["-","m","+","2","4","5","6","7"]
  4.     mybonus = ""
  5.     if(note[-1] in bonuslist):
  6.         mybonus = note[-1]
  7.     nofiteraction = int(modifier*2)
  8.     index = notes.index(note)
  9.     maxindex = len(notes) -1
  10.  
  11.     while(nofiteraction != 0):
  12.         if index == maxindex:
  13.             index = 0
  14.         else:
  15.             index +=1
  16.         nofiteraction -=1
  17.  
  18.     return notes[index] + mybonus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement