Update samples

This commit is contained in:
Ted Nyman
2013-12-11 15:13:27 -08:00
parent 4d40cab954
commit 1b96f87888
3 changed files with 17 additions and 166 deletions

View File

@@ -1540,7 +1540,7 @@ SuperCollider:
type: programming
color: "#46390b"
lexer: Text only
primary_extension: .sc
primary_extension: .scd
TOML:
type: data

View File

@@ -386,7 +386,6 @@
".styl"
],
"SuperCollider": [
".sc",
".scd"
],
"Tea": [
@@ -504,8 +503,8 @@
".gemrc"
]
},
"tokens_total": 426327,
"languages_total": 498,
"tokens_total": 426192,
"languages_total": 497,
"tokens": {
"ABAP": {
"*/**": 1,
@@ -41329,64 +41328,28 @@
"#000": 1
},
"SuperCollider": {
"BCR2000": 1,
"{": 14,
"var": 2,
"controls": 2,
"controlBuses": 2,
"rangedControlBuses": 2,
"responders": 2,
";": 32,
"*new": 1,
"super.new.init": 1,
"}": 14,
"init": 1,
"Dictionary.new": 3,
"(": 34,
")": 34,
"this.createCCResponders": 1,
"createCCResponders": 1,
"Array.fill": 1,
"|": 4,
"i": 5,
"CCResponder": 1,
"src": 3,
"chan": 3,
"num": 3,
"val": 4,
"[": 3,
"]": 3,
".postln": 1,
"controls.put": 1,
"+": 4,
"controlBuses.put": 1,
"Bus.control": 1,
"Server.default": 1,
"controlBuses.at": 2,
".value": 1,
"/": 2,
"nil": 4,
"//": 4,
"value": 1,
"at": 1,
"arg": 4,
"controlNum": 6,
"controls.at": 2,
"scalarAt": 1,
"busAt": 1,
"//boot": 1,
"server": 1,
"s.boot": 1,
";": 18,
"(": 22,
"SynthDef": 1,
"{": 5,
"var": 1,
"sig": 7,
"resfreq": 3,
"Saw.ar": 1,
")": 22,
"SinOsc.kr": 1,
"*": 3,
"+": 1,
"RLPF.ar": 1,
"Out.ar": 1,
"}": 5,
".play": 2,
"do": 2,
"arg": 1,
"i": 1,
"Pan2.ar": 1,
"SinOsc.ar": 1,
"exprand": 1,
@@ -41403,6 +41366,8 @@
"a.test.plot": 1,
"b.test.plot": 1,
"Env": 1,
"[": 2,
"]": 2,
".plot": 2,
"e": 1,
"Env.sine.asStream": 1,
@@ -44654,7 +44619,7 @@
"Squirrel": 130,
"Standard ML": 243,
"Stylus": 76,
"SuperCollider": 268,
"SuperCollider": 133,
"Tea": 3,
"TeX": 1155,
"Turing": 44,
@@ -44787,7 +44752,7 @@
"Squirrel": 1,
"Standard ML": 2,
"Stylus": 1,
"SuperCollider": 2,
"SuperCollider": 1,
"Tea": 1,
"TeX": 1,
"Turing": 1,
@@ -44808,5 +44773,5 @@
"Xtend": 2,
"YAML": 1
},
"md5": "ba2022a3abc994a60ac4e0a820a0ad2d"
"md5": "972f542e6d1805da92e3afc9a5d89f31"
}

View File

@@ -1,114 +0,0 @@
BCR2000 {
var controls,
controlBuses,
rangedControlBuses,
responders
;
*new {
^super.new.init;
}
init {
controls = Dictionary.new(108);
controlBuses = Dictionary.new(108);
rangedControlBuses = Dictionary.new(108);
this.createCCResponders;
}
createCCResponders {
responders = Array.fill(108, {|i|
CCResponder({|src, chan, num, val|
[src, chan, num, val].postln;
// Write to controls
controls.put(i + 1, val);
// Write to bus (converted to scalar 0..1)
controlBuses.put(i + 1, Bus.control(Server.default));
controlBuses.at(i + 1).value = val / 127;
},
// Adjust values as/if needed
nil, // src
nil, // chan
nil, // num
nil // value
)
});
}
// Value from BCR
at {arg controlNum;
^controls.at(controlNum)
}
// Convert to 0..1
scalarAt {arg controlNum;
^controls.at(controlNum) / 127
}
// Get a bus
busAt {arg controlNum;
^controlBuses.at(controlNum)
}
/*
busRangeAt(arg controlNum, lo, hi;
if (rangedControlBuses.at(controlNum).isNil, {
rangedControlBuses.put(controlNum, Bus.control(Server.default))
});
// Left to right order of operations
//rangedControlBuses.put(
bus.value = hi - lo * controls.at(controlNum) + lo;
^bus
}
*/
}
/* Scratch
Dictionary
b = BCR2000();
b.at(4);
b.scalarAt(4);
b.controls[5].get;
throw
z = Dictionary.new(2);
z.at(\1);
Array.fill(10, {|i| i.postln;})
(2 + 3).asSymbol;
SynthDef(\x, {
arg amp = 0.01,
freq = 1200,
modDepth = 0.7,
modFreq = 2
;
var
carrier,
modulator
;
modulator = SinOsc.ar(modFreq, mul: modDepth);
carrier = Saw.ar(freq, add: modulator, mul: amp);
Out.ar([0,1], carrier)
}).store;
x = Synth(\x);
x.set(\modDepth, 1);
x.set(\modFreq, 64);
x.map(\modFreq, b.busAt(
ControlSpec
*/