Programming Old School Sound in Python

Once upon a time in the galaxy there were microcomputers that ran BASIC and had simple sound commands that made the machine sound and hiss in all sorts of strange and beautiful ways.

Besides making great sounds, it was also very useful as a learning tool because you could hear the results of your code.

I would like you to have the sound functionality of machines like BBC Micro with its envelope command, but without the need to use an emulator and learn or retrain all the quirks of the various BASIC dialects.

I would also like to avoid creating a midi or wav file, but would like to make sounds directly with the code. I tried winsound.Beep, but after about 4 notes, the time between notes seems random, and the functionality is nothing compared to something like the ZX spectrum.

Does anyone know how to do this with Python?

+6
source share
2 answers

I think the audioop package is the closest that you are going to get in python to what you had in the good old days. This is pretty low level, but this point. You can use this as building blocks to create your own library of retro sounds.

+1
source

I will write an Introduction to Python and NumPy , where you will learn how to create a sine and play it directly from Python.

This is not very bizarre, but you probably need to get started.

0
source

All Articles