Sashane27
Sashane27

Reputation: 21

How to play musical notes in Python?

I wrote some code in Python which randomly picks numbers and converts them into music notes in a text file. But I want to know if there is a way to play the notes and music. If there is a package, are there tutorials or docs that I could look into?

Thanks in advance!

Upvotes: 2

Views: 1698

Answers (1)

Chris Wesseling
Chris Wesseling

Reputation: 6368

Making music is a pretty broad subject. I think the closest thing to what you ask for is midi. A pretty simple protocol where you can tell what note to play for how long. These questions should help you along with how to write midi files and then play them.

If you actually want to create the waves yourself and synthesise the sound this should help.

But the subject is broad and there's a long (non exhaustive) list of music software written in Python.

Upvotes: 1

Related Questions