Exemplo n.º 1
0
def test_simple_minor_chord_build():
    c = Chord.build_chord(Note.from_note_string('C4'), 'I', 'minor')
    expected = [
        Note.from_note_string('C4'),
        Note.from_note_string('E4b'),
        Note.from_note_string('G4')
    ]

    assert c.notes == expected
Exemplo n.º 2
0
def test_over_octave_chord_build():
    c = Chord.build_chord(Note.from_note_string('G4'), 'II', 'minor')
    expected = [
        Note.from_note_string('A4'),
        Note.from_note_string('C5'),
        Note.from_note_string('E5b')
    ]

    assert c.notes == expected
Exemplo n.º 3
0
def test_simple_major_chord_build_non_tonic():
    c = Chord.build_chord(Note.from_note_string('C4'), 'V', 'major')
    expected = [
        Note.from_note_string('G4'),
        Note.from_note_string('B4'),
        Note.from_note_string('D5')
    ]

    assert c.notes == expected
Exemplo n.º 4
0
def test_multi_note_add_under():
    c = Chord(Note.from_note_string('D4'))
    c.add_note(Note.from_note_string('C4'))
    c.add_note(Note.from_note_string('B3'))
    notes = [
        Note.from_note_string('B3'),
        Note.from_note_string('C4'),
        Note.from_note_string('D4')
    ]
    assert c.notes == notes
Exemplo n.º 5
0
def test_simple_note_add_middle():
    c = Chord(Note.from_note_string('C4'))
    c.add_note(Note.from_note_string('E4'))
    c.add_note(Note.from_note_string('D4'))
    notes = [
        Note.from_note_string('C4'),
        Note.from_note_string('D4'),
        Note.from_note_string('E4')
    ]
    assert c.notes == notes
Exemplo n.º 6
0
def test_double_note_add():
    c = Chord(Note.from_note_string('C4'))
    c.add_note(Note.from_note_string('E4'))
    c.add_note(Note.from_note_string('B4'))
    notes = [
        Note.from_note_string('C4'),
        Note.from_note_string('E4'),
        Note.from_note_string('B4')
    ]
    assert c.notes == notes
Exemplo n.º 7
0
def test_midi_10_sharp():
    n = Note.from_note_string('A-1#')
    mid = n.midi_note_number()
    assert mid == 10
Exemplo n.º 8
0
def test_midi_127_double_sharp():
    n = Note.from_note_string('F9##')
    mid = n.midi_note_number()
    assert mid == 127
Exemplo n.º 9
0
def test_midi_127():
    n = Note.from_note_string('G9')
    mid = n.midi_note_number()
    assert mid == 127
Exemplo n.º 10
0
def test_midi_22_flat():
    n = Note.from_note_string('B0b')
    mid = n.midi_note_number()
    assert mid == 22
Exemplo n.º 11
0
def test_midi_16():
    n = Note.from_note_string('E0')
    mid = n.midi_note_number()
    assert mid == 16
Exemplo n.º 12
0
def test_midi_num_83():
    n1 = Note.from_midi_num(83)
    n2 = Note.from_note_string('B5')
    assert n1 == n2
Exemplo n.º 13
0
def test_midi_num_73():
    n1 = Note.from_midi_num(73)
    n2 = Note.from_note_string('C5#')
    assert n1 == n2
Exemplo n.º 14
0
def test_midi_num_72():
    n1 = Note.from_midi_num(72)
    n2 = Note.from_note_string('C5')
    assert n1 == n2
Exemplo n.º 15
0
def test_midi_num_71():
    n1 = Note.from_midi_num(71)
    n2 = Note.from_note_string('B4')
    assert n1 == n2
Exemplo n.º 16
0
def test_midi_num_81():
    n1 = Note.from_midi_num(81)
    n2 = Note.from_note_string('A5')
    assert n1 == n2
Exemplo n.º 17
0
def test_midi_num_82():
    n1 = Note.from_midi_num(82)
    n2 = Note.from_note_string('A5#')
    assert n1 == n2
Exemplo n.º 18
0
def test_midi_num_74():
    n1 = Note.from_midi_num(74)
    n2 = Note.from_note_string('D5')
    assert n1 == n2
Exemplo n.º 19
0
def test_midi_11():
    n = Note.from_note_string('B-1')
    mid = n.midi_note_number()
    assert mid == 11
Exemplo n.º 20
0
def test_midi_num_75():
    n1 = Note.from_midi_num(75)
    n2 = Note.from_note_string('D5#')
    assert n1 == n2
Exemplo n.º 21
0
def test_midi_22_sharp():
    n = Note.from_note_string('A0#')
    mid = n.midi_note_number()
    assert mid == 22
Exemplo n.º 22
0
def test_midi_num_76():
    n1 = Note.from_midi_num(76)
    n2 = Note.from_note_string('E5')
    assert n1 == n2
Exemplo n.º 23
0
def test_midi_23():
    n = Note.from_note_string('B0')
    mid = n.midi_note_number()
    assert mid == 23
Exemplo n.º 24
0
def test_midi_num_77():
    n1 = Note.from_midi_num(77)
    n2 = Note.from_note_string('F5')
    assert n1 == n2
Exemplo n.º 25
0
def test_midi_127_flat():
    n = Note.from_note_string('A9bb')
    mid = n.midi_note_number()
    assert mid == 127
Exemplo n.º 26
0
def test_midi_num_78():
    n1 = Note.from_midi_num(78)
    n2 = Note.from_note_string('F5#')
    assert n1 == n2
Exemplo n.º 27
0
def test_midi_9():
    n = Note.from_note_string('A-1')
    mid = n.midi_note_number()
    assert mid == 9
Exemplo n.º 28
0
def test_midi_num_79():
    n1 = Note.from_midi_num(79)
    n2 = Note.from_note_string('G5')
    assert n1 == n2
Exemplo n.º 29
0
def test_midi_10_flat():
    n = Note.from_note_string('B-1b')
    mid = n.midi_note_number()
    assert mid == 10
Exemplo n.º 30
0
def test_midi_num_80():
    n1 = Note.from_midi_num(80)
    n2 = Note.from_note_string('G5#')
    assert n1 == n2