| 1 |
// Listing 1.9 Using and manipulating float variables |
| 2 |
|
| 3 |
220 => float twinkle; // (1) Declares and initializes a float |
| 4 |
// to hold your twinkle pitch. |
| 5 |
|
| 6 |
1.5 * twinkle => float twinkle2; // Uses math to derive your 2nd |
| 7 |
// twinkle pitch from the first one. |
| 8 |
|
| 9 |
1.6818 * twinkle => float lit; // Uses more math to derive lit pitch from your base twinkle. |
| 10 |
|
| 11 |
1.2585 * twinkle2 => float tle; // Uses more math to derive tle pitch from twinkle2. |
| 12 |
|
| 13 |
2 * twinkle => float octave; // Makes a new pitch an octave above twinkle. |
| 14 |
|
| 15 |
<<< twinkle, twinkle2, lit, tle, octave >>>; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|