Sound
Sound
: stores and manipulates a sound
Sound
from a Sample
getSample()
that returns the Sample
for the Sound
Sound
Sample
passed as a parameter and method getSample
returns a copy
of the sample for the Sound
Sound
from client code, preventing the client
code from changing the actual sample of the Sound
Sound
that manipulate a Sound
's
sample
Sound
and calls method getSample()
:
SoundTest
copy()
private
because it is for use only in the class
itself
Sound
that has a String
parameter for the name of a file containing a sound. The sound format is .aiff
or .wav. Modify the SoundTest sketch to use this constructor with sound file bassoon-c4.wav.
Sound
method increaseVolume()
that doubles the volume of the sound. Remember to constrain sample values to be
between -1.0 and 1.0
Sound
method changeVolume(aFactor)
that changes the volume of the sound by a passed factor. Remember to constrain
sample values to be between -1.0 and 1.0
largest
largest
largest
value -1. Loop through
all samples; if a sample is greater than largest
, save that value
as largest
Sound
method normalize()
that normalizes the sound.
Sound
method forceToExtremes()
that sets all non-negative sample values to the maximum positive value (1.0) and
all negative sample values to the minimum negative value (-1.0).
Sound
method clip(aStart,
aEnd)
that clips the sound from a given start index to a given end index.
Sound
method splice(aSound,
aSourceStart, aSourceStop, aTargetStart)
that copies part of a given
sound into this sound, at a given start index.
Sound
method reverse()
that reverses the sound.
Sound
method mirror()
that mirrors the sound front to back.
Sound
method add(aSound)
that adds a given sound to the sound.
Sound
method echo(aDelay,
aNumEchoes)
that creates multiple echoes of the sound after a given
number of delay samples. Try scaling by 0.6.
Sound
method doubleFrequency()
that doubles the frequency of this sound.
Sound
method halveFrequency()
that halves the frequency of this sound.
Sound
method changeFrequency(aFactor)
that changes the frequency of this sound by a given factor.
Sound
method createSineWave(aFrequence, aMaxAmplitude)
that returns a Sound
which is a one second sine wave with the given frequency and maximum amplitude.Sound
method createSquareWave(aFrequence, aMaxAmplitude)
that returns a Sound
which is a one second square wave with the given frequency and maximum amplitude. Sound
method createSawtoothWave(aFrequence, aMaxAmplitude)
that returns a Sound
which is a one second sawtooth wave with the given frequency and maximum amplitude.