コード例 #1
0
ファイル: Chord.py プロジェクト: JoshuaSeth/Harmonity
    def CreateTriadFromToneAndScale(self, tone, scale):
        self.baseTone = tone
        self.tones.append(tone)

        indexOfSecond = u.ClipToLength(u, scale.tones.index(self.baseTone) + 2, scale.tones.__len__())
        self.tones.append(scale.tones[indexOfSecond])

        indexOfThird = u.ClipToLength(u, scale.tones.index(self.baseTone) + 4, scale.tones.__len__())
        self.tones.append(scale.tones[indexOfThird])

        chordConfig1 = t.toneMap.index(self.tones[1].name) - t.toneMap.index(self.tones[0].name)
        if chordConfig1 < 0:
            chordConfig1 = t.toneMap.__len__()+chordConfig1

        chordConfig2 = t.toneMap.index(self.tones[2].name) - t.toneMap.index(self.tones[0].name)
        if chordConfig2 < 0:
            chordConfig2 = t.toneMap.__len__()+chordConfig2
        self.configuration = [chordConfig1, chordConfig2]
コード例 #2
0
 def GetToneAbove(self, steps):
     tone = Tone()
     nr = self.nrInToneMap + steps
     nr = u.ClipToLength(u, nr, toneMap.__len__())
     tone.CreateFromNumberInTonemap(nr)
     return tone