Csound Csound-dev Csound-tekno Search About

Re: init error again

Date1999-08-23 19:14
Frompete moss
SubjectRe: init error again
[oops!  meant to copy this to the list as well]
 
the oscili opcode is a bit of c code that needs to have an init function
run before it can work.  i have had this same problem recently.  the
quick answer is dont put oscils in goto statements because they wont be
initialized.  you need to get more creative in your logic if you want
this to work.

try something like this:
instr 1
   aout      oscili 10000, 440, 1
   asig      in                        ; get the live input
   krms      rms         asig
   if krms   <= 700  kgoto  end
     out aout
   end:
endin

this way the oscil is always running and it gets its init correctly.
sound only gets output at certain times.

this example might need more tweaking to get the desired results.  im
not sure is out has the same init requirements.

:P
> 
> Antoine Lefebvre wrote:
> >
> > I change kgoto by goto to avoid initialisation but I get the same error...
> >
> > INIT ERROR: oscili: not initialized
> >
> > here is the orc:
> > instr 1
> >   aout      init        0
> >   asig      in                        ; get the live input
> >   krms      rms         asig
> >   if krms       > 700     goto       startinst
> >            goto        end
> >   startinst:
> >   aout      oscili      10000, 440, 1
> >   end:
> >         out         aout
> >  endin
> > --
> > Antoine Lefebvre
> > antoinelefebvre@softhome.net
> > http://pages.infinit.net/linux/rocket/index.html