We can use Python or another language to create any audio. However, it does not provide the interactive experience, such as making changes and listening to the result. This is where a DAW (Digital Audio Workstation) like LMMS is helpful. It is free and open-source.
It is best to use Python to create repetitive parts and for analysis.
Most of what Python will be used here is to extract features, so they may be used to create new samples, etc.
It is assumed that you have installed and setup LMMS. Here we will create a very simple audio.
When LMMS is opened, the default tempo is 140 and there is a Kicker instrument on Beats and Bass Editor. Click on two locations in the pattern so it looks like this:
We added two instances of the audio sample at positions 9 and 13. Also, position 1 in Song Editor has been switched. Next, we can use the File menu to export the file as a wav file.
The file is opened in Audacity, which is also free and open-source. We can see two replicas of the sample at two positions that were created in the Beats and Bass Editor. Also we note the frequency of the sample is changing from high to low (within a small range). Even though the amplitude is 1, the effective volume is low because of our inability to detect low-frequencies (fletcher-munson equal loudness curves).