[See also: My (big) project on Chiptune synthesis. Please email me for the accompanying Cycling '74 MaxMSP chiptune synthesiser patches]
Here is a pure data patch that will allow you to generate "chiptune" sounds relatively easily using pd.
Download here: chipwave.pd
you will also need adsr.pd
It is based on a system of CONTROL TABLES.
One control table is responsible for selecting a waveform for each of the 4 channels of sound by reading a value from a table every 25 miliseconds.
The pitch of the waveform can be altered by reading values from a table too.
This method is like a mini-sequencer, one that gets triggered every time a MIDI note is played.
This behaviour is almost identical to the idea of "instruments" in "tracker" software.
A very complex sequence of sound texture changes can be programmed very easily, to create sounds similar to Nintendo Gameboy, NES, Commodore C64 and Atari.
Using these mini sequences, or instruments, you can create waveforms that look like this, and sound like this. [mp3 example here]
- All waveforms have MIDI controlled pitch, they are not velocity sensitive.
- The amplitude envelopes for each channel are ADSR type, and can be edited on a per-channel basis.
- The square waveform has an adjustable pulse width using the MOD WHEEL MIDI CONTROLLER.
- The noise is a sample-and-hold variety, with a variable sample rate, to generate apparent rising and falling of noise "pitch".
- * Extend the patch to allow "program changes" that will change instrument sequences
*** Please note that the default patch has the ADSR envelope modified to make notes on Channel 1 have lower amplitudes than the other channels. ***