How can I make a play two musical notes simultaneously in Python?

572 Views Asked by At

I plan to do a music notation which allow the user to place the note where ever they want and allowed them to play the notes they placed.

If the user put the note in the same time which we have to play 2 or above notes together, any solution to solve that problem?

3

There are 3 best solutions below

1
PatNowak On

Answer is really simple and straightforward in theory - use threads. Your code has to be executed asynchronously.

1
L_Pav On

Use multiprocess and winsound module to do so.

1
Meysam On
import threading
....
....
....
threading.Thread(name='<thread_name>', target='<your_target>').start()

you can do it 2 times for 2 different targets