here's a simple markovian sample munger written in python2.5.1. should be compatible with 2.6. all bets are off for 3.0.
analyzes wave files. don't be a joker and run mp3's through it unless you're willing to accept the consequences.
it takes a really long time to generate transition tables for each sample. this is mostly because i'm new to python and my programs are not optimized. eventually i'd like to have some flag that lets you save transition tables based on samples so you can generate new soundfiles from old transition tables without having to re-analyze the soundfile. on any reasonable machine hovering around 2 ghz, a one second sample takes a few seconds (<30) to analyze. generating the soundfile may take a few seconds depending on how long a file you asked for. run the script without params to get its usage. usage is also covered in the comment block at the top of the script.
usage (assuming python aliases python2.5 / 2.6):
python markovSamp.py <path-to-infile (unix-legal paths only)> <depth (samples per unit)> <length (number of units in output file> <path-to-outfile (will write to new file if filename doesn't exist at path)>
ps- I used this script to generate the following stereo signal from one of the Unwashed guys' dark psy kicks.Â They called it 'the monster', hence the name.