-
Notifications
You must be signed in to change notification settings - Fork 15
11 small differences between sc and cc
mohayonao edited this page Dec 7, 2013
·
2 revisions
A function of CoffeeCollider cannot omit parenthese when calling with no arguments.
// SuperCollider
69.midicps(); // 440
69.midicps; // 440
# CoffeeCollider
69.midicps() # 440
69.midicps # [Function]
// SuperCollider
10pi // 31.415926535898
10.pi() # 31.415926535898
[ 1, 2, 3 ].pi() # [ 3.1415926535, 6.2831853071, 9.424777960 ]
Line.kr(0, 2, dur:1).pi() # 1秒かけて 0 から 2pi まで変化する
// SuperCollider
[ 1, 2, 3 ] + [ 10, 20 ] // [ 11, 22, 13 ]
[ 1, 2, 3 ] +.s [ 10, 20 ] // [ 11, 22 ]
(1..100) max:.f [ 10, 20, 30 ]
# CoffeeCollider
[ 1, 2, 3 ] + [ 10, 20 ] # [ 11, 22, 13 ]
[ 1, 2, 3 ] +S+ [ 10, 20 ] # [ 11, 11 ]
[1..100].max([ 10, 20, 30 ], FOLD)
// SuperCollider
rrand(0, 10.0) // return a Float
rrand(0, 10) // return an Integer
# CoffeeCollider
rrand(0, 10) # return a Float
rrand(0, 10).asInt() # return an Integer
// SuperCollider
1 + 2 * 3 // (1 + 2) * 3 -> 9
# CoffeeCollider
1 + 2 * 3 # 1 + (2 * 3) -> 7
// SuperCollider
nil
inf
# CoffeeCollider
null
Infinity
// SuperCollider
a = 10; // global
# CoffeeCollider
$a = 10 # global