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

Re: [sc-dev] Impulse UGen Fix: was Re: [sc-users] is this really phase offset?



your diff is going in the wrong direction.
also please make a diff with context.
then email it to me as an attachment so mail doesn't munge it.

On Dec 10, 2004, at 12:24 PM, Charlls Quarra wrote:


 Ok, seem to be fixed now. Below are the differences
with the previous version


 Could someone commit this?



$ diff -w -B -E -b source/plugins/LFUGens.cpp
source/plugins/LFUGens.cpp.~1.33.~
227d226
<         void Impulse_next_aa(Impulse *unit, int
inNumSamples);
756,759c755
<                 phase -= 1.f
<                       z = 1.f;
<               } else if(phase <0.f) {
<                 phase += 1.f;
---
                      phase -= 1.f;
792,796c788
<               } else if(phase <0.f) {
<                 phase += 1.f;
<                 z=1.f;
<                 }
<                   else {
---
              } else {
807,840d798
< void Impulse_next_aa(Impulse *unit, int
inNumSamples)
< {
<       float *out = ZOUT(0);
<       float *freq = ZIN(0);
<       float *phaseOffset =  ZIN(1);
<
<       float freqmul = unit->mFreqMul;
<       double phase = unit->mPhase;
<       double rate_acum = unit->mPhase;
<       //      double phaseSlope =
CALCSLOPE(phaseOffset, prev_phaseOffset);
<       phase += unit->mPhaseOffset;
<
<       LOOP(inNumSamples,
<               float z;
<
<               if (phase >= 1.f) {
<                       rate_acum -= 1.f;
<                       z = 1.f;
<               } else if (phase < 0.f) {
<                 rate_acum += 1.f;
<                 z = 1.f;
<                 }
<                 else {
<                       z = 0.f;
<               }
<               rate_acum += (ZXP(freq) * freqmul);
<                 phase = rate_acum +
ZXP(phaseOffset);
<               ZXP(out) = z;
<       );
<
<       unit->mPhase = rate_acum;
<       unit->mPhaseOffset = phase - rate_acum;
< }
<
858,860d815
<               } else if (phase < 0.f) {
<                 phase += 1.f;
<                 z = 1.f;
884,886d838
<               }else if (phase < 0.f) {
<                 phase += 1.f;
<                 z = 1.f;
903,905c855
<         if (INRATE(1) == calc_FullRate) {
<           SETCALC(Impulse_next_aa);
<         } else if(INRATE(1) != calc_ScalarRate) {
---
              if(INRATE(1) != calc_ScalarRate) {















 --- Charlls Quarra <charlls_quarra@xxxxxxxxxxxx>
escribió:


 Im wondering if the phase offset argument in
Impulse
is really behaving well.

 Note that this scratches well when one moves the
mouse

{ SinOsc.ar(0.0, MouseX.kr(-100, 100), 0.2) }.play;

 But this doesnt; seem to scratch only once

{ Impulse.ar(0.0, MouseX.kr(-100, 100), 0.2) }.play;

So it seems that the phase offset in Impulse is
adding
to   a net internal phase in the Ugen, not sure tho


=====
Running on:
1.5 Ghz P4
256Mb
asus v800x chipset
RH9 CCRMA-patched linux


	

	
		
___________________________________
¡Llevate a Yahoo! en tu Unifón!
Ahora podés usar Yahoo! Messenger en tu Unifón, en
cualquier momento y lugar.
Encontrá más información en:
http://ar.mobile.yahoo.com/sms.html

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users


=====
Running on:
1.5 Ghz P4
256Mb
asus v800x chipset
RH9 CCRMA-patched linux


	

	
		
___________________________________
¡Llevate a Yahoo! en tu Unifón!
Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar.
Encontrá más información en: http://ar.mobile.yahoo.com/sms.html
<LFUGens.cpp.bz2>_______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev