|
This program turns a stream into PCM output. It interpolates between lines of the stream. It uses the interpolated pixel values to be the volume of given frequencies. The frequencies are interpolated between a given max and min so that the ratio of frequencies in adjacent columns is constant.
For example, if the minimum frequency and maximum frequency
are there default values of 128 and 4096 respectively and the
stream is five pixels wide, the following would happen. This
program would interpolate between two consecutive lines in
the input stream. The result will have the same width as the
input stream. The zero-th column would get mapped to 128Hz,
the first column to 256Hz, the second column to 512Hz, the
third column to 1024Hz, and the fourth column to 2048Hz. In
general, the j
-th column for a stream with
w
columns would get mapped to:
exp( log(minHz) + j * ( log(maxHz) - log(minHz) ) / w )
64.0
.0.44
.128.0
.4096.0
.
Note, if the minimum and maximum aren't both powers of the
same number, chances are that there will be a great deal of
interference between your frequencies that results in crackles
in the sound. Also note, that there is no reason that the
minimum frequency really has to be smaller than the maximum
frequency.1.0
.8192
.-1
up to 1
over an interval and then drops back down
to -1
. A toothsaw wave steadily drops from
1
to -1
over the interval and
then hops back up to 1
. The default is
sine
.[-32767,32767]
and emitted as
signed 16-bit 2's complement MSB numbers.
The default is to use signed 16-bit output.