Experiments with audio and audio synthesis using python3
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
harrysentonbury cff1d94ae7 added save wav func to QDSynth 1 month ago
audio note from qt-dead 8 months ago
.gitignore ignore pychache 2 years ago
LICENSE all new 2 years ago
README.md added save wav func to QDSynth 1 month ago
breather.py GPL v3.0 notice on individual files 2 years ago
brown.py GPL v3.0 notice on individual files 2 years ago
december_wave.py copy notice thingy 2 years ago
delay_phlaze_rand_thing.py improved random 7 months ago
envelope_grabber.py fetlin 2 years ago
fractaling.py added picture size arg 1 year ago
heart.py license thing etc 1 year ago
j4.py GPL v3.0 notice on individual files 2 years ago
loopy_code_woteva.py run in terminal reminder 9 months ago
oscillogram.py how to 2 1 year ago
phlazinger.py unchanged accidental changes 1 year ago
quarter_dead_synth.py added save wav func to QDSynth 1 month ago
random_audio_slices.py deleted mysterious keyword arg 1 year ago
shaped_filtered_square.py GPL v3.0 notice on individual files 2 years ago
shark_fin_wave.py GPL v3.0 notice on individual files 2 years ago
simmer_bass.py more funnctionality 1 year ago
sound2newspaper.py fixed wrong date 1 year ago
sound2vid_effects.py horrizontal waves 4 months ago
stretchinger.py update docstring 11 months ago
tadpoles.py new 1 year ago
thingy_iter.py added echo 9 months ago
thyaudio.py fettling 4 months ago
view_shit.py new sound2vid 7 months ago
wave_folding.py GPL v3.0 notice on individual files 2 years ago

README.md

Experimentations

Experiments with audio and audio synthesis using python3

pip3 install numpy scipy simpleaudio sounddevice matplotlib

To load mp3 files into a numpy arrays:

pip3 install audio2numpy

audio2numpy requires ffmpeg

sudo apt install ffmpeg

breather

Sounds like creepy breathing.

brown

output sound A or sound B depending on the amplitude of the input sound file. (sound A being from the input file in this case, sound B is some audio FM)

december_wave

Some code that returns a piece of music.

envelope_grabber

Returns the envelope or the inverted envelope of a sound file (0 to 1.0). This can be used to multiply another sound with amongst other things. This code is an example of shaping some added together triangle waves. Stereo or mono input. Outputs mono.

fractaling

Generate Mandelbrot Set fractals. It is not audio stuff but i will just keep it here for now. Can run in the terminal.

python3 fractaling.py

Example command with times 5 magnification (zoom) and -1.5 x offset and 0.0 y offset and also save a png image:-

python3 fractaling.py -m 5 -x -1.5 0.0 -o mandelbrot.png

Further investigation Here. The idea is to open it in a text editor and experiment with operations on the RGB to get differend colouring. np.uint8(whatever operation to index) on lines 55, 56 and 57.

heart

It originally made heart beat sounds but then it evolved. It now makes all sorts of beats and noises.

j4

Weird noise. Involves changing speed of a filtered, frequency modulated but phase shifted by an integer value radians incremented as a function of x sine wave.

loopy_code_woteva

That crap from diode.zone. You will need to provide some input for the code to mess with, it will appear in the left channel. Run: just say or sing stuff or woteva into you default mic:-

python3 loopy_code_woteva.py

Or use a sound file:-

python3 loopy_code_woteva.py -i [path/to/file.wav or mp3]

Change the default bars per minute:-

python3 loopy_code_woteva.py -b [integer, bars per minute. default=43]

oscillogram

View what small sound files look like. Mono, stereo, print number of samples, sample rate and duration. wav or mp3.

To zoom Click on the magnifier icon then click and drag a rectangle around the section to zoom into, then use the arrow keys to toggle between views. Click on the move icon and pan with left click and drag, increase amplitude with right click and drag. The window is also resizable.

Prerequisits

pip3 install numpy matplotlib scipy audio2numpy

Run

python3 oscillogram.py /path/to/file.wav

phlazinger

A phaser or flanger or whatever. sin or sweep control or custom signal of the same length numpy array as the input sound. ie:- an envelope from envelope_grabber. Iterate effect over sound n times and delay on each iteration by n samples.

quarter dead synth

An earlier incarnation of cutie-dead-synth using tkinter instead of PyQt. I called it 1/4 dead because that was the first tune that popped out of my fingers after I tapped a key and heard the first note. It uses the simpleaudio package. I added a button to create a directory full of wav files of each note. Type the required sample rate as an arg when running. Defualts to 48000 Hz with no arg.

Prerequisites for simpleaudio

sudo pip3 install --upgrade pip setuptools
sudo apt-get install -y python3-dev libasound2-dev

dependences

pip3 install numpy scipy
pip3 install simpleaudio

sudo apt-get install python-tk

random_audio_slices

Chops up a numpy array full of audio data then sticks it back together in a random order.

shaped_filtered_square

Added together square waves, high pass filtered then shaped into a rhythm.

simmer_bass

Iterating filters on shark fin waves in envelopes. Used in a music video:- diode.zone-simmer()

sound2video_effects

Something i have started experimenting with. I will leave it here so i don't forget. I use the program called view_shit.py to see the audio file values.

stretchinger

It stretches and stretches and stretches... Or squishes sound. Outputs stereo.

shark_fin_wave

A wave that looks like a shark fin. When detuned, it evolves into a shark shape. Excuse: I was bored!.

thyaudio

All the classes from these experiments in one place. Depends on numpy.

wave_folding

Folds any wave or sound file you can fit into a numpy array. This includes .wav files etc. Folds whatever half of the wave you like, as many times you like.


Some of this stuff was used and can be heard in some videos on my diode zone channel. It is just low quality messing around and stuff.