| 1 |
// Listing 8.4 Using Machine.add, Machine.remove, and Machine.replace |
| 2 |
|
| 3 |
// Example of using Machine functions |
| 4 |
// by Sporkie Griswold, June 2014 |
| 5 |
|
| 6 |
// (1) Add foo/bar program from listing 8.1... |
| 7 |
Machine.add(me.dir()+"/Listing8.1.ck") => int foobar; |
| 8 |
2.0 :: second => now; |
| 9 |
// (2) ...then add2 code of listing 8.2... |
| 10 |
Machine.add(me.dir()+"/Listing8.2.ck") => int drumnbass; |
| 11 |
6.0 :: second => now; |
| 12 |
// (3) ...add 8.3 code (modalbend program)... |
| 13 |
Machine.add(me.dir()+"/Listing8.3.ck") => int modalbend; |
| 14 |
4.0 :: second => now; |
| 15 |
// (4) ...remove 8.3... |
| 16 |
Machine.remove(modalbend); |
| 17 |
2.0 :: second => now; |
| 18 |
// (5) ...replace foobar with modalbend code... |
| 19 |
Machine.replace(foobar,me.dir()+"/Listing8.3.ck") => modalbend; |
| 20 |
4.0 :: second => now; |
| 21 |
Machine.remove(modalbend); // (6) ...then remove it. |