nxInstrument004

Download all code, records and samples
Download nxInstrument004 2009.21.3 2009.21.6

Instrument Code:

// Supercollider Code:
// nxInstrument004.sc
// Date: 2009.20.03
// Author: Miquel Parera Jaques
// Target: Connect MIDIOut & AudioOut
 
(
p = ProxySpace.push(s.boot);
p.makeTempoClock(4.0);
History.clear.end;
History.start;
)
 
(
MIDIClient.init;
m = MIDIOut(0);
)
 
"zynaddsubfx -L '/home/neix/nx00401.xiz' -U".unixCmd;
z = Buffer.read(s,"nxInstrument004-01-Sampler.wav",0);
 
"aconnect -o".unixCmd;
"aconnect -i".unixCmd;
 
"aconnect 129:7 130:0".unixCmd;
 
Pdef(\x);
Pdef(\x, Pbind(\type, \midi, \midiout, m, \midinote, Pseq([31, 32, 31], inf), \dur, Pseq([0.5, 0.3, 0.2], inf)));
 
(
SynthDef( "click1", {arg rate=0.2, pan = 0, freq = 125, rq = 0.8;
    var a;
    a = PlayBuf.ar(1,0,rate,1,0,1);
    a = RLPF.ar(a,freq,rq);
    Out.ar(0, Pan2.ar(a, pan));
}).send(s);
SynthDef( "click2", {arg rate=0.2, pan = -1, freq = 150, rq = 0.8;
    var a;
    a = PlayBuf.ar(1,0,rate,1,0,1);
    a = RLPF.ar(a,freq,rq);
    Out.ar(0, Pan2.ar(a, pan));
}).send(s);
SynthDef( "click3", {arg rate=0.2, pan = 1, freq = 175, rq = 0.8;
    var a;
    a = PlayBuf.ar(1,0,rate,1,0,1);
    a = RLPF.ar(a,freq,rq);
    Out.ar(0, Pan2.ar(a, pan));
}).send(s);
)
 
"ecasound -i jack -o '/home/neix/nxInstrument004-01.wav'".unixCmd;
 
"jack_lsp".unixCmd;
 
"jack_connect ZynAddSubFX:out_1 ecasound:in_1".unixCmd; 
"jack_connect ZynAddSubFX:out_2 ecasound:in_2".unixCmd; 
"jack_connect SuperCollider:out_1 ecasound:in_1".unixCmd; 
"jack_connect SuperCollider:out_2 ecasound:in_2".unixCmd;
 
d =Task({
    Pdef(\x).play;    
    a = Synth("click1");
    b = Synth("click2");
    c = Synth("click3");
    24.wait;
    a.set(\rate, 0.8);
    a.set(\freq, 300);
    8.wait;
    b.set(\rate, -0.8);
    b.set(\freq, 333);
    8.wait;
    c.set(\rate, 1.0);
    c.set(\freq, 366);
    24.wait;
    a.set(\rate, 1.6);
    a.set(\freq, 366);
    8.wait;
    b.set(\rate, -1.6);
    b.set(\freq, 413);
    8.wait;
    c.set(\rate, 2.0);
    c.set(\freq, 444);
    24.wait;
    a.set(\rate, 3.2);
    a.set(\freq, 484);
    8.wait;
    b.set(\rate, -3.2);
    b.set(\freq, 510);
    8.wait;
    c.set(\rate, 4.0);
    c.set(\freq, 560);
    24.wait;
    a.free;
    8.wait;
    b.free;
    8.wait;
    c.free;
    8.wait;
    Pdef(\x).stop;    
}
);
 
d.play;
 
"killall zynaddsubfx".unixCmd;
"killall ecasound".unixCmd;
 
History.end;
History.saveStory("nxInstrument004-01-Story.scd");
 
"killall jackd & killall java".unixCmd; p.pop; s.quit;

Story file:

///////////////////////////////////////////////////
// History, as it was on Sat Mar 21 01:41:26 2009.
///////////////////////////////////////////////////
 
// - 0:0:0 -  
(
p = ProxySpace.push(s.boot);
p.makeTempoClock(4.0);
History.clear.end;
History.start;
)
 
// - 0:0:9.45 -  
(
MIDIClient.init;
m = MIDIOut(0);
)
 
// - 0:0:17.44 -  
"zynaddsubfx -L '/home/neix/nx00401.xiz' -U".unixCmd;
 
// - 0:0:24.82 -  
z = Buffer.read(s,"nxInstrument004-01-Sampler.wav",0);
 
// - 0:0:28.31 -  
"aconnect 129:7 130:0".unixCmd;
 
// - 0:0:31.53 -  
Pdef(\x);
 
// - 0:0:33 -  
Pdef(\x, Pbind(\type, \midi, \midiout, m, \midinote, Pseq([31, 32, 31], inf), \dur, Pseq([0.5, 0.3, 0.2], inf)));
 
// - 0:0:43.34 -  
(
SynthDef( "click1", {arg rate=0.2, pan = 0, freq = 125, rq = 0.8;
    var a;
    a = PlayBuf.ar(1,0,rate,1,0,1);
    a = RLPF.ar(a,freq,rq);
    Out.ar(0, Pan2.ar(a, pan));
}).send(s);
SynthDef( "click2", {arg rate=0.2, pan = -1, freq = 150, rq = 0.8;
    var a;
    a = PlayBuf.ar(1,0,rate,1,0,1);
    a = RLPF.ar(a,freq,rq);
    Out.ar(0, Pan2.ar(a, pan));
}).send(s);
SynthDef( "click3", {arg rate=0.2, pan = 1, freq = 175, rq = 0.8;
    var a;
    a = PlayBuf.ar(1,0,rate,1,0,1);
    a = RLPF.ar(a,freq,rq);
    Out.ar(0, Pan2.ar(a, pan));
}).send(s);
)
 
// - 0:0:47.16 -  
"ecasound -i jack -o '/home/neix/nxInstrument004-01.wav'".unixCmd;
 
// - 0:0:54.42 -  
"jack_connect ZynAddSubFX:out_1 ecasound:in_1".unixCmd; 
 
// - 0:0:56.21 -  
"jack_connect ZynAddSubFX:out_2 ecasound:in_2".unixCmd; 
 
// - 0:0:57.4 -  
"jack_connect SuperCollider:out_1 ecasound:in_1".unixCmd; 
 
// - 0:0:58.57 -  
"jack_connect SuperCollider:out_2 ecasound:in_2".unixCmd;
 
// - 0:1:9.9 -  
(
d =Task({
    Pdef(\x).play;    
    a = Synth("click1");
    b = Synth("click2");
    c = Synth("click3");
    24.wait;
    a.set(\rate, 0.8);
    a.set(\freq, 300);
    8.wait;
    b.set(\rate, -0.8);
    b.set(\freq, 333);
    8.wait;
    c.set(\rate, 1.0);
    c.set(\freq, 366);
    24.wait;
    a.set(\rate, 1.6);
    a.set(\freq, 366);
    8.wait;
    b.set(\rate, -1.6);
    b.set(\freq, 413);
    8.wait;
    c.set(\rate, 2.0);
    c.set(\freq, 444);
    24.wait;
    a.set(\rate, 3.2);
    a.set(\freq, 484);
    8.wait;
    b.set(\rate, -3.2);
    b.set(\freq, 510);
    8.wait;
    c.set(\rate, 4.0);
    c.set(\freq, 560);
    24.wait;
    a.free;
    8.wait;
    b.free;
    8.wait;
    c.free;
    8.wait;
    Pdef(\x).stop;    
}
);
);
 
// - 0:1:13.35 -  
d.play;
 
// - 0:4:10.24 -  
"killall zynaddsubfx".unixCmd;
 
// - 0:4:11.39 -  
"killall ecasound".unixCmd;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License