#!/bin/sh # # This uses the mixSamples program to mix four PCM outputs # generated by other programs. # # # First, let's look at the 'mixSamples' parameters: # # -gain 8.0 # scales up the volume # -stereo # tells it to output stereo # -freq 44100 # tells it the incoming PCM is 44.1kHz # -length 240 # tells it to chop the song at 240 seconds # # it will use the default 5-second fadeout starting # # at the 235 second mark # # # Then, 'mixSamples' specifies all of the subcommands to string # together: # # ./swarm -lps 1024 -lines 0 \ # | ./fromStream -lps 512 -maxHz 2048.0 -gain 0.8 -float \ # -freq 44100 # # This takes a swarm, tells it that it is to generate 1024 lines of # stream output for every second of wasp/gnat movement, and it is to # generate those lines indefinitely. # The fromStream program takes 512 of those lines per second, # assigns frequencies to the columns, hushes it a bit, makes sure # it outputs floating point PCM at 44.1 kHz. # # # The next command is similar to the previous. But, the command after is: # # ./pgmToStream -file logan-beat.pgm -reps 0 \ # | ./fromStream -lps 256 -minHz 256.0 -maxHz 2048.0 -gain 0.2 \ # -float -freq 44100 # # This takes the image ``logan-beat.pgm'' and repeats it indefinitely. # The ``fromStream'' command then takes 256 of those lines per second, # maps them to frequencies, quiets it down a great deal, and outputs # floating point PCM samples at 44.1 kHz. # # The last command is about the same. It starts slightly offset in # the image and the ``fromStream'' sucks up lines twice as fast and # keeps things at really low frequencies, though. # # And, all of this is run into lame to encode it. # ./mixSamples -gain 8.0 -stereo -freq 44100 -length 240 \ -command './swarm -lps 1024 -lines 0 \ | ./fromStream -lps 512 -maxHz 2048.0 -gain 0.8 -float -freq 44100' \ -command './swarm -lps 4768 -lines 0 \ | ./fromStream -lps 512 -minHz 1024.0 -maxHz 2048.0 \ -wave triangle -gain 0.4 -float -freq 44100' \ -command './pgmToStream -file logan-beat.pgm -reps 0 \ | ./fromStream -lps 256 -minHz 256.0 -maxHz 2048.0 -gain 0.2 \ -float -freq 44100' \ -command './pgmToStream -file logan-beat.pgm -reps 0 -offset 56 \ | ./fromStream -lps 1024 -maxHz 512.0 -gain 0.6 -wave triangle \ -float -freq 44100' \ | lame -r -m j -s 44.1 \ --tt "Beat" \ --ta "nklein" \ --tl "swarm" \ --ty "2001" \ --tg "Ambient" - sw-beat.mp3