[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Pdefn quant
Am 03.03.2009 um 23:46 schrieb Julian Rohrhuber:
Hi,
I'm having some problems with Pdefn.
I was assuming that by setting a clock and a quant (just 1) the
source pattern would get exchanged on the clock's next beat.
Misunderstanding, user error or bug?
It should work as you expect.
the example below works for me.
the new stream is inserted by the message "sched":
sched { arg func;
if(quant.isNil)
{ func.value }
{ this.clock.schedAbs(quant.nextTimeOnGrid(this.clock),
{ func.value; nil }) }
}
maybe the gap is one too long, because the change is picked up one
event later? In what way it is wrong for you?
The change is one event late.
The notes array is shifted, the beat accent is not on the lowest note,
but on the highest, the last item in the array.
This happens also if one does some similar scheduling in the lang :
(
Pdefn(\midi).remove;
// TempoClock.default, no quant from user
Pdefn(\midi, Pseq([56, 58, 60, 62], inf));
p = Pbind( // clock beat accented
\amp, Pseq([0.12, 0.01, 0.02, 0.04], inf), \dur, 0.25,
\midinote, Pdefn(\midi)
).play(quant: 1); // TempoClock.default
)
(
// array shifted (not always, but most often)
TempoClock.default.schedAbs(TempoClock.default.beats.ceil, {
Pdefn(\midi, Pseq([54, 58, 60, 63], inf));
});
)
(
// scheduling before the beat, okay
TempoClock.default.schedAbs(TempoClock.default.beats.ceil -0.1, {
Pdefn(\midi, Pseq([53, 58, 60, 63], inf));
});
)
Thanks,
Stephan
s.boot;
t = TempoClock(1.7).permanent_(true);
(
Pdefn(\midi, Pseq([56, 58, 60, 62], inf))
.clock_(t)
.quant_(1);
p = Pbind( // one accented
\amp, Pseq([0.12, 0.01, 0.02, 0.04], inf), \dur, 0.25,
\midinote, Pdefn(\midi),
\legato, 0.4
).play(t, quant: 1);
)
// not synced
Pdefn(\midi).source = Pseq([54, 58, 60, 62], inf);
Pdefn(\midi).source = Pseq([52, 58, 60, 62], inf);
p.stop;
p.play(t, true, 1); // now in sync
(
// clean up
p.stop;
Pdefn(\midi).remove; // ERROR if clock stopped before
t.stop;
t.permanent = false;
)
_______________________________________________
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/
_______________________________________________
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/