我想知道定义自定义比例的正确方法是引入“比例”类的属性吗?
我是否应该将我的课程包含在“music21/scale/ init .py”中
class myAbastract(AbstractScale):
'''
A pseudo my-scale.
'''
def __init__(self):
super().__init__()
self.type = 'Abstract My Name'
self.octaveDuplicating = True
self.dominantDegree: int = -1
self.buildNetwork()
当我在 main.py 中定义 myScale 时,它似乎没有继承“deriveAll()”方法/函数。
pitchListStrs = 'a b` c d e f g a'.split()
pitchList = [pitch.Pitch(p) for p in pitchListStrs]
myScaleA = scale.ConcreteScale(pitches=pitchList)
[str(p) for p in myScaleA.getPitches('E-5', 'G-7')]
myScale = myScaleA.abstract
mySol =scale.ConcreteScale()
mySol.tonic = pitch.Pitch('D')
但是,没有定义deriveAll:
myScale.deriveAll(['E5', 'F5', 'G5', 'A5', 'B`5', 'C6', 'D6', 'E6'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'AbstractScale' object has no attribute 'deriveAll'
任何帮助将不胜感激。