Playing a set of chords

When implementing this code:

for pitches, duration in harmony:

  •    accomp.play_chord(pitches, .7, duration, blocking = False)*
    

I get what seems to be all pitches played at once. Here’s an example of what the harmony variable could be:
[[[50, 48, 45], 2.5], [[54, 49, 53], 2.75], [[43, 48, 47], 5], [[62, 64, 58], 3.75], [[73, 70, 71], 4.5]]

Thanks.

The problem looks like the blocking=False. Only use that when you want things to be played at the same time! play_chord automatically superimposes the notes of the chord.

Thanks for the response, Marc.

I went ahead and took out the blocking = False bit.

One further question, how would I play the set of chords over a melody at the same time? So far I have:

for pitches, duration in harmony:
accomp.play_chord(pitches, 0.7, duration)

for pitch, duration in melody:
    piano.play_note(pitch, 0.7, duration)

This code executes the harmony first and then the melody.

Look into the fork command, either in this forum, or in my YouTube tutorials!