| 1 |
// quick survey of chuck primitives |
| 2 |
// <<<>>> will print the type and value of any variable; |
| 3 |
|
| 4 |
// integers |
| 5 |
1 => int i; |
| 6 |
<<<i>>>; |
| 7 |
// modify value and print again... |
| 8 |
2 => i; |
| 9 |
<<<i>>>; |
| 10 |
|
| 11 |
// hexadecimal notation |
| 12 |
0x22 => i; |
| 13 |
<<<i>>>; |
| 14 |
|
| 15 |
// floats |
| 16 |
5.678 => float f; |
| 17 |
<<<f>>>; |
| 18 |
|
| 19 |
// durations are a measure of time |
| 20 |
// the value we print will be in audio samples |
| 21 |
|
| 22 |
9.0::second => dur d; |
| 23 |
<<<d>>>; |
| 24 |
|
| 25 |
now => time t; |
| 26 |
<<<t>>>; |
| 27 |
|
| 28 |
// we advance time, and now will change to reflect |
| 29 |
<<<"waiting 10 seconds...">>>; |
| 30 |
10::second => now; |
| 31 |
<<<now>>>; |
| 32 |
|
| 33 |
// there is more: see type_analysis.ck for more primitives |
| 34 |
// including complex and polar |