Alex Norman's working 240D projects

Pd WaveShaper

I created a very simple waveshaper in for Pure Data. It is based off the internal PD tabread~ object. You give the object a name of an array that you'd like to use for the wave-shaping function (you can also specify a new array to use by sending a "set arrayname" message to left input). This array is used to compute output samples based on the value of the input samples. The input is clipped to be in the range -1..1, then it is scaled and shifted to be in the range 0..(array length - 1). The input samples are used as the x value when indexing the array and the y value from the array is output (linear interpolation is used to get in between samples). If you have a strait line from x,y = (0,-1) to (array_len-1,1) in your array you'd get out the exact sample values that you put on the input. If you put some other values in the array (as shown in the picture) you will get a distorted output, which may or may not be pleasing to you.

the code is here pd-waveshape.tar.gz

Saw Synth and Score Sequencer

Earlier in the class I created a saw-tooth wave synthesizer with an ADSR envelope that reads note information from standard in. I also made a note sequencer that writes to standard out. If you "pipe" data from the note sequencer to the saw-synth then you can play melodies. The nice thing about this method is it is very simple to replace the saw-synth with some other synthesis program (if it reads from standard in and accepts notes given by the sequencer). to use it you can just do:
./seq-alex scorefile | ./saw-alex
I've included 1 score file in the code archive.
I also created a little perl script that reads your mouse position and outputs frequency and amplitude values. The X position of the mouse determines the amplitude and the Y position determined the frequency. This probably only works on Linux because it reads from /dev/psaux (you also have to have permissions set up to read from that). to use that you can just pipe the mousefreq.pl script to the saw-alex program like:
./mousefreq.pl | ./saw-alex

the code is here saw_and_seq.tar.gz