This tutorial walks you through generating a sine wave in Python, using libraries like wave and struct, and exporting it as a .wav file. Ideal for those interested in audio processing or sound design.
3d
Code
Media
Python
I Stole My Friend’s FaceIntro I extracted my mate’s (approximately 60×60 pixel) face from a Facebook picture, and overlaid it onto a depth-map for a similarly shaped face, then used a custom python script to create a 3d wavefront model of his face, and an accompanying .mtl file for the texture. I will create a post soon properly dissecting […]
Code
Python
Python Packing Streams of Arbitrary LengthWhen starting out with IO and learning to efficiently read and write binary structures to and from Python most people will confront the problem of packing a string or list into a structure. Variations of this question plague Stack Overflow, here are two quick examples:https://stackoverflow.com/questions/3753589/packing-and-unpacking-variable-length-array-string-using-the-struct-module-in-py, https://stackoverflow.com/questions/34117620/how-to-unpack-variable-length-data-in-python-struct I have a rather simple solution I decided to […]
Animations
Code
Math
Media
Python
Julia Blend (Animated Julia Sets)Draw Julia set animations by simply defining a 2d line though the complex plane. A Julia set is simply a recursive function or iterative process that takes the form z=z^2+cwhere the initial value of z is a complex number representing a point in 2d space, and c is any complex.The z argument is updated until […]
Animations
Code
Graphics
Media
Physics
Python
Drawing With GravitySimulation is a great way to learn new concepts. Whenever I’m confronted with some scary physics equation I can’t follow I usually try to find the equivalent concept in a syntax I know. In the following post I will covering a few loose simulations of Newtonian inspired gravity.It’s not true Newtonian gravity as I was […]
Audio
Audio Compression
Code
Python
Extrema Compression (Part 2)Part 2 is on decompression, start with Part 1 Extrema Compression (Part 1)Decompression:Luckily for us the decompression phase is much simpler than the compression phase. It would have been simpler regardless but We create a new wave file for the output, we simply need to have a while loop read through the file five bytes […]
3d
Code
Game Design
Media
Python
Python Model Sword MakerMake a variety of sword, knives, hammer/axes, polearms, and much more with only a few lines code. The code is split into 3 libraries:Mesh.py: Tools for processing triangle meshes. The triangle mesh is a list of triangles composed of 3 vertices, each with a corresponding colour (RGB from 0 to 1). Currently the library only […]
Code
Python
Human Readable Spectrum FilesXML based spectrum files and a Python class for reading, writing, and modifying them. I was hoping to put together a Javascript tool for visualising the Red-shift of different celestial phenomena over different distances.Sadly it didn’t take long to learn the dominant file format for spectra (.SPC) is binary encoded and pretty complex; as a […]
Audio
Audio Compression
Code
Media
Python
Extrema Compression (Part 1)ExtremaCompression is a low-loss compression method for audio.
Unlike MP3, OGG and other common standards the results still vary widely proptional to frequency.
Higher frequency oscillations will be encoded with minimal loss, but also minimal compression, while low frequencies will compress very small but the quality may deviate from the original product.
Audio
Code
Old Projects
Python
.Au Audio files with pythonThe Sun Microsystems .au not the ones from Audacity. I believe it’s a great place to start learning about structs, how to pack/unpack, and how to work with file headers.
0