mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Update samples
This commit is contained in:
@@ -1540,7 +1540,7 @@ SuperCollider:
|
|||||||
type: programming
|
type: programming
|
||||||
color: "#46390b"
|
color: "#46390b"
|
||||||
lexer: Text only
|
lexer: Text only
|
||||||
primary_extension: .sc
|
primary_extension: .scd
|
||||||
|
|
||||||
TOML:
|
TOML:
|
||||||
type: data
|
type: data
|
||||||
|
|||||||
@@ -386,7 +386,6 @@
|
|||||||
".styl"
|
".styl"
|
||||||
],
|
],
|
||||||
"SuperCollider": [
|
"SuperCollider": [
|
||||||
".sc",
|
|
||||||
".scd"
|
".scd"
|
||||||
],
|
],
|
||||||
"Tea": [
|
"Tea": [
|
||||||
@@ -504,8 +503,8 @@
|
|||||||
".gemrc"
|
".gemrc"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tokens_total": 426327,
|
"tokens_total": 426192,
|
||||||
"languages_total": 498,
|
"languages_total": 497,
|
||||||
"tokens": {
|
"tokens": {
|
||||||
"ABAP": {
|
"ABAP": {
|
||||||
"*/**": 1,
|
"*/**": 1,
|
||||||
@@ -41329,64 +41328,28 @@
|
|||||||
"#000": 1
|
"#000": 1
|
||||||
},
|
},
|
||||||
"SuperCollider": {
|
"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,
|
"//boot": 1,
|
||||||
"server": 1,
|
"server": 1,
|
||||||
"s.boot": 1,
|
"s.boot": 1,
|
||||||
|
";": 18,
|
||||||
|
"(": 22,
|
||||||
"SynthDef": 1,
|
"SynthDef": 1,
|
||||||
|
"{": 5,
|
||||||
|
"var": 1,
|
||||||
"sig": 7,
|
"sig": 7,
|
||||||
"resfreq": 3,
|
"resfreq": 3,
|
||||||
"Saw.ar": 1,
|
"Saw.ar": 1,
|
||||||
|
")": 22,
|
||||||
"SinOsc.kr": 1,
|
"SinOsc.kr": 1,
|
||||||
"*": 3,
|
"*": 3,
|
||||||
|
"+": 1,
|
||||||
"RLPF.ar": 1,
|
"RLPF.ar": 1,
|
||||||
"Out.ar": 1,
|
"Out.ar": 1,
|
||||||
|
"}": 5,
|
||||||
".play": 2,
|
".play": 2,
|
||||||
"do": 2,
|
"do": 2,
|
||||||
|
"arg": 1,
|
||||||
|
"i": 1,
|
||||||
"Pan2.ar": 1,
|
"Pan2.ar": 1,
|
||||||
"SinOsc.ar": 1,
|
"SinOsc.ar": 1,
|
||||||
"exprand": 1,
|
"exprand": 1,
|
||||||
@@ -41403,6 +41366,8 @@
|
|||||||
"a.test.plot": 1,
|
"a.test.plot": 1,
|
||||||
"b.test.plot": 1,
|
"b.test.plot": 1,
|
||||||
"Env": 1,
|
"Env": 1,
|
||||||
|
"[": 2,
|
||||||
|
"]": 2,
|
||||||
".plot": 2,
|
".plot": 2,
|
||||||
"e": 1,
|
"e": 1,
|
||||||
"Env.sine.asStream": 1,
|
"Env.sine.asStream": 1,
|
||||||
@@ -44654,7 +44619,7 @@
|
|||||||
"Squirrel": 130,
|
"Squirrel": 130,
|
||||||
"Standard ML": 243,
|
"Standard ML": 243,
|
||||||
"Stylus": 76,
|
"Stylus": 76,
|
||||||
"SuperCollider": 268,
|
"SuperCollider": 133,
|
||||||
"Tea": 3,
|
"Tea": 3,
|
||||||
"TeX": 1155,
|
"TeX": 1155,
|
||||||
"Turing": 44,
|
"Turing": 44,
|
||||||
@@ -44787,7 +44752,7 @@
|
|||||||
"Squirrel": 1,
|
"Squirrel": 1,
|
||||||
"Standard ML": 2,
|
"Standard ML": 2,
|
||||||
"Stylus": 1,
|
"Stylus": 1,
|
||||||
"SuperCollider": 2,
|
"SuperCollider": 1,
|
||||||
"Tea": 1,
|
"Tea": 1,
|
||||||
"TeX": 1,
|
"TeX": 1,
|
||||||
"Turing": 1,
|
"Turing": 1,
|
||||||
@@ -44808,5 +44773,5 @@
|
|||||||
"Xtend": 2,
|
"Xtend": 2,
|
||||||
"YAML": 1
|
"YAML": 1
|
||||||
},
|
},
|
||||||
"md5": "ba2022a3abc994a60ac4e0a820a0ad2d"
|
"md5": "972f542e6d1805da92e3afc9a5d89f31"
|
||||||
}
|
}
|
||||||
@@ -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
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user