[PD-dev] t_sample vs t_float in PDa vs vanilla

IOhannes m zmölnig zmoelnig at iem.at
Fri Jan 1 20:47:27 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hans-Christoph Steiner wrote:
> 
> I am attempting a merge of the PDa integer code with Pd-vanilla 0.43. 
> Vanilla now mostly had the t_sample/t_float stuff ironed out, but there
> are a few minor differences between the two that I am not sure of. 
> Here's the first that is in a bunch of places, including in d_arithmetic.c:
> 
> vanilla:
>     t_float g = *(t_float *)(w[2]);
> 
> PDa:
>     t_sample g = ftofix(*(t_float *)(w[2]));
> 
> It seems to me that 'g' should be t_sample, not t_float. Any ideas?
> 


g is the scalar argument given to the object (or set via a message).

when i tried to clean up the t_sample / t_float code, the decisions i
made where based on where the values come from:
- - a sample within a signal vector is always t_sample
- - a number in a message is always t_float
- - a number in an object's argument should always be t_floatarg.

the idea is, that that the signal and the messages might have different
numeric types (as is the case in PdA)

now t_float and t_floatarg are certainly mixed up often.
but i tried to get the line between t_sample (signal) and t_float (not
signal) right.

therefore "g" is t_float and not t_sample in the first place.
it should _then_ be converted into a t_sample, before the actual
arithmetic is being done on the incoming signal (of t_samples).
this could be done in one line, but it probably should not, for
readability's sake.


fgasmr
IOhannes




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAks+UU8ACgkQkX2Xpv6ydvT37ACg6QeSWGFXAtXv7C/VI6Tp8pL4
H4IAoNZ9BtB+Bp6xKc6O9pQLHeUYsxmm
=Sa26
-----END PGP SIGNATURE-----




More information about the Pd-dev mailing list