Home

Audio Programming

Pitch Shift


Here's some C++ code I've written to practice audio processing. The surrounding system uses XAudio2 for playback.

In the code above, an interpolated sample is added in-between each pair of samples resulting in the pitch being lowered by one octave when the audio is played back at the same sample rate. You can hear the difference below.

Delay


In this example, samples at an offset managed by the delay line are added together to create a delay effect.

Here is the processed version.

Atari 2600 Emulation


For Oil Strike '75, a game we developed in the Sumo Digital Academy, I worked with an emulation of an Atari 2600 sound chip. I created the sound effects for the game as well as a system which interfaced with the sound chip emulation in order to play back presets which consisted of arrays of commands for the chip emulation.

Here is the UI I designed to help me note values to input into the arrays when programming sound effects. The three numbers refer to the three commands you can send to the TIA chip, which are volume, waveform, and divider.

The original chip had only one volume setting, but we decided to add variable volume values to add a bit more dynamic contrast in the sound effects and music.

And here's a short victory stinger programmed using the music sequencing system I created.

It's very slow to write music with this system as it's made up of arrays of chip commands like the sound effects, but there's the additional concept of patterns which can be overlaid and arranged into a track.

Because of the way the oscillator is pitched using dividers, notes are not tuned in equal temperament. This means that only certain keys will sound roughly in tune.