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

[Sc-devel] Re: [Propose] Make #define GET_BUF generally available

No objections to this, and one offlist message in favour - will do this soon

maybe the RGET RPUT, too.

// macros to put rgen state in registers
#define RGET \
	RGen& rgen = *unit->mParent->mRGen; \
	uint32 s1 = rgen.s1; \
	uint32 s2 = rgen.s2; \
	uint32 s3 = rgen.s3;

#define RPUT \
	rgen.s1 = s1; \
	rgen.s2 = s2; \
	rgen.s3 = s3;


2007/11/8, Dan Stowell <danstowell@xxxxxxxxx>:
 In fact, while I'm at it, I'd also like to define a macro to access
 the full audio rate:

 #define FULLRATE unit->mWorld->mFullRate.mSampleRate

 I've often needed to know the full audio rate, even in a control-rate
 UGen (where SAMPLERATE actually gives you the control rate). I'd bet
 that others have had this too (perhaps some of Nick's machine
 listening kit?).

 OK to put these two new defines into SC_Unit.h?


 2007/11/8, Dan Stowell <danstowell@xxxxxxxxx>:
 > Hi -
 > Writing my chapter (on writing UGens), I realise that it's quite a
 > fiddle for UGen writers to access buffers, because the macros for
 > doing this aren't made available by the standard API (i.e. by
 > SC_PlugIn.h and all that follows from that).
 > There's a GET_BUF macro which appears here and there: separately in
 > three plugin files, albeit with slight tweaks. It would be nice to
 > make the basic version of that macro generally available - it would
 > really simplify the procedure for third-party UGen writers.
 > Not sure exactly the best place to put the macro - perhaps SC_Unit.h.
 > OK for me to do this, after SC 3.1.1 is out?
 > Dan
 > --
 > http://www.mcld.co.uk


Sc-devel mailing list