Hello, Daniel
Thanks for answer, but I'm looking for more general solution.
I came up to:
(PulseCount.kr(trig) + start % div).sign bitXor: 1 bitAnd: trig; // emulates PulseDivider.kr(trig, div, start) but with possible ugen in "start" argument
, but got different phase (randomly?) between original and emulated PulseDivider when changing "div" argument:
//
(x = { var freq = 8,
trig = Impulse.kr(freq),
div = MouseX.kr(1,4).round,
start = 0,
pd_orig = PulseDivider.kr(trig, div, start),
pd_emul = (PulseCount.kr(trig) + start % div).sign bitXor: 1 bitAnd: trig;
SinOsc.ar(90, 0, 4).tanh * Decay2.ar(T2A.ar([pd_orig, pd_emul]), 0.03, 1/freq) / 2
}.asSynthDef.name_("temp_divider").add.play)
x.free;
//
Looks like PulseDivider ugen uses different algorithm(?)
Post by Daniel MayerHi,
one way to handle this would be an array of PulseDividers
with all possible offsets to choose from.
(
SynthDef(\offsetSwitcher, { |out = 0, offset = 3|
var p, a, b, div;
p = Impulse.ar(8);
div = Select.ar(offset, (0..3).collect { |i| PulseDivider.ar(p, 4, i) });
a = SinOsc.ar(1200, 0, Decay2.ar(p, 0.005, 0.1));
b = SinOsc.ar(600, 0, Decay2.ar(div, 0.005, 0.5));
Out.ar(0, [a, b] * 0.4 * EnvGate())
}).add;
)
// start and trigger different offsets
x = Synth(\offsetSwitcher)
x.set(\offset, 0)
x.set(\offset, 1)
x.set(\offset, 2)
x.set(\offset, 3)
x.release
Of course the offset switch might be defined within the SynthDef also.
In general the more refined trigger sequences you want the more
I'd go for a pattern solution, if this is feasible in your application.
Greetings
Daniel
-----------------------------
www.daniel-mayer.at
-----------------------------
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.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: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/