Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #7
0
def test_midi_10_sharp():
    n = Note.from_note_string('A-1#')
    mid = n.midi_note_number()
    assert mid == 10
Exemple #8
0
def test_midi_127_double_sharp():
    n = Note.from_note_string('F9##')
    mid = n.midi_note_number()
    assert mid == 127
Exemple #9
0
def test_midi_127():
    n = Note.from_note_string('G9')
    mid = n.midi_note_number()
    assert mid == 127
Exemple #10
0
def test_midi_22_flat():
    n = Note.from_note_string('B0b')
    mid = n.midi_note_number()
    assert mid == 22
Exemple #11
0
def test_midi_16():
    n = Note.from_note_string('E0')
    mid = n.midi_note_number()
    assert mid == 16
Exemple #12
0
def test_midi_num_83():
    n1 = Note.from_midi_num(83)
    n2 = Note.from_note_string('B5')
    assert n1 == n2
Exemple #13
0
def test_midi_num_73():
    n1 = Note.from_midi_num(73)
    n2 = Note.from_note_string('C5#')
    assert n1 == n2
Exemple #14
0
def test_midi_num_72():
    n1 = Note.from_midi_num(72)
    n2 = Note.from_note_string('C5')
    assert n1 == n2
Exemple #15
0
def test_midi_num_71():
    n1 = Note.from_midi_num(71)
    n2 = Note.from_note_string('B4')
    assert n1 == n2
Exemple #16
0
def test_midi_num_81():
    n1 = Note.from_midi_num(81)
    n2 = Note.from_note_string('A5')
    assert n1 == n2
Exemple #17
0
def test_midi_num_82():
    n1 = Note.from_midi_num(82)
    n2 = Note.from_note_string('A5#')
    assert n1 == n2
Exemple #18
0
def test_midi_num_74():
    n1 = Note.from_midi_num(74)
    n2 = Note.from_note_string('D5')
    assert n1 == n2
Exemple #19
0
def test_midi_11():
    n = Note.from_note_string('B-1')
    mid = n.midi_note_number()
    assert mid == 11
Exemple #20
0
def test_midi_num_75():
    n1 = Note.from_midi_num(75)
    n2 = Note.from_note_string('D5#')
    assert n1 == n2
Exemple #21
0
def test_midi_22_sharp():
    n = Note.from_note_string('A0#')
    mid = n.midi_note_number()
    assert mid == 22
Exemple #22
0
def test_midi_num_76():
    n1 = Note.from_midi_num(76)
    n2 = Note.from_note_string('E5')
    assert n1 == n2
Exemple #23
0
def test_midi_23():
    n = Note.from_note_string('B0')
    mid = n.midi_note_number()
    assert mid == 23
Exemple #24
0
def test_midi_num_77():
    n1 = Note.from_midi_num(77)
    n2 = Note.from_note_string('F5')
    assert n1 == n2
Exemple #25
0
def test_midi_127_flat():
    n = Note.from_note_string('A9bb')
    mid = n.midi_note_number()
    assert mid == 127
Exemple #26
0
def test_midi_num_78():
    n1 = Note.from_midi_num(78)
    n2 = Note.from_note_string('F5#')
    assert n1 == n2
Exemple #27
0
def test_midi_9():
    n = Note.from_note_string('A-1')
    mid = n.midi_note_number()
    assert mid == 9
Exemple #28
0
def test_midi_num_79():
    n1 = Note.from_midi_num(79)
    n2 = Note.from_note_string('G5')
    assert n1 == n2
Exemple #29
0
def test_midi_10_flat():
    n = Note.from_note_string('B-1b')
    mid = n.midi_note_number()
    assert mid == 10
Exemple #30
0
def test_midi_num_80():
    n1 = Note.from_midi_num(80)
    n2 = Note.from_note_string('G5#')
    assert n1 == n2