You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
758 B

  1. from load_asset import load
  2. scales = load('scales')
  3. note_names = load('notes')
  4. ##def create(scale_type,root):
  5. ##
  6. import convert
  7. class scale:
  8. def __init__(self,*notes):
  9. self.notes = scale.number(notes)
  10. self.raw_intv = self.ri()
  11. self.root = self.notes[0]
  12. #takes notes from notes to numbers
  13. def number(notes):
  14. print('ran')
  15. return list(map(convert.above_c,notes))
  16. #finds raw intervals
  17. def ri(self):
  18. notes = self.notes
  19. return list(map(lambda x: x-notes[0],notes[1:]))
  20. #returns new scale with given root
  21. def tanspose(self,n):
  22. if type(n) != int:
  23. n = above_c(n)
  24. return scale(*list(map(lambda x: x+n,self.raw_intv)))
  25. #todo fingers method