|
|
| JSyn | |
| Tutorial | |
Many things can cause an object to vibrate including being struck like a drum, bowed like a violin, or plucked like a guitar. In general, a large object like a cello, a bass drum, or a truck will vibrate slower than a small object like a violin, cow bell, or a bicycle. We perceive slower vibrations to be lower pitches and faster vibrations to be higher pitches. The slowest vibrations that we can hear are about 40 wiggles per second, or 40 Hertz. The fastest vibrations we can hear are about 20000 Hertz (Hz).
JSyn oscillators have a "frequency" port that allows us to change the number of times the output goes up and down per second. Let's set the frequency of our sineOsc to 500 vibrations per second:
sineOsc.frequency.set( 500.0 );Oscillators also have a port that controls how far up or down the numbers go (ultimately, how far the speaker diaphragm gets pushed in and out). This "amplitude" port controls how loud the sound is. Let's tell our oscillator to output numbers in the range of -0.4 to 0.4.
sineOsc.amplitude.set( 0.4 );Oscillators typically output a signal that is centered at zero and can go as low as -1.0 and as high as +1.0.
© 1997-2008 Mobileer Inc All Rights Reserved