nxInstrument001

Download all code, records and samples
Download nxInstrument001 2009.10.3 2009.10.6

Instrument Code:

// Supercollider Code:
// nxInstrument001.sc
// Date: 2009.03.02
// Author: Miquel Parera Jaques
// Target: MIDI CCcontrol
 
(
p = ProxySpace.push(s.boot);
p.makeTempoClock(2.0);
MIDIIn.connect;
History.clear.end;
History.start;
)
 
o = ServerOptions.new;
o.memSize = 20000;
 
(
b = Buffer.read(s, "nxInstrument001-01-Sampler-01.wav", bufnum:1);
c = Buffer.read(s, "nxInstrument001-01-Sampler-02.wav", bufnum:2);
d = Buffer.read(s, "nxInstrument001-01-Sampler-03.wav", bufnum:3);
)
 
"aconnect -o".unixCmd;
"aconnect 20:0 129:1".unixCmd;
 
(
~osc_01 = { arg distorter=0, freq=0, rate=100; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), -1).distort * distorter),0.5,0.5,0.2)}};
f = CCResponder({|src,chan,num,value|~osc_01.set(\distorter, value*0.01);},nil,00,20,nil);
g = CCResponder({|src,chan,num,value|~osc_01.set(\freq, value.midicps);},nil,00,03,nil);
h = CCResponder({|src,chan,num,value|~osc_01.set(\rate, if(value==127,{3.0},{100}));},nil,00,28,nil);
~osc_02 = { arg distorter=0, freq=0, rate=150; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), 1).distort * distorter),0.5,0.5,0.2)}};
i = CCResponder({|src,chan,num,value|~osc_02.set(\distorter, value*0.01);},nil,00,21,nil);
j = CCResponder({|src,chan,num,value|~osc_02.set(\freq, value.midicps);},nil,00,09,nil);
k = CCResponder({|src,chan,num,value|~osc_02.set(\rate, if(value==127,{3.0},{150}));},nil,00,29,nil);
~osc_03 = { arg distorter=0, freq=0, rate=200; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), -1).distort * distorter),0.5,0.5,0.2)}};
l = CCResponder({|src,chan,num,value|~osc_03.set(\distorter, value*0.01);},nil,00,22,nil);
m = CCResponder({|src,chan,num,value|~osc_03.set(\freq, value.midicps);},nil,00,14,nil);
n = CCResponder({|src,chan,num,value|~osc_03.set(\rate, if(value==127,{-3.0},{200}));},nil,00,30,nil);
~osc_04 = { arg distorter=0, freq=0, rate=250; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), 1).distort * distorter),0.5,0.5,0.2)}};
t = CCResponder({|src,chan,num,value|~osc_04.set(\distorter, value*0.01);},nil,00,23,nil);
q = CCResponder({|src,chan,num,value|~osc_04.set(\freq, value.midicps);},nil,00,15,nil);
r = CCResponder({|src,chan,num,value|~osc_04.set(\rate, if(value==127,{-3.0},{250}));},nil,00,31,nil);
)
 
s.prepareForRecord("/home/neix/nxInstrument001-01.wav");
s.record;
 
~z.play;
~z.fadeTime = 33;
~z = { Pan2.ar(RHPF.ar(SinOsc.ar(SinOsc.kr(0.5), 0, Pulse.ar(~tempo.kr * 2.000)), 50, 0.1, 0.5), 0)};
 
(
~z.end;
~osc_05.fadeTime = 33;
~osc_06.fadeTime = 66;
~osc_05 = { arg distorter=1.5, freq=33, rate=0.5; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(2,2,rate,1,0,1), 0).distort * distorter),0.5,0.5,0.2)}};
~osc_06 = { arg distorter=1.5, freq=66, rate= -1.5; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,2,rate,4,0,1), 1).distort * distorter),1.5,1.5,1.2)}};
)
 
~osc_07 = { arg distorter=2.5, freq=333, rate=0.5; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,3,rate,1,0,1), -1).distort * distorter),0.5,0.5,0.2)}};
 
(
~osc_05.end;
~osc_06.end;
~osc_07.end;
)
 
History.end;
History.saveStory("nxInstrument001-01-Story.scd");
 
s.stopRecording;
 
s.quit;
"killall java & killall jackd".unixCmd;
p.pop;

Story file:

///////////////////////////////////////////////////
// History, as it was on Sun Mar  1 23:17:00 2009.
///////////////////////////////////////////////////
 
// - 0:0:0 -  
(
p = ProxySpace.push(s.boot);
p.makeTempoClock(2.0);
MIDIIn.connect;
History.clear.end;
History.start;
)
 
// - 0:0:2.65 -  
o = ServerOptions.new;
 
// - 0:0:3.55 -  
o.memSize = 20000;
 
// - 0:0:9.76 -  
(
b = Buffer.read(s, "nxInstrument001-01-Sampler-01.wav", bufnum:1);
c = Buffer.read(s, "nxInstrument001-01-Sampler-02.wav", bufnum:2);
d = Buffer.read(s, "nxInstrument001-01-Sampler-03.wav", bufnum:3);
)
 
// - 0:0:12.67 -  
"aconnect 20:0 129:1".unixCmd;
 
// - 0:0:23.71 -  
(
~osc_01 = { arg distorter=0, freq=0, rate=100; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), -1).distort * distorter),0.5,0.5,0.2)}};
f = CCResponder({|src,chan,num,value|~osc_01.set(\distorter, value*0.01);},nil,00,20,nil);
g = CCResponder({|src,chan,num,value|~osc_01.set(\freq, value.midicps);},nil,00,03,nil);
h = CCResponder({|src,chan,num,value|~osc_01.set(\rate, if(value==127,{3.0},{100}));},nil,00,28,nil);
~osc_02 = { arg distorter=0, freq=0, rate=150; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), 1).distort * distorter),0.5,0.5,0.2)}};
i = CCResponder({|src,chan,num,value|~osc_02.set(\distorter, value*0.01);},nil,00,21,nil);
j = CCResponder({|src,chan,num,value|~osc_02.set(\freq, value.midicps);},nil,00,09,nil);
k = CCResponder({|src,chan,num,value|~osc_02.set(\rate, if(value==127,{3.0},{150}));},nil,00,29,nil);
~osc_03 = { arg distorter=0, freq=0, rate=200; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), -1).distort * distorter),0.5,0.5,0.2)}};
l = CCResponder({|src,chan,num,value|~osc_03.set(\distorter, value*0.01);},nil,00,22,nil);
m = CCResponder({|src,chan,num,value|~osc_03.set(\freq, value.midicps);},nil,00,14,nil);
n = CCResponder({|src,chan,num,value|~osc_03.set(\rate, if(value==127,{-3.0},{200}));},nil,00,30,nil);
~osc_04 = { arg distorter=0, freq=0, rate=250; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,1,rate,1,0,1), 1).distort * distorter),0.5,0.5,0.2)}};
t = CCResponder({|src,chan,num,value|~osc_04.set(\distorter, value*0.01);},nil,00,23,nil);
q = CCResponder({|src,chan,num,value|~osc_04.set(\freq, value.midicps);},nil,00,15,nil);
r = CCResponder({|src,chan,num,value|~osc_04.set(\rate, if(value==127,{-3.0},{250}));},nil,00,31,nil);
)
 
// - 0:0:26.52 -  
s.prepareForRecord("/home/neix/nxInstrument001-01.wav");
 
// - 0:0:27.75 -  
s.record;        // MIDI INFO:     1.Sliders distorter out low.
            // MIDI INFO:     2.Knob 1 altered for listen alter plus ~z(init pos:k1:0;k2:60;k3:70;k4:127+-). 
 
// - 0:0:30.24 -  
~z.play;
 
// - 0:0:30.91 -  
~z.fadeTime = 33;
 
// - 0:1:30.76 -  
~z = { Pan2.ar(RHPF.ar(SinOsc.ar(SinOsc.kr(0.5), 0, Pulse.ar(~tempo.kr * 2.000)), 50, 0.1, 0.5), 0)};
 
            // MIDI INFO:     3.Knobs altered->put button for listen sampler without noise.
 
// - 0:2:57.35 -  
~z.end;
            // MIDI INFO:     4.Buttons noise plus ~osc's.
            // MIDI INFO:     5.Play with midi alternatives.
 
// - 0:3:5.03 -  
~osc_05 = { arg distorter=1.5, freq=33, rate=0.5; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(2,2,rate,1,0,1), 0).distort * distorter),0.5,0.5,0.2)}};
 
// - 0:3:40.91 -  
~osc_06 = { arg distorter=1.5, freq=66, rate= -1.5; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,2,rate,4,0,1), 1).distort * distorter),1.5,1.5,1.2)}};
 
// - 0:4:25.73 -  
~osc_07 = { arg distorter=2.5, freq=333, rate=0.5; {Out.ar(0, CombN.ar(Pan2.ar(SinOsc.ar(freq) * PlayBuf.ar(1,3,rate,1,0,1), -1).distort * distorter),0.5,0.5,0.2)}};
 
// - 0:5:16.73 -  
~osc_05.end;
 
// - 0:5:25.45 -  
~osc_06.end;
 
// - 0:5:29.61 -  
~osc_07.end;
 
            // MIDI INFO:     6.The end is the end of one noise slider.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License