Hello,
I am trying to build a Pdef(Pbind) to produce chords that change frequency in time (portamento), each chord note going to a different frequency.
I tried this:
(
SynthDef(\portamentoPerc, {
|freq=440, endFreq=440, dur=1, portaDelai=0, portaDur=1, amp=0.4|
var sig, env, pitch;
env = EnvGen.kr(Env.perc(attackTime:0.01, releaseTime:dur-(dur/12)), doneAction:2);
pitch = EnvGen.kr(
Env(levels:[freq, freq, endFreq], times:[portaDelai, portaDur], curve:[\hold, \exp]));
sig = SinOsc.ar(freq:pitch, mul:env)*amp;
sig = Splay.ar(sig);
Out.ar(0, sig);
}).add;
)Synth(\portamentoPerc);
(
Pdef(\portamentoSeq, Pbind(\instrument, \portamentoPerc,
\freq, Pseq([{Array.fill(size:10, function:{rrand(200,1000)})}],inf), // random freq
\endFreq, Pseq([Array.fill(size:10, function:{ rrand(Pkey(\freq)-20,Pkey(\freq)+20)})], inf),
// frequency end of portamento (relating to freq) - it does not work!
\dur, 2,
\portaDelai, Pkey(\dur)*0.1, //delay before portamento
\portaDur, Pkey(\dur)*0.7, // portamento duration
\amp, 0.1
));
)
c = Pdef(\portamentoSeq);
c.play;
c.pause;
But it does not work.
Do you think it’s possible?