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