def test_create_t_voice_direction( major_scale, c_major_chord, direction, intended_result ): result = tintinnabuli.create_t_voice( major_scale, c_major_chord, direction=direction ) assert list(result.flat.notes) == list(intended_result.flat.notes)
right_hand = stream.Part() left_hand = stream.Part() left_hand.clef = clef.TrebleClef() # Main Loop to build the nine sections for section_index in range(8): # Right hand # ----------------------------------------------------------------------------------------- # Create the m-voice m_voice = transformations.scalar_transposition(core_melody, section_index * -2, reference_scale) # Create the t-voice t_voice = tintinnabuli.create_t_voice( m_voice, t_chord, position=2, direction=tintinnabuli.Direction.DOWN) # Merge and append right hand streams tools.append_stream(right_hand, tools.merge_streams(m_voice, t_voice).chordify()) # Append right hand interlude tools.append_stream(right_hand, _right_hand_interlude()) if section_index < 6: right_hand.append( clef.TrebleClef()) # Add treble clef except for last section # Left hand # ---------------------------------------------------------------------------------------------- # Create the second m-voice m_voice2 = transformations.scalar_transposition(m_voice, -9,
def test_create_t_voice_tmode(major_scale, t_mode, intended_result): result = tintinnabuli.create_t_voice(major_scale, ("C#", "E", "A"), t_mode=t_mode) assert list(result.flat.notes) == list(intended_result.flat.notes)
def test_create_t_voice_pitch_list_numeric(major_scale): result = tintinnabuli.create_t_voice(major_scale, (0, 2, 9)) intended_result = converter.parse("tinyNotation: D A A A A c c d") assert list(result.flat.notes) == list(intended_result.flat.notes)
def test_create_t_voice(major_scale, c_major_chord): result = tintinnabuli.create_t_voice(major_scale, c_major_chord) intended_result = converter.parse("tinyNotation: E E G G c c c e") assert list(result.flat.notes) == list(intended_result.flat.notes)