-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 07/28/2011 02:15 AM, katja wrote:
I was looking for a suitable spot in the code to do this. First looked at dac~, but since there may be many dac~s instantiated this is not most efficient. Then I found sys_send_dacs(), where the integrated sample values are checked for max absolute value. It is however not possible to do a simple typecast here because samples are just stored back into *sys_soundin and *sys_soundout which are type t_sample. Maybe dac~ should integrate samplevalues in an intermediate vector of type t_sample. And then, in sys_send_dacs(), integrated samples could be checked, cast to float and stored into *sys_soundout vector of type float. And something similar for the input. That's what I'll try.
imho, the only sensible place to do this is the actual audio backend code (s_audio_*.c), since your audio backend might support double floats (e.g. jackd is prepared for that already, though i don't known whether anybody ever used it that way).
you don't want to do the calculations in double, then convert to single only to output as double, do you?
fgmadr IOhannes