[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] pdef inside synthdef



hello im having a problem with pdef.  I need to put a pdef inside a
synthdef. Ive tried the following code but it doesnt work , the idea is
when i create a "holi" synth it shouild create a rythmical pattern , any
idea whats am i doing wrong?


unfortunately, patterns cannot be part of a SynthDef. So you can't mix Pdef and ugens directly. But your example does not need any such combination, just remove the SynthDef and replace it by Pdef:

(
Pdef(\holi, Pbind(\instrument, \holo,
			\freq, 50.rand + 1,
\dur, Pseq.new([20.rand * 0.1 , 0.5, 0.25, 0.5], inf); // dur arg
		)
).play;
)



thanks


(
SynthDef(\holo, { arg freq= 229, amp = 0.1, pan= 0.0;
var signal, env;
env= EnvGen.ar(Env.perc, doneAction:2);
signal =SinOsc.ar(freq,0.5) * env;

signal = Pan2.ar(signal, pan);
Out.ar(0,signal);
}).load(s);
)

(
SynthDef(\holi, { arg freq= 9, amp = 0.1, pan= 0.0;
var signal, env;
 Pdef(\example1,
		Pbind(\instrument, \holo,
					\freq, 50.rand + 1,
\dur, Pseq.new([20.rand * 0.1 , 0.5, 0.25, 0.5], inf); // dur arg

		)			).play;

}
))


Synth(\holi)

--
  simeon cosik
  simeon_cosik@xxxxxxxxxxx

--
http://www.fastmail.fm - A fast, anti-spam email service.


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/


--





.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/