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

Re: [sc-dev] [commit?] A2K ugen



A2K should simply return the first value in each buffer. This is compatible with how it is handled implicitly for ugens that only respond at k-rate.

averaging is not a good resampling technique anyway.

so it is like this now:

*************** extern "C"
*** 230,235 ****
--- 235,243 ----
        void K2A_next(K2A *unit, int inNumSamples);
        void K2A_Ctor(K2A* unit);

+       void A2K_next(A2K *unit, int inNumSamples);
+       void A2K_Ctor(A2K* unit);
+
        void Silent_next(Silent *unit, int inNumSamples);
        void Silent_Ctor(Silent* unit);

*************** void K2A_Ctor(K2A* unit)
*** 1098,1103 ****
--- 1106,1126 ----
        ZOUT0(0) = unit->mLevel;

  }
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////
+
+ void A2K_next(A2K *unit, int inNumSamples)
+ {
+       ZOUT0(0) = ZIN0(0); // return first sample in block
+ }
+
+ void A2K_Ctor(A2K* unit)
+ {
+       SETCALC(A2K_next);
+       A2K_next(unit, 1);
+
+ }
+

//////////////////////////////////////////////////////////////////////////////////////////////////

  void Silent_Ctor(Unit* unit)
*************** void load(InterfaceTable *inTable)
*** 3357,3362 ****
--- 3380,3386 ----
        DefineSimpleUnit(VarSaw);
        DefineSimpleUnit(SyncSaw);
        DefineSimpleUnit(K2A);
+       DefineSimpleUnit(A2K);
        DefineSimpleUnit(Silent);
        DefineSimpleUnit(Line);
        DefineSimpleUnit(XLine);
--








.