Csound Csound-dev Csound-tekno Search About

Reinit soundin

Date1997-04-15 18:41
FromRiccardo Bianchini
SubjectReinit soundin
Hello!
Can anyone help me understand WHY soundin ug seems not to reinit?
This is a fragment of my orchestra:

iskip   =       1.5     ;or anything, even zero
fromhere:
a1      soundin "anyfile.wav",iskip
        timout  0,.1,contin
        reinit  fromhere
contin:                 ;etc....

reinit statement is supposed to reinit all UGs between label 'fromhere' and
itself, right?

Well, soundin goes on quietly reading its file without reinitialize.

Thanks to anyone who can help me.

Riccardo

Date1997-04-15 23:37
From"Matt J. Ingalls"
SubjectRe: Reinit soundin
> Can anyone help me understand WHY soundin ug seems not to reinit?
> Well, soundin goes on quietly reading its file without reinitialize.

here's the first line in the init code (which i assume is called by
reinit):


   if (p->fdch.fd != 0)   return;           /* if file already open, rtn
*/


bypassing all the file opening stuff (AND not reiniting the skip time,
which is why you are doing all this, right?)


-matt



Date1997-04-29 18:28
FromRichard Dobson
SubjectRe: Reinit soundin
> 
> 
> > Can anyone help me understand WHY soundin ug seems not to reinit?
> > Well, soundin goes on quietly reading its file without reinitialize.
> 
> here's the first line in the init code (which i assume is called by
> reinit):
> 
> 
>    if (p->fdch.fd != 0)   return;           /* if file already open, rtn
> */
> 
> 
> bypassing all the file opening stuff (AND not reiniting the skip time,
> which is why you are doing all this, right?)
> 
> 
> -matt

I think there may be a cunning bug here, which I've found elsewhere -
the Csound code is  full of tests against fopen() - it assumed
that a return value of zero signalled failure, whereas in fact it is -1.
That is, an fd of 0 in fact signals a valid file. the test should be modified
to recognize zero as a valid fd, therefore. If this proves to be the case,
I will send the fix to John Fitch, to go in the next version (if he hasn't
already done it!).

Richard Dobson