コード例 #1
0
ファイル: setbase.py プロジェクト: calebsmith/Sator
 def fromint(integer, modulus=12):
     """
     Static method that returns a PCSet object with pc's generated from
     their integer representation.
         Ex:
             0 = [], 1 = [0], 2 = [1], 3 = [0, 1], 4 = [2], 5 = [0, 2]
             PCSet.fromint(5) returns PCSet([0, 2])
     """
     from sator.pcset import PCSet
     new_set = PCSet(mod=modulus)
     new_set.pitches = utils.fromint(integer)
     return new_set
コード例 #2
0
ファイル: setbase.py プロジェクト: calebsmith/Sator
 def forte_name(fname):
     """
     A static method that returns a PCSet object with the fort-name provided
     as a string argument.
     Returns an empty PCSet if the argument is not a string with a valid
     Forte name.
     """
     from sator.pcset import PCSet
     fset = utils.from_forte(fname)
     new_set = PCSet()
     if fset:
         new_set.pitches = fset
     return new_set