next up previous
Next: Playing the initial and Up: Changing the frequency over Previous: Changing the frequency over

Determining the starting and ending frequency

[Note: this section can be skipped on first reading.]

OK, so that generates a glissando from the initial to the final state. How do you know the initial and final frequencies?

Here's the general formula for determining the frequency, given the sampling rate and the state duration:

\begin{displaymath}
frequency~=~sampling\_rate~/~state\_duration\end{displaymath}

The duration of the state is the sum of durations of its elements. So the initial state has a duration of

\begin{displaymath}
state\_duration~=~20~+~30~+~40~+~10~=~100~samples\end{displaymath}

The default sampling rate for TrikTraks is 22050 samples per second, so to find the frequency, you solve for the frequency:

freq = 22050/100

freq = 220.5

The initial frequency is 220.5 hertz.

The final frequency can be determined in the same way:

freq = 22050/(40 + 60 + 80 + 20 )

freq = 22050/200

freq = 110.25

The final frequency is 110.25 hertz. The sound starts at 220.5 hertz, and descends until it ends at 110.25 hertz, which is one octave lower.


next up previous
Next: Playing the initial and Up: Changing the frequency over Previous: Changing the frequency over
Arun Chandra
arunc@evergreen.edu