[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:
![]()
The duration of the state is the sum of durations of its elements. So the initial state has a duration of
![]()
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.