-
Notifications
You must be signed in to change notification settings - Fork 0
/
final_script
55 lines (44 loc) · 1.48 KB
/
final_script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
SynthDef(\ping, {
arg freq;
var sig;
//sig = Decay.ar(Impulse.ar(0, 0, 0.5), 0.1+0.5, WhiteNoise.ar);
sig = SinOsc.ar(freq).clip2(0.1) * 0.5;
//Decay.ar(Impulse.ar(0, 0, rand), 0.1+rand, WhiteNoise.ar);
sig = EnvGen.kr(Env.perc(0.05, 2), doneAction:2) * sig;
//sig = sig.distort;
//sig = CombL.ar(sig,0.5, 1/freq);
//sig = sig.fold2(0.3).play;
//sig = Pan2.kr(freq)*sig;
Out.ar(0, sig);
}).add;
o = OSCresponderNode(nil, '/newnote', {
|t, r, msg| msg[1].postln; Synth.new(\ping, [\freq, msg[1].midicps])
}).add;
OSCMessageDispatcher(nil, '/message', 2);
~processingOut = NetAddr("127.0.0.1", 10000);
~processingOut.sendMsg("/from_SC", 500);
~processingOut.sendMsg("/note_message",2);
s = Server.local;
o = OSCresponderNode(nil, '/tr', {
|t, r, msg| msg[3].postln; ~processingOut = NetAddr("127.0.0.1",10000); ~processingOut.sendMsg("/note_message",msg[3]);
}).add;
(
SynthDef("pitchFollow1",{
var in, amp, freq, hasFreq, out;
//in = SinOsc.ar(523,0,0.5);//Mix.new(SoundIn.ar([0,1]));
in = Mix.new(SoundIn.ar([0,1]));
//amp = Amplitude.kr(in, 0.5, 0.05);
# freq, hasFreq = Pitch.kr(in, ampThreshold: 0.1, median: 7);
freq.scope;
//freq = Lag.kr(freq.cpsmidi.round(1).midicps, 0.05);
//hasFreq.poll(0.01);
freq.poll(hasFreq, trigid: 12);
//freq.postln;
/* out = Mix.new(VarSaw.ar(freq * [0.5,1,2], 0, LFNoise1.kr(0.3,0.1,0.1), amp));
6.do({
out = AllpassN.ar(out, 0.040, [0.040.rand,0.040.rand], 2)
});
Out.ar(0,out)
*/
}).play(s);
)