SamRate v1.5 ================== by GLYPH, 1997 What is it? =========== SamRate is a spunky little CLI program that lets you change the frequency of an 8SVX sample, saving it as a new sample. It uses splinear interpolation to reduce aliasing, so it sounds very nice! No more buzzy low notes, and no more wishing your music program had higher octaves! pros: + changes frequency and / or volume + has compressor mode to reduce clipping when increasing volume + has filter mode to reduce distortion when raising pitch + adjusts the LOOP information correctly + handles any size sample + reads 8SVX and RAW, writes 8SVX + handles both the just intonation scale and the equal-tempered scale. + Catmull-Rom splinear interpolation is cool + uses happy 8SVX format, which is usable by many happy Amiga music programs cons: - only handles one file at a time with no wildcard support - it's still not quite as fast as I'd like it to be Changes Since v1.0 ================== + adds 1 byte to odd-length samples instead of subtracting 1. (8SVXs must have even lengths) + added FILTER command and COMPRESSOR command. - FREQUENCY is no longer a synonym for RATE, since I want to reserve F for the FILTER command. + added RAW sample reading if 8SVX header is not found. + optimized the resampling routine a little, 10% speed gain. + checks if SourceName = DestName and stops if it is. + optionally retains non-essential iff chunks, like ANNO. Usage ===== From a Shell, type: SamRate src dest [commands1] [commands2] ... "src" is the name of the original sample "dest" is the name you want the new sample saved under Here's the commands: -------------------- N / NOTE / P / PITCH oldnote newnote Transposes the sample from "oldnote" to "newnote". Acceptable notes are C,C#,D,D#,E,F,F#,G,G#,A,A#,B. It also accepts H as B. To specify an octave, put the octave number immediately after the note. i.e. C1 or G#2. Accepted octaves are 1-4. J / JUST Tells SamRate you want to use the just intonation scale. Otherwise, it will use the equal-tempered scale, since it's what most music programs use. R / RATE oldrate newrate like NOTE command, but uses frequencies instead of note names. It adjusts the sample by a ratio of newrate:oldrate. V / VOL / VOLUME oldvolume newvolume Increases the volume of the sample by a ratio of newvolume:oldvolume. C / COMP / COMPRESS Samrate has to Limit the audio from -127.5 to 127.5 in order to fit it into 8 bits. This can cause clipping when the volume is increased. The Compress command logarithmically compresses the range {0 - 219} to {0 - 127.5}, so changing the volume to anything less than 171% will never cause clipping. It's kind of like Gamma for images. (Volume is like Contrast) IT IS NOT A DATA COMPRESSOR, I.E. IT DOES NOT MAKE THE FILE SMALLER. F / FILTER Applies a low-pass filter to the sample. This is especially useful when raising the pitch of samples with very high frequencies, like cymbals. S / STRIP tells SamRate to strip all unnecessary IFF chunks from the file. Otherwise, they will be copied unchanged. If no commands are used, SamRate will copy the sample unchanged. This is handy for converting RAW samples to 8SVXs. Examples ======== SamRate flute.snd flute2.snd N c d would take "flute.snd", raise it from C to D using the equal-tempered scale, and save it as "flute2.snd". SamRate Drum.snd LowDrum.snd NOTE f3 c1 JUST would take "Drum.snd", lower it from F3 to C1 using the just intonation scale, and save it as "LowDrum.snd". SamRate Clap.snd HiLoudClap.snd RATE 16000 10000 VOL 100 250 would take "Clap.snd", raise it from 16000 Hz to 10000 Hz, increase the volume from 100 to 250, and save it as "HiLoudClap.snd". SamRate Blip.snd BlipLoud.snd VOL 100 300 COMP would take "Blip.snd", increase the volume from 100 to 300 with compression, and save it as "BlipLoud.snd". SamRate Cymbal.snd HiCymbal.snd NOTE C1 C2 FILTER would take "Cymbal.snd", raise it an octave with low-pass filtering, and save it as "HiCymbal.snd". Future Commands =============== Here are a few other ideas that I haven't implemented yet. I plan to add the more useful ones to future versions of SamRate. If you feel I've left out an important command, E-Mail me. L / LEN / LENGTH newlength adjusts the pitch of the sample so that the sample is newlength bytes long. NOISE / NOISY tells SamRate to noisily interpolate areas where white noise is detected. (better upsampling for percussion samples) Author contact ============== SamRate is written by GLYPH (Graham Fyffe) SamRate is freeware. You can use it anywhere you like, and pass it around as much as you like, as long as you include this doc file. Mail me with any bugs / questions / comments / suggestions. E-Mail: y82s1@unb.ca Home Page URL: http://www.geocities.com/CollegePark/9315/graham.htm