Csound Csound-dev Csound-tekno Search About

Advice: Default sr/kr/ksmps

Date1997-03-19 16:09
Fromjpff@maths.bath.ac.uk
SubjectAdvice: Default sr/kr/ksmps
Message written at 19 Mar 1997 12:56:39 +0000

Browsing the source, as I tend to do when depressed, I noticed that
there is a default of 100000/1000/10 for these three values.  These
seem rather perverse values when 11025 is the AIFF and Windows number.

Would there be great objections if I changed the defaults?  If no
objections, what do you think would be sensible defaults?
While I was at it I would arrange that one only needs to give values
to two of these as I suggested way back in October.

==John

Date1997-03-20 17:46
From"Matt J. Ingalls"
SubjectRe: Advice: Default sr/kr/ksmps
this reminds me of this line in otran() in otran.c:

if ((float)fabs((((double)tran_sr/(double)tran_kr) - (double)tran_ksmps))
> (float).0001)

i never figured out where .0001 came from, unless it was 1/DFLT_SR!???!?!?

> there is a default of 100000/1000/10 for these three values.  These
			^^^^^^
	you mean 10000 right?
-matt


Date1997-03-20 20:25
From"Matt J. Ingalls"
Subjectfloat kr===/Default sr/kr/ksmps
sorry for this:

but i guess what i coming to is that maybe, while you are changing the
default sr/kr/ksmps, John, you could take a look at some of this ksmps
calculation code(in otran() and elsewhere?) -- if there needs some
clean-up/fixes.

and this makes me bring up the whole fractional kr debate again.
Maybe my limited knowledge of csound internals is, indeed, too limited,
but would it be possible to require only ksmps be an integer, then kr
could be a flt-pt?  there are a bunch of calculations in ugens and things
that use kr(ekr) - but could they be rounded to the closest int, or just
remain float, or have ekr be "interpolated" - rounding to the closest int
throughout the generation? (yuck! maybe i just talked myself out of this
idea)
 
> if ((float)fabs((((double)tran_sr/(double)tran_kr) - (double)tran_ksmps))
> > (float).0001)
> 
> i never figured out where .0001 came from, unless it was 1/DFLT_SR!???!?!?
ok, now thinking about it, .0001 has nothing to do with DFLT_SR, but it
still doesn't make sense to me:

	if(calculated_ksmps differs by >.0001 of given_ksmps)
		synterr();
	else (just make ksmps = calculated_ksmps);

	then i don't even see where ksmps is changed (only the static
tran_ksmps)
	and of course why '.0001' ?


-matt

Date1997-03-21 00:22
Fromtolve
SubjectRe: Advice: Default sr/kr/ksmps
your ears must have been a raging inferno...

>Message written at 19 Mar 1997 12:56:39 +0000
>
>Browsing the source, as I tend to do when depressed, I noticed that
>there is a default of 100000/1000/10 for these three values.  These
>seem rather perverse values when 11025 is the AIFF and Windows number.

meant to ask about those tonight!

>Would there be great objections if I changed the defaults?

nope.

>If no objections, what do you think would be sensible defaults?

i vote 48k. rate i select on my DAT and quite popular among my tribe. but
now my question. is a specific control rate desirable for direct transfer
in digital domain to and/or from DAT machine set at 48k?

>While I was at it I would arrange that one only needs to give values
>to two of these as I suggested way back in October.
>
>==John

off topic addendum: thought that was you i spotted in the launderette 3:45a
on my way out to ives from sis living Earl's Court London '90.

tolve