示例#1
0
def prime_form(notes):
    set_zero = transposition_startswith(normal_form(notes), 0)
    set_inv = transposition_startswith(normal_form(inversion(set_zero)), 0)
    if interval_tie(set_zero) <= interval_tie(set_inv):
        return set_zero
    else:
        return set_inv
示例#2
0
文件: pcset.py 项目: Jbaud/pyknon
def prime_form(notes):
    set_zero = transposition_startswith(normal_form(notes), 0)
    set_inv = transposition_startswith(normal_form(inversion(set_zero)), 0)
    if interval_tie(set_zero) <= interval_tie(set_inv):
        return set_zero
    else:
        return set_inv
示例#3
0
def matrix(row):
    return [
        transposition_startswith(row, n) for n in inversion_first_note(row)
    ]
示例#4
0
文件: pcset.py 项目: Jbaud/pyknon
def matrix(row):
    return [transposition_startswith(row, n) for n in inversion_first_note(row)]
示例#5
0
 def test_transposition_startswith(self):
     n1 = [3, 7, 11, 10]
     n2 = [4, 8, 0, 11]
     self.assertEqual(music.transposition_startswith(n1, 4), n2)
示例#6
0
#!/usr/bin/env python

from pyknon.simplemusic import inversion_startswith, transposition_startswith, retrograde, transposition
from pyknon.music import Note, NoteSeq
from pyknon.genmidi import Midi

motif = [0, 1, 7, 3]
a = inversion_startswith(motif, 11)
b = transposition_startswith(motif, 5)
c = retrograde(transposition_startswith(motif, 1))
notes = motif + a + b + c

note_list = NoteSeq([Note(x, dur=0.125) for x in notes])
midi = Midi(tempo=120)
midi.seq_notes(note_list)
midi.write("midi/simple-combination1.mid")
 def test_transposition_startswith(self):
     n1 = [3, 7, 11, 10]
     n2 = [4, 8, 0, 11]
     self.assertEqual(music.transposition_startswith(n1, 4), n2)