C-M-x ( “line 1”.postln; “line 2”.postln; “last line”; ) base code <code> ( var melody, bass, chord; bass = Pbind( \dur, Pseq([3.0],inf), \midinote, Pseq([67,62] - 12, inf) ); chord = Pbind( \amp, 0.05, \dur, Pseq([1.0,2.0],inf), \midinote, Pseq([\,[59,62,66],\, [57,61,66]] , inf) ); melody = Pbind( \dur, Pseq([ 1, 1, 1, 1, 1, 1, 1,1 ,1, 3, 12],inf), \midinote, Pseq([\,66,69,67,66,61,59,61,62,57,54] + 12, inf) ); Ptpar([0,bass, 0,chord, 0,melody]).play ) }}} –http://www.iamas.ac.jp/~tn800/sc3/contest1/ 주말에 리믹스 해봐야지 —- ==== 마이크 가지고 놀기 ==== * 기본 입력 <code> AudioIn.ar([1,2],0.1) }.play; 마이크 [1,2] 스테레오 부터 입력 받아 재생
</code>
// "help-AudioIn" 이름으로 Out.ar에 재생.
(
SynthDef("help-AudioIn",{ arg out=0;
Out.ar(out,
AudioIn.ar(1) // 마이크 모노
)
}).play;
)
// stereo through patching from input to output
(
SynthDef("help-AudioIn",{ arg out=0;
Out.ar(out,
AudioIn.ar([1,2]) //마이크[1,2] 스테레오
)
}).play;
)
(
{ //ring modulatior
SinOsc.ar(MouseX.kr(0.001,110,'exponential' ))*AudioIn.ar(1,0.1)
}.play; // stereo through patching from input to output
)
- Vocoder 만들기
SynthDef(\dVocoder, {
arg out = 0;
var signal, vocode;
signal = AudioIn.ar(1, 5);
vocode = Vocoder.ar(Saw.ar(150),signal, 8);
Out.ar(out,vocode);
}).play;
s.boot
(
// @@@initialize
var fttsize ;
var fttBufA, fttBufB ;
var inSynth, inVocal, vocoder ;
fttsize = 512;
fttBufA = Buffer.alloc(s,fttsize,1);
fttBufB = Buffer.alloc(s,fttsize,1);
// @@@SynthDef
SynthDef("AudioInput", {arg audioin=1, outbus=0;
Out.ar(outbus, AudioIn.ar(audioin));
}).send(s);
SynthDef("SawSynth", {arg audioin=1, outbus=0;
var output, freq, hasFreq;
# freq, hasFreq = Pitch.kr(AudioIn.ar(audioin), ampThreshold: 0.02, median: 7);
freq = freq.cpsmidi.round(1).midicps*1;
output = HPF.ar(Saw.ar(freq, 0.3) + Saw.ar(freq*0.5, 0.4), freq * 1.5);
Out.ar(outbus,output);
}).send(s);
SynthDef("FFTVocoder", {arg modin=0, carin=1, outbus=0;
var output, input, chainA, chainB, chainC;
input = In.ar(modin, 1);
chainA = FFT(fttBufA.bufnum, (HPF.ar(HPF.ar(input, 3000, 2)+(input*0.4), 100)) );
chainB = FFT(fttBufB.bufnum, In.ar(carin, 1));
chainC = PV_MagMul(chainB, chainA);
output = Limiter.ar(IFFT(chainC), 1, 0.01); ReplaceOut.ar(outbus,[output,output]);
}).send(s);
// @@@Synthsize
inVocal = Synth.new("AudioInput", [\audioin, 1, \outbus, 0], s);
inSynth = Synth.new("SawSynth", [\audioin, 1, \outbus, 1], inVocal, \addAfter);
vocoder = Synth.new("FFTVocoder", [\outbus, 0, \modin, 0, \carin, 1 ], inSynth, \addAfter);
)
http://www.create.ucsb.edu/pipermail/sc-users/2007-January/030902.html
- harmony with mic (휘파람 불면 물소리남)
(
// (Dan Stowell) (public domain 2006)
// USE HEADPHONES to prevent feedback.
x = {
var son, freq, hasFreq, amp, out, harm;
son = AudioIn.ar(1); // get first channel of sound input
# freq, hasFreq = Pitch.kr(son); // Pitch of input signal
amp = Amplitude.ar(son); // Amplitude of input signal
harm = SinOsc.ar(freq * 2, 0, amp * hasFreq);
Pan2.ar(harm + son)
}.play;
)
x.free; // Use this to stop the synth
- Reverb
SynthDef("reverb1", {arg mix=0.2, decaytime=15,in=0, out=0;
var input;
var p,e;
var f1, f2,z,a=4,c=5;
input = (0.2 * AudioIn.ar([1,2]));
x = DelayN.ar(input, 0.048);
y = Mix.ar(CombL.ar(x, 0.1, LFNoise1.kr(Array.fill(c,{0.1.rand}), 0.04, 0.05), decaytime));
a.do({ y = AllpassN.ar(y, 0.050, [0.050.rand,0.050.rand], 1) });
Out.ar(0, (input+(mix*y)));
}).play;
참고: http://year-of-the-croissant.blogspot.com/
참고: https://devel.goto10.org/listing.php?repname=ixi&path=%2Fsupercollider%2F&rev=0&sc=0
참고: http://puredyne.itchybit.org/testing/iso/puredyne.iso 배포판