'\" t .\" Title: hetro .\" Author: .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 08/01/2011 .\" Manual: The Canonical Csound Reference Manual .\" Source: 5.10 .\" Language: English .\" .TH "HETRO" "1" "08/01/2011" "5.10" "The Canonical Csound Reference" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" hetro \- Decomposes an input soundfile into component sinusoids\&. .\" hetro .SH "DESCRIPTION" .PP Hetrodyne filter analysis for the Csound adsyn generator\&. .SH "SYNTAX" .sp .if n \{\ .RS 4 .\} .nf \fBcsound \-U hetro\fR [flags] infilename outfilename .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf \fBhetro\fR [flags] infilename outfilename .fi .if n \{\ .RE .\} .SH "INITIALIZATION" .PP \fIhetro\fR takes an input soundfile, decomposes it into component sinusoids, and outputs a description of the components in the form of breakpoint amplitude and frequency tracks\&. Analysis is conditioned by the control flags below\&. A space is optional between flag and value\&. .PP \fI\-s srate\fR \-\- sampling rate of the audio input file\&. This will over\-ride the srate of the soundfile header, which otherwise applies\&. If neither is present, the default is 10000\&. Note that for \fIadsyn\fR synthesis the srate of the source file and the generating orchestra need not be the same\&. .PP \fI\-c channel\fR \-\- channel number sought\&. The default is 1\&. .PP \fI\-b begin\fR \-\- beginning time (in seconds) of the audio segment to be analyzed\&. The default is 0\&.0 .PP \fI\-d duration\fR \-\- duration (in seconds) of the audio segment to be analyzed\&. The default of 0\&.0 means to the end of the file\&. Maximum length is 32\&.766 seconds\&. .PP \fI\-f begfreq\fR \-\- estimated starting frequency of the fundamental, necessary to initialize the filter analysis\&. The default is 100 (cps)\&. .PP \fI\-h partials\fR \-\- number of harmonic partials sought in the audio file\&. Default is 10, maximum is a function of memory available\&. .PP \fI\-M maxamp\fR \-\- maximum amplitude summed across all concurrent tracks\&. The default is 32767\&. .PP \fI\-m minamp\fR \-\- amplitude threshold below which a single pair of amplitude/frequency tracks is considered dormant and will not contribute to output summation\&. Typical values: 128 (48 db down from full scale), 64 (54 db down), 32 (60 db down), 0 (no thresholding)\&. The default threshold is 64 (54 db down)\&. .PP \fI\-n brkpts\fR \-\- initial number of analysis breakpoints in each amplitude and frequency track, prior to thresholding (\fI\-m\fR) and linear breakpoint consolidation\&. The initial points are spread evenly over the duration\&. The default is 256\&. .PP \fI\-l cutfreq\fR \-\- substitute a 3rd order Butterworth low\-pass filter with cutoff frequency \fIcutfreq\fR (in Hz), in place of the default averaging comb filter\&. The default is 0 (don\*(Aqt use)\&. .SH "PERFORMANCE" .PP As of Csound 4\&.08, \fIhetro\fR can write SDIF ouput files if the output file name ends with "\&.sdif" or "\&.SDIF"\&. See the sdif2ad utility for more information about the Csound\*(Aqs SDIF support\&. .SH "EXAMPLES" .PP .sp .if n \{\ .RS 4 .\} .nf \fIhetro\fR \-s44100 \-b\&.5 \-d2\&.5 \-h16 \-M24000 audiofile\&.test adsynfile7 .fi .if n \{\ .RE .\} .sp This will analyze 2\&.5 seconds of channel 1 of a file "audiofile\&.test", recorded at 44\&.1 kHz, beginning \&.5 seconds from the start, and place the result in a file "adsynfile7"\&. We request just the first 16 harmonics of the sound, with 256 initial breakpoint values per amplitude or frequency track, and a peak summation amplitude of 24000\&. The fundamental is estimated to begin at 100 Hz\&. Amplitude thresholding is at 54 db down\&. .PP The Butterworth LPF is not enabled\&. .SS "File Format" .PP The output file contains time\-sequenced amplitude and frequency values for each partial of an additive complex audio source\&. The information is in the form of breakpoints (time, value, time, value, \&.\&.\&.\&.) using 16\-bit integers in the range 0 \- 32767\&. Time is given in milliseconds, and frequency in Hertz (cps)\&. The breakpoint data is exclusively non\-negative, and the values \-1 and \-2 uniquely signify the start of new amplitude and frequency tracks\&. A track is terminated by the value 32767\&. Before being written out, each track is data\-reduced by amplitude thresholding and linear breakpoint consolidation\&. .PP A component partial is defined by two breakpoint sets: an amplitude set, and a frequency set\&. Within a composite file these sets may appear in any order (amplitude, frequency, amplitude \&.\&.\&.\&.; or amplitude, amplitude\&.\&.\&., then frequency, frequency,\&.\&.\&.)\&. During adsyn resynthesis the sets are automatically paired (amplitude, frequency) from the order in which they were found\&. There should be an equal number of each\&. .PP A legal \fIadsyn\fR control file could have following format: .sp .if n \{\ .RS 4 .\} .nf \-1 time1 value1 \&.\&.\&. timeK valueK 32767 ; amplitude breakpoints for partial 1 \-2 time1 value1 \&.\&.\&. timeL valueL 32767 ; frequency breakpoints for partial 1 \-1 time1 value1 \&.\&.\&. timeM valueM 32767 ; amplitude breakpoints for partial 2 \-2 time1 value1 \&.\&.\&. timeN valueN 32767 ; frequency breakpoints for partial 2 \-2 time1 value1 \&.\&.\&.\&.\&.\&.\&.\&.\&.\&. \-2 time1 value1 \&.\&.\&.\&.\&.\&.\&.\&.\&.\&. ; pairable tracks for partials 3 and 4 \-1 time1 value1 \&.\&.\&.\&.\&.\&.\&.\&.\&.\&. \-1 time2 value1 \&.\&.\&.\&.\&.\&.\&.\&.\&.\&. .fi .if n \{\ .RE .\} .SH "CREDITS" .PP .RS 4 Author: Tom Sullivan .RE .RS 4 1992 .RE .RS 4 Author: John ffitch .RE .RS 4 1994 .RE .RS 4 Author: Richard Dobson .RE .RS 4 2000 .RE .PP October 2002\&. Thanks to Rasmus Ekman, added a note about the SDIF format\&. .SH "AUTHORS" .PP \fBBarry Vercoe\fR .br MIT Media Lab .RS 4 Author. .RE .PP \fBDan Ellis\fR .br MIT Media Lab, Cambridge Massachussetts .RS 4 Author. .RE .SH "COPYRIGHT" .br